Skip to content

Commit

Permalink
dd-refactor: dracut + build bits
Browse files Browse the repository at this point in the history
Here's where we actually modify stuff to use `driver_updates.py`:

* Parse commandline options to /tmp/dd_{net,disk,interactive,todo}
* Generate udev rules etc. in `driver-updates-genrules.sh`
* `fetch-driver-net.sh`: fetch .iso file and call driver-updates
* Modify `driver-updates@.service`:
  * Use `dmesg -n1` and `/proc/sys/kernel/printk` to hide console messages
  * Make sure we run after vconsole is set up
  * Use `plymouth --hide-splash` rather than `plymouth quit`
    (this is how dracut handles emergency shells)
* Drop `driver-updates.sh` (which ran driver-updates in `pre-trigger`)
* Drop `driver-updates-net.sh` (`driver_updates.py` handles saving repos)
* Drop old `driver-updates`
* Make necessary changes to `Makefile.am` and `module-setup.sh`
* Add `dracut/test_*.py` to `nosetests.sh`
* `anaconda-lib.sh`: Add `wait_for_dd`, remove `start_driver_update`,
                     fix `run_kickstart` for the new stuff above

Resolves: RHBZ#1084197
Resolves: RHBZ#1164131
Related: RHBZ#1213546
  • Loading branch information
wgwoods committed Jul 9, 2015
1 parent 5657d9c commit 039492f
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 946 deletions.
6 changes: 3 additions & 3 deletions dracut/Makefile.am
Expand Up @@ -44,9 +44,9 @@ dist_dracut_SCRIPTS = module-setup.sh \
parse-anaconda-dd.sh \
fetch-driver-net.sh \
driver-updates@.service \
driver-updates.sh \
driver-updates-net.sh \
driver-updates-genrules.sh \
anaconda-depmod.sh \
driver-updates
driver_updates.py \
test_driver_updates.py

MAINTAINERCLEANFILES = Makefile.in
50 changes: 11 additions & 39 deletions dracut/anaconda-lib.sh
Expand Up @@ -216,39 +216,21 @@ run_kickstart() {
. $hookdir/cmdline/*parse-anaconda-repo.sh
. $hookdir/cmdline/*parse-livenet.sh
. $hookdir/cmdline/*parse-anaconda-dd.sh
case "$repotype" in
http*|ftp|nfs*) do_net=1 ;;
cdrom|hd|bd) do_disk=1 ;;
esac
[ "$root" = "anaconda-auto-cd" ] && do_disk=1

# kickstart Driver Disk Handling
# parse-kickstart may have added network inst.dd entries to the cmdline
# Or it may have written devices to /tmp/dd_ks

# Does network need to be rerun?
dd_args="$(getargs dd= inst.dd=)"
for dd in $dd_args; do
case "${dd%%:*}" in
http|https|ftp|nfs|nfs4)
do_net=1
rm /tmp/dd_net.done
break
;;
esac
done

# Run the driver update UI for disks
if [ -e "/tmp/dd_args_ks" ]; then
# TODO: Seems like this should be a function, a mostly same version is used in 3 places
start_driver_update "Kickstart Driver Update Disk"
rm /tmp/dd_args_ks
fi
# Figure out whether we need to retry disk/net stuff
case "$root" in
anaconda-net:*) do_net=1 ;;
anaconda-disk:*) do_disk=1 ;;
anaconda-auto-cd) do_disk=1 ;;
esac
[ -f /tmp/dd_net ] && do_net=1
[ -f /tmp/dd_disk ] && do_disk=1

# disk: replay udev events to trigger actions
if [ "$do_disk" ]; then
# set up new rules
. $hookdir/pre-trigger/*repo-genrules.sh
. $hookdir/pre-trigger/*driver-updates-genrules.sh
udevadm control --reload
# trigger the rules for all the block devices we see
udevadm trigger --action=change --subsystem-match=block
Expand Down Expand Up @@ -277,16 +259,6 @@ wait_for_updates() {
echo "[ -e /tmp/liveupdates.done ]" > $hookdir/initqueue/finished/updates.sh
}

start_driver_update() {
local title="$1"

tty=$(find_tty)

# save module state
cat /proc/modules > /tmp/dd_modules

info "Starting $title Service on $tty"
systemctl start driver-updates@$tty.service
status=$(systemctl -p ExecMainStatus show driver-updates@$tty.service)
info "DD status=$status"
wait_for_dd() {
echo "[ -e /tmp/dd.done ]" > $hookdir/initqueue/finished/dd.sh
}

0 comments on commit 039492f

Please sign in to comment.