Skip to content

Instantly share code, notes, and snippets.

@masterzorag
Last active January 5, 2017 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masterzorag/31bc945c01a0a131e19a to your computer and use it in GitHub Desktop.
Save masterzorag/31bc945c01a0a131e19a to your computer and use it in GitHub Desktop.
Collected infos
toolchain info from https://github.com/rusxakep/asuswrt-security/raw/master/release/src/router/email-3.1.3/config.log
---------------
PATH: /opt/trendchip/mips-linux-uclibc/usr/bin # (tbs-sdk missing piece)
PATH: /opt/brcm/hndtools-mipsel-uclibc/bin
PATH: /opt/brcm/hndtools-mipsel-linux/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1721: checking for mips-linux-gcc
configure:1748: result: mips-linux-uclibc-gcc -mips32r2 -msoft-float
configure:2026: checking for C compiler version
configure:2033: mips-linux-uclibc-gcc -mips32r2 -msoft-float --version >&5
mips-linux-uclibc-gcc (GCC) 4.3.4
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2036: $? = 0
configure:2043: mips-linux-uclibc-gcc -mips32r2 -msoft-float -v >&5
Using built-in specs.
Target: mips-linux-uclibc
Configured with: /home/socsw_local/lino/toolchain/tc3262/buildroot-2009.11/output/toolchain/gcc-4.3.4/configure \
--prefix=/usr --build=i386-pc-linux-gnu
--host=i386-pc-linux-gnu --target=mips-linux-uclibc
--enable-languages=c,c++
--with-sysroot=/opt/trendchip/mips-linux-uclibc
--with-build-time-tools=/opt/trendchip/mips-linux-uclibc/usr/mips-linux-uclibc/bin
--disable-__cxa_atexit
--enable-target-optspace
--with-gnu-ld --disable-libssp --enable-tls --enable-shared
--with-gmp=/home/socsw_local/lino/toolchain/tc3262/buildroot-2009.11/output/toolchain/gmp
--with-mpfr=/home/socsw_local/lino/toolchain/tc3262/buildroot-2009.11/output/toolchain/mpfr
--disable-nls --enable-threads --disable-multilib --disable-decimal-float
--with-float=soft --with-abi=32 --with-tune=mips32r2
Thread model: posix
gcc version 4.3.4 (GCC)
configure:2046: $? = 0
configure:2053: mips-linux-uclibc-gcc -mips32r2 -msoft-float -V >&5
mips-linux-uclibc-gcc: '-V' must come at the start of the command line
configure:2056: $? = 1
...
-----------------------------
~ $
2684ctl delgroup ifip6 mkfifo ripd traceroute
2684d deluser igmpproxyv3 mknod ripngd traceroute6
3g-mngr dhcp-fwd inadyn-mt mld rm true
3g-stub diagtest init modprobe rmmod tty
[ ebtables insmod mount route udhcpc
[[ echo ip6aac msntp seq udhcpd
addgroup env ip6mon mv sh umount
adduser ethcmd ip6tables nanocom sleep updatedd
adslphxcmd ethtool iptables netstat smbd upgrader
arp expr kill nmbd smbpasswd upnp.sh
ash false kill_proc.sh nohup start-stop-daemon uptime
atmphxcmd fdisk killall nslookup sync usb_modeswitch
bftpd flash_test klogd ntfs-3g syslogd vconfig
brctl flush_conntrack ln pc tar verify
busybox ftpd logger ping tb_tr069 vnetconfig
cat fuser logic ping6 tcci wan
chmod getsmaps login poweroff test wc
cmd grep logmonitor protest tftp wlanphxcmd
cmddaemon halt ls ps tftpd zebra
cp hotplug lsmod ramon time
cut hw_nat miniupnpd reboot tm
date ifconfig mkdir renice top
~ $ busybox --help
BusyBox v1.6.1 (2014-05-12 11:39:11 CST) multi-call binary
Copyright (C) 1998-2006 Â Erik Andersen, Rob Landley, and others.
Licensed under GPLv2. Â See source distribution for full notice.
Usage: busybox [function] [arguments]...
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:
[, [[, addgroup, adduser, arp, ash, cat, chmod, cp, cut,
date, delgroup, deluser, echo, env, expr, false, fdisk,
fuser, grep, halt, ifconfig, inetd, init, insmod, kill,
killall, klogd, linuxrc, ln, logger, login, ls, lsmod,
mkdir, mkfifo, mknod, modprobe, mount, mv, netstat, nohup,
nslookup, ping, ping6, poweroff, ps, reboot, renice, rm,
rmmod, route, seq, sh, sleep, start-stop-daemon, sync,
syslogd, tar, telnetd, test, tftp, time, top, traceroute,
true, tty, umount, uptime, vconfig, vnetconfig, wc
~ $ cat /var/log/device_info
Manufacturer: D-Link
ProductClass: D-Link GO-DSL-AC750
SerialNumber: 48ee0c9abe90
IP: 192.168.1.1
HWVer: T1
SWVer: EU_1.02
~ $ cat /proc/cmdline
console=ttyS0,115200 mem=64M root=31:2 mtdparts=sflash:196608(boot),1379584(kernel),7798784(rootfs),-(data) rootfstype=squashfs es=1
~ $ cat /proc/partitions
major minor #blocks name
31 0 192 mtdblock0 #*1024 = 196608(boot)
31 1 1347 mtdblock1 #*1024 = 1379328, (+ 256) = 1379584(kernel)
31 2 7616 mtdblock2 #*1024 = 7798784(rootfs)
31 3 7228 mtdblock3 #*1024 = 7401472 -(data)
~ $ cat /proc/version
Linux version 2.6.36 (chenkai@software.gj.com) (gcc version 4.3.4 (GCC) ) #1 SMP Mon May 12 11:35:30 CST 2014
~ $ cat /proc/cpuinfo
system type : MT7511
processor : 0
cpu model : MIPS 34Kc V5.5
BogoMIPS : 430.89
wait instruction : yes
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0ff8, 0x0490, 0x0880]
ASEs implemented : mips16 dsp mt
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available
processor : 1
cpu model : (null) V5.5
BogoMIPS : 323.58
wait instruction : yes
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0ff8, 0x0490, 0x0880]
ASEs implemented : mips16 dsp mt
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available
processor : 2
cpu model : (null) V5.5
BogoMIPS : 323.58
wait instruction : yes
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0ff8, 0x0490, 0x0880]
ASEs implemented : mips16 dsp mt
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available
processor : 3
cpu model : (null) V5.5
BogoMIPS : 323.58
wait instruction : yes
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0ff8, 0x0490, 0x0880]
ASEs implemented : mips16 dsp mt
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available
~ $ cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / squashfs ro,relatime 0 0
null /proc proc rw,relatime 0 0
tmpfs /var tmpfs rw,relatime 0 0
none /sys sysfs rw,relatime 0 0
tmpfs /mnt tmpfs rw,relatime 0 0
tmpfs /dev tmpfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
~ $ cat /proc/meminfo
MemTotal: 60768 kB
MemFree: 20380 kB
Buffers: 1496 kB
Cached: 6024 kB
SwapCached: 0 kB
Active: 6756 kB
Inactive: 5020 kB
Active(anon): 4440 kB
Inactive(anon): 160 kB
Active(file): 2316 kB
Inactive(file): 4860 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 4308 kB
Mapped: 3100 kB
Shmem: 344 kB
Slab: 15392 kB
SReclaimable: 516 kB
SUnreclaim: 14876 kB
KernelStack: 1088 kB
PageTables: 304 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 30384 kB
Committed_AS: 9336 kB
VmallocTotal: 1048180 kB
VmallocUsed: 10516 kB
VmallocChunk: 972500 kB
~ $ lsmod
Module Size Used by Tainted: P
mt7510sar 36878 1 - Live 0xc382e000 (P)
qdma 101267 1 mt7510sar, Live 0xc37ed000 (P)
user_usb_modem 14315 0 - Live 0xc3699000
usb_storage 37343 0 - Live 0xc3240000
rt5392ap 1489160 1 - Live 0xc1480000
led 5953 0 - Live 0xc1118000
btn 3445 1 - Live 0xc110c000
option 12962 0 - Live 0xc10ee000
usb_wwan 7390 1 option, Live 0xc10cf000
nls_cp936 120753 0 - Live 0xc109e000
nls_cp437 4545 0 - Live 0xc1069000
nls_ascii 3009 0 - Live 0xc105f000
usbserial 26518 3 user_usb_modem,option,usb_wwan, Live 0xc1046000
scsi_wait_scan 479 0 - Live 0xc1029000
ehci_hcd 43104 0 - Live 0xc100e000
ohci_hcd 23729 0 - Live 0xc0fe2000
mt7610e 1488606 1 - Live 0xc0bca000
tc3162_dmt 2375883 0 - Live 0xc05e7000 (P)
module_sel 1266 2 rt5392ap,mt7610e, Live 0xc01a2000
tccicmd 69943 5 mt7510sar,rt5392ap,led,mt7610e,tc3162_dmt, Live 0xc0170000
hw_nat 39149 0 - Live 0xc011b000 (P)
fe_api 672 2 mt7510sar,hw_nat, Live 0xc00ea000 (P)
cross-compile static Busybox for mips
--------------------------------------
1. Toolchain:
http://buildroot.uclibc.org/downloads/manual/manual.html#configure
http://buildroot.uclibc.org/downloads/manual/manual.html#_advanced_usage
...
make toolchain
/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr/bin/mips-linux-gcc -v
Using built-in specs.
COLLECT_GCC=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr/bin/mips-linux-gcc
COLLECT_LTO_WRAPPER=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr/libexec/gcc/mips-buildroot-linux-uclibc/4.8.5/lto-wrapper
Target: mips-buildroot-linux-uclibc
Configured with: ./configure --prefix=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr --sysconfdir=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/etc --enable-static --target=mips-buildroot-linux-uclibc --with-sysroot=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr/mips-buildroot-linux-uclibc/sysroot --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --with-gmp=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr --with-mpfr=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr --with-pkgversion='Buildroot 2015.08.1' --with-bugurl=http://bugs.buildroot.net/ --disable-libsanitizer --enable-tls --disable-libmudflap --enable-threads --with-mpc=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr --without-isl --without-cloog --with-float=soft --disable-decimal-float --with-arch=mips32r2 --with-abi=32 --enable-languages=c --enable-poison-system-directories --with-build-time-tools=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1/output/host/usr/mips-buildroot-linux-uclibc/bin --enable-shared --disable-libgomp
Thread model: posix
gcc version 4.8.5 (Buildroot 2015.08.1)
2. BusyBox:
cp package/busybox/busybox.config output/build/busybox-1.24.1/.config
cd output/build/busybox-1.24.1
make silentoldconfig
make menuconfig
BUILDROOTDIR=/mnt/iso/buildroot.uClibc/buildroot-2015.08.1
export PATH=$BUILDROOTDIR/output/host/usr/bin:$PATH
make CROSS_COMPILE=mips-linux- busybox
file ./busybox
./busybox: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), statically linked, stripped
3. Test in qemu:
qemu-mips busybox
BusyBox v1.24.1 (2015-11-14 19:03:01 CET) 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 --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:
[, [[, addgroup, adduser, ar, arp, arping, ash, awk, basename, blkid, bunzip2,
bzcat, cat, catv, chattr, chgrp, chmod, chown, chroot, chrt, chvt, cksum, clear,
cmp, cp, cpio, crond, crontab, cut, date, dc, dd, deallocvt, delgroup, deluser,
devmem, df, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, echo,
egrep, env, ether-wake, expr, false, fdflush, fdformat, fdisk, fgrep, find, flock,
fold, free, freeramdisk, fsck, fstrim, fuser, getopt, getty, grep, gunzip, gzip,
halt, hdparm, head, hexdump, hostid, hostname, hwclock, id, ifconfig, ifdown, ifup,
inetd, init, insmod, install, ip, ipaddr, ipcrm, ipcs, iplink, iproute, iprule,
iptunnel, kill, killall, killall5, klogd, last, less, linux32, linux64, linuxrc, ln,
loadfont, loadkmap, logger, login, logname, losetup, ls, lsattr, lsmod, lsof, lspci,
lsusb, lzcat, lzma, makedevs, md5sum, mdev, mesg, microcom, mkdir, mkfifo, mknod,
mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mt, mv, nameif, netstat,
nice, nohup, nslookup, od, openvt, passwd, patch, pidof, ping, pipe_progress,
pivot_root, poweroff, printenv, printf, ps, pwd, rdate, readahead, readlink,
readprofile, realpath, reboot, renice, reset, resize, rm, rmdir, rmmod, route, rpm,
run-parts, runlevel, sed, seq, setarch, setconsole, setkeycodes, setlogcons,
setserial, setsid, sh, sha1sum, sha256sum, sha3sum, sha512sum, sleep, sort,
start-stop-daemon, strings, stty, su, sulogin, swapoff, swapon, switch_root, sync,
sysctl, syslogd, tail, tar, tee, telnet, test, tftp, time, top, touch, tr, true,
truncate, tty, tune2fs, udhcpc, uevent, umount, uname, uniq, unix2dos, unlink,
unlzma, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vlock, watch,
watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat
qemu-mips busybox ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=1.587 ms
@masterzorag
Copy link
Author

shot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment