2
0
mirror of https://github.com/topjohnwu/Magisk synced 2025-08-31 07:25:12 +00:00

Update scripts

This commit is contained in:
topjohnwu
2017-09-06 16:13:23 +08:00
parent eceba26894
commit 0eb79e5acd
5 changed files with 62 additions and 89 deletions

View File

@@ -73,6 +73,33 @@ find_boot_image() {
[ -L "$BOOTIMAGE" ] && BOOTIMAGE=`readlink $BOOTIMAGE`
}
migrate_boot_backup() {
# Update the broken boot backup
if [ -f /data/stock_boot_.img.gz ]; then
./magiskboot --decompress /data/stock_boot_.img.gz
mv /data/stock_boot_.img /data/stock_boot.img
fi
# Update our previous backup to new format if exists
if [ -f /data/stock_boot.img ]; then
ui_print "- Migrating boot image backup"
SHA1=`./magiskboot --sha1 /data/stock_boot.img 2>/dev/null`
STOCKDUMP=/data/stock_boot_${SHA1}.img
mv /data/stock_boot.img $STOCKDUMP
./magiskboot --compress $STOCKDUMP
fi
}
sign_chromeos() {
echo > empty
./chromeos/futility vbutil_kernel --pack new-boot.img.signed \
--keyblock ./chromeos/kernel.keyblock --signprivate ./chromeos/kernel_data_key.vbprivk \
--version 1 --vmlinuz new-boot.img --config empty --arch arm --bootloader empty --flags 0x1
rm -f empty new-boot.img
mv new-boot.img.signed new-boot.img
}
is_mounted() {
if [ ! -z "$2" ]; then
cat /proc/mounts | grep $1 | grep $2, >/dev/null
@@ -127,7 +154,6 @@ boot_actions() {
mount -o bind $MAGISKBIN /dev/magisk/mirror/bin
fi
MAGISKBIN=/dev/magisk/mirror/bin
$MAGISKBIN/magisk magiskpolicy --live "allow fsck * * *"
}
recovery_actions() {