Mount HTC one M8 system partition as read write

So why cant you write to system partition on HTC devices even after rooting? it’s because they are S-ON by default. which means that neither can you access certain areas of the system nor can you guarantee a permanent root. S-OFF means that the NAND part of the device is unlocked and can be written to. S-ON also has some other restrictions like image signatures etc. to make an end run around the S-ON problems, you can temporarily mount your system partition as read/write by running the following commands via ADB. or just the last two lines in terminal emulator on the device itself.   adb shell su mount -o rw,remount -t ext4 /dev/block/mmcblk0p45 /system