Volume Boost for [Perry] LineageOS 14.1 for Moto E4 Qualcomm - Moto E4 Themes, Apps, and Mods

If you find the maximum volume level too low in Lineage 14.1 , here are the steps to replace the configuration file, mixer_paths.xml, as root.
- Download the attached file, mixer_paths-moto-e4-lineage-14.1-new.xml, to your internal storage, /sdcard.
- Execute the following commands from terminal or adb shell.
mount -o rw,remount /system
cd /system/etc
# make backup of the original xml just in case
mv mixer_paths.xml /sdcard/mixer_paths.xml-0
# assuming you downloaded the new xml in internal storage, /sdcard
cp -av /sdcard/mixer_paths-moto-e4-lineage-14.1-new.xml mixer_paths.xml
chmod 644 mixer_paths.xml
cd /
sync​- Restart your phone for the new settings to take effect.
If you need to revert to the original settings, you can use the attached original xml and apply the same procedure as above.
This method is based on Moto G4 Native volume boost by hp420.
As always, proceed with caution when you are root.
​

zendude said:
If you find the maximum volume level too low in Lineage 14.1 , here are the steps to replace the configuration file, mixer_paths.xml, as root.
- Download the attached file, mixer_paths-moto-e4-lineage-14.1-new.xml, to your internal storage, /sdcard.
- Execute the following commands from terminal or adb shell.
mount -o rw,remount /system
cd /system/etc
# make backup of the original xml just in case
mv mixer_paths.xml /sdcard/mixer_paths.xml-0
# assuming you downloaded the new xml in internal storage, /sdcard
cp -av /sdcard/mixer_paths-moto-e4-lineage-14.1-new.xml mixer_paths.xml
chmod 644 mixer_paths.xml
cd /
sync
- Restart your phone for the new settings to take effect.
If you need to revert to the original settings, you can use the attached original xml and apply the same procedure as above.
This method is based on Moto G4 Native volume boost by hp420.
As always, proceed with caution when you are root.
Click to expand...
Click to collapse
Couldn't u just replace mixer_paths.XML in systems/etc of course u would have to rename it tho

skullkid383 said:
Couldn't u just replace mixer_paths.XML in systems/etc of course u would have to rename it tho
Click to expand...
Click to collapse
Yes. Some people might prefer using a file manager with root access to achieve the same result if they are more comfortable with gui over command line shell.

Will it work on Stock by any chance?

[email protected]@bl3s said:
Will it work on Stock by any chance?
Click to expand...
Click to collapse
Yes

mn1968 said:
Yes
Click to expand...
Click to collapse
Awesome! Thanks!

Related

[q] problem editting build.prop

cannot edit build.prop. i get an error when trying to edit it with es file explorer (there was an error when trying to save this file.)
any help? ive edited it before, but i dont know how. im pretty sure i did it this way but im not sure why its not saving properly this time.
running calk+clemsyn rom/kernel combo.
thanks!
Copy it to another folder edit the copy and then move the edited file in the correct folder.
tried that already, didnt work. got another error
I use Root Explorer to do any editing.
Any other suggestions? I'd rather not have to pay for it
joshtb86 said:
cannot edit build.prop. i get an error when trying to edit it with es file explorer (there was an error when trying to save this file.)
any help? ive edited it before, but i dont know how. im pretty sure i did it this way but im not sure why its not saving properly this time.
running calk+clemsyn rom/kernel combo.
thanks!
Click to expand...
Click to collapse
If the build.prop you want to edit is in /system, then you'll have to mount /system read-write before you can modify any files there:
Code:
$ su [I]Become superuser. Prompt will change to '#'.[/I]
# /system/xbin/mount -w -o remount /system
[I]Edit the file[/I]
# /system/xbin/mount -r -o remount /system
You must have the Superuser app from Market and busybox installed on the gTablet for the commands to work. If you can't edit the file in ES File Explorer because of permission errors, copy the file into /mnt/sdcard via the command line, edit it there (or on the PC after removing the card), then move it back into place in /system and restore the old permissions:
Code:
$ cp /system/build.prop /mnt/sdcard/.
[I]a) The build.prop file in /mnt/sdcard should be editable now in ES File Explorer.
Edit the file, then do:
OR
b) Unmount the SD card via Settings > Storage, then remove the SD card and
edit the file elsewhere. Plug it back in, and, after it mounts do:[/I]
$ su
# /system/xbin/mount -w -o remount /system
# /system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
# chown root.root /system/build.prop
# chmod 644 /system/build.prop
# /system/xbin/mount -r -o remount /system
All this is much easier through adb if you have that setup.
Note: Do not type the prompts--the '$' and '#' characters--in; they're just there to tell you what the Terminal screen should look like.
joshtb86 said:
Any other suggestions? I'd rather not have to pay for it
Click to expand...
Click to collapse
Did you have ES file explorer in Root mode?
In Es file explorer
Settings->Root Options -> both boxes checked, (HiAPK mode for first box)
I usually copy the file to sdcard and modify it, get ES explorer in root mode and copy it back. Do a backup before, in case you mess it up.
I usually use a terminal in su mode for editiing/copying, but that might not be needed.
cbay said:
Did you have ES file explorer in Root mode?
In Es file explorer
Settings->Root Options -> both boxes checked, (HiAPK mode for first box)
I usually copy the file to sdcard and modify it, get ES explorer in root mode and copy it back. Do a backup before, in case you mess it up.
I usually use a terminal in su mode for editiing/copying, but that might not be needed.
Click to expand...
Click to collapse
if i use CM Mod, i cant see any files. if i use HiAPK, all the files have -rw and a lot of stuff before it and i cant read anything, but it does mount. CW had problems mounting the drive. im gonna try out the terminal commands
rajeevvp said:
If the build.prop you want to edit is in /system, then you'll have to mount /system read-write before you can modify any files there:
Code:
$ su [I]Become superuser. Prompt will change to '#'.[/I]
# /system/xbin/mount -w -o remount /system
[I]Edit the file[/I]
# /system/xbin/mount -r -o remount /system
You must have the Superuser app from Market and busybox installed on the gTablet for the commands to work. If you can't edit the file in ES File Explorer because of permission errors, copy the file into /mnt/sdcard via the command line, edit it there (or on the PC after removing the card), then move it back into place in /system and restore the old permissions:
Code:
$ cp /system/build.prop /mnt/sdcard/.
[I]a) The build.prop file in /mnt/sdcard should be editable now in ES File Explorer.
Edit the file, then do:
OR
b) Unmount the SD card via Settings > Storage, then remove the SD card and
edit the file elsewhere. Plug it back in, and, after it mounts do:[/I]
$ su
# /system/xbin/mount -w -o remount /system
# mv /mnt/sdcard/build.prop /system/build.prop
# chown root.root /system/build.prop
# chmod 644 /system/build.prop
# /system/xbin/mount -r -o remount /system
All this is much easier through adb if you have that setup.
Note: Do not type the prompts--the '$' and '#' characters--in; they're just there to tell you what the Terminal screen should look like.
Click to expand...
Click to collapse
when i tried the mv command to move it back, i still got errors in moving it and was not able to
joshtb86 said:
when i tried the mv command to move it back, i still got errors in moving it and was not able to
Click to expand...
Click to collapse
Try
Code:
/system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
instead of plain 'mv'. The default Android mv command is idiotically implemented. (See this post if you're interested in the details):
http://forum.xda-developers.com/showpost.php?p=13956585&postcount=4
Using 'cp' command instead of 'mv' should also work; this way, you'll also have a backup of build.prop in /mnt/sdcard/.
rajeevvp said:
Try
Code:
/system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
instead of plain 'mv'. The default Android mv command is idiotically implemented. (See this post if you're interested in the details):
http://forum.xda-developers.com/showpost.php?p=13956585&postcount=4
Using 'cp' command instead of 'mv' should also work; this way, you'll also have a backup of build.prop in /mnt/sdcard/.
Click to expand...
Click to collapse
thanks so much again. i finally got it to work, but i just wanted to get netflix to work, and it still doesnt. after all that work. ugh.
JoTeC said:
I use Root Explorer to do any editing.
Click to expand...
Click to collapse
Thanks, I tried two other applications and they didn't work. Was able to edit with Root Explorer. didnt fix the Netflix playback. Bummer.
***** changing the Nexus S to HTC Vision and samsung to HTC did the trick.
Root explorer will work, and is a great app. Worht the money.
Also, ADB from a PC will work as well. Just install the android sdk and use ADB.
From windows cmd prompts the commands are just adb remount (to remount as root) then "adb pull /system/build.prop" (this will pull it to the sdk platform-tools folder that adb.exe is in) and then edit to your hearts delite.
"adb push build.prop /system/build.prop" to send it back.
I was able to use ES File System by unchecking the Mount File System option in the Root options menu and then rechecking it. I imagine that it forced a remount of the file system in a writable mode.
This worked on our nabi big tab hd24
We now have true multiuser, where everyone has their own login, files, emails, bookmarks, web history, etc; as it should be.
I first did a factory reset, then installed kingo root, then another reset, did the build prop edit this suggested (es file explorer did not work) but build prop editor did....
We now have the nabi big tab hd 24 running as our primary desktop workstation computer...
No we just wish for a room update to be made available with the latest version of Android.
4.4.2 is getting old, and as is common little manufacturer long term support...

[EXPANDSD] Join your external SD with internal SD!

WARN: For developer only.
attachment is the EXPANDSD script.
Why use it?
So many applications use /sdcard for mass data storage(gameloft, navigation...),
but I9100's internal_sd size is limit to 11G, so we need external_sd's space.
But these applications dosen't know how to use external_sd, old method is hack the apk for external_sd, but this will change apk's signature, and need smali/baksmali to work. My method work in system level, don't need change any apk file.
How to use:
1.make expandsd.ownhere dirctory in external_sd root directory.
2.move internal_sd's directory(for example:/gameloft) to expandsd.ownhere
3.run init_expandsd.sh
Theory:
use 'mount --bind' feature, bind external_sd's dir to internal_sd.
Because the sd card using fat32 partition format, the 'ln -s' command does not work, so the "mount --bind" is the only way to dynamically change the directory content.
Hi mate,
Thks for your shares. I have a question. How run init_expandsd.sh?
I tried gscript and init.d, but doesn't seem to be working
woohoo a great dev has come. glad you got here mate! love your work on Desire section.
harrynghiem said:
Hi mate,
Thks for your shares. I have a question. How run init_expandsd.sh?
Click to expand...
Click to collapse
you can try to use terminal emu, just type su then navigate to folder where the script located, then type sh init_expandsd.sh then enter. this might do the trick to execute .sh
dexterdave said:
you can try to use terminal emu, just type su then navigate to folder where the script located, then type sh init_expandsd.sh then enter. this might do the trick to execute .sh
Click to expand...
Click to collapse
Does it work for you?
It's a great idea thanks a lot for your work. I was wondering why ln was not working.
But too bad it does not work for me, i get the following error :
[1] Segmentation fault
Do you have any idea why ?
Thanks again
problems when connecting phone to pc
hi,
tried the "mount --bind" in order to try your script.
works fine. the directory contents is shared between the 2 path's,
but i have a problem when i connect the phone to a pc.
when i try to disconnect, the sdcard and external_sd are not
available anymore until i reboot the phone
note: the commands that i have executed are:
Code:
mkdir /mnt/sdcard/external_sd/foo
echo "test" > /mnt/sdcard/external_sd/foo/test
mkdir /mnt/sdcard/foo
mount --bind /mnt/sdcard/external_sd/foo /mnt/sdcard/foo
Can this script be placed in init.d folder for autorun at boot?
Edit: sorry, already answered above: no, it cannot.
Sent from my GT-P1000 using Tapatalk
Seems abandoned by @ownhere
Sent from my GT-I9100
Idan73 said:
Seems abandoned by @ownhere
Sent from my GT-I9100
Click to expand...
Click to collapse
too bad, it could be very useful..
TheFirstBen said:
It's a great idea thanks a lot for your work. I was wondering why ln was not working.
But too bad it does not work for me, i get the following error :
[1] Segmentation fault
Do you have any idea why ?
Thanks again
Click to expand...
Click to collapse
got the same problem please help
How to use?
ownhere said:
WARN: For developer only.
attachment is the EXPANDSD script.
Why use it?
So many applications use /sdcard for mass data storage(gameloft, navigation...),
but I9100's internal_sd size is limit to 11G, so we need external_sd's space.
But these applications dosen't know how to use external_sd, old method is hack the apk for external_sd, but this will change apk's signature, and need smali/baksmali to work. My method work in system level, don't need change any apk file.
How to use:
1.make expandsd.ownhere dirctory in external_sd root directory.
2.move internal_sd's directory(for example:/gameloft) to expandsd.ownhere
3.run init_expandsd.sh
Theory:
use 'mount --bind' feature, bind external_sd's dir to internal_sd.
Because the sd card using fat32 partition format, the 'ln -s' command does not work, so the "mount --bind" is the only way to dynamically change the directory content.
Click to expand...
Click to collapse
thanks,
this is genius
I'm not using your script (have myself some ux & scripting skills) but did not know about the -bind option on android
Ridiculously simple and efficient
Did it my own way and it works great
Thanks a lot for this
dawabz94 said:
thanks,
this is genius
I'm not using your script (have myself some ux & scripting skills) but did not know about the -bind option on android
Ridiculously simple and efficient
Did it my own way and it works great
Thanks a lot for this
Click to expand...
Click to collapse
Then why not share with us please !
Let us know how you did
Yes I'd like to know another method also.!
Sent from my GT-I9100 using XDA
Chairmansaab said:
Then why not share with us please !
Let us know how you did
Click to expand...
Click to collapse
Hi,
it's very easy indeed, once you got the point.
I do most of my stuff using an "adb shell" session so I'll post here my steps to get it working.
Also I like simple implementation so my script is the strict minimum needed to mount necessary folders
I assume you have a rooted device with working busybox and a kernel that supports /etc/init.d/
I suggest you do the test on a dummy folder before applying on a real folder.
So start by creating a folder called /sdcard/dummy
Do it the way you want , I do it with an "adb shell" session
Code:
cd /sdcard
mkdir dummy
Then copy some files in it (photos for examples)
Code:
cd /sdcard
cd DCIM
cd Camera
cp `ls -1 |tail -5` /sdcard/dummy
From now on, we consider we want to move transparently /sdcard/dummy to the external SD
1. move the folder to the external sd
CAUTION : I'm running a CM9 rom => my external sd is mounted on /mnt/emmc
Standard samsung sdcard mount is /sdcard/external_sd
The path might be different according to your brand and rom
Moving the folder code
Code:
cd /sdcard
mv dummy /mnt/emmc/
2. Create the mount point in the indernal SD
Code:
cd /sdcard
mkdir dummy
3.a Check the mount is successful by manually doing it
Code:
mount --bind /mnt/emmc/dummy /sdcard/dummy
3.b Check you see exactly the same thing on both folders
Both commands should return exactly the same output
Code:
ls -l /sdcard/dummy
Code:
ls -l /mnt/emmc/dummy
If everything is fine, then you're good to go
4. Automate mount at boot time
Create a script in /etc/init.d to automate the mount at boot time
I personally use "vi" but most people prefer graphical UIs, I can't recommend any here, do it your own way
So basically you would go root,remount /system in read/write mode and create the file
Code:
su
mount -o remount,rw /dev/block/mmcblk0p9 /system
cd /etc/init.d
vi 90binds
Insert following lines, save and exit
Note that the "sleep 60" is to let the system boot up before mounting partitions (thanks to the initial script shared here)
Code:
#!/system/bin/sh
sleep 60
mount --bind /mnt/emmc/dummy /sdcard/dummy
Change owner and permissions, flush disk cache and remount /system in read only
Code:
su
mount -o remount,rw /dev/block/mmcblk0p9 /system
cd /etc/init.d
chown root:shell
chmod 6755 90binds
sync
mount -o remount,ro /dev/block/mmcblk0p9 /system
To check, run
Code:
su
cd /etc/init.d
ls -l 90binds
The output should look like this :
Code:
-rwsr-sr-x 1 root shell [I]0 MMM D HH:MM[/I] 90binds
5. Now you can reboot and check - after reboot - that the mount is done
Both commands should return exactly the same output (always ran in an "adb shell" session)
Code:
ls -l /sdcard/dummy
Code:
ls -l /mnt/emmc/dummy
6. Now you're good to move other folders
Basically, you move the folder to external SD
Create the mount point on the internal SD
Append the mount command in the 90binds script
And that's it
Hope this helps
---------- Post added at 11:09 AM ---------- Previous post was at 11:04 AM ----------
benc88 said:
Yes I'd like to know another method also.!
Sent from my GT-I9100 using XDA
Click to expand...
Click to collapse
Just posted
Take time to read and understand the idea

[Q] init.d support for stock rom P500

Hi, I just read some tips about using script for enhancing performance.
It says that the script must be places in system/etc/init.d
But in stock rom P500 (GB 2.3.3 v20G) I can't find folder init.d
The questions:
1. Is the stock rom already support init.d script execution?
2. If yes, will it works just by creating folder init.d and place script there?
3. If not, how to enable support init.d for Optimus One, stock ROM rooted?
I search this forum and find some guide about init.d support in other phone models, will it works on Optimus One too, or perhaps it needs particular way to do it?
1. No
2. If you have init.d support in rom.
3. Only way to do it is cook a custom rom through kitchen to add init.d support
terratrix said:
1. No
2. If you have init.d support in rom.
3. Only way to do it is cook a custom rom through kitchen to add init.d support
Click to expand...
Click to collapse
3. answer is some wrong:
you doesnt need to cook a custom rom, you only need the adb (android debug bridge) to "speak" with your phone:
0.) on your phone download busybox from market
1.) install android sdk on your computer
2.) install LG usb drivers on your computer
3.) open a console (on windows use the "cmd" command)
4.) remount "root" to read/write (type following commands in the cmd)
Code:
adb shell
mount -o remount,rw /dev/block/mmcblk1 /
exit
5.) retrive the init.rc file from your device: (type the command in the cmd)
Code:
adb pull /init.rc C:\users\XXXXX\Desktop\init.rc
6.) open the init.rc file and add the busybox command to execute scripts in the /system/etc/init.d folder
after the lines that does mkdirs etc but BEFORE zygote starts (this stars the whole android)...
Code:
service userinit /system/xbin/busybox run-parts /system/etc/init.d
oneshot
7.) close and save the file, push it back to your device, than reboot:
Code:
adb push XXXX\XXXX\init.rc /init.rc
now you can use the init.d folder as in CyanogenMod / other custom roms.
andy572 said:
3. answer is some wrong:
you doesnt need to cook a custom rom, you only need the adb (android debug bridge) to "speak" with your phone:
0.) on your phone download busybox from market
1.) install android sdk on your computer
2.) install LG usb drivers on your computer
3.) open a console (on windows use the "cmd" command)
4.) remount "root" to read/write (type following commands in the cmd)
Code:
adb shell
mount -o remount,rw /dev/block/mmcblk1 /
exit
5.) retrive the init.rc file from your device: (type the command in the cmd)
Code:
adb pull /init.rc C:\users\XXXXX\Desktop\init.rc
6.) open the init.rc file and add the busybox command to execute scripts in the /system/etc/init.d folder
after the lines that does mkdirs etc but BEFORE zygote starts (this stars the whole android)...
Code:
service userinit /system/xbin/busybox run-parts /system/etc/init.d
oneshot
7.) close and save the file, push it back to your device:
Code:
adb push XXXX\XXXX\init.rc /init.rc
now you can use the init.d folder as in CyanogenMod / other custom roms.
Click to expand...
Click to collapse
Ah thanks for correcting my answer ^^
Dear Andy,
Thanks 4 the procrdure, however i wanted to ask you whether there is any tool to check that the scripts in the init.d folder r getting executed?
andy572 said:
.....guide...
Click to expand...
Click to collapse
That works? I mean init.rc is in ramdisk in boot partition, and gets unpacked on boot, so any changes in / are lost on reboot - at least that is what was told to me.
Kanad said:
Dear Andy,
Thanks 4 the procrdure, however i wanted to ask you whether there is any tool to check that the scripts in the init.d folder r getting executed?
Click to expand...
Click to collapse
Option 1 - run logcat during boot (Trough ADB, type logcat in adb shell, a little simpler if using Droid Explorer)
Option 2 - Run a script that changes something that was previously different. Try installing the supercharger (with different from normal minfree values), rebooting and running the script again to make sure the minfree values are modified. If so, init.d is working and vice versa.
andy572 said:
6.) open the init.rc file and add the busybox command to execute scripts in the /system/etc/init.d folder
after the lines that does mkdirs etc but BEFORE zygote starts (this stars the whole android)...
Code:
service userinit /system/xbin/busybox run-parts /system/etc/init.d
oneshot
Click to expand...
Click to collapse
I go directly to this step, using root explorer on phone (not using PC+ADB)
But after reboot, init.rc i've already edited before has been restored again to original value, as said by Tasssadar.
Maybe I should do it using PC+ADB instead of direct edit on phone?
optimuswhite said:
I go directly to this step, using root explorer on phone (not using PC+ADB)
But after reboot, init.rc i've already edited before has been restored again to original value, as said by Tasssadar.
Maybe I should do it using PC+ADB instead of direct edit on phone?
Click to expand...
Click to collapse
you are trying to modify a running system, sure - you have to do such things
in the boot.img file and have to re-flash it. there is no way to modify a running
system, sorry for misunderstanding.
andy572 said:
you are trying to modify a running system, sure - you have to do such things
in the boot.img file and have to re-flash it. there is no way to modify a running
system, sorry for misunderstanding.
Click to expand...
Click to collapse
I see.
so, is someone can guide me how to deal with boot.img on stock rom?
optimuswhite said:
I see.
so, is someone can guide me how to deal with boot.img on stock rom?
Click to expand...
Click to collapse
go to your recovery, make a backup of your current system and connect the
phone via usb to your computer and copy the rom from the phone to your computer.
then, use the htc kitchen to modify the created rom / or the boot.img

[Q] Linux/Android Question

I am adding some mod files and tweaks to an android 2.3.3 image. It is a Livesuit flashable image for the Alpha 2 Skypad. I use unimg.exe to extract the files then fileaddsum and unimg to repack the file under Windows.
I mount the extracted image in Linux Mint then make my changes. I have tried different tricks people have suggested to set the permissions of the file, but whenever I umount and repack the img, it will install, but I have to go into adb and chmod the files. I have written a simple command file so it only take a second, but being new to Linux I am not finding any way to set the permission when I copy over the files to the mounted image.
Any suggestions/ Thanks in advance.
bump..........................................
re-bump .............................................
Not sure if this will help, but in unix permissions are set with chmod. so to ad the exicutable permission you enter:
Code:
su
chmod a+x filename
exit
However if youve had suggestions on setting permissions, you must already know this?
matts95 said:
Not sure if this will help, but in unix permissions are set with chmod. so to ad the exicutable permission you enter:
Code:
su
chmod a+x filename
exit
However if youve had suggestions on setting permissions, you must already know this?
Click to expand...
Click to collapse
That wasn't working for me. But I found a cheat, I guess you could say. Once the image was open I would pull the files from the emulator or a pad directly to the image+folder. Not elegant but it worked.

How to create terminal script

Hey, can someone tell me how to create a script to run a terminal command. I looked up google but didn't find any good results.
Open a new file, and write:
Code:
#!/system/bin/sh
your_command
another_command
another_one_xD
Save the file with sh extension, and run your script as follows:
Code:
su #optional, if your script needs root access.
sh yourscript.sh
If you get an error, probably need to grant permissions to your script, so:
Code:
chmod +x yourscript.sh
And try again.
Granting su is
$ su
Correct?
And thanks for the reply :]
Sent from my XT862 using Tapatalk 2
Yep
When you set the permissions, you only have to do that once right?
Yes.
I'm trying to build a script to move pics and video from my internal storage to external storage. I have the script made and on my phone but when I run it, I get an error: "failed on /storage/sdcard0/DCIM/Camera/*.jpg" - Cross-device link . Any idea what that means?
mmurphmsu said:
I'm trying to build a script to move pics and video from my internal storage to external storage. I have the script made and on my phone but when I run it, I get an error: "failed on /storage/sdcard0/DCIM/Camera/*.jpg" - Cross-device link . Any idea what that means?
Click to expand...
Click to collapse
Move (mv) only move the directory entry, not the actual data. Because of this, you can not move files from one disk to another (e.g. from internal to sdcard), hence the cross device error. You'll have to copy and then delete the original.
kuisma said:
Move (mv) only move the directory entry, not the actual data. Because of this, you can not move files from one disk to another (e.g. from internal to sdcard), hence the cross device error. You'll have to copy and then delete the original.
Click to expand...
Click to collapse
That seems to have done the trick but I have found another issue. When going into multiple directories (/storage/sdcard0/DCIM/Camera) from the script or even the root directory, I get a No Such file or directory error. But I can CD into that directory and manually cp and rm the files. Any idea why that is happening?
mmurphmsu said:
That seems to have done the trick but I have found another issue. When going into multiple directories (/storage/sdcard0/DCIM/Camera) from the script or even the root directory, I get a No Such file or directory error. But I can CD into that directory and manually cp and rm the files. Any idea why that is happening?
Click to expand...
Click to collapse
You've simply done something wrong. Show us the script.
Here is the script I created:
#!/system/bin/sh
#
#
#
#
#Move Pictures from Internal Storage to External Storage media
cp /storage/sdcard0/DCIM/Camera/IMG* /storage/sdcard1/DCIM/Camera
rm /storage/sdcard0/DCIM/Camera/IMG*
#
#
#
#Move Videos from Internal Storage to External Storage media
cp /storage/sdcard0/DCIM/Camera/VID* /storage/sdcard1/DCIM/Camera
rm /storage/sdcard0/DCIM/Camera/VID*
I put the script in the root directory and run it from there. Its permissions are rwxrwxr
mmurphmsu said:
Here is the script I created:
#!/system/bin/sh
#
#
#
#
#Move Pictures from Internal Storage to External Storage media
cp /storage/sdcard0/DCIM/Camera/IMG* /storage/sdcard1/DCIM/Camera
rm /storage/sdcard0/DCIM/Camera/IMG*
#
#
#
#Move Videos from Internal Storage to External Storage media
cp /storage/sdcard0/DCIM/Camera/VID* /storage/sdcard1/DCIM/Camera
rm /storage/sdcard0/DCIM/Camera/VID*
I put the script in the root directory and run it from there. Its permissions are rwxrwxr
Click to expand...
Click to collapse
Does /storage/sdcard1/DCIM/Camera exists? Try add:
mkdir -p /storage/sdcard1/DCIM/Camera
... to the script before you begin the copy. This will create the destination(s) in case of non-existent.
Also, your cp and rm command will fail with this error if there aren't any files named both IMG* and VID* in the source directory.
kuisma said:
Does /storage/sdcard1/DCIM/Camera exists? Try add:
mkdir -p /storage/sdcard1/DCIM/Camera
... to the script before you begin the copy. This will create the destination(s) in case of non-existent.
Also, your script will fail with this error if there aren't any files named both IMG* and VID* in the source directory.
Click to expand...
Click to collapse
Yes it exists. I can navigate to the directory in Root Explorer. I tried running the script in Root Explorer but it didn't move the two pics i have in the /storage/sdcard0/DCIM/Camera directory to the /storage/sdcard1/DCIM/Camera directory.
mmurphmsu said:
Yes it exists. I can navigate to the directory in Root Explorer. I tried running the script in Root Explorer but it didn't move the two pics i have in the /storage/sdcard0/DCIM/Camera directory to the /storage/sdcard1/DCIM/Camera directory.
Click to expand...
Click to collapse
And you DO have files named IMG* and VID* in your source directory?
kuisma said:
And you DO have files named IMG* and VID* in your source directory?
Click to expand...
Click to collapse
Yes. I took to pictures and then tried running it and it still fails. I wonder if its not working cause I'm on CM10?
mmurphmsu said:
Yes. I took to pictures and then tried running it and it still fails. I wonder if its not working cause I'm on CM10?
Click to expand...
Click to collapse
You realise that even with pictures in the directory, you'll still get this error from the next operations you try executing on the videos? Still, the script should a) still copy the images, and b) not terminate due to this error anyway (i.e. consider it a warning).
But you say the images are not copied. Quite odd, I'd say.
Add a path to the script (export PATH=/system/bin:/system/xbin plus the places you need), add a test "echo Running" to make sure the script actually is launched by Root Explorer. And add +x permissions for all, even "other". You can also add:
echo /storage/sdcard0/DCIM/Camera/IMG*
... before the first copy. This will show you what files matching your expression.
I'll just manually move them. I was just hoping for an easier way until CM10 is enabled to save pictures to the external SD card.
mmurphmsu said:
I'll just manually move them.
Click to expand...
Click to collapse
Take this as an opportunity to learn more about script programming, I'd say.
Experience is what we get when we expected something else.
kuisma said:
Take this as an opportunity to learn more about script programming, I'd say.
Experience is what we get when we expected something else.
Click to expand...
Click to collapse
I do a little in UNIX at work that's why I tried this. I really want to learn how to program for actual Android apps. Just need to find something to help me get started, as I have no clue where to start.
Where save the file ?
Hello
I'm french and don't speak english very well ....
I try to do what is explain in this topic ( for tethering with a Sony Ericsson KYNO V - ics 4.0.4 with root access ....
I don't understand where to save the file with sh extension
What i want to run is : #!/system/bin/sh
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o rmnet0 -j MASQUERADE
My script is :
su root
sh scripttether.sh
Thank you very much for your help
BR
RoberGalarga said:
Open a new file, and write:
Code:
#!/system/bin/sh
your_command
another_command
another_one_xD
Save the file with sh extension, and run your script as follows:
Code:
su #optional, if your script needs root access.
sh yourscript.sh
If you get an error, probably need to grant permissions to your script, so:
Code:
chmod +x yourscript.sh
And try again.
Click to expand...
Click to collapse

Categories

Resources