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