FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 03-19-2011, 10:02 AM
Michael Tokarev
 
Default create links in initramfs to busybox with other names if not already exist

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hooks/zz-busybox | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/hooks/zz-busybox b/hooks/zz-busybox
index d6dd3f5..1846376 100755
--- a/hooks/zz-busybox
+++ b/hooks/zz-busybox
@@ -22,4 +22,13 @@ if [ "${BUSYBOX}" != "n" ] && [ -e ${BUSYBOXDIR}/busybox ]; then
rm -f ${DESTDIR}/bin/busybox
copy_exec ${BUSYBOXDIR}/busybox /bin/busybox
ln -s busybox ${DESTDIR}/bin/sh
+ # Create links with other names if not already exist
+ # (for this to work this hook should be the last)
+ # Current busybox may come without --list[-full] support
+ for link in $(${BUSYBOXDIR}/busybox --list-full 2>/dev/null); do
+ if [ ! -e "${DESTDIR}/$link" ]; then
+ [ -d "${DESTDIR}/${link%/*}" ] || mkdir -p "${DESTDIR}/${link%/*}"
+ ln -s /bin/busybox "${DESTDIR}/$link"
+ fi
+ done
fi
--
1.7.2.3


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1300532524-25825-6-git-send-email-mjt@msgid.tls.msk.ru">http://lists.debian.org/1300532524-25825-6-git-send-email-mjt@msgid.tls.msk.ru
 
Old 04-08-2011, 11:13 AM
maximilian attems
 
Default create links in initramfs to busybox with other names if not already exist

On Sat, 19 Mar 2011, Michael Tokarev wrote:

>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> hooks/zz-busybox | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/hooks/zz-busybox b/hooks/zz-busybox
> index d6dd3f5..1846376 100755
> --- a/hooks/zz-busybox
> +++ b/hooks/zz-busybox
> @@ -22,4 +22,13 @@ if [ "${BUSYBOX}" != "n" ] && [ -e ${BUSYBOXDIR}/busybox ]; then
> rm -f ${DESTDIR}/bin/busybox
> copy_exec ${BUSYBOXDIR}/busybox /bin/busybox
> ln -s busybox ${DESTDIR}/bin/sh
> + # Create links with other names if not already exist
> + # (for this to work this hook should be the last)
> + # Current busybox may come without --list[-full] support
> + for link in $(${BUSYBOXDIR}/busybox --list-full 2>/dev/null); do
> + if [ ! -e "${DESTDIR}/$link" ]; then
> + [ -d "${DESTDIR}/${link%/*}" ] || mkdir -p "${DESTDIR}/${link%/*}"
> + ln -s /bin/busybox "${DESTDIR}/$link"
> + fi
> + done
> fi

hmmmm
Care to explain the "beauty" of aboves compared to STANDALONE_SHELL
simplicity?

--
maks


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110408111359.GD32269@stro.at">http://lists.debian.org/20110408111359.GD32269@stro.at
 
Old 04-08-2011, 06:03 PM
Michael Tokarev
 
Default create links in initramfs to busybox with other names if not already exist

08.04.2011 15:13, maximilian attems wrote:
> On Sat, 19 Mar 2011, Michael Tokarev wrote:
>
[]
>> + for link in $(${BUSYBOXDIR}/busybox --list-full 2>/dev/null); do
>> + if [ ! -e "${DESTDIR}/$link" ]; then
>> + [ -d "${DESTDIR}/${link%/*}" ] || mkdir -p "${DESTDIR}/${link%/*}"
>> + ln -s /bin/busybox "${DESTDIR}/$link"
>> + fi
>> + done
>
> hmmmm
> Care to explain the "beauty" of aboves compared to STANDALONE_SHELL
> simplicity?

Yes, easily. The above way we can control which implementations
are used. With CONFIG_STANDALONE_SHELL (which this whole thing
tries to remove) if something is built into busybox it gets
executed, no matter if the actual utility may be not from busybox.

Consider for example module-init-tools - if I enable modprobe in
busybox it will be used no matter which implementation you actually
put into initramfs.

It is also quite unnatural, so to say, - to provide an utility with
some extended arguments/features and wonder why it fails when you
run it in initramfs or whatever else busybox is used.

Note the patch above creates links to busybox only when there's
no alternative implementation already available in initramfs.
In other words, it gives us a choice -- either use busybox
implementation or whatever else user may have wish to use.

Later on, continuing modprobe example again, we can make
module-init-tools initramfs hook optional (conditional),
controlled by presense of busybox and a configuration
variable for example.

That's the whole reason of the change - to make busybox
to act as any other regular command does, and provide
what a user actually expects.

Thanks!

/mjt


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4D9F4DDF.2090606@msgid.tls.msk.ru">http://lists.debian.org/4D9F4DDF.2090606@msgid.tls.msk.ru
 

Thread Tools




All times are GMT. The time now is 10:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org