Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
####### # # E-scripts on busybox # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # An introduction to eev can be found here: # # (find-eev-quick-intro) # http://angg.twu.net/eev-intros/find-eev-quick-intro.html # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at <http://angg.twu.net/e/init.e> # or at <http://angg.twu.net/e/init.e.html>. # See also <http://angg.twu.net/emacs.html>, # <http://angg.twu.net/.emacs[.html]>, # <http://angg.twu.net/.zshrc[.html]>, # <http://angg.twu.net/escripts.html>, # and <http://angg.twu.net/>. # ####### # «.busybox-git» (to "busybox-git") # «.busybox-deb» (to "busybox-deb") # «.busybox-1.2.0» (to "busybox-1.2.0") # «.ash-redirection» (to "ash-redirection") # «.busybox-deb-src» (to "busybox-deb-src") ##### # # busybox-git (broken) # 2019sep06 # ##### # «busybox-git» (to ".busybox-git") # https://busybox.net # https://busybox.net/downloads/ # https://git.busybox.net/busybox/tree/?h=1_31_stable # https://git.busybox.net/busybox * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) rm -Rfv ~/usrc/busybox/ cd ~/usrc/ git clone https://git.busybox.net/busybox cd ~/usrc/busybox/ git branch --list -a git for-each-ref PAGER=cat git log --oneline --graph --all -20 # (find-fline "~/usrc/") # (find-fline "~/usrc/busybox/") # (find-gitk "~/usrc/busybox/") # (code-c-d "busybox" "~/usrc/busybox/") # (find-busyboxfile "") ##### # # busybox-deb # 2019sep04 # ##### # «busybox-deb» (to ".busybox-deb") # (find-status "busybox") # (find-vldifile "busybox.list") # (find-udfile "busybox/") # (find-man "1 busybox") # (find-udfile "busybox/BusyBox.txt.gz" "\n init\n") # (find-udfile "busybox/BusyBox.txt.gz" "\n init\n" "controlling tty") # http://ftp.debian.org/debian/pool/main/b/busybox/busybox_0.60.5-2.2.dsc #* rm -Rv ~/usrc/busybox/ mkdir ~/usrc/busybox/ cd ~/usrc/busybox/ dpkg-source -x \ $S/http/ftp.debian.org/debian/pool/main/b/busybox/busybox_0.60.5-2.2.dsc #* # (code-c-d "busybox" "~/usrc/busybox/busybox-0.60.5/") # (find-busyboxfile "") # (find-busyboxfile "telnet.c") # (find-busyboxfile "init.c" "static void set_term(int fd)") # (find-busyboxfile "init.c" "setsid();") # (find-man "file") cd /usr/bin/ file * # (find-sh "cd /usr/bin/ && file *") # (find-sh "cd /usr/bin/ && file * | grep script") # (find-fline "/usr/bin/") # (find-fline "/usr/bin/" "apt-key") # (find-sh "busybox") # (find-sh "busybox --list") # (find-sh "busybox --list | gsub.lua '.+' '# (find-sh \"busybox --help %1\")'") # (find-sh "busybox --help ar") # (find-sh "busybox --help adjtimex") # (find-sh "busybox ar") # (find-sh "busybox adjtimex --help") # (find-gawknode "Getline/File") # (find-man "ar") [ [[ acpid adjtimex ar arp arping ash awk basename blockdev brctl bunzip2 bzcat bzip2 cal cat chgrp chmod chown chroot chvt clear cmp cp cpio cttyhack cut date dc dd deallocvt depmod devmem df diff dirname dmesg dnsdomainname dos2unix du dumpkmap dumpleases echo egrep env expand expr false fgrep find fold free freeramdisk fstrim ftpget ftpput getopt getty grep groups gunzip gzip halt head hexdump hostid hostname httpd hwclock id ifconfig init insmod ionice ip ipcalc kill killall klogd last less ln loadfont loadkmap logger login logname logread losetup ls lsmod lzcat lzma lzop lzopcat md5sum mdev microcom mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount mt mv nameif nc netstat nslookup od openvt patch pidof ping ping6 pivot_root poweroff printf ps pwd rdate readlink realpath reboot renice reset rev rm rmdir rmmod route rpm rpm2cpio run-parts sed seq setkeycodes setsid sh sha1sum sha256sum sha512sum sleep sort start-stop-daemon stat strings stty swapoff swapon switch_root sync sysctl syslogd tac tail tar taskset tee telnet test tftp time timeout top touch tr traceroute traceroute6 true tty udhcpc udhcpd umount uname uncompress unexpand uniq unix2dos unlzma unlzop unxz unzip uptime usleep uudecode uuencode vconfig vi watch watchdog wc wget which who whoami xargs xz xzcat yes zcat * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) # (find-man "cat") ##### # # busybox-deb-src # 2019sep04 # ##### # «busybox-deb-src» (to ".busybox-deb-src") # (find-apt-get-source-links "busybox") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) # (find-sh "apt-cache show busybox") # (find-sh "apt-cache showsrc busybox") rm -Rv /tmp/d/ mkdir /tmp/d/ cd /tmp/d/ sudo apt-get build-dep -y busybox apt-get source busybox 2>&1 | tee osource apt-get source --build busybox 2>&1 | tee osourceb NOTICE: 'busybox' packaging is maintained in the 'Git' version control system at: https://anonscm.debian.org/git/d-i/busybox.git # (find-fline "/tmp/d/") # (find-fline "/tmp/d/busybox-1.22.0/") # (code-c-d "busyboxdebsrc" "/tmp/d/busybox-1.22.0/") # (find-busyboxdebsrcfile "") # (find-busyboxdebsrcfile "findutils/find.c") ##### # # busybox 1.00 # 2005feb17 # ##### # http://www.busybox.net/downloads/busybox-1.00.tar.gz # (find-busyboxfile "loginutils/") # (find-busyboxfile "loginutils/vlock.c") #* rm -Rv ~/usrc/busybox-1.00/ tar -C ~/usrc/ -xvzf $S/http/www.busybox.net/downloads/busybox-1.00.tar.gz #* cd ~/usrc/busybox-1.00/ make menuconfig #* cd ~/usrc/busybox-1.00/ cp -iv ~/BUSYBOX/config-1.00 .config #* cd ~/usrc/busybox-1.00/ make dep |& tee omd make |& tee om #* # (code-c-d "busybox" "~/usrc/busybox-1.00/") # (find-busyboxfile "") # (find-busyboxfile "INSTALL") # (find-busyboxfile "busybox.links") #* umount /tmp/bb/dev/pts umount /tmp/bb/dev umount /tmp/bb/proc #* rm -Rv /tmp/bb/ mkdir /tmp/bb/ cd /tmp/bb/ mkdir /tmp/bb/bin mkdir /tmp/bb/sbin mkdir /tmp/bb/usr mkdir /tmp/bb/usr/bin mkdir /tmp/bb/usr/sbin cp -v ~/usrc/busybox-1.00/busybox /tmp/bb/bin/busybox for i in $(cut -b2- ~/usrc/busybox-1.00/busybox.links); do ln /tmp/bb/bin/busybox /tmp/bb/$i done #* igetlibs () { { for i in $*; do ldd $i; done; } | awk '{print $3}' | sort | uniq; } iaddfiles () { cp --parents -v $* /tmp/bb/; } iaddlibsfor () { iaddfiles $(igetlibs $*); } iaddlibsfor /tmp/bb/bin/busybox #* mkdir /tmp/bb/etc/ cat > /tmp/bb/etc/passwd <<'%%%' root:$1$iNoPuw.c$hcdKc.rOAaXJ/6TGaGOGo0:0:0:root:/:/bin/sh edrx:$1$uTh4JVZJ$MK5FyVCC3unb.EzMuTIBq0:1000:1000:edrx,,,:/:/bin/sh aleph:$1$ulSHqf1v$YX/K9IPHs6EH3yV.4sD0i/:1001:1001:aleph,,,:/:/bin/sh beth:$1$RSXXvlfG$Vc31nH63tOsdpAwp4k.ne1:1002:1002:beth,,,:/:/bin/sh r::0:0:root:/:/bin/sh e::1000:1000:edrx,,,:/:/bin/sh %%% mkdir /tmp/bb/dev/ mkdir /tmp/bb/proc/ mount -t devfs bbdev /tmp/bb/dev mount -t proc bbproc /tmp/bb/proc mount -t devpts bbddevpts /tmp/bb/dev/pts #* chroot /tmp/bb bin/login #* # Needs to be run as root # (ee-once (eeb-gdb-start "/tmp/bb/usr/sbin/" "chroot")) set args /tmp/bb /bin/login br main br applets.c:164 br chroot_main run #* ##### # # busybox 1.2.0 # 2006jul14 # ##### # «busybox-1.2.0» (to ".busybox-1.2.0") # http://www.busybox.net/ # http://www.busybox.net/downloads/busybox-1.2.0.tar.bz2 #* rm -Rv ~/usrc/busybox-1.2.0/ tar -C ~/usrc/ -xvjf $S/http/www.busybox.net/downloads/busybox-1.2.0.tar.bz2 #* cd ~/usrc/busybox-1.2.0/ make menuconfig # (find-fline "~/usrc/busybox-1.2.0/.config") # (find-fline "~/BUSYBOX/config-1.2.0") # (find-sh0 "cp -v ~/usrc/busybox-1.2.0/.config ~/BUSYBOX/config-1.2.0") #* cd ~/usrc/busybox-1.2.0/ cp -iv ~/BUSYBOX/config-1.2.0 .config #* cd ~/usrc/busybox-1.2.0/ make dep |& tee omd make |& tee om #* ##### # # redirections in ash # 2006aug03 # ##### # «ash-redirection» (to ".ash-redirection") # (find-es "bash" "pipe_stdout_stderr") # (find-es "bash" "redirection") # (find-busyboxfile "shell/ash.c") # (find-busyboxfile "shell/ash.c" "check for redirection") # (find-busyboxfile "shell/ash.c" "If the token is TREDIR") # (find-busyboxfile "shell/ash.c" "Parse a redirection operator") # (find-busyboxfile "shell/ash.c" "Code for dealing with input/output redirection") # (find-busyboxfile "shell/ash.c" "openredirect(union node *redir)") # (find-busyboxfile "shell/ash.c" "dupredirect(union node *redir, int f)") # (find-busyboxfile "shell/ash.c" "redirect(union node *redir, int flags)") # (find-busyboxfile "shell/ash.c" "shcmd(union node *cmd, FILE *fp)") # (find-busyboxgrep "grep -nH -e edirect shell/*") # (find-busyboxgrep "grep -niH -e edir shell/*") # (find-busyboxfile "shell/ash.c" "case NCLOBBER:") # (find-busyboxfile "shell/ash.c" "\nredir:") # (find-busyboxfile "shell/ash.c" "A job is" "single process or" "a pipeline") ##### # # busybox-1.10.1 # 2008may05 # ##### # http://busybox.net/ # http://busybox.net/downloads/busybox-1.10.1.tar.bz2 #* rm -Rv ~/usrc/busybox-1.10.1/ tar -C ~/usrc/ -xvjf \ $S/http/busybox.net/downloads/busybox-1.10.1.tar.bz2 cd ~/usrc/busybox-1.10.1/ find * -type f -name '*.[ch]' | sort > .files.ch etags $(cat .files.ch) #* # (code-c-d "busybox" "~/usrc/busybox-1.10.1/") # (find-busyboxfile "") # (find-busyboxfile ".files.ch") # (find-busyboxfile "networking/telnet.c") # (find-busyboxfile "networking/telnetd.c") # (find-busyboxfile "Makefile.help") ##### # # busybox-1.19.1 # 2011sep02 # ##### # http://busybox.net/downloads/busybox-1.19.1.tar.bz2 #* rm -Rv ~/usrc/busybox-1.19.1/ tar -C ~/usrc/ -xvjf \ $S/http/busybox.net/downloads/busybox-1.19.1.tar.bz2 cd ~/usrc/busybox-1.19.1/ #* # (code-c-d "busybox" "~/usrc/busybox-1.19.1/") # (find-busyboxfile "") # (find-busyboxfile "coreutils/") # (find-busyboxfile "coreutils/md5_sha1_sum.c") # (find-busyboxfile "libbb/") # (find-busyboxfile "libbb/hash_md5_sha.c") # (find-busyboxfile "libbb/hash_md5_sha.c" "md5_begin") # (find-busyboxfile "libbb/hash_md5prime.c" "md5_begin") # (find-busyboxsh "find | sort") cat > /tmp/bb/etc/issue.net <<'%%%' Debian GNU/Linux 3.1 initrd %t %%% #* /tmp/bb/usr/sbin/chroot ~/usrc/busybox-1.00/ "Lua as replacement for Bash scripting" http://lua-users.org/lists/lua-l/2010-07/msg00086.html Idea: add Lua to busybox http://en.wikipedia.org/wiki/Alpine_Linux # Local Variables: # coding: utf-8-unix # modes: (fundamental-mode sh-mode) # End: