[Q] /sbin/echo and updater-script not playing nice... - Android Q&A, Help & Troubleshooting

Firstly, if this is the wrong forum, my apologies.
My problem is that I'm trying to use /sbin/echo to modify a file during a zip flash, but according to the recovery logs, all it's doing is printing the whole thing to the log. For example, if I do:
Code:
run_program("/sbin/echo", "'test' >> /sdcard/test.txt");
I don't get a new /sdcard/test.txt file with the word "test" in it, I get the output "'test' >> /sdcard/test.txt" in the log. Sorry if this is a common question, but I've been Googling without success for a couple hours now.
Thanks in advance!

Related

hw_config.sh updating using echo command

firstly i'd like to apologize if this has been brought up before (i can't seem to find it), or if i'm posting in the wrong subforum. i originally made a thread in General but it seems that the entire subforum has far less visitors than here...
now idk if anyone's figured this out yet, but i just tried it and it works.
instead of pulling out hw_config.sh, editing it, then pushing it back again or just plain editing it from the phone itself, we can use the "ECHO" command...
from the shell:
# remount
# echo "whatever you want to put here" >> /system/etc/hw_config.sh
Click to expand...
Click to collapse
it will append whatever it is you typed within the " " to the END of hw_config.sh
still haven't figured out how to do insert new line in it tho apart from multiple echo commands.
i think this can be particularly useful for devs like doixanh who's said that he needs to create a custom zip for different ROMs? maybe something like that can be put into the xrecovery update script? idk how to go about editing that file so i didn't wanna try it.
maybe something for his for example mddi module can have a command like
echo "insmod /system/lib/modules/x8mddi.ko # fix mddi lags" >> /system/etc/hw_config.sh
Click to expand...
Click to collapse
or something like that
Simple universal solution: don't edit hw_config. Use chargemon, that way only one update zip is needed.
can't say i know what it is or how to use it i'm still quite new to all this hehe. will look it up tho. i do know a little basic linux and command line things so i was just trying it out to see if it works since DX said he won't be making custom zips for all the different ROMs out there but many ppl seems to be asking for one. just thought maybe it would help :shrugs:
add to the second (empty one) line in chargemon this:
insmod /system/lib/modules/ModuleName.ko
You can add more insmod lines, one bellow another.
Then everyone should update recovery with FlashTool 0.2.9.1 to avoid any issues, and push new chargemon to /system/bin
Of course, you can modify the positioning in chargemon, for example, place insmod lines after keypress check - for booting into recovery, to make it still possible to boot into recovery if modules cause bootloops.

Sideload has perms 40755

Does anyone know how to fix a e:/tmp/sideload has perms 40755 issue?
I was flashing a rom and got stuck there.
Any help will be appreciated.
Thank you!
Whenever I used to get that I'd pull battery do a full wipe and try again. Later I flashed my recovery again and the problem has stopped entirely. I flash ROMs as much as 5 times a day (on a good day).
proxhack said:
Does anyone know how to fix a e:/tmp/sideload has perms 40755 issue?
I was flashing a rom and got stuck there.
Any help will be appreciated.
Thank you!
Click to expand...
Click to collapse
I haven't seen this error come up before on the q&a board, but I very well could have missed it.
The recovery outputs the details around the error in a /tmp/recovery.log file. Once the error occurs, its best to check this file, /tmp/recovery.log for the details around the error. In order to really troubleshot the specific issue, we'd need a copy of the /tmp/recovery.log and the .zip file being loaded.
Sorry that doesn't directly answer the question, but it will lead to the best technical solution possible! Hope that helps provide some light around recovery .zip flashing troubleshooting!
I just got this trying to install sick sense rom. There is no log file in tmp/
MikeC84 said:
I just got this trying to install sick sense rom. There is no log file in tmp/
Click to expand...
Click to collapse
whenever the recovery first boots, it will create a log file in /tmp/recovery.log. this file will get wiped on reboot. the best time to pull and examine the /tmp/recovery.log file is right after the recovery throws the installing error.
if, for some odd reason, there is a recovery.log in /tmp, you can also try checking /cache/recovery.log.
if you can post the file contents up we can help troubleshoot!
i know i've seen people post back, after attempting to flash 2-3 times the error would disappear. i also know i've seen people post that re-flashing the custom recovery, or flashing an updated version helps clear the issue.
hope that helps!
I had this problem too after trying to flash Viper-Rom RC2 version 4. The problem did not occur during the first installation, but after realizing I forgot to format the data partition, and going back and formatting everything and trying the install again, I had the perms 40755 issue. It appears that having a rom that tweaks the file system and permissions will cause this issue on occasion. After pulling the battery like triscuit suggested, it worked just fine. Unfortunately I scoured the entire phone for a recovery.log file and it was nowhere to be found. We may not have a technical reasoning for this issue exactly, but triscuit's workaround appears to take care of the problem.

Trying to flash My own Rom

Used dsixdas Rom kitchen.
Built my own Rom using rogers stock RUU
starts to flash, then I get, error in sd card installation aborted
(status 0)
the last thing it was doing
minzip: extracted file "system/cuE:Error in /sdcard/marksrom
any takers??!!
Thanks guys
markdexter said:
Used dsixdas Rom kitchen.
Built my own Rom using rogers stock RUU
starts to flash, then I get, error in sd card installation aborted
(status 0)
the last thing it was doing
minzip: extracted file "system/cuE:Error in /sdcard/marksrom
any takers??!!
Thanks guys
Click to expand...
Click to collapse
What type of zip file is it?
its just the one that dsxidas tool spits out, although I did notice some differences.
If i click on the Rom.zip file, go to properties, then security. The only 2 that where check-marked was "modify" and "read & execute" So i compared that to a Rom that works on my device and noticed that in that same box they where all checked. - full control
modify
Read & execute
Read
Write
Special permissions
I changed those in my Rom so there all checked,however cant flash till tonight.
Just wondering if that could possibly be an, or the, issue
Not sure how to check what type of .zip file it is??
markdexter said:
Used dsixdas Rom kitchen.
Built my own Rom using rogers stock RUU
starts to flash, then I get, error in sd card installation aborted
(status 0)
the last thing it was doing
minzip: extracted file "system/cuE:Error in /sdcard/marksrom
any takers??!!
Thanks guys
Click to expand...
Click to collapse
markdexter said:
its just the one that dsxidas tool spits out, although I did notice some differences.
If i click on the Rom.zip file, go to properties, then security. The only 2 that where check-marked was "modify" and "read & execute" So i compared that to a Rom that works on my device and noticed that in that same box they where all checked. - full control
modify
Read & execute
Read
Write
Special permissions
I changed those in my Rom so there all checked,however cant flash till tonight.
Just wondering if that could possibly be an, or the, issue
Not sure how to check what type of .zip file it is??
Click to expand...
Click to collapse
Lol .. the "check boxes" you're referring to only indicate the access permissions for the specific .zip file. When in recovery mode, everything runs as root. If there is any read permission on the file, recovery should be able to acces it without any issues. Further, you mentioned above the recovery was in the process of flashing the file indicating the recovery has no issues accessing the file.
If the recovery has no issues accessing the file, there shouldn't be any issues with the specific permissions of the ROM .zip file on that specific file system in recovery mode.
As a ROM developer, the next step to troubleshooting and understanding errors when flashing a ROM is by becoming familiar with the custom recovery error log.
The custom recovery shows very limited information on the display, but in the log shows much more detail. The logs are generally kept at /tmp/recovery.log and /cache/recovery.log.
The best process is to process the .zip file and when the recovery errors, open up the recovery log. If you can paste back here the few lines before the error occurred including the error we can start working on the issue.
We might need a copy of the .zip file to match up with the recovery log to understand how much progress was made in order before the error occured.
The only other common place for ROM flashing errors when developing a ROM will be in the updater-script file. Might need a copy of this posted also.
In summary, the two most common places for issues occur either in the file name/structure of the .zip or in the updater-script.
Hope that helps! Good luck!
joeykrim said:
Lol .. the "check boxes" you're referring to only indicate the access permissions for the specific .zip file. When in recovery mode, everything runs as root. If there is any read permission on the file, recovery should be able to acces it without any issues. Further, you mentioned above the recovery was in the process of flashing the file indicating the recovery has no issues accessing the file.
If the recovery has no issues accessing the file, there shouldn't be any issues with the specific permissions of the ROM .zip file on that specific file system in recovery mode.
As a ROM developer, the next step to troubleshooting and understanding errors when flashing a ROM is by becoming familiar with the custom recovery error log.
The custom recovery shows very limited information on the display, but in the log shows much more detail. The logs are generally kept at /tmp/recovery.log and /cache/recovery.log.
The best process is to process the .zip file and when the recovery errors, open up the recovery log. If you can paste back here the few lines before the error occurred including the error we can start working on the issue.
We might need a copy of the .zip file to match up with the recovery log to understand how much progress was made in order before the error occured.
The only common place for ROM flashing errors when developing a ROM will be in the updater-script file. Might need a copy of this posted also.
In summary, the two most common places for issues occur either in the file name/structure of the .zip or in the updater-script.
Hope that helps! Good luck!
Click to expand...
Click to collapse
Amazing answer, thank you so much for taking your time with me, appreciate it, I'll try the recovery log, see what I get, as you can tell I'm pretty new to this, everyone has to start somewhere!
Thanks again buddy
Sent from my HTC EVO 3D X515a using xda premium

Read/write file access

Hello
Some of application such as Sygic, Aptoid, Waze and others cannot access to sdcard unless I reboot.
When verffying with Root Explorere I have noticed that the default access to Sdcard is R/O. As soon as I change that to Read/Write every thing goes right.
The problem is R/O keeps come back and apps cannot run until I do modification again.
Anyone can help please as to fix permenantly this issue.
Thanks
samaliset said:
Hello
Some of application such as Sygic, Aptoid, Waze and others cannot access to sdcard unless I reboot.
When verffying with Root Explorere I have noticed that the default access to Sdcard is R/O. As soon as I change that to Read/Write every thing goes right.
The problem is R/O keeps come back and apps cannot run until I do modification again.
Anyone can help please as to fix permenantly this issue.
Thanks
Click to expand...
Click to collapse
There are two ways
1 the easy way is an app from playstore to do that at every boot
Are many can do this
2 the hard way is a script
You can paste it to init.d folder or script manager execute at every boot
Do you have gtab?
And sd card should not have sysrw option
Something wrong with install of rom
samaliset said:
When verffying with Root Explorere I have noticed that the default access to Sdcard is R/O. As soon as I change that to Read/Write every thing goes right.
The problem is R/O keeps come back and apps cannot run until I do modification again.
Click to expand...
Click to collapse
Peculiar problem. Will have to do some tests and look at some logs to find out the cause.
1. Can you create or delete files/dirs. on the SDcard, and do these changes persist after a reboot? Or do they vanish--like the changes never happened?
2. What's the output of this command right after a reboot?
Code:
$ [B]mount[/B]
rajeevvp said:
Peculiar problem. Will have to do some tests and look at some logs to find out the cause.
1. Can you create or delete files/dirs. on the SDcard, and do these changes persist after a reboot? Or do they vanish--like the changes never happened?
2. What's the output of this command right after a reboot?
Code:
$ [B]mount[/B]
Click to expand...
Click to collapse
Thanks for your reply,
1- I realy need some more details about this point. Some more explaination will be highly appreciated.
2- After typing this line and enter, the output is : /system/bin/sh:
Code:
$: not found. Moreover,after reboot, wh
ile launching Waze, I get the message : "Wazecan't access your sd card. Make sure it isn't mounted".
geowolf1000 said:
There are two ways
1 the easy way is an app from playstore to do that at every boot
Are many can do this
2 the hard way is a script
You can paste it to init.d folder or script manager execute at every boot
Do you have gtab?
And sd card should not have sysrw option
Something wrong with install of rom
Click to expand...
Click to collapse
Thanks fro your reply.
1- May know which app I should use.
2- Sure it looks hard for me to do that.
Yes I do have a Gtab 7.7 with JB.
The rest of the message needs more explaination if possible.
samaliset said:
Thanks fro your reply.
1- May know which app I should use.
2- Sure it looks hard for me to do that.
Yes I do have a Gtab 7.7 with JB.
The rest of the message needs more explaination if possible.
Click to expand...
Click to collapse
Sd card always alow read/write permission is not part of root
Type mount to terminal and post the result so rajeevvp give you his knowledge
samaliset said:
Yes I do have a Gtab 7.7 with JB.
Click to expand...
Click to collapse
There is no such device as a gTablet 7.7. Is this the tablet you have?
1. Use the standard file manager app and create or delete some files and directories on the SDcard. Reboot the gTablet. Verify that the changes you made remain after the reboot.
2. The $ character is just a prompt, used to indicate that the commands that follow can be executed by any user. Don't type that into the Terminal emulator app. Type in only the stuff shown in bold.
3. Setup adb (see the sticky threads) to make entering commands and collecting logs easier.
4. From now on post the exact error or diagnostic messages that you see. Or, make screenshots and post them.
I am very sorry to post my message here by mistzke.
Anyway I would like to thank all for your help and would like to inform you that the probme had been solved in installing a new tom.
Thanks znd sorry again

OpenRecoveryScript question

I hope someone can answer this question for me. I've written some logic for OpenRecoveryScript that I am going to use in conjunction with Tasker to get my phone to automatically take an image in TWRP once per month.
Below is the code I plan on using in Tasker to put some commands in the OpenRecoveryScript file. (The %MyDate and %TIME items are Tasker variables.)
My question is: do I need to somehow delete the OpenRecoveryScript file when it is done running? Or is it automatically deleted when exiting TWRP? I ask because I don't want the script to run every time I go into TWRP; only when it is set to run by Tasker.
Code:
set crfolder="/cache/recovery"
set orsfile="${crfolder}/openrecoveryscript"
chmod 0777 ${crfolder}
rm -f ${orsfile}
touch ${orsfile}
echo "backup SDBO auto-%MyDate--%TIME" >> ${orsfile}
I believe twrp clears out the /cache/recovery directory after exiting twrp. You can always make a script like echo "test" >> /sdcard/test.txt then boot into twrp twice, but one time running the script. then see if there are two lines in that text file or just one. that should answer your question definitively.
Ophidian_DarkCore said:
I believe twrp clears out the /cache/recovery directory after exiting twrp. You can always make a script like echo "test" >> /sdcard/test.txt then boot into twrp twice, but one time running the script. then see if there are two lines in that text file or just one. that should answer your question definitively.
Click to expand...
Click to collapse
Good idea. Thanks for the suggestion.

Categories

Resources