Skip to content

Commit

Permalink
fix SystemRescue 11.02 boot (ventoy#2958)
Browse files Browse the repository at this point in the history
  • Loading branch information
jc committed Dec 24, 2024
1 parent b11c387 commit 6411db5
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions IMG/cpio/ventoy/init_chain
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,24 @@ ventoy_unpack_initramfs() {

for vtx in '1F8B zcat' '1F9E zcat' '425A bzcat' '5D00 lzcat' 'FD37 xzcat' '894C lzopcat' '0221 lz4cat' '28B5 zstdcat' '3037 cat' '4C5A lunzip -c'; do
if [ "${vtx:0:4}" = "${vtmagic:0:4}" ]; then
echo "vtx=$vtx" >> $VTLOG
if [ $vtskip -eq 0 ]; then
if [ "${vtx:5}" = "xzcat" ]; then
echo "vtx=$vtx" >> $VTLOG
dd if=$vtfile skip=$vtskip of=$vttmp iflag=skip_bytes status=none
mv $vttmp $vtfile
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
echo 'xzcat failed, now try xzminidec...' >> $VTLOG
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
echo 'xzcat failed, now try xzminidec...' >> $VTLOG
rm -f $VTOY_PATH/xzlog
cat $vtfile | xzminidec 2> $VTOY_PATH/xzlog | (cpio -idmu 2>>$VTLOG; cat > $vttmp)

if grep -q 'limit' $VTOY_PATH/xzlog; then
echo 'xzminidec failed, now try xzcat_musl ...' >> $VTLOG
xzcat_musl $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
fi
cat $vtfile | xzminidec 2> $VTOY_PATH/xzlog | (cpio -idmu 2>>$VTLOG; cat > $vttmp)

if grep -q 'limit' $VTOY_PATH/xzlog; then
echo 'xzminidec failed, now try xzcat_musl ...' >> $VTLOG
xzcat_musl $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
fi
else
${vtx:5} $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
fi
else
dd if=$vtfile skip=$vtskip iflag=skip_bytes status=none | ${vtx:5} | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
${vtx:5} $vtfile | (cpio -idmu 2>>$VTLOG; cat > $vttmp)
fi
break
fi
Expand Down

0 comments on commit 6411db5

Please sign in to comment.