]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Fix the issue when booting latest systemrescue
authorlongpanda <admin@ventoy.net>
Mon, 14 Feb 2022 04:31:06 +0000 (12:31 +0800)
committerlongpanda <admin@ventoy.net>
Mon, 14 Feb 2022 04:31:06 +0000 (12:31 +0800)
IMG/cpio/sbin/init
IMG/cpio/ventoy/hook/arch/ventoy-disk.sh
IMG/cpio/ventoy/init_chain
IMG/cpio_x86/ventoy/busybox/xzcat32_musl.xz [new file with mode: 0644]
IMG/cpio_x86/ventoy/busybox/xzcat64_musl.xz [new file with mode: 0644]

index 3fd3cc5ee0b18e256c3dd670d9a18851e18a8a5b..15686c4eb7168eb4e3df6eebb6b4a21214dff60b 100644 (file)
@@ -115,6 +115,8 @@ fi
 
 if [ "$VTOY_ARCH" = "x86_64" ]; then
     echo "Use x86_64 busybox toolkit ..." >>$VTLOG
 
 if [ "$VTOY_ARCH" = "x86_64" ]; then
     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 $VTOY_PATH/tool/dmsetup64 $VTOY_PATH/tool/dmsetup
     ln -s $VTOY_PATH/tool/lunzip64 $VTOY_PATH/tool/lunzip
     ln -s $BUSYBOX_PATH/xzminidec64 $BUSYBOX_PATH/xzminidec
     ln -s $VTOY_PATH/tool/dmsetup64 $VTOY_PATH/tool/dmsetup
     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
 elif [ "$VTOY_ARCH" = "i386" ]; then
     echo "Use i386 busybox toolkit ..." >>$VTLOG
     ln -s $VTOY_PATH/tool/zstdcat64 $VTOY_PATH/tool/zstdcat
 elif [ "$VTOY_ARCH" = "i386" ]; then
     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 $VTOY_PATH/tool/dmsetup32 $VTOY_PATH/tool/dmsetup
     ln -s $VTOY_PATH/tool/lunzip32 $VTOY_PATH/tool/lunzip
     ln -s $BUSYBOX_PATH/xzminidec32 $BUSYBOX_PATH/xzminidec
     ln -s $VTOY_PATH/tool/dmsetup32 $VTOY_PATH/tool/dmsetup
     ln -s $VTOY_PATH/tool/lunzip32 $VTOY_PATH/tool/lunzip
index c1765376d931e9d6774e6a99dabe4a5eeb386e86..31e65f0972de9606142dc5d0c400bef5d9569b6b 100644 (file)
@@ -49,7 +49,12 @@ done
 
 if [ -n "$1" ]; then
     vtlog "ln -s /dev/$vtDM $1"
 
 if [ -n "$1" ]; then
     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
     vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
     vtlog "vtLABEL is $vtLABEL"
 else
     vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
     vtlog "vtLABEL is $vtLABEL"
@@ -59,7 +64,11 @@ else
         vtlog "vtLABEL is $vtLABEL from cmdline"
     fi
     
         vtlog "vtLABEL is $vtLABEL from cmdline"
     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 
 
 # OK finish
 fi 
 
 # OK finish
index 6f87a5d233e3cd2d663992f0931df616e13b74d5..a2feafa8c1a2c5e845b4acfa9f3fd56bb6e704a7 100644 (file)
@@ -77,12 +77,10 @@ ventoy_unpack_initramfs() {
                 if [ "${vtx:5}" = "xzcat" ]; then
                     rm -f $VTOY_PATH/xzlog
                     ${vtx:5} $vtfile 2> $VTOY_PATH/xzlog | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
                 if [ "${vtx:5}" = "xzcat" ]; then
                     rm -f $VTOY_PATH/xzlog
                     ${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        
-                        cat $vtfile | xzminidec | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
+                        echo 'xzcat failed, now try xzcat_musl ...' >> $VTLOG  
+                        xzcat_musl $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
                     fi
                     fi
-                    
                 else
                     ${vtx:5} $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
                 fi
                 else
                     ${vtx:5} $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
                 fi
diff --git a/IMG/cpio_x86/ventoy/busybox/xzcat32_musl.xz b/IMG/cpio_x86/ventoy/busybox/xzcat32_musl.xz
new file mode 100644 (file)
index 0000000..78563c4
Binary files /dev/null and b/IMG/cpio_x86/ventoy/busybox/xzcat32_musl.xz differ
diff --git a/IMG/cpio_x86/ventoy/busybox/xzcat64_musl.xz b/IMG/cpio_x86/ventoy/busybox/xzcat64_musl.xz
new file mode 100644 (file)
index 0000000..98e453b
Binary files /dev/null and b/IMG/cpio_x86/ventoy/busybox/xzcat64_musl.xz differ