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.

due to partial upgrade path and thus the need of support of lvm2 and mdadm
inside of mkinitramfs itself, busybox is kept. klibc shipps dash, which
is a fine sh. the missing parts in klibc-utils are sed, awk or grep that
is used by aboves hooks.

a really stripped down initramfs does not need busybox nor glibc,
as udev and module-init-tools compiles against klibc.
 
> --- 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

ok thanks,
not yet tested but scheduled for 0.85d
bon weekend.

-- 
maks


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to