[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#338405: another patch for busybox support



tags 338405 pending
stop

On Mon, Dec 11, 2006 at 07:41:04AM +1100, Russell Coker wrote:
<snipp>
> 
> Strange, I seem to save 250K.  I just extracted the new cpio archive and 
> observe busybox files with 161 hard links.
> 
> My patch is against initramfs-tools version 0.85b, did you test against a 
> different version that might have some other change which conflicts?
 
no i forgot to use your cp "trick",
haven't looked in copy_exec since longer..

> # mkinitramfs.orig 2.6.17-2-xen-686 -o orig
> # mkinitramfs 2.6.17-2-xen-686 -o new
> # ls -l
> total 4660
> -rw-r--r-- 1 root root 2252363 2006-12-11 07:35 new
> -rw-r--r-- 1 root root 2502586 2006-12-11 07:34 orig

yes i can confirm that too:
ls -lt /boot/initrd.img-2.6.18-[23]-686
-rw-r--r-- 1 root root 5182386 2006-12-10 21:46 /boot/initrd.img-2.6.18-3-686
-rw-r--r-- 1 root root 5447271 2006-11-27 10:25 /boot/initrd.img-2.6.18-2-686

> # diff -u /usr/sbin/mkinitramfs.orig /usr/sbin/mkinitramfs
> --- /usr/sbin/mkinitramfs.orig  2006-12-02 15:42:16.000000000 +1100
> +++ /usr/sbin/mkinitramfs       2006-12-11 07:34:49.000000000 +1100
> @@ -228,7 +228,12 @@
>  else
>     rm -f ${DESTDIR}/bin/sh
>     copy_exec ${BUSYBOXDIR}/busybox /bin/busybox
> -   ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh
> +   rm ${DESTDIR}/bin/busybox
> +   cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox
> +   for n in `busybox | tail -19 | tr , \\n | sed -e "s/ \|\t//"|grep .` ; do
> +           ln -f ${DESTDIR}/bin/busybox ${DESTDIR}/bin/$n
> +   done
> +   ln -f ${DESTDIR}/bin/busybox ${DESTDIR}/bin/sh
>  fi
> 
>  # Modutils

using aboves with the modified sed parsing and leaving out the sh line
as already listed in the busybox cmds:

=== modified file 'mkinitramfs'
--- mkinitramfs	2006-12-02 17:51:54 +0000
+++ mkinitramfs	2006-12-10 20:52:17 +0000
@@ -228,7 +228,12 @@
 else
 	rm -f ${DESTDIR}/bin/sh
 	copy_exec ${BUSYBOXDIR}/busybox /bin/busybox
-	ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh
+	rm -f ${DESTDIR}/bin/busybox
+	cp ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/busybox
+	for cmd in `busybox | sed -n '/functions:$/,$p' \
+		| sed  -e 's/[[:space:]]*//g; s/,$//; s/,/\n/g; /busybox/d'`; do
+		ln -f ${DESTDIR}/bin/busybox ${DESTDIR}/bin/${cmd}
+	done
 fi
 
 # Modutils

thanks i'll upload that for 0.85d

--
maks



Reply to: