guys,
i have a script that runs on every boot. but its not working. i mean, the directory is still having its permission to write and the files on the directory is not beeing empty with the script. would "rm -rf /data/log/*" be better than the current one below? what am i doing wrong? thank in advance
(yes i have SU and root. im using script manager)
#!/system/bin/sh
rm /data/log/*.* <-- why isnt this deleting the files in log directory ??
chmod 444 data/log
really??no one?
Related
hello,
I'm new to android and i could re-brand my phone just using the tutorial
i have used adb to get in to the root of e10i (x10 mini)"the su"
i want to understand
first is default.prop this is the file i need to edit becous' i didn't/couldn't find and build.prop in the system dir ?
assume yes i did pull it by using \adb.exe pull default.prop is this right but when I'm trying to push it back after edit
\android-sdk-windows\tools\adb.exe push / default.prop
it stuck
this file cloud not be deleted using rm under the su
$ ls
ls
sqlite_stmt_journals
cache
sdcard
etc
system
sys
sbin
proc
init.rc
init.qcom.sh
init.qcom.rc
init.qcom.post_boot.sh
init.goldfish.rc
init.delta.sh
init.delta.rc
init
default.prop
data
root
dev
$ rm default.prop
rm default.prop
rm failed for default.prop, Read-only file system
nether of cp over wiret it
i did try to change the permission
$ chmod 777 default.prop
chmod 777 default.prop
Unable to chmod default.prop: Read-only file system
can anyone could help me to re-brand this phone ????
Push back to /sdcard instead, and from there copy to /system.
Sorry, might have answered to wrong question
skogholm said:
Push back to /sdcard instead, and from there copy to /system.
Sorry, might have answered to wrong question
Click to expand...
Click to collapse
i could push it to the phone but i could not relapse it
I would do like this:
adb shell
su
pull /system/build.prop
cat /system/build.prop > /sdcard/build.prop.original (make a copy...)
.. modify the file in whatevertool
adb push build.prop /sdcard
adb shell
su
cat /sdcard/build.prop > /system/build.prop
But be careful...
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
hey!
im developing an app but its a secret what it is about so i cant tell u to mouch
anyways, im needing help with the code.
Q2?
its very similar to the xRecovery installer for the x10, like when u press 'install' button it copys some files to the system folder, how can i do so?
ex: i want to copy derp.sh to /sdcard/derp.sh and the run the 'derp.sh' file all this from the installer.
Q2?
is it possible to send adb commands from the installer to the phone like "adb shell" or run sh files from the installer?
Q3?
is it possile to add a line of text to 'hw_config' file in 'modules' folder?
BTW im not a expert developer so yeah.....
Ch33rs
Moved to proper forum
benji.berg said:
hey!
im developing an app but its a secret what it is about so i cant tell u to mouch
anyways, im needing help with the code.
Q2?
its very similar to the xRecovery installer for the x10, like when u press 'install' button it copys some files to the system folder, how can i do so?
ex: i want to copy derp.sh to /sdcard/derp.sh and the run the 'derp.sh' file all this from the installer.
Q2?
is it possible to send adb commands from the installer to the phone like "adb shell" or run sh files from the installer?
Q3?
is it possile to add a line of text to 'hw_config' file in 'modules' folder?
BTW im not a expert developer so yeah.....
Ch33rs
Click to expand...
Click to collapse
A1]
#mount system in RW
cp <filelocation>/derp.sh /sdcard/derp.sh
chmod 777 /sdcard/derp.sh
su -c /sdcard/derp.sh
A2]
#mount system in RW
chmod 777 <filelocation>/programname.sh
su -c <filelocation>/programname.sh
A3]
#mount system in RW
echo "#code to add" >> /system/etc/hw_config.sh
DooMLoRD said:
A1]
#mount system in RW
cp <filelocation>/derp.sh /sdcard/derp.sh
chmod 777 /sdcard/derp.sh
su -c /sdcard/derp.sh
A2]
#mount system in RW
chmod 777 <filelocation>/programname.sh
su -c <filelocation>/programname.sh
A3]
#mount system in RW
echo "#code to add" >> /system/etc/hw_config.sh
Click to expand...
Click to collapse
And all this should i paste in an .sh file ?
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
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?