Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
50c56f8b
Commit
50c56f8b
authored
Sep 05, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify flash scripts
parent
9e9f8ca8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
48 deletions
+5
-48
flash_script.sh
scripts/flash_script.sh
+5
-48
No files found.
scripts/flash_script.sh
View file @
50c56f8b
...
...
@@ -92,9 +92,7 @@ fi
# Copy required files
rm
-rf
$MAGISKBIN
2>/dev/null
mkdir
-p
$MAGISKBIN
cp
-af
$BINDIR
/.
$COMMONDIR
/.
$MAGISKBIN
cp
-af
$CHROMEDIR
$MAGISKBIN
cp
-af
$TMPDIR
/bin/busybox
$MAGISKBIN
/busybox
cp
-af
$BINDIR
/.
$COMMONDIR
/.
$CHROMEDIR
$TMPDIR
/bin/busybox
$MAGISKBIN
chmod
-R
755
$MAGISKBIN
# addon.d
...
...
@@ -105,44 +103,10 @@ if [ -d /system/addon.d ]; then
chmod
755 /system/addon.d/99-magisk.sh
fi
##########################################################################################
# Magisk Image
##########################################################################################
$BOOTMODE
&&
boot_actions
||
recovery_actions
if
(
is_mounted /data
)
;
then
IMG
=
/data/magisk.img
else
IMG
=
/cache/magisk.img
ui_print
"- Data unavailable, use cache workaround"
fi
if
[
-f
$IMG
]
;
then
ui_print
"-
$IMG
detected!"
else
ui_print
"- Creating
$IMG
"
$MAGISKBIN
/magisk
--createimg
$IMG
64M
fi
if
!
is_mounted /magisk
;
then
ui_print
"- Mounting
$IMG
to /magisk"
MAGISKLOOP
=
`
$MAGISKBIN
/magisk
--mountimg
$IMG
/magisk
`
fi
is_mounted /magisk
||
abort
"! Magisk image mount failed..."
# Core folders
mkdir
-p
$COREDIR
/props
$COREDIR
/post-fs-data.d
$COREDIR
/service.d 2>/dev/null
chmod
755
$COREDIR
/post-fs-data.d
$COREDIR
/service.d
chown
0.0
$COREDIR
/post-fs-data.d
$COREDIR
/service.d
# Legacy cleanup
mv
$COREDIR
/magiskhide/hidelist
$COREDIR
/hidelist 2>/dev/null
rm
-rf
$COREDIR
/magiskhide
$COREDIR
/bin
##########################################################################################
#
Unpack boot
#
Boot patching
##########################################################################################
find_boot_image
...
...
@@ -163,10 +127,7 @@ cd $MAGISKBIN
# Source the boot patcher
.
$COMMONDIR
/boot_patch.sh
"
$BOOTIMAGE
"
if
[
-f
stock_boot
*
]
;
then
rm
-f
/data/stock_boot
*
2>/dev/null
mv
stock_boot
*
/data
fi
[
-f
stock_boot
*
]
&&
rm
-f
/data/stock_boot
*
2>/dev/null
ui_print
"- Flashing new boot image"
if
[
-L
"
$BOOTIMAGE
"
]
;
then
...
...
@@ -178,12 +139,8 @@ rm -f new-boot.img
cd
/
if
!
$BOOTMODE
;
then
$MAGISKBIN
/magisk
--umountimg
/magisk
$MAGISKLOOP
rmdir
/magisk
recovery_cleanup
fi
# Cleanups
$BOOTMODE
||
recovery_cleanup
rm
-rf
$TMPDIR
ui_print
"- Done"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment