[f20-branch/master/rhel7-branch][PATCH] Make sure url and mirrorlist are not set at once

Martin Kolman mkolman at redhat.com
Thu Dec 5 17:40:31 UTC 2013


While looking like a simple fix, this bug is actually quite convoluted. :)

While kickstart already throws a parsing error if you try to use
 --baseurl and --mirrorlist at once, up till now it was still possible
to set both if the method or repo boot options were used together with a kickstart
with url & the --mirrorlist option. Like this, the boot option set ksdata.method.url
and the kickstart command set ksdata.method.mirrorlist. So Yum got both and if the
repos were not in sync it tended to abort the installation.

The attached patch fixes the issue by clearing ksdata.method.mirrorlist if
the repo or method boot options are used.

But it does not end here. If you check out the bug number 1026834,
you might notice that the issue only happens if the old depreciated
method boot option is used and never if repo is used. This is because
of Dracut, which is also parsing the kickstart, but incorrectly.
The parse-kickstart script does not know about the --mirrorlist
option, so it outputs inst.repo=None. This line ends in the
/run/install/cmdline.d/80-kickstart.conf file.

Dracut also detects that method is depreciated, so it prints a warning
and adds and corrects it to repo and outputs the line out to the
/run/install/cmdline.d/75-anaconda-options.conf

Once Anaconda is started, it parses all files command line files
it can fins, including the kernel command line file and _ALL_ files
in /run/install/cmdline.d.

As a result, the Anaconda option parser gets _3_ different valid installation source
options: method (from kernel command line), repo(from 75-anaconda-options.conf) and
         inst.repo (from 80-kickstart.conf)
Even though the options are stored in a dictionary, looks like most of the time
the option parser gets the url and not the None from inst.repo, so both url & mirrorlist
are set as described above.

But why does it work if repo is used instead of method ?

Actually, it doesn't. :) If method is not used, the option parser gets only
repo (set to url provided to the bootoption) and inst.repo (set to None).
Again, by chance, this time the option parser uses the None, so
ksdata.method.url stays None, and ksdata.method.mirrorlist is used for the
installation. _This is wrong._ The mirror list provided by kickstart is
overriding the url provided by the boot option! :) So it works with repo
only due to a bug & depends on dict ordering...

Unfortunately, there doesn't seem to be an easy fix for this. We can't
just stop parsing the url kickstart command in Dracut, as it seems to be used
inside Dracut for some sort of iSCSI initialization. We also can't just stop
parsing the 80-kickstart.conf file in Anaconda because it contains valuable
information, such as which network device was used to boot the system.

Basically, it all boils down to the fact that we are mixing stuff provided
by Dracut Anaconda is interested in with internal Dracut data that Anaconda
should _not_ be processing at all. So to fix it, our Dracut module
needs to be modified to separate Anaconda specific and Dracut specific output.

In short:
* the attached patch fixes the installation abort reported in the bug report
* there is still a less serious issue of Kickstart source overriding
  source provided by a bootoption
* to fix the second issue, changes to our Dracut module will be needed
* we are parsing quite a lot of shady files provided by Dracut directly to
  our boot option dict without any checking



Martin Kolman (1):
  Make sure url and mirrorlist are not set at once (#1026834)

 anaconda | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
1.8.4.2



More information about the anaconda-patches mailing list