Update scripts

This commit is contained in:
topjohnwu 2016-11-13 21:02:35 +08:00
parent dbbc85719e
commit 5921d3a42a
2 changed files with 12 additions and 20 deletions

View File

@ -249,6 +249,7 @@ fi
ui_print "- Device platform: $ARCH" ui_print "- Device platform: $ARCH"
BINDIR=$INSTALLER/$ARCH BINDIR=$INSTALLER/$ARCH
chmod -R 755 $CHROMEDIR/futility $BINDIR
find_boot_image find_boot_image
if [ -z "$BOOTIMAGE" ]; then if [ -z "$BOOTIMAGE" ]; then
@ -267,13 +268,11 @@ if (is_mounted /data); then
mkdir -p /data/busybox mkdir -p /data/busybox
cp -af $BINDIR /data/magisk cp -af $BINDIR /data/magisk
cp -af $INSTALLER/common/init.magisk.rc $INSTALLER/common/magic_mask.sh /data/magisk cp -af $INSTALLER/common/init.magisk.rc $INSTALLER/common/magic_mask.sh /data/magisk
chmod -R 755 /data/magisk
chcon -R "u:object_r:system_file:s0" /data/magisk
/data/magisk/busybox --install -s /data/busybox /data/magisk/busybox --install -s /data/busybox
ln -s /data/magisk/busybox /data/busybox/busybox ln -s /data/magisk/busybox /data/busybox/busybox
# Prevent issues # Prevent issues
rm -f /data/busybox/su /data/busybox/sh rm -f /data/busybox/su /data/busybox/sh
chcon -R "u:object_r:system_file:s0" /data/magisk /data/busybox chcon -hR "u:object_r:system_file:s0" /data/magisk /data/busybox
chmod -R 755 /data/magisk /data/busybox chmod -R 755 /data/magisk /data/busybox
PATH=/data/busybox:$PATH PATH=/data/busybox:$PATH
else else
@ -314,10 +313,6 @@ MAGISKLOOP=$LOOPDEVICE
mkdir -p /magisk/.core/magiskhide 2>/dev/null mkdir -p /magisk/.core/magiskhide 2>/dev/null
cp -af $INSTALLER/common/magiskhide/. /magisk/.core/magiskhide cp -af $INSTALLER/common/magiskhide/. /magisk/.core/magiskhide
# Remove legacy SuperSU module
mkdir -p /magisk/zzsupersu
touch /magisk/zzsupersu/remove
########################################################################################## ##########################################################################################
# Boot image patch # Boot image patch
########################################################################################## ##########################################################################################
@ -332,8 +327,6 @@ NEWBOOT=$TMPDIR/boottmp/new-boot.img
UNPACKDIR=$TMPDIR/boottmp/bootunpack UNPACKDIR=$TMPDIR/boottmp/bootunpack
RAMDISK=$TMPDIR/boottmp/ramdisk RAMDISK=$TMPDIR/boottmp/ramdisk
chmod 777 $CHROMEDIR/futility $BINDIR/*
ORIGBOOT=$BOOTIMAGE ORIGBOOT=$BOOTIMAGE
ui_print "- Unpacking boot image" ui_print "- Unpacking boot image"

View File

@ -237,20 +237,19 @@ case $1 in
log_print "** Magisk post-fs mode running..." log_print "** Magisk post-fs mode running..."
# Cleanup previous stuffs... # Cleanup previous version stuffs...
rm -rf /cache/magisk /cache/magisk_merge /cache/magiskhide.log rm -rf /cache/magisk /cache/magisk_merge /cache/magiskhide.log
if [ -d "/cache/magisk_bootanim" ]; then if [ -d "/cache/magisk_mount" ]; then
log_print "Mounting custom Boot Animation" log_print "Mounting cache files"
find /cache/magisk_bootanim -type f 2>/dev/null | while read ITEM ; do find /cache/magisk_mount -type f 2>/dev/null | while read ITEM ; do
chmod 644 "$ITEM" chmod 644 "$ITEM"
chcon "u:object_r:system_file:s0" "$ITEM" chcon "u:object_r:system_file:s0" "$ITEM"
TARGET="${ITEM#/cache/magisk_bootanim}" TARGET="${ITEM#/cache/magisk_mount}"
bind_mount "$ITEM" "$TARGET" bind_mount "$ITEM" "$TARGET"
done done
fi fi
unblock unblock
;; ;;
@ -290,7 +289,7 @@ case $1 in
mv /cache/stock_boot.img /data 2>/dev/null mv /cache/stock_boot.img /data 2>/dev/null
chcon -R "u:object_r:system_file:s0" $BINPATH $TOOLPATH chcon -hR "u:object_r:system_file:s0" $BINPATH $TOOLPATH
chmod -R 755 $BINPATH $TOOLPATH chmod -R 755 $BINPATH $TOOLPATH
# Image merging # Image merging
@ -318,7 +317,7 @@ case $1 in
# Remove modules # Remove modules
for MOD in $MOUNTPOINT/* ; do for MOD in $MOUNTPOINT/* ; do
if [ -f "$MOD/remove" ]; then if [ -f "$MOD/remove" ] || [ "$MOD" = "zzsupersu" ]; then
log_print "Remove module: $MOD" log_print "Remove module: $MOD"
rm -rf $MOD rm -rf $MOD
fi fi
@ -377,7 +376,7 @@ case $1 in
done done
# Proper permissions for generated items # Proper permissions for generated items
chcon -R "u:object_r:system_file:s0" $TMPDIR chcon -hR "u:object_r:system_file:s0" $TMPDIR
# Stage 2 # Stage 2
log_print "Bind mount module items" log_print "Bind mount module items"
@ -402,8 +401,8 @@ case $1 in
log_print "Enabling BusyBox" log_print "Enabling BusyBox"
$TOOLPATH/cp -afc /data/busybox/. $COREDIR/busybox $TOOLPATH/cp -afc /data/busybox/. $COREDIR/busybox
$TOOLPATH/cp -afc /system/xbin/. $COREDIR/busybox $TOOLPATH/cp -afc /system/xbin/. $COREDIR/busybox
chmod 755 $COREDIR/busybox chmod -R 755 $COREDIR/busybox
chcon "u:object_r:system_file:s0" $COREDIR/busybox chcon -hR "u:object_r:system_file:s0" $COREDIR/busybox
bind_mount $COREDIR/busybox /system/xbin bind_mount $COREDIR/busybox /system/xbin
fi fi