diff --git a/busybox.changes b/busybox.changes index 4e0f560..12a0ab1 100644 --- a/busybox.changes +++ b/busybox.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 23 15:16:30 CEST 2008 - hare@suse.de + +- Include mkinitrd scriptlets. + ------------------------------------------------------------------- Thu Jan 17 14:30:48 CET 2008 - sassmann@suse.de diff --git a/busybox.spec b/busybox.spec index 7d10b2a..beffdc7 100644 --- a/busybox.spec +++ b/busybox.spec @@ -10,17 +10,20 @@ # norootforbuild + Name: busybox BuildRequires: dietlibc Url: http://www.busybox.net/ Version: 1.8.2 -Release: 1 +Release: 31 Summary: The Swiss Army Knife of Embedded Linux License: GPL v2 or later Group: System/Base AutoReqProv: on Source: http://busybox.net/downloads/%{name}-%{version}.tar.bz2 Source2: busybox.SuSE.config +Source3: mkinitrd-setup.sh +Source4: mkinitrd-boot.sh Patch1: busybox-1.8.2-arping.patch Patch2: busybox-1.8.2-static.patch Patch3: busybox-1.8.2-vi.patch @@ -75,6 +78,9 @@ install applets/install.sh $RPM_BUILD_ROOT/usr/bin/busybox.install install busybox $RPM_BUILD_ROOT/usr/bin install -d $RPM_BUILD_ROOT%_mandir/man1 install -m 644 docs/BusyBox.1 $RPM_BUILD_ROOT%_mandir/man1 +install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts +install -m 755 %{S:3} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-busybox.sh +install -m 755 %{S:4} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-busybox.sh %files %defattr(-,root,root) @@ -84,8 +90,14 @@ install -m 644 docs/BusyBox.1 $RPM_BUILD_ROOT%_mandir/man1 /usr/bin/busybox.install %dir /usr/share/busybox %config /usr/share/busybox/busybox.links +%dir /lib/mkinitrd +%dir /lib/mkinitrd/scripts +/lib/mkinitrd/scripts/setup-busybox.sh +/lib/mkinitrd/scripts/boot-busybox.sh %changelog +* Wed Jul 23 2008 hare@suse.de +- Include mkinitrd scriptlets. * Thu Jan 17 2008 sassmann@suse.de - update to 1.8.2 see http://www.busybox.net/ for full changelog @@ -138,7 +150,7 @@ install -m 644 docs/BusyBox.1 $RPM_BUILD_ROOT%_mandir/man1 - Update to 1.00 final * Tue Aug 17 2004 nashif@suse.de - Update to 1.00-rc3 -* Thu Aug 05 2004 nashif@suse.de +* Fri Aug 06 2004 nashif@suse.de - Update to 1.00-rc2 * Wed Jul 21 2004 nashif@suse.de - Update to 1.00-rc1 @@ -150,7 +162,7 @@ install -m 644 docs/BusyBox.1 $RPM_BUILD_ROOT%_mandir/man1 - Update to 1.0 pre 8 * Wed Feb 11 2004 ro@suse.de - hack to build it on amd64 -* Tue Feb 10 2004 schwab@suse.de +* Wed Feb 11 2004 schwab@suse.de - Fix building on ia64. * Wed Feb 04 2004 kukuk@suse.de - Remove wrong dietlibc requires @@ -200,7 +212,7 @@ install -m 644 docs/BusyBox.1 $RPM_BUILD_ROOT%_mandir/man1 - disabled insmod for all archs except IA32, ARM and SH * Tue Dec 19 2000 nashif@suse.de - Update to 0.48 (Fixes many bugs) -* Mon Nov 27 2000 nashif@suse.de +* Tue Nov 28 2000 nashif@suse.de - Fixed pathes in install script * Tue Nov 07 2000 nashif@suse.de - Added EM_486 and OPEN_MAX fixes diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh new file mode 100644 index 0000000..ee25c82 --- /dev/null +++ b/mkinitrd-boot.sh @@ -0,0 +1,6 @@ +#!/bin/bash +#%stage: setup +#%if: 1 = 2 +#%programs: busybox + +## this is only a dummy script so we see busybox as a feature in the list diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh new file mode 100644 index 0000000..9b36f81 --- /dev/null +++ b/mkinitrd-setup.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# +#%stage: boot +#%depends: progs +# +if use_script busybox; then + if [ ! -x "/usr/bin/busybox" ]; then + echo "[BUSYBOX] No Busybox executable was found" + else + for i in `busybox | grep Curr -A 200 | grep -v "Currently defined f"`; do + DIR=bin + busyfile="${i/,/}" + # skip programs that do not work properly (if they exist) + if [ -e "bin/$busyfile" -o -e "sbin/$busyfile" ]; then + case $busyfile in + # modprobe: breaks udev + # fsck: breaks fsck.ext3 + # umount: does not know -f + # sleep: can only use full integers (no floats) + # init: no need for init in initrd (breaks bootchart) + # cp: missing -v (breaks bootchart) + modprobe|fsck|umount|mount|sleep|init|cp) + continue + ;; + esac + fi + if [ -h "bin/$busyfile" ]; then + # don't process symlinks + continue + elif [ -e "bin/$busyfile" ]; then + verbose "[BUSYBOX] replacing $DIR/$busyfile" + rm -f bin/$busyfile + elif [ -e "sbin/$busyfile" ]; then + DIR=sbin + rm -f sbin/$busyfile + verbose "[BUSYBOX] replacing $DIR/$busyfile" + fi + # we have to remove the copied program files from the + # internal list so we only get shared libs that are + # actually used + declare -i binc + for ((binc=0 ; $binc<${#initrd_bins[@]} ; binc++)); do + ${A##*/} + if [ "${initrd_bins[$binc]##*/}}" = "$busyfile" ]; then + initrd_bins[$binc]='' + fi + done + ln -s ../bin/busybox "$DIR/$busyfile" + done + fi +fi