yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] mbc07:
Without the module, there's no xbin in my ROM. If I install the module in that state (just to be clear, I'm installing directly from Magisk Manager -- I don't know if there's a way of grabbing logs in that scenario), the script will finish without errors but then, upon rebooting, I'll be stuck in a bootloop. If I manually create an empty xbin folder on /system before installing the Magisk Module (again, directly from Magisk Manager), the script will also finish without errors but this time, no bootloop.

I'm also sure it's being installed as a Magisk Module instead of being installed directly to /system because after removing the module and rebooting, I'll have only the empty xbin folder I created earlier in the system partition.

TL;DR apparently Magisk doesn't like binding things to folders that don't exist, at least on my phone...
[Android Software/Hacking General [Developers Only]] osm0sis:
Magisk doesn't just bind though, it creates a mirror tree with any new things in it that are needed, that should include xbin if the busybox installation worked correctly. There is a super obvious "Save Log" button in Magisk Manager after a module installation, so please remove your empty /system/xbin, uninstall the module, reboot, install the module and upload the installation log.

It could just be your device being crazy as you say, but we'll never know if you don't help.
[Android Software/Hacking General [Developers Only]] Tecalote:
I had the same issue on Huawei P8 (Android 6) b399 - in the Firmware doesn't xbin folder in system exist.

Rooted with Magisk..

Installing Busybox made Bootloop..

After I created the xbin folder with the right permission, the issue was solved.

That's a new "trend" of some Manufacturer making Firmwares without xbin..
[Android Software/Hacking General [Developers Only]] osm0sis:
Okay, maybe you'll be more willing to provide a log? I need to know where my module is installed and what subdirectory it uses. The install log from when the system doesn't have xbin should show all that, and show me if it's something on my side or a Magisk bug I need to report.
[Android Software/Hacking General [Developers Only]] Tecalote:
You can be sure it's nothing on your side - cause I tried also the Busybox by [MENTION=5423715]YashdSaraf[/MENTION] and it was the same.

I would think it's a Magisk bug and it is good if you report.

In about two weeks I flash the original Firmware new, root it with Magisk and then flash your Busybox and take Log - and post it here as attachment.
[Android Software/Hacking General [Developers Only]] Setialpha:
If the ROM does not have /system/xbin, but you have it in your magisk module, you'll cause a boot loop. It's a Magisk issue since ever™, that creating a file or folder directly in /system won't let the device boot, which is the case here, if /system/xbin is lacking in-ROM.

Thanks for the hint, though, I've updated my stuff to use /system/bin instead. I didn't know any ROM without /system/xbin even exists.

Alternatively one could check if it exists and only use /system/bin if /system/xbin doesn't exist, instead of hardcoding.
[Android Software/Hacking General [Developers Only]] osm0sis:
/system/bin for busybox is kinda dangerous since you don't want to override toolbox/toybox versions of utilities the ROM may rely on.. I'll look into it though since I used to do similar filtering for SuperSU su.img before /su/xbin got added.
[Android Software/Hacking General [Developers Only]] Setialpha:
In fact. The only alternative would be to create /system/xbin on the real partition (which shouldn't cause any harm).
[Android Software/Hacking General [Developers Only]] osm0sis:
Oh definitely, but the goal is usually to remain systemless.

If someone really doesn't care then they can always rename the zip with -system in the filename and flash via recovery to force a system installation, which should also make the /system/xbin directory in the process.
[Android Software/Hacking General [Developers Only]] Setialpha:
No, I mean an empty /system/xbin, that's enough to fix the boot issue.
[Android Software/Hacking General [Developers Only]] osm0sis:
Right but if you're already modifying /system then you might as well install busybox there.
[Android Software/Hacking General [Developers Only]] Setialpha:
Well, that's of course one way of putting it, another would be that an empty directory won't harm. But it's a matter of choice, for example Magisk also removes any 'su' from /system.
[Android Software/Hacking General [Developers Only]] Tecalote:
Another fact - normally system includes xbin folder in almost Firmwares (until there come out some without) and if the phone is rooted with Magisk the xbin folder in system must exist, cause Busybox cannot be installed properly as Magisk module without real xbin folder in system. (regardless of the Bootloop that arises due to the missing xbin folder)
[Android Software/Hacking General [Developers Only]] GammelBS:
Recovery install of busybox on taimen without xbin but with magisk. Hope this helps.
[Android Software/Hacking General [Developers Only]] GammelBS:
Same on mako with unlagacy-android rom. This bootloops after install.
[Android Software/Hacking General [Developers Only]] jd1639:
I've followed your work osm0sis and am not sure where else to go. I'm trying to re-partition and old skyrocket using parted. It's not in sbin so I've tried to push it there and appeared to push something somewhere but I can't find it in sbin. This is what I've done:

PS C:\Users\jeff\Downloads> adb push c:/Users/jeff/Downloads/parted/parted \sbin

2708 KB/s (346680 bytes in 0.125s)

PS C:\Users\jeff\Downloads> adb shell

~ # [6nls

I'm new to all this so it's probably a silly question.
[Android Software/Hacking General [Developers Only]] osm0sis:
Well slashes go the opposite ways in both Windows and Android (Linux) to how you have them, so from your Downloads directory, `adb parted\parted /sbin/` should be sufficient considering your adb appears to already be root.
[Android Software/Hacking General [Developers Only]] jd1639:
Thanks. I thought it was something silly.
[Android Software/Hacking General [Developers Only]] jd1639:
Hey osmOsis, I might need a little more help. I'm trying to create a partition between the existing mmcblk24 and mmcblk25. I'm getting an error that it's outside mmcblk0. Do you see where something is going wrong?

# [6nparted /dev/block/mmcblk0 unit b print

Model: MMC KYL00M (sd/mmc)

Disk /dev/block/mmcblk0: 15758000128B

Sector size (logical/physical): 512B/512B

Partition Table: msdos

NEVER MIND I GOT IT, NEEDED THE B

Number Start End Size Type File system Flags

1 512B 104858111B 104857600B primary

2 104858112B 105370111B 512000B primary boot

3 105370112B 106906111B 1536000B primary

4 106906112B 15758000127B 15651094016B extended

5 109051904B 109563903B 512000B logical

6 113246208B 115343359B 2097152B logical

7 117440512B 120000511B 2560000B logical

8 121634816B 132120575B 10485760B logical

9 134217728B 134729727B 512000B logical

10 138412032B 138924031B 512000B logical

11 142606336B 143118335B 512000B logical

12 146800640B 157286399B 10485760B logical

13 159383552B 262143999B 102760448B logical fat16 lba

14 264241152B 267386879B 3145728B logical

15 268435456B 271581183B 3145728B logical

16 272629760B 275775487B 3145728B logical

17 276824064B 379584511B 102760448B logical fat16

18 381681664B 384827391B 3145728B logical

19 385875968B 389021695B 3145728B logical

20 390070272B 393215999B 3145728B logical

21 394264576B 404750335B 10485760B logical ext4

22 406847488B 417333247B 10485760B logical

23 419430400B 429916159B 10485760B logical

24 432013312B 1059061759B 627048448B logical ext4

25 3212836864B 3529506815B 316669952B logical ext4

26 3531603968B 3666870271B 135266304B logical ext4

27 3670016000B 15758000127B 12087984128B logical fat32

~ # [6nparted dev/block/mmcblk0 mkpart logical 1061158912 3210739711

Error: The location 1061158912 is outside of the device /dev/block/mmcblk0.

~ # [6n

Thanks again
[Android Software/Hacking General [Developers Only]] osm0sis:
Sorry, I've never tried to do anything like that. I imagine if you did get parted to work it'd be complicated by needing to add fstab entries and such as well... Search the forums, I'm sure there are some users/devices around that have used parted to change things before.
[Android Software/Hacking General [Developers Only]] jd1639:
never mind. I got it. Needed the b at the end of the start and stop
[Android Software/Hacking General [Developers Only]] jd1639:
Somehow I managed to delete and add partitions without borking the device. That's enough learning for now.:D
[Android Software/Hacking General [Developers Only]] jcmm11:
Where did you get parted for Android?
[Android Software/Hacking General [Developers Only]] jd1639:
I found it in this https://iwf1.com/how-to-re-partitio...-all-options-included-change-size-fs-type-etc

It's 32 bit ARM so if your device is something different I'm not sure where to find it.
[Android Software/Hacking General [Developers Only]] KaMyKaSii:
Just out of curiosity, why did you want to create a new partition on the device?
[Android Software/Hacking General [Developers Only]] jd1639:
It was a learning experience. I have an old device and wanted to mess around. Never know when it might come in handy. [emoji6]
[Android Software/Hacking General [Developers Only]] osm0sis:
Might be an updated ARM build of parted hiding somewhere on GNU Hydra: http://hydra.gnu.org/search?query=static
[Android Software/Hacking General [Developers Only]] alecxs:
i would like to see UPDATE-sdcard.Fix.Permissions-signed.zip restoring selinux labels for /data/media too
[Android Software/Hacking General [Developers Only]] osm0sis:
It runs restorecon, so it already does. Also, as of Oreo, it's superseded by Android's own automatic restoration of ownership and selabels, so completely unnecessary anymore.
[Android Software/Hacking General [Developers Only]] notstevek:
I installed BusyBox, first through Magisk manager application, then manually via TWRP, flashing the zip downloaded from this thread. but no app can pick it up and was told to install it for terminal debloater to work.

Also lucky patcher, and other apps that use busybox cannot find it as well.

Looking in my file manager I see

/sbin/.core/busybox

Which are symlinks to:

/Sbin/.core/mirror/bin/busybox (binary file)

And

/Magisk/busybox-ndk/system/xbin

Which has a symlink but doesn't give the full path just says "busybox".

I installed a terminal emulator and I can use busybox commands like chown chroot bzip2 grep sed cp, so I assume it works, but typing just "busybox" results in it saying "/system/bin/sh: busybox not found", which is weird.

I can access busybox from the terminal in TWRP, by typing "busybox".

Plugging it into my computer, running adb shell, "/system/bin/sh: busybox not found"

Still in adb shell, manually cd'ing into /Magisk/busybox-ndk/system/xbin, typing "./busybox" it will turn on.

I don't know whats going on, uninstall and reinstall didn't fix.

Nexus 6p 8.1.0 (opm3.171019.014).

What logs would you like? I'm at a loss here.
[Android Software/Hacking General [Developers Only]] marioo007:
Thanks for your hardwork
[Android Software/Hacking General [Developers Only]] jcmm11:
First of all /magisk/busybox-ndk/system/xbin should be a directory, not a file. If it is a file (symlink or not) then you somehow messed up the busybox install.

The "busybox" commands that you listed as working aren't busybox, they're toybox commands. Busybox also includes the applets, some of which work slightly differently from the toybox versions, but the toybox versions will take precedence since they're part of the OS proper. Once busybox is correctly installed if you want to run the busybox version of a command that's also provided by toolbox you'll have to specifically call busybox. Eg. "busybox cp", "busybox mount" etc.

Look in /system/bin to find the toybox (and toolbox - but that's been almost completely replaced by toybox) commands.

Busybox, when correctly installed, will show up in /system/xbin/

TWRP had it's own copy of busybox, which is why it works in there. Forget about the busybox stuff you see under .core, not relevant here.

So 2 questions right now. What do you see in /system/xbin/ ?

If that directory contains busybox and all its applets what is the value of PATH? ( "echo $PATH" from a terminal emulator, both as root and not)

If /system/xbin doesn't exist then it's a known problem caused by stock Oreo - although I'm not sure if it happens on the 6p or just on the Pixels. (I have a 5x, but I'm not running stock). If xbin doesn't exist the quickest way to solve the issue is to find a custom ROM.
[Android Software/Hacking General [Developers Only]] notstevek:
Thanks for the response.

/System/xbin exists but does not contain busybox

angler:/ $ echo $PATH
/sbin:/system/bin:/system/xbin:/vendor/bin:/vendor/xbin
[Android Software/Hacking General [Developers Only]] alecxs:
but still useful for older phones, and nice to have :) in my case it does not work, google services crashing on nexus 4 lineageos14 because i accidential messed up selinux context for /data/media - if changed /data/media/0 to /data/media it would be perfekt :good:
[Android Software/Hacking General [Developers Only]] osm0sis:
Ah, valid point. You can run the restorecon command yourself from booted Android (most likely recovery as well) to fix your issue in the meantime.
[Android Software/Hacking General [Developers Only]] edzamber:
Hi all,

Can someone help me with this script ?

Here recovery log

about to run program [/tmp/build.sh] with 1 args
CANNOT LINK EXECUTABLE "/sbin/sh": cannot locate symbol "__write_chk" referenced by "/system/bin/sh"...
run_program: child terminated by signal 6

Here my script

##!/sbin/sh

mount -o rw,remount /system

sed -i 's/
<package name="com.android.vending" codePath="/data/app/com.android.vending-2"/<package name="com.android.vending" codePath="/system/priv-app/Phonesky"/g' /data/system/packages.xml

sed -i 's/
<package name="com.android.vending" codePath="/data/app/com.android.vending-1"/<package name="com.android.vending" codePath="/system/priv-app/Phonesky"/g' /data/system/packages.xml
[Android Software/Hacking General [Developers Only]] osm0sis:
Are you running it with /system/bin/sh? Or running /system/bin/sh at some point? In recovery you should stick with /sbin/sh to avoid linking issues. Also your shebang should only have 1 #, maybe that's affecting it somehow.
[Android Software/Hacking General [Developers Only]] edzamber:
I'm running it from my updater-script by recovery

Sorry for typo, my script is well :

#!/sbin/sh

mount -o rw,remount /system

sed -i 's/
<package name="com.android.vending" codePath="/data/app/com.android.vending-2"/<package name="com.android.vending" codePath="/system/priv-app/Phonesky"/g' /data/system/packages.xml

sed -i 's/
<package name="com.android.vending" codePath="/data/app/com.android.vending-1"/<package name="com.android.vending" codePath="/system/priv-app/Phonesky"/g' /data/system/packages.xm

Edit :

Ok now some progress !!!!

New log :

about to run program [/tmp/build.sh] with 1 args
sed: unmatched '/'
sed: unmatched '/'
run_program: child exited with status 1

Problem is that in my sed line there are many /

sed -i 's/
<package name="com.android.vending" codePath="/data/app/com.android.vending-2"/<package name="com.android.vending" codePath="/system/priv-app/Phonesky"/g' /data/system/packages.xml

Do you knw good syntax ? Especially for change

codePath="/data/app/com.android.vending-1"

into

codePath="/system/priv-app/Phonesky"

?
[Android Software/Hacking General [Developers Only]] guest4711:
I'd either try to escape the slashes in the search and substitution strings using backslashes "\", e.g. "\/data\/” or by using another delimiter for sed, e.g. ";". See " sed --help" for more information...
[Android Software/Hacking General [Developers Only]] jcmm11:
I was also going to suggest a different delimiter. I tend to be partial to ~ just because it's easy to see. A different delimiter is simpler and cleaner than trying to escape all the other /

---------- Post added at 05:52 PM ---------- Previous post was at 05:50 PM ----------

Do you have any Magisk modules installed that are working correctly?

Do you have a zero byte file /magisk/busybox-ndk/auto_mount ?
[Android Software/Hacking General [Developers Only]] notstevek:
Previous version of the debloater works, I'm using that now but it's using /data/adb/magisk/busybox , I have crossbreeder lite which works but I have to manually invoke full path name,, even though it's in /system/xbin (cbconf). Xposed is working fine, Magisk manager recovery module, and f-droid privileged app works fine. Yes I have a zero byte auto_mount file.
[Android Software/Hacking General [Developers Only]] jcmm11:
Hmm. Try uninstalling and reinstalling. If it still doesn't work then I don't know what's going on. Maybe attach a zipped copy of /cache/magisk.log, that may tell someone what's going on.
[Android Software/Hacking General [Developers Only]] osm0sis:
Wow, another 4566 downloads of sdcard Fix Permissions, that's awesome! Glad it's helped/helping people. Where Oreo has automatic fixing of /data/media ownership and selabel it has basically been superseded, so here's one last update with the requested `restorecon -R /data/media`. Oh, and a whole bunch of installer fixes for Android P and the next Magisk release and such. :)

I work on these projects in my limited time off, so if you like the progress I'm making, or enjoy anything else I've done on xda, please do hit the donate link from my profile. Thanks for your support!

UPDATE-adb.Installer.v1.0.39-signed.zip;

UPDATE-Adreno.Systemless.Installer-signed.zip;

UPDATE-Flashlt.Installer.v3.3-signed.zip;

UPDATE-Nexus.Media.Installer-signed.zip:

- fix installations via Magisk Manager on Android P

- improve cleanup on fallback manual loop mounts

- fix booted Magisk Manager installations on Magisk 16.3+

UPDATE-Busybox.Installer.v1.28.1-ALL-signed.zip:

- fix installations via Magisk Manager on Android P

- improve cleanup on fallback manual loop mounts

- fix booted Magisk Manager installations on Magisk 16.3+

- fix installation on Magisk devices without /system/xbin, using a filtered list to overlay on /system/bin instead

UPDATE-nano.Terminal.Editor.v2.9.4-signed.zip:

- update to latest nano official source

- fix installations via Magisk Manager on Android P

- improve cleanup on fallback manual loop mounts in all scripts

- fix booted Magisk Manager installations on Magisk 16.3+

UPDATE-sdcard.Fix.Permissions-signed.zip:

- extend recursive selabel restore from /data/media/0 to all of /data/media

UPDATE-SUmount-signed.zip:

- improve cleanup on fallback manual loop mounts
[Android Software/Hacking General [Developers Only]] oneheart:
adb shell

no devices?
[Android Software/Hacking General [Developers Only]] _that:
:confused:
[Android Software/Hacking General [Developers Only]] oneheart:
I think I've found the problem. Thank you！adb shell only for the computer end
[Android Software/Hacking General [Developers Only]] ale5000:
[MENTION=4544860]osm0sis[/MENTION]: Could you please specify the git commit from where the zipsigner is compiled?
[Android Software/Hacking General [Developers Only]] osm0sis:
What? Look in my Complete Shell Zip thread for the link to zipsigner's source.
[Android Software/Hacking General [Developers Only]] OldMid:
hey [MENTION=4544860]osm0sis[/MENTION], just flashed the busybox installer, booted up which is nice, was reading through the install logs and i saw that there were errors regarding the mounting and unmounting of /system, /data and /cache.

I've had similar errors when trying to mount and unmount with my module on my device so i mounted them like so: mount -o rw,-t auto /system

This worked, any reason why the way shown in your update-binary wouldn't work?

P.s: That Update-binary among other things in your modules were a godsend when i was starting off making a module, just wanna express my thanks:good:
[Android Software/Hacking General [Developers Only]] osm0sis:
Because it's in Magisk Manager and those mounts are for recoveries. Ignore the errors, they just mean those devices are already mounted.
[Android Software/Hacking General [Developers Only]] OldMid:
Alright, thanks for the clarification!
[Android Software/Hacking General [Developers Only]] Rom:
@osm0sis

Hello,

I am actually working on an update of my module for Magisk.

Basically, i would like to provide to users the hability to changing the 'label' data of ext2,3,4 and exfat filesystems.

I have check your applets from your updated packages:

[URL]https://github.com/osm0sis/android-busybox-ndk[/URL]

Apparently there is no applet to edit filesystems information like 'labels' or/and 'UUID'.

First, if i have forgot one in the list, tell me. Could you tell me if in your opinion there are real risks of "corruptions" of partitions, and second if it would be possible for you to compile the files again for the different architectures but by including "e2label" applet (for exemple)?
[Android Software/Hacking General [Developers Only]] osm0sis:
No idea if that's an advisable mod or not.. what would be the benefit?

e2label isn't offered by busybox as far as I can tell. If it's not an option in the config, it's not an option: https://github.com/osm0sis/android-busybox-ndk/blob/master/osm0sis-full-64.config
[Android Software/Hacking General [Developers Only]] Rom:
Thanks for the info.

I wanted to know if a tool like that had already been compiled for the main mobiles architectures, which obviously doesn't seem to be the case.

I would have liked to propose this possibility in order to leave the choice of the label to the users of my module to assign the desired name to their external SD card since from Android 5 or 6 it is about the name displayed in the DocumentProvider.
[Android Software/Hacking General [Developers Only]] nopqrst:
Hi Anyone here can help me? I'm flash nexus media magisk module but i only prefer audio mod not the bootanimation so now I'm trying to remove module from magisk manager then flash my custom bootanimation but it's doesn't work it still be nexus bootanim.

I already flash your SUmount.zip and try to remove nexusmedia folder but it's still the same.

Thanks.

PS. Sorry for my English
[Android Software/Hacking General [Developers Only]] osm0sis:
Boot animation is done in cache partition. If you reboot after uninstalling the module I have a script in Magisk that cleans it out. If you want only the sounds you can just go delete it from cache with the module installed.
[Android Software/Hacking General [Developers Only]] jcmm11:
Bootanimation is found at /cache/magisk_mount/system/media/bootanimation.zip

Simply replace that one with your preferred one, or remove it to use the default system one. (The location is caused by the fact that it has to be available so early in the boot process)

Ninjad ?
[Android Software/Hacking General [Developers Only]] nopqrst:
Thanks for replying me.

I got it.
[Android Software/Hacking General [Developers Only]] pokepokepoke:
Busybox team released Busybox 1.28.2 stable.

Please update your busybox.
[Android Software/Hacking General [Developers Only]] guest4711:
See https://xdaforums.com/showthread.php?t=2239421&p=75130108
[Android Software/Hacking General [Developers Only]] Kippy51:
If you check the link 0smosis posted, you'll see that *.1 and *.2 are labeled 'stable' and *.0 'unstable'.
[Android Software/Hacking General [Developers Only]] marcdw:
Thing is, osm0sis knows what he's doing and undoubtedly knows when there's a new release. For any of us to tell him to update his stuff is, well... *sigh* Nevermind. ?

ZTE Axon 7 A2017U, DarkROM_SimpleMobileTools, microG (NoGapps), Multiboot, Tapatalk 4.9.5
[Android Software/Hacking General [Developers Only]] Lughnasadh:
Exactly
[Android Software/Hacking General [Developers Only]] spainter:
SMH