mirror of
https://github.com/ventoy/Ventoy.git
synced 2026-12-05 11:56:51 +01:00
Fix the boot issue for nixos 2605+ (#3813)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user