FORUMS
Remove All Ads from XDA

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

13,700 posts
Thanks Meter: 30,282
 
By osm0sis, Recognized Developer / Recognized Contributor on 18th April 2013, 12:37 AM
Post Reply Email Thread
26th September 2019, 12:23 PM |#2491  
Member
Thanks Meter: 6
 
More
Ah! Stupid me did do this before but had no look into it, because I thought there isn't likely too much new info there, while no errors are shown in the magisk "flashing" screen. But obviously that's wrong.
Here you are:

- Copying zip to temp directory
- Installing Busybox_for_Android_NDK-1.30.1(13020).zip
Archive: /data/user/0/com.Povw.HKC.FbYQ8Qe/cache/flash/install.zip
inflating: install.sh
inflating: module.prop
mount: can't read '/etc/fstab': No such file or directory

Busybox Installer Script
by osm0sis @ xda-developers
mount: can't read '/etc/fstab': No such file or directory

mount: can't read '/etc/fstab': No such file or directory
Mounting...

Extracting files...
Archive: /data/user/0/com.Povw.HKC.FbYQ8Qe/cache/flash/install.zip
creating: META-INF/
creating: META-INF/com/
creating: META-INF/com/google/
creating: META-INF/com/google/android/
inflating: META-INF/com/google/android/update-binary
inflating: META-INF/com/google/android/updater-script
inflating: README.md
inflating: busybox-arm
inflating: busybox-arm64
inflating: busybox-mips
inflating: busybox-mips64
inflating: busybox-x86
inflating: busybox-x86_64
inflating: install.sh
inflating: module.prop

Installing...
Using architecture: arm64
umount: can't unmount /dev/tmp/su: No such file or directory
Using path: /dev/tmp/su/xbin

Cleaning...

Creating symlinks...

Unmounting...
umount: can't unmount /system: Device or resource busy
umount: can't unmount /data: Device or resource busy
umount: can't unmount /cache: Device or resource busy

Done!
26th September 2019, 03:11 PM |#2492  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,282
 
Donate to Me
More
Quote:
Originally Posted by ako673de

I have an op3t (still) on oreo, rooted with magisk, Versions are up to date.
Some months ago I noticed that the magisk busybox module is no longer getting updated, when I update. It kept stuck at v1.29.3. It didn't bother me too much since then.
Yesterday I wanted to address the issue and uninstalled the module, in order to install the current one right after (hopefully tricking it to "update" that way). Instead I never manged to install it ever after. There is no /su folder on my phone, /system/xbin contains nothing bb related, and there's also no trace to bb anywhere else, although your installer always tells me that everything "went fine". I didn't even manage to install any other busybox from the PlayStore.

Still one bb seems to exist, in /sbin/. magisk/busybox, but that isn't yours, right? And it's not useable in system, right?

I just checked that /system/xbin is writable by root, but now I'm out of ideas...

Quote:
Originally Posted by jcmm11

And we still need the install log

Quote:
Originally Posted by ako673de

Ah! Stupid me did do this before but had no look into it, because I thought there isn't likely too much new info there, while no errors are shown in the magisk "flashing" screen. But obviously that's wrong.
Here you are:

Code:
- Copying zip to temp directory
- Installing Busybox_for_Android_NDK-1.30.1(13020).zip
Archive:  /data/user/0/com.Povw.HKC.FbYQ8Qe/cache/flash/install.zip
  inflating: install.sh
  inflating: module.prop
mount: can't read '/etc/fstab': No such file or directory
 
Busybox Installer Script
by osm0sis @ xda-developers
mount: can't read '/etc/fstab': No such file or directory
 
mount: can't read '/etc/fstab': No such file or directory
Mounting...
 
Extracting files...
Archive:  /data/user/0/com.Povw.HKC.FbYQ8Qe/cache/flash/install.zip
   creating: META-INF/
   creating: META-INF/com/
   creating: META-INF/com/google/
   creating: META-INF/com/google/android/
  inflating: META-INF/com/google/android/update-binary
  inflating: META-INF/com/google/android/updater-script
  inflating: README.md
  inflating: busybox-arm
  inflating: busybox-arm64
  inflating: busybox-mips
  inflating: busybox-mips64
  inflating: busybox-x86
  inflating: busybox-x86_64
  inflating: install.sh
  inflating: module.prop
 
Installing...
Using architecture: arm64
umount: can't unmount /dev/tmp/su: No such file or directory
Using path: /dev/tmp/su/xbin
 
Cleaning...
 
Creating symlinks...
 
Unmounting...
umount: can't unmount /system: Device or resource busy
umount: can't unmount /data: Device or resource busy
umount: can't unmount /cache: Device or resource busy
 
Done!

"/dev/tmp/su/xbin"

You clearly have a su.img on your device. Look in /data or /cache and clean up your messy device.
26th September 2019, 03:27 PM |#2493  
Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by osm0sis

"/dev/tmp/su/xbin"

You clearly have a su.img on your device. Look in /data or /cache and clean up your messy device.

Not that I'm aware of. It's true that I came from SuperSU before moving to Magisk, but at that time I ran an su uninstaller, and - most importantly - afterwards I didn't have a problem with installing the magisk bb module. This came up only some time later.

Anyway, now it's going a bit too far beyond my knowledge. What do I have to look for in /data and /cache and how can I clean it up if an su cleaner didn't quite succeed in this before?

Thank you for your help!
26th September 2019, 04:47 PM |#2494  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,282
 
Donate to Me
More
Quote:
Originally Posted by ako673de

Not that I'm aware of. It's true that I came from SuperSU before moving to Magisk, but at that time I ran an su uninstaller, and - most importantly - afterwards I didn't have a problem with installing the magisk bb module. This came up only some time later.

Anyway, now it's going a bit too far beyond my knowledge. What do I have to look for in /data and /cache and how can I clean it up if an su cleaner didn't quite succeed in this before?

Thank you for your help!

No, you do. I'm telling you you do, because there's no other way to have that output in the log if you don't.

Use a file explorer app. Go to /data and look for su.img. Delete it if it's there. Go to /cache (if your device has one) and look for su.img. Delete it if it's there. Done.

I'd suggest my unSU zip but it'd remove Magisk on you too... Though if you end up having trouble with the above then maybe it would be smarter for you to start clean and remove both, then install Magisk fresh.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
26th September 2019, 05:23 PM |#2495  
Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by osm0sis

No, you do. I'm telling you do, because there's no other way to have that output in the log if you don't.

Use a file explorer app. Go to /data and look for su.img. Delete it if it's there. Go to /cache (if your device has one) and look for su.img. Delete it if it's there. Done.

I'd suggest my unSU zip but it'd remove Magisk on you too... Though if you end up having trouble with the above then maybe it would be smarter for you to start clean and remove both, then install Magisk fresh.

In fact, it was just that easy! Thanks so much for your patience!
9th October 2019, 09:00 AM |#2496  
Senior Member
Flag Sydney
Thanks Meter: 1,867
 
More
Hello, although not directly related to an @osm0sis script, I think this thread probably has a better chance of resolving an answer than a general "ask anything" thread.

My problem is that when I do (all under su)
Code:
cat /sys/devices/system/cpu/cpufreq/all_time_in_state;
I commonly get an "incomplete file", such as
Code:
freq            cpu0            cpu1            cpu2            cpu3
300000          3242
422400          973
652800          1161
729600          970
883200          1766
960000          779
1036800         797
1190400         1393
1267200         275
1497600         942
1574400         147
1728000         598
1958400         586
2265600         8452
However, If I open the file in any text editor, I get a complete file like
Code:
freq            cpu0            cpu1            cpu2            cpu3
300000          3158            1129            1193            2330
422400          930             626             686             858
652800          1140            474             951             1157
729600          962             298             561             694
883200          1760            331             658             854
960000          779             97              188             260
1036800         777             254             341             482
1190400         1378            259             425             688
1267200         275             39              61              105
1497600         930             247             310             591
1574400         147             29              60              96
1728000         594             205             344             469
1958400         584             225             249             589
2265600         8395            5854            6116            8607
I have tried an
Code:
am write;
before the cat to no avail.

Any other ideas? ie on getting the file when it is complete. ( am guessing the OS is writing to the file during the cat, but why would the text editor manage to always get a full file
10th October 2019, 12:03 AM |#2497  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,282
 
Donate to Me
More
Quote:
Originally Posted by DiamondJohn

Hello, although not directly related to an @osm0sis script, I think this thread probably has a better chance of resolving an answer than a general "ask anything" thread.

My problem is that when I do (all under su)

Code:
cat /sys/devices/system/cpu/cpufreq/all_time_in_state;
I commonly get an "incomplete file", such as
Code:
freq            cpu0            cpu1            cpu2            cpu3
300000          3242
422400          973
652800          1161
729600          970
883200          1766
960000          779
1036800         797
1190400         1393
1267200         275
1497600         942
1574400         147
1728000         598
1958400         586
2265600         8452
However, If I open the file in any text editor, I get a complete file like
Code:
freq            cpu0            cpu1            cpu2            cpu3
300000          3158            1129            1193            2330
422400          930             626             686             858
652800          1140            474             951             1157
729600          962             298             561             694
883200          1760            331             658             854
960000          779             97              188             260
1036800         777             254             341             482
1190400         1378            259             425             688
1267200         275             39              61              105
1497600         930             247             310             591
1574400         147             29              60              96
1728000         594             205             344             469
1958400         584             225             249             589
2265600         8395            5854            6116            8607
I have tried an
Code:
am write;
before the cat to no avail.

Any other ideas? ie on getting the file when it is complete. ( am guessing the OS is writing to the file during the cat, but why would the text editor manage to always get a full file

This is the only time I have ever worked with time_in_state.. maybe try piping and manipulating the data along these lines?: https://github.com/osm0sis/GN-Synaps.../live#L93-L101

I would also try grep to see if it does any better.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
10th October 2019, 01:46 AM |#2498  
Senior Member
Flag Sydney
Thanks Meter: 1,867
 
More
Quote:
Originally Posted by osm0sis

This is the only time I ever worked with time_in_state.. maybe try piping and manipulating the data along these lines?: https://github.com/osm0sis/GN-Synaps.../live#L93-L101

I would also try grep to see if it does any better.

I did try so many different avenues (including grep, awk, sed etc), and they all failed. But I hadn't tried the above. But unfortunately it failed in the same way

Not that it makes a difference, but the above link was accessing each CPU individually, so would mean looping to catch/gather the details for each CPU (4 in my case). I found these files appeared to be filled in, however, for some strange reason, CPU1 was only available (ie the folder and therefore the file) now and then. and KA-Mod intermittently didn't report on that CPU

I think I might try asking on the MiX thread (the text editors I tested that worked) to see if I can get some direction. Although its a root access file only, I think I saw some direct Java calls to access root-only files outside of a shell script.
10th October 2019, 03:29 AM |#2499  
Senior Member
Flag Sydney
Thanks Meter: 1,867
 
More
F...FYI: I was wrong, on further testing I found that the method below also does not reliably return a complete file.
Additionally (which originally hid the failure from me) the code below was missing adding line/carriage returns top the end of each line read.
FYI: The following quick mock test in Java works every time, but I need to do it in a shell
Code:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public static String getCPUUsage() throws IOException {
	String dataOut = "";
	String s1 = "";
	String fileName = "/sys/devices/system/cpu/cpufreq/all_time_in_state";
	BufferedReader bufferedReader = new BufferedReader(new FileReader(fileName));
	
	s1 = bufferedReader.readLine();
	while ( s1 != null)
		{
		  dataOut = dataOut + s1;
		  s1 = bufferedReader.readLine();
		}
	
	return dataOut;
}
12th October 2019, 02:54 AM |#2500  
Member
Flag Austin, TX
Thanks Meter: 29
 
More
Quote:
Originally Posted by osm0sis

I was originally waiting for Busybox 1.31.x to go stable, but that seems to be taking forever (1.31.0 unstable has been out since early June), so let's get this update out before I have to focus on my wedding and honeymoon for the next few weeks!

Thanks for all your work on this module!

I'd been keeping an eye out for long as well, wondering what the deal is. It certainly looks like 1.31.0 is the stable release in git, but they don't reflect that on their website.
https://git.busybox.net/busybox/log/?h=1_31_stable

There's no further patch work, because a 1.31.1 branch doesn't even exist when I manually type it in, and they jumped right into 1.32.0 with large commits:
https://git.busybox.net/busybox/log/
12th October 2019, 03:27 AM |#2501  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,282
 
Donate to Me
More
Quote:
Originally Posted by Jon8RFC

Thanks for all your work on this module!

I'd been keeping an eye out for long as well, wondering what the deal is. It certainly looks like 1.31.0 is the stable release in git, but they don't reflect that on their website.
https://git.busybox.net/busybox/log/?h=1_31_stable

There's no further patch work, because a 1.31.1 branch doesn't even exist when I manually type it in, and they jumped right into 1.32.0 with large commits:
https://git.busybox.net/busybox/log/

They always do that, only pushing commits and extra tags to the stable branch for the official stable point releases once they're discovered/added in the master branch after the unstable has been out for awhile.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
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