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

Re: can someone help me with adding a kickstart flag?



> Soooo, I'm trying to add "--extlinux" ยน as an option to the bootloader
> command. I have the following patches to pykickstart and to anaconda, on
> top of the previously-posted to anaconda-patches ones. I know that the
> previous patches which add extlinux as a commandline option work. And, I
> know that this is _partitially_ working, because if I don't have the patched
> pykickstart in my installer image it errors out with --extlinux being
> invalid. With this code, it silently accepts bootloader --extlinux, but then
> doesn't actually switch from grub.
> 
> I'm probaby doing something really silly, or missing something obvious. I'd
> appreciate if someone could help me figure out where!

Your pykickstart bit looks fine, and you can prove that by running "make
test" or by running ksvalidator against a file containing your new flag.
So it's gotta be something in the integration.

> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index cd6713d..0bad770 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -241,7 +241,7 @@ class AutoPart(commands.autopart.F18_AutoPart):
>  
>          doAutoPartition(storage, ksdata)
>  
> -class Bootloader(commands.bootloader.F18_Bootloader):
> +class Bootloader(commands.bootloader.F19_Bootloader):
>      def execute(self, storage, ksdata, instClass):
>          if self.location == "none":
>              location = None
> @@ -294,6 +294,9 @@ class Bootloader(commands.bootloader.F18_Bootloader):
>          if self.leavebootorder:
>              flags.leavebootorder = True
>  
> +        if self.extlinux:
> +            flags.extlinux = True
> +
>  class BTRFS(commands.btrfs.F17_BTRFS):
>      def execute(self, storage, ksdata, instClass):
>          for b in self.btrfsList:

Your anaconda patch works by modifying get_bootloader to set the
bootloader if a command line argument has been provided.  That happens
really early on.  At the point where bootloader.execute runs, it's too
late.

What might be easiest is if you modify dracut/parse-kickstart instead of
pyanaconda/kickstart.py.  Put in a block for bootloader similar to
what's already there, and have it add the command line argument if the
flag is given in kickstart.  That'd save you from having to write code
to change out the anaconda.bootloader instance.  Who knows what'll go
wrong with that.

> 1. I have no really strong objection to --useExtlinux, like the old
>    --useLilo, but that has always seemed kind of awkward to me, and the
>    other flags aren't consistently verbs. But I'm okay either way if someone
>    does care.

--extlinux is fine.  I always hated the --useLilo capitalization.

Just keep in mind that once this option is in, we'll have to support it
for a good long while.

- Chris


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