Fix the boot issue for nixos 2605+ (#3813)
Ventoy CI / build (push) Canceled after 0s
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Canceled after 0s

This commit is contained in:
longpanda
2026-12-02 18:04:44 +08:00
parent 26980f9d59
commit db894fd970
5 changed files with 71 additions and 32 deletions
+12 -2
View File
@@ -19,7 +19,17 @@
. $VTOY_PATH/hook/ventoy-os-lib.sh
vtRuleFile=$($FIND / -name '*.rules' -type f | $GREP udev | $HEAD -n1)
PATH=$BUSYBOX_PATH/:$VTOY_PATH/tool:$PATH
ventoy_add_udev_rule_with_path "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace" "${vtRuleFile%/*}/99-ventoy.rules"
if [ -e /etc/systemd/system ]; then
system=$($FIND /nix -type d | $GREP 'initrd-units$')
echo "nixos with systemd $system" >> $VTLOG
mkdir -p $system/initrd-root-device.target.wants
cp -a $VTOY_PATH/hook/nixos/ventoy-disk.service $system/
ln -sf $system/ventoy-disk.service $system/initrd-root-device.target.wants/ventoy-disk.service
else
echo "nixos init script" >> $VTLOG
vtRuleFile=$($FIND / -name '*.rules' -type f | $GREP udev | $HEAD -n1)
ventoy_add_udev_rule_with_path "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace" "${vtRuleFile%/*}/99-ventoy.rules"
fi