surma / gobox Goto Github PK
View Code? Open in Web Editor NEWSomething like busybox in pure Go
License: MIT License
Something like busybox in pure Go
License: MIT License
Hi Surma,
I have made a similar project recently called 'someutils' - https://github.com/laher/someutils - having initially seen your project, amongst others.
So, thanks for the inspiration I took from your code - I've linked you on my README because I got good ideas from you.
So, this isn't really an issue but just a heads-up & thanks.
Also, your project came up in the someutils discussion on golang-nuts aswell:
https://groups.google.com/forum/#!topic/golang-nuts/hr6Nnv20_L8
Cheers
would you like to consider making gobox go gettable?
Hello. I'm interesting on this project, but it not works in go1 release.
Can You upgrade code to ability to go get cmd/gobox ?
After that i can add dpkg reader/installer and ar reader
The default list of applets don't output a static binary, and are not able to be chrooted into using only /bin/gobox and symlinks created with -install
And the gobox -install .
command installs correctly if not using a chroot, but it is not a relative path (such as the example file tree below) and therefore links to the pre-chroot path of gobox.
Is there a way to output a static binary with networking features? ๐
A quick ldd returns the following dependencies:
bash-4.3$ ldd /git/gopath/bin/gobox
linux-vdso.so.1 (0x00007ffe14764000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa94151a000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa941151000)
/lib64/ld-linux-x86-64.so.2 (0x000055e35e78f000)
I am using go version go1.6.2 linux/amd64
Here is the filesystem that is able to be chrooted into, after removing the network related applets (telnetd,httpd,wget) and manually creating the correct symbolic links:
.
โโโ bin
โโโ bash -> sh
โโโ cat -> gobox
โโโ echo -> gobox
โโโ gobox
โโโ grep -> gobox
โโโ gunzip -> gobox
โโโ gzip -> gobox
โโโ head -> gobox
โโโ kill -> gobox
โโโ ls -> gobox
โโโ mkdir -> gobox
โโโ mknod -> gobox
โโโ mount -> gobox
โโโ ps -> gobox
โโโ rm -> gobox
โโโ sh -> gobox
โโโ shell -> gobox
โโโ umount -> gobox
โโโ zcat -> gobox
Here is the size difference in case you were curious:
-rwxr-xr-x 1 aerth root 3966408 May 24 00:39 gobox-nonet
-rwxr-xr-x 1 aerth root 8966744 May 24 00:48 gobox-net
# and human form
-rwxr-xr-x 1 aerth root 3.8M May 24 00:39 gobox-nonet
-rwxr-xr-x 1 aerth root 8.6M May 24 00:48 gobox-net
and ldd difference:
bash-4.3$ ldd gobox-net
linux-vdso.so.1 (0x00007ffe1abef000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f33b17aa000)
libc.so.6 => /lib64/libc.so.6 (0x00007f33b13e1000)
/lib64/ld-linux-x86-64.so.2 (0x0000556a98aba000)
bash-4.3$ ldd gobox-nonet
not a dynamic executable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.