[Galaxy S 5 Q&A, Help & Troubleshooting] aregvadfbg:
I am collecting information on if and how it is possible to flash CyanogenMod 11 to the Galaxy S5 without setting the Knox Warranty Void flag to 0x1 (which mostly means loosing your warranty). Please feel free to contribute!

Definitely possible is:

Root Galaxy S5 (G900F) while keeping Knox 0x0. This works via Towelroot method.

Install some custom ROMs (NeatROM or ALEXNDR) while kepping Knox 0x0. This works via flashing with Mobile Odin PRO. Instructions are available in both ROM threads.

Now the question is if we can use the Mobile Odin PRO flash method for CyanogenMod ROM and what has to be done to avoid Knox 0x1.

In the CM11 zips there are folders for recovery, system and META-INF as well as boot.img and file_context files.

system: flashing ok

The system folder contains the contents of the system partition and should be fine to flash as the other ROMs with Knox 0x0 have that, too. I don't think any checks on the contents of the system partition are done by Knox (please correct me if i'm wrong!).

boot.img: flashing not safe

The boot.img file contains primarily the kernel image and the ramdisk; details can be found here and instructions on modifying are for example here.

I think at least the kernel image is checked by Knox (i don't know how and when, maybe if it is signed by samsung or if the checksum matches known kernels; any information on that would be helpful!). The ALEXNDR ROM for example uses the same boot.img as the stock G900FXXU1ANG2 firmware. CM11 uses a different kernel (CAF), which quite certainly would not pass any Knox checks. In conclusion i think it is advised NOT to flash the CM11 boot.img if you want to keep Knox 0x0.

This leads to the question if you can use a stock kernel in combination with CM11. It has been reported to work with earlier versions of CM on other devices, but i could not find much information on this, it might or might not work. If anyone has better information on this, please post it!

recovery: flashing not safe

Flashing custom recoveries will trigger Knox 0x1 (as far as i know). I could not yet find out when the recovery is actually installed, the ROM installer only copies the recovery installer into /system/etc/install-cm-recovery.sh and the recovery image to /system/recovery-from-boot.p. My guess is it will be installed on first boot.

As the recovery should not be necessary to run CM11, it should not be flashed. More detailed information welcome!

META-INF: only flash with modiffications

This contains primarily the ROM installer script at /META-INF/com/google/android/updater-script. This is run when you 'flash a zip' (see here for details) and is pretty straightforward to read. Most actions seem harmless, but 2 or 3 might have to be removed/modified, like package_extract_dir("recovery", "/system"); or package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");.

/system/bin/backuptool.sh seems safe, it only backs up and restores addon /system files.

file_contexts: flashing ok

Not sure about this, i don't think it is actually flashed or anything. The other ROMs with Knox 0x0 don't have it, but i don't know how it would trigger Knox 0x1. This seems to be a SELinux config file containing types and ranges for system files etc.

So atm the following would be interesting (DON'T DO THIS, IT WOULD MOST DEFINETELY NOT WORK OR EVEN BRICK YOUR DEVICE! This is just hypothetic.):

Rooted S5 with stock G900FXXU1ANG2 firmware.

Remove the boot.img and recovery part from CM11 zip.

Flash the modified zip via Mobile Odin PRO.

I tried this and it failed. Had to restore device with stock rom and Odin, still Knox 0x0 though.

Has anyone tried something similar? Do you have additional information that might be helpful? Then please contribute!

DISCLAIMER: I can NOT guarantee any of this information to be correct! Whatever you do with this information is completely YOUR OWN RESPONSIBILITY.