####### # # 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. # # 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 # or at . # See also , # , # , # , # and . # ####### # «.busybox-1.2.0» (to "busybox-1.2.0") # «.ash-redirection» (to "ash-redirection") # (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();") ##### # # 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") cat > /tmp/bb/etc/issue.net <<'%%%' Debian GNU/Linux 3.1 initrd %t %%% # /tmp/bb/usr/sbin/chroot ~/usrc/busybox-1.00/ # Local Variables: # coding: no-conversion # modes: (fundamental-mode sh-mode) # ee-delimiter-hash: "\n#\n" # ee-delimiter-percent: "\n%\n" # ee-anchor-format: "«%s»" # End: