Re: [PATCH] grubby: Add --dracut cmdline argument to use dracut for --mkinitrd (take 2)

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

 



On 09/09/2009 02:51 PM, Hans de Goede wrote:
> Add --dracut cmdline argument to use dracut for --mkinitrd, this is needed
> for %post generation of dracut initrd's to which we are moving due to
> GPL concerns about shipping pre build initrd's

This looks fine to me.

> ---
>  new-kernel-pkg |   20 +++++++++++++++-----
>  1 files changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/new-kernel-pkg b/new-kernel-pkg
> index bb4cbb1..28e08ce 100755
> --- a/new-kernel-pkg
> +++ b/new-kernel-pkg
> @@ -82,6 +82,7 @@ fi
>  mode=""
>  version=""
>  initrd=""
> +dracut=""
>  initrdfile=""
>  moddep=""
>  verbose=""
> @@ -92,7 +93,7 @@ mbargs=""
>  adddracutargs=""
>  
>  usage() {
> -    echo "Usage: `basename $0` [-v] [--mkinitrd] [--rminitrd]" >&2 
> +    echo "Usage: `basename $0` [-v] [--mkinitrd] [--rminitrd] [--dracut]" >&2 
>      echo "       [--initrdfile=<initrd-image>] [--depmod] [--rmmoddep]" >&2
>      echo "       [--kernel-args=<args>] [--remove-args=<args>]" >&2 
>      echo "       [--banner=<banner>] [--multiboot=multiboot]" >&2
> @@ -269,7 +270,7 @@ update() {
>  }
>  
>  mkinitrd() {
> -    if [ -n "$USEDRACUT" -a -x /sbin/dracut ]; then
> +    if [ -n "$dracut" ]; then
>          tool="/sbin/dracut -f $initrdfile $version"
>      else
>  	tool="/sbin/mkinitrd --allow-missing -f $initrdfile $version"
> @@ -309,6 +310,10 @@ while [ $# -gt 0 ]; do
>  	    initrd="remove"
>  	    ;;
>  
> +	--dracut)
> +	    dracut=--dracut
> +	    ;;
> +
>  	--initrdfile*)
>  	    if echo $1 | grep '=' >/dev/null ; then
>  	    	initrdfile=`echo $1 | sed 's/^--initrdfile=//'`
> @@ -432,17 +437,22 @@ fi
>  
>  # set the initrd file based on arch; ia64 is the only currently known oddball
>  if [ -z "$initrdfile" ]; then
> +    INITRD_NAME_PREFIX="initrd"
> +    if [ -n "$dracut" ]; then
> +       INITRD_NAME_PREFIX="dracut"
> +    fi
> +
>      if [ `uname -m` = "ia64" ]; then
> -	initrdfile="/boot/efi/EFI/redhat/initrd-$version.img"
> +       initrdfile="/boot/efi/EFI/redhat/$INITRD_NAME_PREFIX-$version.img"
>      else
> -	initrdfile="/boot/initrd-$version.img"
> +       initrdfile="/boot/$INITRD_NAME_PREFIX-$version.img"
>      fi
>  
>  fi
>  [ -n "$verbose" ] && echo "initrdfile is $initrdfile"
>  
>  # add dracut i18n, keyboard and plymouth kernel args if requested
> -if [ -n "$adddracutargs" ]; then
> +if [ -n "$dracut" -o -n "$adddracutargs" ]; then
>      [ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard 
>      [ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
>  


-- 
        Peter

Power corrupts.  Absolute power is kind of neat.
		-- John Lehman, Secretary of the Navy, 1981-1987

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux