gobox とは
"Something like busybox in pure Go"
https://github.com/surma/gobox
「ピュアGoで書かれたbusybox風の何か」
インストール
go get github.com/surma/gobox
$GOROOT/bin に実行ファイルができていました。
$ ls -lh ~/go/bin/gobox
-rwxrwxr-x 1 koba koba 7.3M Apr 9 05:33 /home/koba/go/bin/gobox
$ file ~/go/bin/gobox
/home/koba/go/bin/gobox: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, not stripped
strip したらサイズは4.7MBになりました。
$ cp ~/go/bin/gobox .
$ cp gobox gobox.unstripped
$ strip gobox
$ ls -lh gobox*
-rwxrwxr-x 1 koba koba 4.7M Apr 9 05:41 gobox
-rwxrwxr-x 1 koba koba 7.3M Apr 9 05:40 gobox.unstripped
$ ./gobox
`gobox` [options]
-help
Show help
-install string
Create symlinks for applets in given path
-list
List applets
Version 0.3.1
List of compiled applets:
zcat, sh, mount, chroot, httpd, mknod, ps, umount, mkdir, grep, ls, rm, wget, kill, cat, head, gzip, gunzip, echo, shell, telnetd, gobox,
使えるコマンドはまだこれだけ。でもなんか面白そう。
意地でもgolangだけでrootfsを作りたいときに。