mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-12 05:07:45 +02:00
Support custom legacy Sony devices with init.real setup
Custom ROM bring-ups of legacy Sony devices contain the following: /init (symlink to /bin/init_sony) /init.real (the "real" Android init) /bin/init_sony (this was /sbin/init_sony on Android <11) Kernel loads the ramdisk and starts /init -> /bin/init_sony /bin/init_sony does low-level device setup (see: https://github.com/LineageOS/android_device_sony_common/blob/lineage-18.1/init/init_main.cpp) /bin/init_sony unlinks /init and renames /init.real to /init /bin/init_sony starts /init Since init_sony needs to run first magiskinit needs to replace init.real instead, so add workarounds based on detection of init.real to boot patcher and uninstaller Thanks @115ek and @bleckdeth Fixes #3636 Co-authored-by: topjohnwu <topjohnwu@gmail.com>
This commit is contained in:
@ -135,6 +135,12 @@ case $((STATUS & 3)) in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Work around custom legacy Sony /init -> /(s)bin/init_sony : /init.real setup
|
||||
INIT=init
|
||||
if [ $((status & 0x4)) -ne 0 ]; then
|
||||
INIT=init.real
|
||||
fi
|
||||
|
||||
##################
|
||||
# Ramdisk Patches
|
||||
##################
|
||||
@ -158,8 +164,16 @@ if [ -f magisk64 ]; then
|
||||
unset SKIP64
|
||||
fi
|
||||
|
||||
# Work around custom legacy Sony /init -> /(s)bin/init_sony : /init.real setup
|
||||
INIT=init
|
||||
SKIPSONY="#"
|
||||
if ./magiskboot cpio ramdisk.cpio "exists init.real"; then
|
||||
INIT=init.real
|
||||
unset SKIPSONY
|
||||
fi
|
||||
|
||||
./magiskboot cpio ramdisk.cpio \
|
||||
"add 0750 init magiskinit" \
|
||||
"add 0750 $INIT magiskinit" \
|
||||
"mkdir 0750 overlay.d" \
|
||||
"mkdir 0750 overlay.d/sbin" \
|
||||
"$SKIP32 add 0644 overlay.d/sbin/magisk32.xz magisk32.xz" \
|
||||
|
Reference in New Issue
Block a user