Re: [PATCH] Do not override user specified initramfs image name

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

 



Am 13.03.2013 02:48, schrieb Dave Young:
> 
> 
> The code section for setting default initramfs image name is only for
> the case that user has not specified image name argument.
> 
> Moving the code to else section of below:
> 
> if [[ "$1" ]]; then
> ...
> else
> ...
> fi
> 
> Also remove the typo of trailing '}'
> 
> Reported-by: Wim Muskee <wimmuskee@xxxxxxxxx>
> Signed-off-by: Dave Young <dyoung@xxxxxxxxxx>
> ---
> diff --git a/lsinitrd.sh b/lsinitrd.sh
> index 7a09423..fe723f7 100755
> --- a/lsinitrd.sh
> +++ b/lsinitrd.sh
> @@ -54,23 +54,23 @@ if [[ "$1" ]]; then
>          usage
>          exit 1
>      fi
> -fi
> -
> -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
> -
> -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
> -    image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
>  else
> -    image="/boot/initramfs-${KERNEL_VERSION}.img}"
> -fi
> +    [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
>  
> -if ! [[ -f "$image" ]]; then
> -    {
> +    if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
> +        image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
> +    else
> +        image="/boot/initramfs-${KERNEL_VERSION}.img"
> +    fi
> +
> +    if ! [[ -f "$image" ]]; then
> +        {
>          echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
>          echo
> -    } >&2
> -    usage
> -    exit 1
> +        } >&2
> +        usage
> +        exit 1
> +    fi
>  fi
>  
>  CAT=zcat
> 

see
http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=727e68d0b5cb93eb6c6e00f0541b8519657a2597
and
http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=d928724c3cf464a495c11162042951887b80f5e6

already committed on 2013-03-11


--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux