[Samsung Galaxy S8 Guides, News, & Discussion] jhofseth:
read this to know how to manually place system root files

I pre-rooted the system using latest SuperSU package instructions and incorporated it into an Odin MD5 ROM; you can read them if you open the latest update-binary in the zip file in a text editor (see below). The SuperSU update-binary gives you instructions where to manually place files, with what permissions and SELinux info. Read that binary and it is easy. I can get through MD5 check just fine with none-modified ROM, then I swap files using the same file name and start flash. So, I get past MD5 checking, but it later just hangs at file analysis, unfortunately. Until someone further modifies Odin, that route is a dead-end.

(smiley faces are supposed to be : and o with no spaces between)

# ----- "SYSTEM" INSTALL -----

#

# "System" install puts all the files needed in /system and does not need

# any boot image modifications. Default install method pre-Android-6.0

# (excluding Samsung-5.1).

#

# Even on Android-6.0+, the script attempts to detect if the current

# firmware is compatible with a system-only installation (see the

# "detect_systemless_required" function), and will prefer that

# (unless the SYSTEMLESS variable is set) if so. This will catch the

# case of several custom ROMs that users like to use custom boot images

# with - SuperSU will not need to patch these. It can also catch some

# locked bootloader cases that do allow security policy updates.

#

# To install SuperSU properly, aside from cleaning old versions and

# other superuser-type apps from the system, the following files need to

# be installed:

#

# API source target chmod chcon required

#

# 7-19 common/Superuser.apk /system/app/Superuser.apk 0644 u:object_r:system_file:s0 gui

# 20+ common/Superuser.apk /system/app/SuperSU/SuperSU.apk 0644 u:object_r:system_file:s0 gui

#

# 17+ common/install-recovery.sh /system/etc/install-recovery.sh 0755 *1 required

# 17+ /system/bin/install-recovery.sh (symlink to /system/etc/...) required

# *1: same as /system/bin/toolbox: u:object_r:system_file:s0 if API < 20, u:object_r:toolbox_exec:s0 if API >= 20

#

# 7+ ARCH/su *2 /system/xbin/su *3 u:object_r:system_file:s0 required

# 7+ /system/bin/.ext/.su *3 u:object_r:system_file:s0 gui

# 17+ /system/xbin/daemonsu 0755 u:object_r:system_file:s0 required

# *2: su.pie for 17+ x86(_32) only

# *3: 06755 if API < 18, 0755 if API >= 18

#

# 19+ ARCH/supolicy /system/xbin/supolicy 0755 u:object_r:system_file:s0 required

# 19+ ARCH/libsupol.so /system/lib(64)/libsupol.so 0644 u:object_r:system_file:s0 required

#

# 21+ /system/bin/app_process32 *5 /system/bin/app_process32_original 0755 u:object_r:zygote_exec:s0 required

# 21+ /system/bin/app_process64 *5 /system/bin/app_process64_original 0755 u:object_r:zygote_exec:s0 required

# 21+ /system/bin/app_processXX *5 /system/bin/app_process_init 0755 u:object_r:system_file:s0 required

# 21+ /system/bin/app_process (symlink to /system/xbin/daemonsu) required

# 21+ *5 /system/bin/app_process32 (symlink to /system/xbin/daemonsu) required

# 21+ *5 /system/bin/app_process64 (symlink to /system/xbin/daemonsu) required

# *5: Only do this for the relevant bits. On a 64 bits system, leave the 32 bits files alone, or dynamic linker errors

# will prevent the system from fully working in subtle ways. The bits of the su binary must also match!

#

# 17+ common/99SuperSUDaemon *6 /system/etc/init.d/99SuperSUDaemon 0755 u:object_r:system_file:s0 optional

# *6: only place this file if /system/etc/init.d is present

#

# 17+ 'echo 1 >' or 'touch' *7 /system/etc/.installed_su_daemon 0644 u:object_r:system_file:s0 optional

# *7: the file just needs to exist or some recoveries will nag you. Even with it there, it may still happen.

#

# It may seem some files are installed multiple times needlessly, but

# it only seems that way. Installing files differently or symlinking

# instead of copying (unless specified) will lead to issues eventually.

#

# After installation, run '/system/xbin/su --install', which may need to

# perform some additional installation steps. Ideally, at one point,

# a lot of this script will be moved there.