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
+39
View File
@@ -0,0 +1,39 @@
#!/ventoy/busybox/sh
. /ventoy/hook/ventoy-hook-lib.sh
if is_ventoy_hook_finished; then
exit 0
fi
vtlog "####### $0 $* ########"
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
wait_for_usb_disk_ready
vtdiskname=$(get_ventoy_disk_name)
if [ "$vtdiskname" = "unknown" ]; then
vtlog "ventoy disk not found"
exit 0
fi
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" 'noreplace'
set_ventoy_hook_finish
rm -f /dev/mapper/ventoy
rm -f /dev/mapper/VentoyPart
mkdir -p /run/udev/rules.d/
ventoy_copy_file /ventoy/hook/default/10-dm.rules /run/udev/rules.d/10-dm.rules 0644
ventoy_copy_file /ventoy/hook/default/11-dm-enable.rules /run/udev/rules.d/11-dm-enable.rules 0644
ventoy_copy_file /ventoy/hook/default/13-dm-disk.rules /run/udev/rules.d/13-dm-disk.rules 0644
udevadm control --reload-rules
udevadm trigger --action=change --sysname-match='dm-*'
udevadm settle
rm -f /etc/systemd/system/initrd-root-device.target.wants/ventoy-disk.service
rm -f /etc/systemd/system/ventoy-disk.service