mipsをクラックする必要があったので、まずbusyboxをビルド

シリアルをつないでみたら、あっさりシェルプロンプト。拍子抜け。
でも、busyboxには何にもコマンドがない。
エンディアンはbigのよう。


んで、そのへんのmips.debをほどいて使ったら

Error: Kernel Floating Point Emulator is not supported

な事に... orz


しかたがないので自前でビルド。
toolchainは腐ったのがあるので、それを使うことに。


どうせなら、最新にする?

# wget http://busybox.net/downloads/busybox-1.14.1.tar.gz
# tar zxvf busybox-1.14.1.tar.gz 
# cd busybox-1.14.1
# make menuconfig
Busybox Settings  --->  
	Build Options  --->  
		[*] Build BusyBox as a static binary (no shared libs) 
		[*] Force NOMMU build 
# make ARCH=mips CROSS_COMPILE=/opt/buildroot-gcc346/mipsel-linux-uclibc/bin/
  CC      miscutils/ionice.o
miscutils/ionice.c: In function `ioprio_set':
miscutils/ionice.c:16: error: `SYS_ioprio_set' undeclared (first use in this function)
miscutils/ionice.c:16: error: (Each undeclared identifier is reported only once
miscutils/ionice.c:16: error: for each function it appears in.)
miscutils/ionice.c: In function `ioprio_get':
miscutils/ionice.c:21: error: `SYS_ioprio_get' undeclared (first use in this function)
make[1]: *** [miscutils/ionice.o] エラー 1
make: *** [miscutils] エラー 2

除外。

Miscellaneous Utilities  ---> 
[ ] ionice  
  CC      util-linux/acpid.o
util-linux/acpid.c: In function `acpid_main':
util-linux/acpid.c:145: error: `EV_SW' undeclared (first use in this function)
util-linux/acpid.c:145: error: (Each undeclared identifier is reported only once
util-linux/acpid.c:145: error: for each function it appears in.)
util-linux/acpid.c:146: error: `SW_LID' undeclared (first use in this function)
make[1]: *** [util-linux/acpid.o] エラー 1
make: *** [util-linux] エラー 2

除外。

Linux System Utilities  ---> 
[ ] acpid 
  CC      util-linux/mount.o
util-linux/mount.c:526:2: #error "You need to build uClibc with UCLIBC_HAS_RPC for NFS support."
make[1]: *** [util-linux/mount.o] エラー 1
make: *** [util-linux] エラー 2

toolchainの問題か... orz
除外。

Linux System Utilities  ---> 
[*] mount  
[ ]   Support mounting NFS file systems
/opt/buildroot-gcc346/mipsel-linux-uclibc/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /opt/buildroot-mipsel-r18398/toolchain_build_mipsel_nofpu/binutils-2.16.1/bfd/elfxx-mips.c:2562
networking/lib.a(inetd.o): In function `register_rpc':
inetd.c:(.text.register_rpc+0x84): undefined reference to `pmap_unset'
inetd.c:(.text.register_rpc+0xa0): undefined reference to `pmap_set'
networking/lib.a(inetd.o): In function `unregister_rpc':
inetd.c:(.text.unregister_rpc+0x3c): undefined reference to `pmap_unset'
networking/lib.a(inetd.o): In function `prepare_socket_fd':
inetd.c:(.text.prepare_socket_fd+0x104): undefined reference to `bindresvport'
networking/lib.a(inetd.o): In function `reread_config_file':
inetd.c:(.text.reread_config_file+0xb40): undefined reference to `getrpcbyname'
shell/lib.a(ash.o): In function `forkshell':
ash.c:(.text.forkshell+0x30): undefined reference to `BUG_fork_is_unavailable_on_nommu'
collect2: ld returned 1 exit status
make: *** [busybox_unstripped] エラー 1

なんだよ。
inetdを削除。

Networking Utilities  ---> 
[ ] inetd  
/opt/buildroot-gcc346/mipsel-linux-uclibc/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /opt/buildroot-mipsel-r18398/toolchain_build_mipsel_nofpu/binutils-2.16.1/bfd/elfxx-mips.c:2562
shell/lib.a(ash.o): In function `forkshell':
ash.c:(.text.forkshell+0x30): undefined reference to `BUG_fork_is_unavailable_on_nommu'
collect2: ld returned 1 exit status
make: *** [busybox_unstripped] エラー 1

ashが通らないのかよ...
toolchain糞。

Shells  --->  
Choose your default shell (hush)  --->  
[ ] ash
  CC      networking/tftp.o
networking/tftp.c: In function `tftpd_main':
networking/tftp.c:635: warning: 'local_file' might be used uninitialized in this function

これは問題なさそう。

  CC      networking/libiproute/ll_proto.o
networking/libiproute/ll_proto.c:24:2: warning: #warning de-bloat

これも。


できた。

# file busybox
busybox: ELF 32-bit LSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, stripped