LoginSignup
3
2

More than 5 years have passed since last update.

Gobox (ピュアGoで書かれたbusybox風の何か) を試す

Posted at

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を作りたいときに。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2