···495495496496 # If we are not booting a NixOS closure (e.g. init=/bin/sh),
497497 # we don't know what root to prepare so we don't do anything
498498- if ! [ -x "/sysroot$closure/prepare-root" ]; then
498498+ if ! [ -x "/sysroot$(readlink "/sysroot$closure/prepare-root" || echo "$closure/prepare-root")" ]; then
499499 echo "NEW_INIT=''${initParam[1]}" > /etc/switch-root.conf
500500 echo "$closure does not look like a NixOS installation - not activating"
501501 exit 0