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

Re: [PATCH 5/5] 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


Reply to: