If the /sbin/init is absolute symlink (e.g. on Debian with systemd: /sbin/init -> /lib/systemd/systemd) then the check [ -x "/newroot/${init}" ] fails.
/sbin/init -> /lib/systemd/systemd
[ -x "/newroot/${init}" ]
With this patch the absolute symlink is resolved.
If the /sbin/init is absolute symlink (e.g. on Debian with systemd:
/sbin/init -> /lib/systemd/systemd
) then the check[ -x "/newroot/${init}" ]
fails.With this patch the absolute symlink is resolved.