Skip to content

Commit

Permalink
/SRC/boot/boot-magisk.img&initrd.img
Browse files Browse the repository at this point in the history
part-1
HuskyDG#25
  • Loading branch information
1457384613gh authored Feb 4, 2023
1 parent 9d38ac4 commit b8513db
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions initrd/init
Original file line number Diff line number Diff line change
Expand Up @@ -149,25 +149,25 @@ check_root()
mkdir /mnt/iso
mount -o loop /iso/$iso /mnt/iso
fi
INITRD_REAL=initrd_real.img
APKFILE=/mnt/$SRC/magisk.apk
INITRD_REAL=boot/initrd_real.img
APKFILE=/mnt/$SRC/boot/magisk.apk
echo "$dev" >"$MAGISKCORE/osroot_dev"
if [ -e /mnt/$SRC/$INITRD_REAL ]; then
zcat /mnt/$SRC/$INITRD_REAL | cpio -id > /dev/null
INITRD_IMAGE="/mnt/$SRC/$INITRD_REAL"
elif [ -e /mnt/$SRC/initrd.img ]; then
zcat /mnt/$SRC/initrd.img | cpio -id > /dev/null
INITRD_IMAGE="/mnt/$SRC/initrd.img"
elif [ -e /mnt/$SRC/boot/initrd.img ]; then
zcat /mnt/$SRC/boot/initrd.img | cpio -id > /dev/null
INITRD_IMAGE="/mnt/$SRC/boot/initrd.img"
elif [ -b /dev/$INITRD_REAL ]; then
zcat /dev/$INITRD_REAL | cpio -id > /dev/null
INITRD_IMAGE="/dev/$INITRD_REAL"
else
return 1
fi
err="$?"
if [ ! -f "/mnt/$SRC/boot-magisk.img" ]; then
rm -rf "/mnt/$SRC/boot-magisk.img"
zcat "/boot.img.gz" >"/mnt/$SRC/boot-magisk.img"
if [ ! -f "/mnt/$SRC/boot/boot-magisk.img" ]; then
rm -rf "/mnt/$SRC/boot/boot-magisk.img"
zcat "/boot.img.gz" >"/mnt/$SRC/boot/boot-magisk.img"
fi
return "$err"
}
Expand Down

0 comments on commit b8513db

Please sign in to comment.