<返回更多

手机上手动安装功能强大的Linux工具Busybox

2022-04-26    中微中科技
加入收藏

BusyBox 是一个集成了三百多个最常用linux命令和工具的软件。功能便捷、强大。

安装需要有root权限

查询并下载自己手机的CPU型号及对应busybox二进制文件

c:tmpfastboot>adb shell
shell@GiONEE_GBL7319:/ $ cat /proc/cpuinfo
Processor       : AArch64 Processor rev 3 (aarch64)
processor       : 0
BogoMIPS        : 26.00

Features        : fp asimd aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: AArch64
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 3

Hardware        : MT6735

AArch64:对应的是ARMv8-A架构,引入的64位指令集,向后兼容基于32位指令集。

下载ARMV8相关的busybox二进制文件:busybox-armv8l

下载地址:
https://busybox.NET/downloads/binaries/

手机上手动安装功能强大的Linux工具Busybox

 


手机上手动安装功能强大的Linux工具Busybox

对应文件:busybox-armv8l

安装方法

adb root              以root来运行
adb remount       重新以读写方式挂载系统
adb push c:tmpbusybox-armv8l   /system/xbin
adb shell
cd /system/xbin
chmod  755  busybox-armv8l           改权限
./busybox-armv8l    --install             安装

有些版本低,前2个命令没有,出现以下问题:error: device not found

c:tmpfastboot>adb shell
shell@GiONEE_GBL7319:/ $ adb root
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device not found
1|shell@GiONEE_GBL7319:/ $ adb remount
error: device not found

c:tmpfastboot>adb push c:/tmp/busybox-armv8l  /system/xbin
adb: error: failed to copy 'c:/tmp/busybox-armv8l' to '/system/xbin/busybox-armv8l': remote Permission denied
c:/tmp/busybox-armv8l: 0 files pushed. 0.4 MB/s (131056 bytes in 0.342s)

此时可先将文件传到临时目录: /data/local/tmp ,在用移动mv命令

c:tmpfastboot>adb push c:/tmp/busybox-armv8l  /data/local/tmp
c:/tmp/busybox-armv8l: 1 file pushed. 0.4 MB/s (1148524 bytes in 3.113s)

1|shell@GiONEE_GBL7319:/ $ su
root@GiONEE_GBL7319:/ # mv  /data/local/tmp/busybox-armv8l   /system/xbin

将/system重新挂载为可读写:(可选)

先查/system挂载对应的文件目录(device):可用如下命令

  • cat /proc/mounts
  • mount
root@GiONEE_GBL7319:/system/xbin # cat /proc/mounts
rootfs / rootfs rw,seclabel 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
tmpfs /mnt/media_rw tmpfs rw,seclabel,relatime,mode=755,uid=1000,gid=1000 0 0
tmpfs /storage/usbotg tmpfs rw,seclabel,relatime,mode=755,uid=1000,gid=1000 0 0
tmpfs /storage/emulated tmpfs rw,seclabel,relatime,mode=755,uid=1023,gid=1023 0 0
/dev/block/platform/mtk-msdc.0/by-name/system /system ext4 rw,seclabel,noatime,data=ordered 0 0

对应目录(device)是:
/dev/block/platform/mtk-msdc.0/by-name/system

重新挂载成可读写:rw是读写,ro是只读(默认)

root@GiONEE_GBL7319:/ # mount -o remount -rw  /dev/block/platform/mtk-msdc.0/by-name/system  /system

或用:root@GiONEE_GBL7319:/ # mount -o remount, rw /system

修改属性:为可执行,chmod 755
/system/xbin/busybox-armv8l

126|root@GiONEE_GBL7319:/ # ls -l /system/xbin/busybox-armv8l
-rw-rw-rw- shell    shell     1148524 2022-01-27 22:12 busybox-armv8l
root@GiONEE_GBL7319:/ # chmod 755  /system/xbin/busybox-armv8l

安 装:./busybox-armv8l --install

127|root@GiONEE_GBL7319:/ # cd /system/xbin
1|root@GiONEE_GBL7319:/system/xbin # ./busybox-armv8l --install
busybox-armv8l: /usr/bin/[: No such file or directory
busybox-armv8l: /usr/bin/[[: No such file or directory
busybox-armv8l: /sbin/acpid: Cross-device link
busybox-armv8l: /usr/sbin/add-shell: No such file or directory
busybox-armv8l: /usr/sbin/addgroup: No such file or directory
busybox-armv8l: /usr/sbin/adduser: No such file or directory
busybox-armv8l: /sbin/adjtimex: Cross-device link
busybox-armv8l: /bin/arch: No such file or directory
                          ......

查看有哪些命令:直接输入busybox-armv8l

127|root@GiONEE_GBL7319:/system/xbin # busybox-armv8l
BusyBox v1.31.0 (2019-06-10 15:54:51 CEST) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --show SCRIPT
   or: busybox --install [-s] [DIR]
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arch, arp,
        arping, ash, awk, base64, basename, bc, beep, blkdiscard, blkid,
        blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, chat,
        chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt,
        cksum, clear, cmp, comm, conspy, cp, cpio, crond, crontab, cryptpw,
        cttyhack, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod,
        devmem, df, dhcprelay, diff, dirname, dmesg, DNSd, dnsdomainname,
         ......

用法对比:busybox + 命令

手机上手动安装功能强大的Linux工具Busybox

 

改个易记的名:

127|root@GiONEE_GBL7319:/system/xbin # cp busybox-armv8l busybox
root@GiONEE_GBL7319:/system/xbin # ls -l
-rwxr-xr-x root     shell       22128 2016-08-11 21:00 BGW
-rwxr-xr-x root     shell       51144 2016-08-11 21:00 amigosu
-rwxr-xr-x root     root      1148524 2015-01-01 13:07 busybox
-rwxr-xr-x shell    shell     1148524 2022-01-27 22:12 busybox-armv8l

root@GiONEE_GBL7319:/system/xbin # busybox ls -l
total 3724
-rwxr-xr-x    1 0        2000         22128 Aug 11  2016 BGW
-rwxr-xr-x    1 0        2000         51144 Aug 11  2016 amigosu
-rwxr-xr-x    1 0        0          1148524 Jan  1 05:07 busybox
-rwxr-xr-x    1 2000     2000       1148524 Jan 27  2022 busybox-armv8l
声明:本站部分内容来自互联网,如有版权侵犯或其他问题请与我们联系,我们将立即删除或处理。
▍相关推荐
更多资讯 >>>