Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with getting filesystem config from TWRP Recovery #33

Open
sijav opened this issue Mar 27, 2017 · 4 comments
Open

Issue with getting filesystem config from TWRP Recovery #33

sijav opened this issue Mar 27, 2017 · 4 comments

Comments

@sijav
Copy link

sijav commented Mar 27, 2017

Hi,
I was about to get an ota from phone and I was in TWRP recovery and find out there's some kinda problems, one of them was in get_filesystem_config file where it just run ls -aRZ /system which will result in strange characters in file lists such as �[0 because of the color thingy ... so I removed the color by changing the ls code to ls -aRZ --color=never and it worked great!

@sijav
Copy link
Author

sijav commented Mar 27, 2017

Nah it didn't worked ... looks like TWRP recovery does not work at all 👎
And as my phone doesn't have anything but TWRP recovery, well, I did it by normal mode 👎

@sijav sijav changed the title Issue with getting filesystem config Issue with getting filesystem config from TWRP Recovery Mar 27, 2017
@sijav
Copy link
Author

sijav commented Mar 27, 2017

I'm stuck at getting an OTA, I've tried various of busybox ls but they just don't fit what your program wants I even tried awk and ended up using this:
$(sudo ls -AlRZ --color=never /system |awk '{if($1!="total"){if(substr($1,length,1)!=":"){print substr($1,1,length($1)-1)" "$3"\t"$4"\t\t"$5" "$10" "$11" "$12}else{print$1}}}')
But still it can't do the stat I don't know why ... please somebody help me out here

@sijav
Copy link
Author

sijav commented Mar 28, 2017

Well I've ended up using my already system's toolbox instead of busybox so I've added another variable to the first of file as BUSYBOXLS and I will check whether the ls support -aRZ by checking the output (see if it's not start with busybox version) if not I'll use where system's ls in bin points out (in my case let's say it was toolbox) and I put the link into busyboxls and I have change the code where this ls thing was needed by adb shell $BUSYBOXLS ls -aRZ /system and adb shell su -c "$BUSYBOXLS ls -aRZ /system" (NOt TESTED) and well it works out :-)

@sijav
Copy link
Author

sijav commented Mar 28, 2017

So there's another issue which I don't know how to solve it by changing the code :| So I just pause the doing thing for a manual check. (I'm not a linux expert :| sry)
The issue is that any file that has & or ( or ) in them or any syntax thing it will break into this error => (in my case)
system/etc/legal/leaflet/in/Middle-East-&-Africa.html /system/bin/sh: -Africa.html: not found /system/bin/sh: -Africa.html: not found stat: can't stat '/system/etc/legal/leaflet/in/Middle-East-': No such file or directory /system/bin/sh: -Africa.html: not found selabel=u:object_r:system_file:s0 capabilities=0x0
or this one =>
system/etc/legal/leaflet/in/India-(IN).html /system/bin/sh: syntax error: '(' unexpected /system/bin/sh: syntax error: '(' unexpected /system/bin/sh: syntax error: '(' unexpected selabel=u:object_r:system_file:s0 capabilities=0x0
So I just look for em manually using a regex and replace them with their proper chmod
EDIT: It just came to my mind that I can actually check the uid gid and perm that if they are start by /system/bin/sh then I'll just change them to 0 0 644 ... assuming they must have been a normal file and I can't do anything about it :|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant