Fix the issue when booting latest systemrescue

This commit is contained in:
longpanda 2022-02-14 12:31:06 +08:00
parent 006f26d07d
commit 86b13727ca
5 changed files with 17 additions and 6 deletions

View File

@ -115,6 +115,8 @@ fi
if [ "$VTOY_ARCH" = "x86_64" ]; then if [ "$VTOY_ARCH" = "x86_64" ]; then
echo "Use x86_64 busybox toolkit ..." >>$VTLOG echo "Use x86_64 busybox toolkit ..." >>$VTLOG
$BUSYBOX_PATH/xzcat $BUSYBOX_PATH/xzcat64_musl.xz > $BUSYBOX_PATH/xzcat_musl
$BUSYBOX_PATH/chmod +x $BUSYBOX_PATH/xzcat_musl
ln -s $BUSYBOX_PATH/xzminidec64 $BUSYBOX_PATH/xzminidec ln -s $BUSYBOX_PATH/xzminidec64 $BUSYBOX_PATH/xzminidec
ln -s $VTOY_PATH/tool/dmsetup64 $VTOY_PATH/tool/dmsetup ln -s $VTOY_PATH/tool/dmsetup64 $VTOY_PATH/tool/dmsetup
ln -s $VTOY_PATH/tool/lunzip64 $VTOY_PATH/tool/lunzip ln -s $VTOY_PATH/tool/lunzip64 $VTOY_PATH/tool/lunzip
@ -124,6 +126,8 @@ if [ "$VTOY_ARCH" = "x86_64" ]; then
ln -s $VTOY_PATH/tool/zstdcat64 $VTOY_PATH/tool/zstdcat ln -s $VTOY_PATH/tool/zstdcat64 $VTOY_PATH/tool/zstdcat
elif [ "$VTOY_ARCH" = "i386" ]; then elif [ "$VTOY_ARCH" = "i386" ]; then
echo "Use i386 busybox toolkit ..." >>$VTLOG echo "Use i386 busybox toolkit ..." >>$VTLOG
$BUSYBOX_PATH/xzcat $BUSYBOX_PATH/xzcat32_musl.xz > $BUSYBOX_PATH/xzcat_musl
$BUSYBOX_PATH/chmod +x $BUSYBOX_PATH/xzcat_musl
ln -s $BUSYBOX_PATH/xzminidec32 $BUSYBOX_PATH/xzminidec ln -s $BUSYBOX_PATH/xzminidec32 $BUSYBOX_PATH/xzminidec
ln -s $VTOY_PATH/tool/dmsetup32 $VTOY_PATH/tool/dmsetup ln -s $VTOY_PATH/tool/dmsetup32 $VTOY_PATH/tool/dmsetup
ln -s $VTOY_PATH/tool/lunzip32 $VTOY_PATH/tool/lunzip ln -s $VTOY_PATH/tool/lunzip32 $VTOY_PATH/tool/lunzip

View File

@ -49,7 +49,12 @@ done
if [ -n "$1" ]; then if [ -n "$1" ]; then
vtlog "ln -s /dev/$vtDM $1" vtlog "ln -s /dev/$vtDM $1"
ln -s /dev/$vtDM "$1"
if [ -e "$1" ]; then
vtlog "$1 already exist"
else
ln -s /dev/$vtDM "$1"
fi
else else
vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/') vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
vtlog "vtLABEL is $vtLABEL" vtlog "vtLABEL is $vtLABEL"
@ -59,7 +64,11 @@ else
vtlog "vtLABEL is $vtLABEL from cmdline" vtlog "vtLABEL is $vtLABEL from cmdline"
fi fi
ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL" if [ -e "/dev/disk/by-label/$vtLABEL" ]; then
vtlog "$1 already exist"
else
ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL"
fi
fi fi
# OK finish # OK finish

View File

@ -77,12 +77,10 @@ ventoy_unpack_initramfs() {
if [ "${vtx:5}" = "xzcat" ]; then if [ "${vtx:5}" = "xzcat" ]; then
rm -f $VTOY_PATH/xzlog rm -f $VTOY_PATH/xzlog
${vtx:5} $vtfile 2> $VTOY_PATH/xzlog | (cpio -idmu 2>>$VTLOG; cat > $vttmp) ${vtx:5} $vtfile 2> $VTOY_PATH/xzlog | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
if grep -q 'corrupted data' $VTOY_PATH/xzlog; then if grep -q 'corrupted data' $VTOY_PATH/xzlog; then
echo 'xzcat failed, now try xzminidec...' >> $VTLOG echo 'xzcat failed, now try xzcat_musl ...' >> $VTLOG
cat $vtfile | xzminidec | (cpio -idmu 2>>$VTLOG; cat > $vttmp) xzcat_musl $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
fi fi
else else
${vtx:5} $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp) ${vtx:5} $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
fi fi

Binary file not shown.

Binary file not shown.