FORUMS
Remove All Ads from XDA

[TOOLS][ZIPS][SCRIPTS] osm0sis' Odds and Ends [Multiple Devices/Platforms]

13,781 posts
Thanks Meter: 30,544
 
By osm0sis, Recognized Developer / Recognized Contributor on 18th April 2013, 01:37 AM
Post Reply Email Thread
5th June 2019, 06:18 AM |#2391  
Recognized Contributor
Thanks Meter: 3,378
 
More
@osm0sis
Weird. I'm getting errors and a bad install of busybox. I was experimenting with some things so wiped out the existing install and went to reinstall.
The only thing that ended up on the bin directory was
[
[[
busybox
See attached image. Also including install logs. One is just a regular install log. The other is a full trace
It's been a while since I installed/upgraded this. Only thing I can think of is the June patch for Pie (Pixel 3 XL).

Need anything else just ask. Fortunately I can work around this.

Edit: beginning to suspect that coreutils is stepping on something. I haven't gone through the trace in detail. I need to know the exact command(s) it's going bad on. Probably look at it tomorrow.
It looks like if I remove both coreutils and busybox, then reboot, busybox installs clean. (Normally I'd just delete the directories then reinstall without rebooting - which means the system still has access to the deleted files)
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20190605-000509.jpg
Views:	1210
Size:	37.0 KB
ID:	4771660  
Attached Files
File Type: zip Busybox-install-logs.zip - [Click for QR Code] (21.1 KB, 18 views)
The Following User Says Thank You to jcmm11 For This Useful Post: [ View ] Gift jcmm11 Ad-Free
5th June 2019, 10:06 AM |#2392  
amg314's Avatar
Senior Member
Flag Kharkov
Thanks Meter: 178
 
More
Quote:
Originally Posted by jcmm11

@osm0sis
Weird. I'm getting errors and a bad install of busybox. I was experimenting with some things so wiped out the existing install and went to reinstall.

Why do not install BB in a usual way in Magisk Manager?
My BB is installed in /system/xbin instead of /system/bin at your device (see Picture).
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2019-06-05-11-05-33.jpg
Views:	508
Size:	221.4 KB
ID:	4771729  
5th June 2019, 02:54 PM |#2393  
Recognized Contributor
Thanks Meter: 3,378
 
More
Quote:
Originally Posted by amg314

Why do not install BB in a usual way in Magisk Manager?
My BB is installed in /system/xbin instead of /system/bin at your device (see Picture).

My device doesn't have an xbin folder which is why it gets installed to bin.
5th June 2019, 04:54 PM |#2394  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,544
 
Donate to Me
More
I'm thinking you probably shouldn't have both coreutils and busybox installed simultaneously..

And maybe coreutils shouldn't be replacing things, maybe if it's in bin it should do what mine does in bin and only add symlinks for new utilities. Pretty clearly sounds like it's breaking the shell environment.
5th June 2019, 05:47 PM |#2395  
Recognized Contributor
Thanks Meter: 3,378
 
More
Quote:
Originally Posted by osm0sis

I'm thinking you probably shouldn't have both coreutils and busybox installed simultaneously..

And maybe coreutils shouldn't be replacing things, maybe if it's in bin it should do what mine does in bin and only add symlinks for new utilities. Pretty clearly sounds like it's breaking the shell environment.

My version of coreutils doesn't replace most existing symlinks. I have boot scripts that resolve any discrepancies between coreutils, busybox, and native bin. I do replace things like find, awk, sed - things that are precompiled binaries rather than symlinks. Hmm - one exception to that, I'll have to try something.
5th June 2019, 06:57 PM |#2396  
Recognized Contributor
Thanks Meter: 3,378
 
More
Quote:
Originally Posted by osm0sis

I'm thinking you probably shouldn't have both coreutils and busybox installed simultaneously..

And maybe coreutils shouldn't be replacing things, maybe if it's in bin it should do what mine does in bin and only add symlinks for new utilities. Pretty clearly sounds like it's breaking the shell environment.

Ok, apparently you're doing something that makes GNU grep unhappy, or something. If I revert to the default grep module everything's fine (both versions are precompiled binaries). Attaching GNU grep in case you want to take a look.
Attached Files
File Type: zip grep.zip - [Click for QR Code] (357.5 KB, 12 views)
5th June 2019, 07:09 PM |#2397  
Senior Member
Thanks Meter: 120
 
More
Quote:
Originally Posted by jcmm11

I do replace things like find, awk, sed - things that are precompiled binaries rather than symlinks.

if you just replace it, then you probably do not replace the symlink, instead you replace the busybox binary where the symlink points. so you can not "replace", you must "unlink" first
5th June 2019, 07:30 PM |#2398  
Recognized Contributor
Thanks Meter: 3,378
 
More
Quote:
Originally Posted by aIecxs

if you just replace it, then you probably do not replace the symlink, instead you replace the busybox binary where the symlink points. so you can not "replace", you must "unlink" first

1) yes you can replace. Or overlay to be exact. If you have a symlink defined in a Magisk Module that overlays an existing symlink the Magisk Module link will prevail.

2) the other point is that what I'm specifically talking about here with things like find, awk, grep, etc aren't symlinks. They're precompiled binaries. Standalone programs that don't depend on busybox or toybox.

3) if you use ln -f, or cp -sf, you can actually replace a symlink with another symlink. The default with cp is to not follow symlinks
5th June 2019, 08:03 PM |#2399  
Senior Member
Thanks Meter: 120
 
More
Quote:
Originally Posted by jcmm11

default with cp is to not follow symlinks

thx (i didn't notice that you are talking about bind mounts) but "default" probably depends on what you use. gnu's behaviour is different from other binaries (or better say other binaries does not fulfil standards). btw i have stock android 7.0 and there cp, sed, find are just symlinks to toybox, while awk is a binary. nevermind

edit: turns out that GNU cp is NOT different from busybox cp, default is follow symlinks
found this in busybox source code
Code:
/* coreutils 6.9 compat:
 * by default, "cp" derefs symlinks (creates regular dest files),
 * but "cp -R" does not. We switch off deref if -r or -R (see above).
 * However, "cp -RL" must still deref symlinks: */
at least, you can test
Code:
[email protected] ~/test $ echo file1 > file1
[email protected] ~/test $ echo file3 > file3
[email protected] ~/test $ ln -s file1 file2
[email protected] ~/test $ ls -l
total 8
-rw-r--r-- 1 mint mint 6 Jun  5 20:56 file1
lrwxrwxrwx 1 mint mint 5 Jun  5 20:56 file2 -> file1
-rw-r--r-- 1 mint mint 6 Jun  5 20:56 file3
[email protected] ~/test $ cat file1
file1
[email protected] ~/test $ cp file3 file2
[email protected] ~/test $ cat file1
file3
[email protected] ~/test $
regarding the grep regex error, this bug was solved with android 7.0
https://android.googlesource.com/platform/bionic/+/master/libc/upstream-netbsd/android/include/netbsd-compat.h

Code:
+  // Passing a null pointer and a size of 0 is a legitimate way to ask
+  // how large a buffer we would need for the error message.
it's probably your old grep binary which you should recompile
5th June 2019, 09:08 PM |#2400  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,544
 
Donate to Me
More
Quote:
Originally Posted by jcmm11

Ok, apparently you're doing something that makes GNU grep unhappy, or something. If I revert to the default grep module everything's fine (both versions are precompiled binaries). Attaching GNU grep in case you want to take a look.

It works in recovery with toybox grep and busybox grep. Magisk installs should always have Magisk's busybox at the front of path, so I'm honestly not sure how you having GNU grep installed in some way would have any effect.
5th June 2019, 10:58 PM |#2401  
Recognized Contributor
Thanks Meter: 3,378
 
More
Quote:
Originally Posted by osm0sis

It works in recovery with toybox grep and busybox grep. Magisk installs should always have Magisk's busybox at the front of path, so I'm honestly not sure how you having GNU grep installed in some way would have any effect.

My bad. It's not grep. (In any case you're forcing BusyBox grep). For whatever reason it's coreutils test command, which also doesn't really make sense because test is a shell builtin, so it shouldn't even be looking at the version in bin. But that's definitely it, and this time I'm sure.

I'd expect TWRP to always work since it doesn't have access to any Magisk Module overrides.

Thing I'll modify my scripts to get rid of any shell built-ins and reserved words.
The Following User Says Thank You to jcmm11 For This Useful Post: [ View ] Gift jcmm11 Ad-Free
Post Reply Subscribe to Thread

Tags
automation, batch, flashable zip, script, tool

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes