User:Yogi.123/update busybox
From ReelBox Maniacs
[edit] update busybox to current version
- Version is 1.1.2, there are some enhancements and fixes in svn
- (my) main reason for updating is making busybox httpd work with php cgi
- But there are also some other enhancements to 1.0, i'd like to see (f.e. e2fsprogs, less, ...)
[edit] ToDo
[edit] Grab current sources from svn
- Done:
[edit] setup configuration to match ReelBox's needs plus more features
- Done:
- be aware of special build configuration needs for running cgi
- make menuconfig -> networking -> httpd
- see configs below
[edit] compile and give php(4|5) a try
- Done:
- This is working perfectly now, needs to setup a httpd.conf:
- Echo "*.php:/opt/bin/php" > <conffile>
- httpd -c <conffile> -h <docroot>
- Files like <docroot>/cg-bin/*.php are run as cgi then
- See busybox/networking/httpd.c source for more information about the configuration file
[edit] verify and adapt rmm patches to busybox
- Done:
- Rules.mak:
- still valid, conditional compilersettings etc. only
- adapted pacht see Yogi.123/update busybox/busybox-Rules.diff
- applets/applets.c:
- #include "config.h" Fixed in rev 11433
- networking/telnet.c:
- scripting, obsolete, included rev 10886
- syslog:
- add -p option, still valid
- see original patch
- adapted patch see Yogi.123/update busybox/busybox-syslog-p.diff
- include/usage.h
- sysklogd/syslogd.c
The patches in archiv/reel-diffs/busybox-*.diff are not handled version dependent
- create empty busybox-applet.diff and busybox-telnetfix.diff
- overwrite src/archiv/reel-diffs/busybox-*.diff
- don't have to touch src/build/inc/busybox.mk
[edit] Check external binaries to be replaced possibly
| binary | bytes | replace | comment |
| eject | no | does not support -t (close) -x (drive speed) | |
| nice | 15920 | yes | new |
| sort | yes | it's in today, flielist-misc-* error | |
| stat | 28468 | yes | new |
| fsck | 18700 | yes | new, e2fsprogs |
| fsck.ext2 | yes | new, e2fsprogs | |
| fsck.ext3 | yes | new, e2fsprogs | |
| mkfs.ext2 | yes | new, e2fsprogs | |
| mkfs.ext3 | yes | new, e2fsprogs | |
| libe2p | yes | new, e2fsprogs | |
| libext2fs | yes | new, e2fsprogs | |
| libcom_err | yes | new, e2fsprogs | |
| libblkid | yes | new, e2fsprogs | |
| libuuid | no | this is used by mkfs.jfs, fsck.js and mkfs.reiserfs |
[edit] Create / copy .config(s)
Done: We are going to have thre configuration files for busybox: for flash, boot/initrd and docimage
- flash requirements
- see origninal file: ./reelbox/src/build/cdimage/flash/busybox-config-1.00
- init, ash, echo, printf, insmod, rmmod, fdisk, mount, umount, mkfs.minix, cp, dd, chmod, reboot, sync, sleep, usleep, test
- while we are at it: external binaries used
- memsettings, reelfpctl1, dformat, lilo, avr_flasher, eject, currently unused: rtl_prog for Realtek 8139
- boot/initrd requirements
- see original file ./reelbox/src/build/docimage/initrd/busybox-config-1.00
- init, ash, insmod, mount, fsck.minix, pivot_root, chroot, echo
- docimage requirements
- see orginal file: ./reelbox/src/build/docimage/busybox-config-1.00
- does not require init, enables a lot of applets (remember correct httpd settings!)
[edit] Check libs used by busybox
- Done:
- just to make shure: old and new are the same
[edit] Create patches for rmm svn copy
Done:
- reelbox/src/build/versions.mk
- reelbox/src/build/scripts/filelist-????-gentoo.2006.0, see external binaries to be replaced
- there are some inconsistencies in the filelists for gentoo. See below.
[edit] Place new busybox source tarball in downloads/
- Done:
[edit] Build patched image
This is only to see, what happens in general - the current image size differs because of some filelist cleanup and several changes to lot's of files. A current build of rmm912 + bb14763 comes along with an iso image of 29915136 bytes.
did a first shot not worrying about e2fprogs
- image size before changes: 30251008
- image size with new bb: 30294016
second shot with e2fsprogs disabled in filelist-* (not libuuid.so -> used by jfs)
- image size with this bb: 30212096
[edit] Test image
After filelist-????-gentoo-2006.0 cleanup (rmm svn 904) and applying the e2fsprogs related patches to these filelists, the image is up and running. vdr crashes when going to standby mode like it does with other current images.
Tested (in sequence):
| fdisk /dev/sda | ok |
| mkfs.jfs /dev/sda1 | ok |
| fsck /dev/sda1 | ok |
| mkfs.ext2 /dev/sda1 | ok |
| fsck /dev/sda1 | ok |
| mkfs.ext3 /dev/sda1 | ok |
| fsck /dev/sda1 | ok |
| cat /etc/sysconfig|sort -u | ok |
| sort -n -r -t":" -k 2 astra.conf | ok |
| stat /etc/sysconfig | ok |
| stat /dev/hdc | ok |
| nice -n 19 stat /dev/hdc | ok |
So busybox applets seem to be ok. I did some zapping, setup, menu, mp3 playing and epg actions. No strange this happened.
Hopefully, there are no other side effects. This needs some more testing anyway.
[edit] Makeup decision about version to use (1.1.2 or svn)
- First go is svn, 1.2 is announced for june, which will be supported as next stable release.
[edit] get it straight
To build an image with busybox from svn, you may grab all you need from svn://ipkg.reelbox-maniacs.org/ipkg/trunk/patches/busybox and run patch.sh (look at the file for paramters).
If you want to get a fresh version of bb right of the cellar, here's what to prepare:
| Code: get the source |
# goto your busybox svn working copy directory cd ./busybox svn up #if this is your first time to get busybox, try #svn co svn://busybox.net/trunk/busybox |
| Code: verfiy that patches apply cleanly |
cat ~/rick/trunk/patch/change-busybox/files/build-patches/busybox-Rules.diff | patch -p1 cat ~/rick/trunk/patch/change-busybox/files/build-patches/busybox-syslog-p.diff | patch -p1 rm Rules.mak* include/usage.h* sysklogd/syslogd.c* svn up # resolve problems, if any and try again |
| Code: verify and apply configuration |
# # configuration for flash CD first cp ~/rick/trunk/patch/change-busybox/files/build-configs/cdimage/flash/busybox-config-svn .config make oldconfig # make sure to save necessary updates cp .config ~/rick/trunk/patch/change-busybox/files/build-configs/cdimage/flash/busybox-config-svn # # configuration fuer /boot/initrd next cp ~/rick/trunk/patch/change-busybox/files/build-configs/docimage/initrd/busybox-config-svn .config make oldconfig # make sure to save necessary updates cp .config ~/rick/trunk/patch/change-busybox/files/build-configs/docimage/initrd/busybox-config-svn # # configuration fuer docimage / last cp ~/rick/trunk/patch/change-busybox/files/build-configs/docimage/busybox-config-svn .config make oldconfig # make sure to save necessary updates cp .config ~/rick/trunk/patch/change-busybox/files/build-configs/docimage/busybox-config-svn |
| Code: create tarball for rmm svn |
# # cleanup current busybox tree, create a tarball # and copy it to the rmm svn make distclean cd .. rm -f busybox-svn ln -sf busybox busybox-svn tar -czf busybox-svn.tar.gz --exclude .svn busybox-svn/* mv busybox-svn.tar.gz ~/rick/trunk/patch/change-busybox/files/ # # run patch.sh cd ~/rick/trunk/patch/change-busybox/ ./patch.sh profilename /home/reelbox |
Now your copy of the rmm svn tree is ready for building a new iso image with a brandnew version of busybox.
To clean your rmm svn copy, run
| Code: svn cleanup to get rid of the busybox update patches |
cd ~/rick/trunk/patch/change-busybox ./patch.sh del /home/reelbox cd /home/reelbox svn up # you may also want to delete some build time files # rm downloads/precompiled-* # rm -r reelbox/temp |

