BusyBox 相关
- BusyBox
- android上安装busybox和使用示例
- 一、下载
- 二、移动
- 三、安装和设置环境变量
- 四、使用
- busybox源码下载和查看
BusyBox
BUSYBOX
BUSYBOX链接https://busybox.net/
点击链接后如图
点击左边菜单栏的Get BusyBix中的Download Source
跳转到busybox 的下载源码界面
有各个版本的busybox源码可以下载
BUSYBOX下载版本源码链接https://busybox.net/downloads/
点击链接后如图
也可以选择binaries 下载busybox去安装使用
BUSYBOX版本下载链接https://busybox.net/downloads/binaries/
点击链接后如图
android上安装busybox和使用示例
例如我下载的是1.31.0版本,用于安卓设备上,进行安装使用
一、下载
1.在Index of /downloads/binaries界面,点击1.31.0-defconfig-multiarch-musl版本
BUSYBOX版本下载链接https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/
点击链接后如图
2.查看android的构架
输入串口指令getprop |grep ro.product.cpu.abi
我的板子查看后是 armeabi-v7a
pxxx_xxx:/ # getprop |grep ro.product.cpu.abi
[ro.product.cpu.abi]: [armeabi-v7a]
3.在busybox-armv7l右击鼠标,选择将链接另存为
busybox-armv7l.txt
将busybox-armv7l.txt改成busybox
二、移动
可以用adb push 也可以用U盘cp
找到一个位置,将busybox放到位置。然后给777 的权限
C:\Users\Administrator>adb push C:\Users\Administrator\Downloads\busybox /data/busybox
C:\Users\Administrator\Downloads\busybox: 1 file pushed, 0 skipped. 110.3 MB/s (1152216 bytes in 0.010s)C:\Users\Administrator>adb shell
pxxx_xxx:/ $ su
pxxx_xxx:/ # cd data/busybox/
pxxx_xxx:/data/busybox # ls -l
total 1132
-rw-rw-rw- 1 shell shell 1152216 2024-12-19 10:50 busybox
pxxx_xxx:/data/busybox # chmod 777 busybox
三、安装和设置环境变量
安装
./代表当前路径,安装在当前路径下,记住路径所在位置,用于设置环境变量
./busybox --install ./
设置环境变量
/data/busybox是刚才的安装路径,如果安装在其它位置可以修改成安装的路径
export PATH=/data/busybox:$PATH
pxxx_xxx:/data/busybox # ./busybox --install ./
pxxx_xxx:/data/busybox # export PATH=/data/busybox:$PATH
pxxx_xxx:/data/busybox # cd /
pxxx_xxx:/ # busybox
BusyBox v1.31.0 (2019-06-10 15:54:50 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 SCRIPTor: busybox --install [-s] [DIR]or: function [arguments]...BusyBox is a multi-call binary that combines many common Unixutilities into a single executable. Most people will create alink to busybox for each function they wish to use and BusyBoxwill 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, dos2unix, dpkg, dpkg-deb, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir,envuidgid, ether-wake, expand, expr, factor, fakeidentd, fallocate, false, fatattr, fbset, fbsplash, fdflush,fdformat, fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk, fsck, fsck.minix, fsfreeze,fstrim, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, groups, gunzip, gzip, halt, hd, hdparm, head,hexdump, hexedit, hostid, hostname, httpd, hush, hwclock, i2cdetect, i2cdump, i2cget, i2cset, i2ctransfer, id,ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod, install, ionice, iostat, ip, ipaddr, ipcalc,ipcrm, ipcs, iplink, ipneigh, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd, last, less,link, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, lpd, lpq,lpr, ls, lsattr, lsmod, lsof, lspci, lsscsi, lsusb, lzcat, lzma, lzop, makedevs, makemime, man, md5sum, mdev,mesg, microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap,mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nanddump, nandwrite, nbd-client,nc, netstat, nice, nl, nmeter, nohup, nologin, nproc, nsenter, nslookup, ntpd, nuke, od, openvt, partprobe,passwd, paste, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir, poweroff,powertop, printenv, printf, ps, pscan, pstree, pwd, pwdx, raidautorun, rdate, rdev, readahead, readlink,readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, resume, rev, rm, rmdir, rmmod,route, rpm, rpm2cpio, rtcwake, run-init, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed,sendmail, seq, setarch, setconsole, setfattr, setfont, setkeycodes, setlogcons, setpriv, setserial, setsid,setuidgid, sh, sha1sum, sha256sum, sha3sum, sha512sum, showkey, shred, shuf, slattach, sleep, smemcap,softlimit, sort, split, ssl_client, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svc, svlogd,svok, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, taskset, tc, tcpsvd, tee, telnet,telnetd, test, tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6, true, truncate, ts, tty,ttysize, tunctl, ubiattach, ubidetach, ubimkvol, ubirename, ubirmvol, ubirsvol, ubiupdatevol, udhcpc, udhcpc6,udhcpd, udpsvd, uevent, umount, uname, unexpand, uniq, unix2dos, unlink, unlzma, unshare, unxz, unzip, uptime,users, usleep, uudecode, uuencode, vconfig, vi, vlock, volname, w, wall, watch, watchdog, wc, wget, which, who,whoami, whois, xargs, xxd, xz, xzcat, yes, zcat, zcip
四、使用
例如使用microcom 串口指令
microcom -t 5000 -s 115200 /dev/ttyS1
打开串口/dev/ttyS1,设置波特率115200,5s没操作退出
pxxx_xxx:/ # microcom -t 5000 -s 115200 /dev/ttyS1# ls
[1;32mapp.elf[m [1;32mconfig.ini[m [1;32mmnt.sh[m
[1;32marm-histbv320-linux-gdb[m [1;32mfactory.elf[m [1;32mreadme.txt[m
[1;32mautorun[m [1;32mfts_config.ini[m
# pxxx_xxx:/ #
busybox源码下载和查看
例如在Index of /downloads下载busybox-1.31.0.tar.bz2
解压后如图
未完待续·
与君共勉!待续
欢迎指错,一起学习