Skip to content

Commit 06c53ae

Browse files
committed
multirom: uninstaller: Support symlinked init and init.real
* Allows the usage of symlinks on /init for ramdisk using this method to call the real binary or script * Detect the init.real file from the primary ramdisk and use it instead of the /init (init_sony for example) Change-Id: I1199e00679f0822433773cd2a374c29074d9685f Signed-off-by: Adrian DC <radian.dc@gmail.com>
1 parent 87f97ff commit 06c53ae

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

install_zip/prebuilt-uninstaller/scripts/clear_boot.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,20 @@ case "$magic" in
3939
;;
4040
esac
4141

42-
if [ rd_cmpr == -1 ] || [ ! -f /tmp/boot/init ] ; then
42+
if [ rd_cmpr == -1 ] || [ ! -e /tmp/boot/init -a ! -L /tmp/boot/init ] ; then
4343
echo "Failed to extract ramdisk!"
4444
return 1
4545
fi
4646

4747
# restore init
4848
if [ -e /tmp/boot/main_init ] ; then
49-
rm /tmp/boot/init
50-
mv /tmp/boot/main_init /tmp/boot/init
49+
if [ -e /tmp/boot/init.real ] ; then
50+
rm /tmp/boot/init.real
51+
mv /tmp/boot/main_init /tmp/boot/init.real
52+
else
53+
rm /tmp/boot/init
54+
mv /tmp/boot/main_init /tmp/boot/init
55+
fi
5156
fi
5257

5358
chmod 750 /tmp/boot/init

0 commit comments

Comments
 (0)