Hey,
So a few months ago, I installed either an older version of Busybox, or the newer version I installed never stuck. Basically, I have two folders that contain the busybox commands: /sbin and /system/xbin. In Terminal Emu., when I enter a Busybox command, it seems to only acknowledge the older folder (/sbin). eg if I type in "busybox ifconfig..." or "busybox ipconfig...." I'm told that there's no such command, in so many words. How do I go about fixing this?
Would it mess anything up if I moved the contents of the newer folder (/system/xbin) into /sbin ?
Also, should there be a busybox file located anywhere (ie a file in root that's executed when "busybox" is typed into Term. Emu?) I can only locate the one in the internal sdcard directory ("busybox-stericon")
Thanks
bumpity
alljokingaside said:
Hey,
So a few months ago, I installed either an older version of Busybox, or the newer version I installed never stuck. Basically, I have two folders that contain the busybox commands: /sbin and /system/xbin. In Terminal Emu., when I enter a Busybox command, it seems to only acknowledge the older folder (/sbin). eg if I type in "busybox ifconfig..." or "busybox ipconfig...." I'm told that there's no such command, in so many words. How do I go about fixing this?
Would it mess anything up if I moved the contents of the newer folder (/system/xbin) into /sbin ?
Also, should there be a busybox file located anywhere (ie a file in root that's executed when "busybox" is typed into Term. Emu?) I can only locate the one in the internal sdcard directory ("busybox-stericon")
Thanks
Click to expand...
Click to collapse
I'm no expert, but based on my experience with Linux, I'd say that the safest thing to do would be to create a symbolic link of all the files in /system/xbin/busybox (or wherever) to /sbin/busybox (or wherever)
If you could post the directory listings of "/sbin" and "/system/xbin" it might help.
alljokingaside said:
Hey,
So a few months ago, I installed either an older version of Busybox, or the newer version I installed never stuck. Basically, I have two folders that contain the busybox commands: /sbin and /system/xbin. In Terminal Emu., when I enter a Busybox command, it seems to only acknowledge the older folder (/sbin). eg if I type in "busybox ifconfig..." or "busybox ipconfig...." I'm told that there's no such command, in so many words. How do I go about fixing this?
Would it mess anything up if I moved the contents of the newer folder (/system/xbin) into /sbin ?
Also, should there be a busybox file located anywhere (ie a file in root that's executed when "busybox" is typed into Term. Emu?) I can only locate the one in the internal sdcard directory ("busybox-stericon")
Thanks
Click to expand...
Click to collapse
There is a directory hierarchy in the Android file system.
You can normally see three different directories for binaries. These have the following priority:
/system/bin
/system/xbin
/sbin
This means that if there are two binaries with the same filename, the binary in the more prioritised map will be executed.
In your case, the /system/xbin has a higher priority than /sbin.
As I see it, you have the following choices:
Keep them co-existing. To select an indiviual binary, enter
/sbin/busybox [function] [arguments]
or
/system/xbin/busybox [function] [arguments].
Remove the unwanted one.
If you are unsure of which you want to discard,
just enter the commands as written in the first choice (without any functions of course).
I hope this post helps you.
Related
I am trying to install TapNTap keyboard in Vegan Ginger. (yeah, I know but I want to anyway). I need to copy two files to /system/app and system/lib. I presently have the files stored in /mnt/sdcard/download. I have terminal emulator installed and when I su I appear to get root (prompt changes to #). I was able to create an empty directory in /. When I try to copy the file to /system/app I get a message that it is a Read-only file system. When I do an ls -l the permissions show drwxr-xr-x for the directory. The owner is root and the group is root. It would seem that as su I should be able to copy the file there. Possibly it is mounted as RO. I tried to use a remount command but it failed. I'm not well versed in that so I may have done something wrong. Long and short - how do I get the file copied into the directory?
http://lmgtfy.com/?q=remount+system+rw+android
Looking at several ROM's for the Desire, I notice that they put the busybox binary in /system/xbin rather than in /system/bin. Also they have links to toolbox in /system/bin for a lot of commands that also exist in busybox, and with /system/bin before /system/xbin in the $PATH will result in getting to the toolbox version, rather than the busybox version of a command. Especially commands like df and ifconfig have a very bad/limited output compared to the busybox versions.
(having to type "busybox df" or "/system/xbin/df" rather then just "df" irritates me)
Are there any special reason for doing it that way, ex are there parts of the android os, that needs to get to the toolbox version of commands to function correctly?
Just thought I wanted to ask, before testing this out.
Also are there a problem in removing /system/bin/sh, and replace it with a link to /system/bin/bash?
Hello everyone,
I've updated my firmware to the latest version of my huawei ascend p7 making it impossible to root my phone. Now what I'm trying to do is get the non-rooted busybox working and replace the old links of commands with the ones in busybox. I'm using the following commands to do that:
First I export the path and such using:
Code:
export PATH=$PATH:/data/data/burrows.apps.busybox/app_busybox;
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/data/burrows.apps.busybox/app_bussybox
Now I'm able to use busybox in my terminal (only for that session, when I exit the terminal and restart it I would have to re-do the export path thing).
So... I wanted to replace all the links to those of busybox using the following command:
Code:
for c in `busybox --list`; do busybox ln -s busybox $c; done
This however outputs for each command for example cat:
Code:
ln: cat: Read-only file system
I've read somewhere that you can remount your system partition in order to make it writeable? Is this the way to do it? And if so what commands should I run? I have access through adb and a normal shell on the phone. Remember: it's non-rooted...
EDIT: seems like I can't remount /system without root priviledges...
Also I would like to be able to have a full colored bash shell with a bashrc (in which I can add the path to busybox aswell) if that's possible.
I'm using jackpal's android terminal emulator.
EDIT: I think I might've posted this on the wrong forum, if anyone is so kind as to move this to this forum: http://forum.xda-developers.com/ascend-p7/help I would greatly appreciate it. Altho I think this might be a general question rather then a model specific question.
Hi, I'd like to ask a general question about device boot. I've made some changes in init.rc and I packed again boot.img. In particular, I've added a .sh script to ramdisk root directory.
The script is named mount_partitions.sh and it does just this task. However, boot.img needs a shell to execute it, but /system is not mounted yet, at that point. So, I need to add a shell to to ramdisk root directory so that init executable can run the .sh script.
Exactly, how I could add shell support in boot.img without mounting the system partition? Any ideas?
Solved
I've found a way to use a shell before mounting system partition. Essentially, it's possible to place a busybox binary (i.e. taken from /system/xbin directory located in another android phone with installed busybox) into ramdisk root directory of boot.img, giving it execute permission in init.rc by chmod command, after remounted ramdisk root directory in read-write mode (by mount command put always in init.rc). It could be also be needed to give execute permission to the shell script (always by chmod command).
Then, it's needed run the shell script by busybox ash command, putting it into init.rc. The line looks like as following:
Code:
exec /busybox ash /myscript.sh
Don't forget to put also a line for remounting ramdisk root directory in read-only mode, after ash shell finished to execute the script (always using mount command in init.rc).
Remember to use the following shebang at the beginning of the shell script:
Code:
#!/busybox sh
shouldn't the shebang end with "ash" instead of just "sh"?
it's just a sh script but it could be true.
Hi, I'd like to ask a general question about busybox. I've added busybox binary into ramdisk root directory of boot.img. I've set busybox binary permissions to 0777 in init.rc, in order to be sure not getting any denied permissions issues.
I've put an exec command into init.rc for using busybox cp and it worked because it really made a copy of default.prop in ramdisk root directory. I've also put a start service line into init.rc That service is essentially a busybox sh call for launching a shell script. Unfortunately, it seems shell script is not executed because some cp and echo commands which I put inside it have not effects.
Looking for around the www, it looked like redirection ('>', '>>', ...) is not prohibited by busybox. So, i've also tried to redirect
command output to a file, but file was not created.
So, how could I debug busybox? Any ideas?