[PATCH] Use shell code to work around missing basename

Brian C. Lane bcl at redhat.com
Tue Aug 14 23:41:41 UTC 2012


On Tue, Aug 14, 2012 at 03:58:16PM -0700, Jesse Keating wrote:
> Basename got removed from dracut land.  This was our only use of it so
> use shell built ins to accomplish the same thing.  Sadly you cannot
> strip both prefix and suffix at the same time, so take a two step
> approach.
> ---
>  dracut/anaconda-modprobe.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/dracut/anaconda-modprobe.sh b/dracut/anaconda-modprobe.sh
> index 20f173f..a14d27a 100644
> --- a/dracut/anaconda-modprobe.sh
> +++ b/dracut/anaconda-modprobe.sh
> @@ -7,7 +7,10 @@ MODULE_LIST="cramfs squashfs iscsi_tcp "
>  
>  SCSI_MODULES=/lib/modules/$KERNEL/kernel/drivers/scsi/device_handler/
>  for m in $SCSI_MODULES/*.ko; do
> -    MODULE_LIST+=" `basename $m .ko` "
> +    # Shell spew to work around not having basename
> +    # Trim the paths off the prefix, then the . suffix
> +    a="${m##*/}"
> +    MODULE_LIST+=" ${a%*.}"
>  done
>  
>  if [ "$ARCH" != "s390" -a "$ARCH" != "s390x" ]; then
> -- 
> 1.7.11.2

Ack.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20120814/14a16880/attachment-0001.sig>


More information about the anaconda-patches mailing list