Sophie LaBüf

  • Home
  • Recommended Apps
  • XDA
  • Facebook
  • About Me
  • Privacy Policy

Stock ROM – SGS4 – init.d

Posted by egingell on Oct 14, 2013
Posted in: Android.

Last Updated on Dec 26, 2022


Disclaimer: I am not responsible for you doing things wrong and breaking your phone or losing your data.

I recently found out that my debuggerd hack to enable init.d support on my stock SGS4 wasn’t working. So, I did this and now it works.

Make a file named “install-recovery.sh” and drop it into /system/etc. Whatever script you put in here will execute at boot up so long as the user/permissions are correct.

chown shell:shell "/system/etc/install-recovery.sh"
chmod 755 "/system/etc/install-recovery.sh"
chmod u=rwx,a=rx "/system/etc/install-recovery.sh" # busybox must support symbolic modes

My “/system/etc/install-recovery.sh” script:

#!/system/bin/sh
LOG="/data/install-recovery.log";

echo "Executing install-recovery.sh" > $LOG;
echo "" >> $LOG;

echo "$(date) install-recovery hack..." > $LOG
echo "" >> $LOG
echo "init.d" >> $LOG

# I can't get run-parts to work for some reason, but this will run every *.sh script in /system/etc/init.d as root.
for N in /system/etc/init.d/*.sh; do
	su -c "$N" 1>>$LOG 2>>$LOG
done;

Notes:

  • Mount binding (in JB 4.2.2+) seems to work. E.g. mount -o bind /folder1 /folder2
  • $(date) does not provide the correct date (mine said: “Wed Apr 15 13:24:13 MST 1970”).
  • The Package Manager is not available. (There may be other unavailabilities, but I don’t intend to test it thoroughly.)

Posts navigation

← Theming The GS4
Google Launcher →
  • Join Discover: get $50
  • Latest

    • FFXV Jan 29, 2025
    • Final Fantasy X-2 Sep 11, 2024
    • Final Fantasy XII Jul 9, 2024
    • TLoU Game vs TV Series Mar 7, 2024
    • EA Customer Support Jan 22, 2024
    • FFX-2 Matchmaking & Publicity Dec 2, 2023
    • Classic Word Streak Nov 3, 2023
    • Final Fantasy X-2 - Via Infinito Oct 20, 2023
    • Getting Screenshots from Switch to Smart Device Oct 20, 2023
    • Spams & Scams Oct 6, 2023
  • Info

    • About Me Jun 24, 2024
    • About Jeckle Apr 30, 2023
    • About Heckle Apr 30, 2023
    • Privacy Policy Dec 25, 2022
  • Categories

    • Android (38)
    • Gaming (15)
    • Nintendo (2)
    • Social Networking (1)
    • Sophie (9)
    • Television (1)
    • Uncategorized (1)
    • Weird Things Nerds Do (3)
  • Tools

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
Proudly powered by WordPress Theme: Parament by Automattic.