2014-04-07 12:38:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# parse-anaconda-dd.sh: handle driver update disk settings
|
|
|
|
|
2016-04-10 04:00:00 +00:00
|
|
|
# Creates the following files:
|
|
|
|
# /tmp/dd_net: list of URLs to fetch
|
|
|
|
# /tmp/dd_disk: list of disk devices to load from
|
|
|
|
# /tmp/dd_interactive: "menu" if interactive mode requested
|
|
|
|
# /tmp/dd_todo: concatenation of the above files
|
2014-04-07 12:38:09 +00:00
|
|
|
|
2016-04-10 04:00:00 +00:00
|
|
|
# clear everything to ensure idempotency
|
|
|
|
rm -f /tmp/dd_interactive /tmp/dd_net /tmp/dd_disk /tmp/dd_todo
|
2014-04-07 12:38:09 +00:00
|
|
|
|
2016-04-10 04:00:00 +00:00
|
|
|
# parse any dd/inst.dd args found
|
|
|
|
for dd in $(getargs dd= inst.dd=); do
|
|
|
|
case "$dd" in
|
|
|
|
# plain 'dd'/'inst.dd': Engage interactive mode!
|
|
|
|
dd|inst.dd) echo menu > /tmp/dd_interactive ;;
|
|
|
|
# network URLs: add to dd_net
|
|
|
|
http:*|https:*|ftp:*|nfs:*|nfs4:*) echo $dd >> /tmp/dd_net ;;
|
|
|
|
# disks: strip "cdrom:" or "hd:" and add to dd_disk
|
|
|
|
cdrom:*|hd:*) echo ${dd#*:} >> /tmp/dd_disk ;;
|
|
|
|
# anything else is assumed to be a disk
|
|
|
|
*) echo $dd >> /tmp/dd_disk
|
2014-04-07 12:38:09 +00:00
|
|
|
esac
|
|
|
|
done
|
2016-04-10 04:00:00 +00:00
|
|
|
|
|
|
|
# for convenience's sake, mash 'em all into one list
|
|
|
|
for dd_f in /tmp/dd_interactive /tmp/dd_net /tmp/dd_disk; do
|
|
|
|
[ -f $dd_f ] && cat $dd_f >> /tmp/dd_todo
|
|
|
|
done
|