Change hard coded dracut hooks directory to variable. (#3753)
Ventoy CI / build (push) Canceled after 0s
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Canceled after 0s

Some distros (e.g.  Fedora 45) change dracut hooks directory from /lib/dracut/hooks to /var/lib/dracut/hooks
This commit is contained in:
longpanda
2026-09-28 20:56:47 +08:00
parent 6568972abc
commit ca552e14c0
10 changed files with 28 additions and 15 deletions
+6
View File
@@ -32,6 +32,11 @@ VTOY_DM_PATH=/dev/mapper/ventoy
VTOY_DEBUG_LEVEL=$($BUSYBOX_PATH/hexdump -n 1 -s 450 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param)
VTOY_LINUX_REMOUNT=$($BUSYBOX_PATH/hexdump -n 1 -s 454 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param)
VTOY_VLNK_BOOT=$($BUSYBOX_PATH/hexdump -n 1 -s 455 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param)
if [ -d /var/lib/dracut/hooks ]; then
VT_DRACUT_HOOKS=/var/lib/dracut/hooks
else
VT_DRACUT_HOOKS=/lib/dracut/hooks
fi
if [ "$VTOY_DEBUG_LEVEL" = "01" ]; then
if [ -e /dev/console ]; then
@@ -39,6 +44,7 @@ if [ "$VTOY_DEBUG_LEVEL" = "01" ]; then
fi
fi
vtlog() {
if [ "$VTLOG" = "$VTOY_PATH/log" ]; then
echo "$*" >>$VTLOG