Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHEL7 backport of inst.ks=cdrom fixes #235

Merged
merged 5 commits into from Jul 23, 2015

Conversation

wgwoods
Copy link
Contributor

@wgwoods wgwoods commented Jul 22, 2015

This is basically the same as #234, except it turns out that a couple of the pre-requisite commits either never made it to RHEL7 or got dropped in the rebase. So I've added bd99015 and 8e5b65d, and now CDROM-swapping with inst.ks=cdrom should work in RHEL7. Yaaayyyyyyyyy~~~

Add a couple of utility functions:

* tell_user() sends a message to the log and the screen via plymouth; if
  plymouth isn't running we send it to the console instead.

* dev_is_cdrom() tells you whether the given device is a CDROM
  (according to udev).

Related: rhbz#1122104

(cherry picked from commit abfa908)
Apparently this is a thing: some people do installs in secure
environments where they have no network and aren't allowed to use USB
devices; all they can use is optical media. So they have the install
disc, and another cdrom that contains their kickstart.

So: the user boots the install DVD with "inst.ks=cdrom[:/path/ks.cfg]",
and once udev notices the disc we run both fetch-kickstart-disk and
anaconda-diskroot¹.

Normally, anaconda-diskroot would mount the installer DVD here, but we
need to be able to eject it, so anaconda-diskroot instead ignores it and
quietly exits.

Meanwhile, fetch-kickstart-disk tries to grab the kickstart and fails
(because we're looking at the install DVD!), so it asks the user to
insert the CDROM containing the kickstart.

So: when the user ejects the DVD and inserts their kickstart CD,
fetch-kickstart-disk will fetch the kickstart and ask for the install
media back.

Finally, the user re-inserts the DVD, anaconda-diskroot mounts it, and
off we go!

¹I'm assuming the ordering is undefined. It might be predictable in
reality but it's probably better if we don't rely on that.

Resolves: rhbz#1122104
(cherry picked from commit 5d016ef)
Commit 5d016ef added support for doing cdrom-swapping while doing
"inst.ks=cdrom[:...]". But it turns out that if you're slow to swap the
discs, we'll hit dracut's retry timeout and it'll drop to the emergency
shell.

So, in response to User Requests, we now disable the timeout entirely
when using "inst.ks=cdrom[:...]"; dracut will wait forever for the
kickstart and/or installer media, and if anything goes wrong you're just
stuck and you'll need to reset.

Resolves: rhbz#1168902
(cherry picked from commit bc6378b)
fetch-kickstart-disk and anaconda-diskroot are *executed*, not sourced,
so they don't get the default dracut environment, so "$kickstart" isn't
set, so "str_starts $kickstart cdrom" is always false, so the user never
gets any of the "Please insert CDROM containing '$path'..." messages.

Set "$kickstart" from the boot args, and then this all works as
expected.

Related: rhbz#1168902
(cherry picked from commit 672ee4f)
anaconda-lib has the `when_any_cdrom_appears` function for this exact
purpose, so use that instead of handcrafting the udev rule.

Related: rhbz#1168902

(cherry picked from commit fdee9c2)
@vpodzime
Copy link
Contributor

These all look good to me too.

@vpodzime vpodzime added the ACK label Jul 23, 2015
wgwoods added a commit that referenced this pull request Jul 23, 2015
RHEL7 backport of inst.ks=cdrom fixes from master. 3fda43f and 3b64e09 should have been there already - maybe they got lost in the rebase? Either way, cdrom-swapping kickstarts should work now.

Resolves: rhbz#1168902
Resolves: rhbz#1122104
@wgwoods wgwoods merged commit a99c8c5 into rhinstaller:rhel7-branch Jul 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants