Bug#338405: another patch for busybox support
On Sat, 02 Dec 2006, Russell Coker wrote:
> The following will significantly reduce the size of an initramfs when busybox
> is used while also enabling all busybox commands (handy if you have an option
> to run a shell from the initramfs for recovery). In spite of what maks
> thinks, the busybox option is still there, so it should be made to work well.
>
> --- mkinitramfs.orig 2006-12-02 15:42:16.000000000 +1100
> +++ mkinitramfs 2006-12-02 17:25:38.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 /bin/busybox ${DESTDIR}/bin/$n
> + done
> + ln -f /bin/busybox ${DESTDIR}/bin/sh
> fi
>
> # Modutils
remodified aboves busybox cmd listing into:
+ for cmd in `busybox | sed -n '/functions:$/,$p' \
+ | sed -e 's/[[:space:]]*//g; s/,$//; s/,/\n/g; /busybox/d'`; do
nack,
this assumes that the initramfs will created on the same fs
than the / is on, that assumption does not hold.
so for a small initramfs without hacking your best bet is to set
BUSYBOX=n
and have no lvm2 or mdadm around.
--
maks
Reply to: