[Q] set_perm_recursive with init.d script? - Android Q&A, Help & Troubleshooting

I can't figure out how to set 777 permissions to a folder and every folder and file inside it using a init.d script..
Folders are /data/AndroidData/ and /data/obb/

Related

is there any ways to open support for init.d on version 1.5.7??

i have rooted perfectly,and built the folder /system/etc/init.d and i gave limits of authority to it.besides,i modify the file install-recovery.sh,the content is
【
#!/system/bin/sh
if ! applypatch -c MTD:recovery:2048:b01ab98799f9db633bbc6b43fe0df8fe5cebb820; then
r=`/data/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "select * from system where name='stay_on_while_plugged_in';"`
if [ $r eq "" ]; then
/data/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "insert into system values (null, 'stay_on_while_plugged_in','0');"
else
/data/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update system set value='0' where name='stay_on_while_plugged_in';"
fi
rm /data/sqlite3
log -t recovery "Installing new recovery image"
applypatch MTD:boot:8388608:f1e31577c64654f400f65ddea1fb4d6a51be9ba9 MTD:recovery c54d675c3e1a8fe9e9d810e7bee501111bacd2ed 8388608 f1e31577c64654f400f65ddea1fb4d6a51be9ba9:/system/recovery-from-boot.p
else
log -t recovery "Recovery image already installed"
fi
# chmod the init.d dir
busybox chmod -R 755 /system/etc/init.d
# run init.d
/system/bin/logwrapper /system/bin/busybox run-parts /system/etc/init.d
】.
but when i reboot the phone,the file Won't enforced.i wonder why?
after testing,when i copy the sh script from init.d to install-recovery,it works.but it confuses me more,why can't i transfer the script from init.d to execute??
mapleshadow said:
after testing,when i copy the sh script from init.d to install-recovery,it works.but it confuses me more,why can't i transfer the script from init.d to execute??
Click to expand...
Click to collapse
Its 5am and I haven't slept much, but have you checked the permissions and made sure they are rw-r-r I've noticed files with different configuration not having these have some issues while running.
Easiest way to look and change is RootExplorer
I ran into a similar issue with my phone. Make sure your init.d folder has execute permissions and the scripts inside the same. i got fed up and made the scripts inside init.d executable ... seems to work now

what is dtinstall.launch?

In some ROMs I've seen this dtinstall.launch file and a folder named /jit.
Can anybody tell me the purpose of this?
dtinstall.launch contains:
Code:
#!/sbin/sh
/system/bin/bash /system/bin/dtinstall
/jit folder contains /lib folder with libdvm.so, libnativehelper.so, and /bin folder with dalvikvm
dt
iONEx said:
In some ROMs I've seen this dtinstall.launch file and a folder named /jit.
Can anybody tell me the purpose of this?
dtinstall.launch contains:
Code:
#!/sbin/sh
/system/bin/bash /system/bin/dtinstall
/jit folder contains /lib folder with libdvm.so, libnativehelper.so, and /bin folder with dalvikvm
Click to expand...
Click to collapse
dt = DarkTremor app2SD install shell script, lives as /system/bin/dtinstall

[Q] Proper chmod for a specific folder?

I need to batch apply a set of permissions to these two folders and all files contained within. I'm moving my ringtones to these so that they preserve upon an SD Unmount, but I need to know the proper command in Terminal Emulator to do so. The files need rw-r-r-
/system/media/audio/ringtones
/system/media/notifications
Any help on this would be greatly appreciated.
if you want to apply a permission to the folder and also(recursive) to all of its contents...
you can use this:
su -c chmod -R 777 /path/to/directory
NOTE: 777 = rwx-rwx-rwx

Extract files and permissions help?

Hi guys,
I'm trying to make some changes to an android box firmware. Ultimately what I'm trying to do is extract some files from a tar.gz into a folder on the root.
I have got as far as creating the directory on the root, and having a shell script run that extracts the files to the root folder. Problem is, the files aren't appearing in my folder.
This is what I've done so far:
1. Extracted the boot image in the firmware to edit "init.rc". I've made the changes so I can make my "test" folder with 777 permissions.
In the "on init" section of init.rc I have this:
Code:
mkdir /test 777
2. I've created the following script (test.h) that runs from init.amlogic.board.rc
Code:
#!/system/bin/sh
MARK=/data/local/test
if [ ! -e $MARK ]; then
echo "test script"
busybox tar -zxf /system/test.tar.gz -C /test/
touch $MARK
echo "OK, installation complete."
fi
This is the code in the init.amlogic.board.rc
Code:
service test_copy /system/bin/test.sh
user root
group root
disabled
oneshot
on property:sys.boot_completed=1
start test_copy
Once the box has booted I can see the "test_copy" file but the tar.gz files are not in my root folder.
The last thing I need is the files from the tar.gz to be 777 permissions.
Obviously I'm a complete noob at this, hope that makes sense and someone can help?

Init.d scripts not executing on boot

I have installed term_init.sh for Init.d support. The scripts run perfectly from SM script manager app. However, they never run upon booting.
I have rooted - Marshmallow.
Any ideas please?
Try this:
1. Create /system/etc/install-recovery.sh (if not exist) set perms to 0755 (rwxr-xr-x) and ownership to 0:2000 (root:shell)
and write:
#!/system/bin/sh
/system/bin/sysinit
2. Create /system/bin/sysinit and set perms to 0755 (rwxr-xr-x) and ownership to 0:2000 (root:shell)
and write:
#!/system/bin/sh
run-parts /system/etc/init.d
3. Create dir /system/etc/init.d and set perms to 0755 (rwxr-xr-x) and ownership to 0:2000 (root:shell)
4. Create /system/etc/init.d/00test and set perms to 0755 (rwxr-xr-x) and ownership to 0:2000 (root:shell)
and write:
#!/system/bin/sh
echo "init.d executed script at boot" > /data/initd.log
5. Reboot and check if /data/initd.log file exist
Thanks!
Yes, the term-init.sh which I installed does everything you have noted above with all permissions. The script executes within Script Manager App but won't execute on boot as intended. Thus, the log file doesn't appear in /data/test.log
Still stuck?
I never do that, so I don't know what can go wrong, but try add init.d service to init.rc:
# Run init.d scripts
service sysinit /system/bin/logwrapper /vendor/bin/busybox run-parts /system/etc/init.d
class main
user root
group shell
oneshot

Categories

Resources