mirror of https://github.com/ventoy/Ventoy.git
fix the lvm issue
This commit is contained in:
parent
60588c8442
commit
3ebc610e7d
|
@ -31,16 +31,6 @@ if is_inotify_ventoy_part $3; then
|
|||
vtlog "find ventoy partition $3 ..."
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace
|
||||
|
||||
# blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
# vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
#
|
||||
# if [ "$vtDM" = "dm-0" ]; then
|
||||
# vtlog "This is dm-0, OK ..."
|
||||
# else
|
||||
# vtlog "####### This is $vtDM ####### this is abnormal ..."
|
||||
# ventoy_swap_device /dev/dm-0 /dev/$vtDM
|
||||
# fi
|
||||
|
||||
set_ventoy_hook_finish
|
||||
else
|
||||
vtlog "##### INOTIFYD: $2/$3 is created (NO)..."
|
||||
|
|
|
@ -28,19 +28,19 @@ else
|
|||
for vtParam in $($CAT /proc/cmdline); do
|
||||
if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
|
||||
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
|
||||
VTKS="inst.ks=hd:/dev/dm-0:$vtRawKs"
|
||||
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
|
||||
break
|
||||
fi
|
||||
|
||||
if echo $vtParam | $GREP -q '^ks=.*:/'; then
|
||||
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
|
||||
VTKS="ks=hd:/dev/dm-0:$vtRawKs"
|
||||
VTKS="ks=hd:/dev/ventoy:$vtRawKs"
|
||||
break
|
||||
fi
|
||||
|
||||
if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then
|
||||
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
|
||||
VTKS="inst.ks=hd:/dev/dm-0:$vtRawKs"
|
||||
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
@ -75,9 +75,9 @@ fi
|
|||
echo "vtInstDD=$vtInstDD" >> $VTLOG
|
||||
|
||||
if $GREP -q 'root=live' /proc/cmdline; then
|
||||
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/dm-0 $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
|
||||
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/ventoy $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
|
||||
else
|
||||
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE inst.stage2=hd:/dev/dm-0 $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
|
||||
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE inst.stage2=hd:/dev/ventoy $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
|
||||
fi
|
||||
|
||||
ventoy_set_inotify_script rhel7/ventoy-inotifyd-hook.sh
|
||||
|
|
|
@ -43,14 +43,9 @@ if is_inotify_ventoy_part $3; then
|
|||
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
|
||||
if [ "$vtDM" = "dm-0" ]; then
|
||||
vtlog "This is dm-0, OK ..."
|
||||
else
|
||||
vtlog "####### This is $vtDM ####### this is abnormal ..."
|
||||
ventoy_swap_device /dev/dm-0 /dev/$vtDM
|
||||
fi
|
||||
|
||||
|
||||
cp -a /dev/$vtDM /dev/ventoy
|
||||
$BUSYBOX_PATH/modprobe isofs >/dev/null 2>&1
|
||||
|
||||
vtGenRulFile='/etc/udev/rules.d/99-live-squash.rules'
|
||||
if [ -e $vtGenRulFile ] && $GREP -q dmsquash $vtGenRulFile; then
|
||||
vtScript=$($GREP -m1 'RUN.=' $vtGenRulFile | $AWK -F'RUN.=' '{print $2}' | $SED 's/"\(.*\)".*/\1/')
|
||||
|
@ -60,10 +55,9 @@ if is_inotify_ventoy_part $3; then
|
|||
vtlog "$vtGenRulFile not exist..."
|
||||
fi
|
||||
|
||||
|
||||
if [ -e /sbin/anaconda-diskroot ]; then
|
||||
vtlog "set anaconda-diskroot ..."
|
||||
/sbin/anaconda-diskroot /dev/dm-0
|
||||
vtlog "set anaconda-diskroot ..."
|
||||
/sbin/anaconda-diskroot /dev/ventoy
|
||||
fi
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
|
|
@ -23,17 +23,20 @@ if [ ! -e /dev/dm-0 ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
|
||||
if ! [ -e /dev/mapper/ventoy ]; then
|
||||
vtlog "link to /dev/mapper/ventoy"
|
||||
ln -s /dev/dm-0 /dev/mapper/ventoy
|
||||
vtlog "link /dev/$vtDM to /dev/mapper/ventoy"
|
||||
ln -s /dev/$vtDM /dev/mapper/ventoy
|
||||
fi
|
||||
|
||||
VTLABEL=$($BUSYBOX_PATH/blkid /dev/dm-0 | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
|
||||
VTLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
|
||||
vtlog "VTLABEL=$VTLABEL"
|
||||
|
||||
if [ -n "$VTLABEL" ]; then
|
||||
if ! [ -e "/dev/disk/by-label/$VTLABEL" ]; then
|
||||
vtlog "link to /dev/disk/by-label/$VTLABEL"
|
||||
ln -s /dev/dm-0 "/dev/disk/by-label/$VTLABEL"
|
||||
vtlog "link /dev/$vtDM to /dev/disk/by-label/$VTLABEL"
|
||||
ln -s /dev/$vtDM "/dev/disk/by-label/$VTLABEL"
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -25,10 +25,11 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
|||
|
||||
blkdev_num=$(dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
[ -e /dev/ventoy ] || cp -a /dev/$vtDM /dev/ventoy
|
||||
|
||||
if [ -e /sbin/anaconda-diskroot ]; then
|
||||
vtlog "set anaconda-diskroot ..."
|
||||
/sbin/anaconda-diskroot /dev/dm-0
|
||||
vtlog "set anaconda-diskroot /dev/ventoy ..."
|
||||
/sbin/anaconda-diskroot /dev/ventoy
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
|
Loading…
Reference in New Issue