Merge #6 Add patches to not require inst. prefix on rhel-9 (#1907566)

This commit is contained in:
Martin Kolman 2021-02-08 18:32:38 +00:00
commit ea8f8d23a5
3 changed files with 347 additions and 0 deletions

View File

@ -0,0 +1,243 @@
From a9d2581448ddb4c9cb1904dca06512aa79145f80 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Mon, 8 Feb 2021 11:26:06 +0100
Subject: [PATCH 1/3] Revert "Remove support for boot arguments without 'inst.'
prefix from Dracut (#1912502)" (#1907566)
Allow to use Anaconda kernel args in Dracut without inst. prefix to not break
beaker. Beaker needs more time for adaptation so avoid to break it for RHEL-9.
This reverts commit a45405de99a42e5af047f04b78d168b6d41fa513.
Related: rhbz#1907566
---
dracut/anaconda-diskroot | 2 +-
dracut/anaconda-ks-sendheaders.sh | 4 +--
dracut/fetch-kickstart-disk | 2 +-
dracut/kickstart-genrules.sh | 2 +-
dracut/parse-anaconda-dd.sh | 2 +-
dracut/parse-anaconda-kickstart.sh | 6 ++---
dracut/parse-anaconda-net.sh | 3 ---
dracut/parse-anaconda-options.sh | 39 ++++++++++++++----------------
dracut/parse-anaconda-repo.sh | 6 ++---
9 files changed, 30 insertions(+), 36 deletions(-)
diff --git a/dracut/anaconda-diskroot b/dracut/anaconda-diskroot
index 274849fdb3..2797e67625 100755
--- a/dracut/anaconda-diskroot
+++ b/dracut/anaconda-diskroot
@@ -39,7 +39,7 @@ run_checkisomd5() {
dev="$1"
path="$2" # optional, could be empty
-kickstart="$(getarg inst.ks=)"
+kickstart="$(getarg ks= inst.ks=)"
# Log the device that triggered this job.
debug_msg "Trying to find a root image on the device $dev."
diff --git a/dracut/anaconda-ks-sendheaders.sh b/dracut/anaconda-ks-sendheaders.sh
index a479a50667..7bc97393b8 100755
--- a/dracut/anaconda-ks-sendheaders.sh
+++ b/dracut/anaconda-ks-sendheaders.sh
@@ -5,7 +5,7 @@
command -v set_http_header >/dev/null || . /lib/url-lib.sh
# inst.ks.sendmac: send MAC addresses in HTTP headers
-if getargbool 0 inst.ks.sendmac; then
+if getargbool 0 kssendmac inst.ks.sendmac; then
ifnum=0
for ifname in /sys/class/net/*; do
[ -e "$ifname/address" ] || continue
@@ -21,7 +21,7 @@ if getargbool 0 inst.ks.sendmac; then
fi
# inst.ks.sendsn: send system serial number in HTTP headers
-if getargbool 0 inst.ks.sendsn; then
+if getargbool 0 kssendsn inst.ks.sendsn; then
system_serial=$(cat /sys/class/dmi/id/product_serial 2>/dev/null)
if [ -z "$system_serial" ]; then
warn "inst.ks.sendsn: can't find system serial number"
diff --git a/dracut/fetch-kickstart-disk b/dracut/fetch-kickstart-disk
index b1ee9f826c..7eb769ea5c 100755
--- a/dracut/fetch-kickstart-disk
+++ b/dracut/fetch-kickstart-disk
@@ -6,7 +6,7 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh
dev="$1"
path="${2:-/ks.cfg}"
-kickstart="$(getarg inst.ks=)"
+kickstart="$(getarg ks= inst.ks=)"
[ -e /tmp/ks.cfg.done ] && exit 1
[ -b "$dev" ] || exit 1
diff --git a/dracut/kickstart-genrules.sh b/dracut/kickstart-genrules.sh
index 84277890dd..8e1ba22643 100755
--- a/dracut/kickstart-genrules.sh
+++ b/dracut/kickstart-genrules.sh
@@ -28,7 +28,7 @@ case "${kickstart%%:*}" in
wait_for_kickstart
;;
"")
- if [ -z "$kickstart" -a -z "$(getarg inst.ks=)" ]; then
+ if [ -z "$kickstart" -a -z "$(getarg ks= inst.ks=)" ]; then
when_diskdev_appears $(disk_to_dev_path LABEL=OEMDRV) \
fetch-kickstart-disk \$env{DEVNAME} "/ks.cfg"
fi
diff --git a/dracut/parse-anaconda-dd.sh b/dracut/parse-anaconda-dd.sh
index 8eeceb9a49..3633d29282 100755
--- a/dracut/parse-anaconda-dd.sh
+++ b/dracut/parse-anaconda-dd.sh
@@ -11,7 +11,7 @@
rm -f /tmp/dd_interactive /tmp/dd_net /tmp/dd_disk /tmp/dd_todo
# parse any dd/inst.dd args found
-for dd in $(getargs inst.dd=); do
+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 ;;
diff --git a/dracut/parse-anaconda-kickstart.sh b/dracut/parse-anaconda-kickstart.sh
index 83b319dc7d..1f4f190db9 100755
--- a/dracut/parse-anaconda-kickstart.sh
+++ b/dracut/parse-anaconda-kickstart.sh
@@ -5,9 +5,9 @@
[ -f /tmp/ks.cfg.done ] && return
# inst.ks: provide a "URI" for the kickstart file
-kickstart="$(getarg inst.ks=)"
+kickstart="$(getarg ks= inst.ks=)"
if [ -z "$kickstart" ]; then
- getargbool 0 inst.ks && kickstart='nfs:auto'
+ getargbool 0 ks inst.ks && kickstart='nfs:auto'
fi
# no root? the kickstart will probably tell us what our root device is.
[ "$kickstart" ] && [ -z "$root" ] && root="anaconda-kickstart"
@@ -23,7 +23,7 @@ case "${kickstart%%:*}" in
set_neednet
;;
urls) # multiple network kickstarts?
- locations="$(getargs inst.ks=)"
+ locations="$(getargs ks= inst.ks=)"
get_urls "$locations" >/tmp/ks_urls
set_neednet
;;
diff --git a/dracut/parse-anaconda-net.sh b/dracut/parse-anaconda-net.sh
index f09ec8d098..5518546e5b 100755
--- a/dracut/parse-anaconda-net.sh
+++ b/dracut/parse-anaconda-net.sh
@@ -16,9 +16,6 @@ mac_to_bootif() {
# handle ksdevice (tell us which device to use for ip= stuff later)
export ksdevice=""
-# TODO: Remove support for ksdevice. It's deprecated a long time already
-# this should be inst.ksdevice however, this is deprecated a long time so we don't have
-# any inst.ksdevice. Let's just ignore this for now.
ksdev_val=$(getarg ksdevice=)
if [ -n "$ksdev_val" ]; then
case "$ksdev_val" in
diff --git a/dracut/parse-anaconda-options.sh b/dracut/parse-anaconda-options.sh
index debe8ac0cb..c2735b0e19 100755
--- a/dracut/parse-anaconda-options.sh
+++ b/dracut/parse-anaconda-options.sh
@@ -58,12 +58,6 @@ check_removed_arg() {
fi
}
-check_removed_no_inst_arg() {
- local removed_arg="$1" new_arg="$2"
- check_removed_arg "$removed_arg" "All usage of Anaconda boot arguments without 'inst.' prefix \
-was removed. Please use $new_arg instead."
-}
-
check_depr_args "blacklist=" "inst.blacklist=%s"
check_depr_arg "nofirewire" "inst.blacklist=firewire_ohci"
@@ -83,32 +77,35 @@ check_removed_arg askmethod "Use an appropriate 'inst.repo=' argument instead."
check_removed_arg asknetwork "Use an appropriate 'ip=' argument instead."
# lang & keymap
-check_removed_no_inst_arg "lang" "inst.lang"
-check_removed_no_inst_arg "keymap" "inst.keymap"
+warn_renamed_arg "lang" "inst.lang"
+warn_renamed_arg "keymap" "inst.keymap"
+
+# debug
+warn_renamed_arg "debug" "inst.debug"
# repo
check_depr_arg "method=" "repo=%s"
-check_removed_no_inst_arg "repo" "inst.repo"
+warn_renamed_arg "repo" "inst.repo"
# stage2
-check_removed_no_inst_arg "stage2" "inst.stage2"
+warn_renamed_arg "stage2" "inst.stage2"
# kickstart
-check_removed_no_inst_arg "ks" "inst.ks"
-check_removed_no_inst_arg "ksdevice" "inst.ks.device"
-check_removed_no_inst_arg "kssendmac" "inst.ks.sendmac"
-check_removed_no_inst_arg "kssendsn" "inst.ks.sendsn"
+warn_renamed_arg "ks" "inst.ks"
+warn_renamed_arg "ksdevice" "inst.ks.device"
+warn_renamed_arg "kssendmac" "inst.ks.sendmac"
+warn_renamed_arg "kssendsn" "inst.ks.sendsn"
# Ignore self-signed SSL certs
-check_removed_no_inst_arg "noverifyssl" "inst.noverifyssl"
-if getargbool 0 inst.noverifyssl; then
+warn_renamed_arg "noverifyssl" "inst.noverifyssl"
+if getargbool 0 noverifyssl inst.noverifyssl; then
# Tell dracut to use curl --insecure
echo "rd.noverifyssl" >> /etc/cmdline.d/75-anaconda-options.conf
fi
# updates
-check_removed_no_inst_arg "updates" "inst.updates"
-if updates=$(getarg inst.updates); then
+warn_renamed_arg "updates=" "inst.updates"
+if updates=$(getarg updates inst.updates); then
if [ -n "$updates" ]; then
export anac_updates=$updates
case $updates in
@@ -122,11 +119,11 @@ if updates=$(getarg inst.updates); then
fi
# for vnc bring network up in initramfs so that cmdline configuration is used
-check_removed_no_inst_arg "vnc" "inst.vnc"
-getargbool 0 inst.vnc && warn "anaconda requiring network for vnc" && set_neednet
+warn_renamed_arg "vnc" "inst.vnc"
+getargbool 0 vnc inst.vnc && warn "anaconda requiring network for vnc" && set_neednet
# Driver Update Disk
-check_removed_no_inst_arg "dd" "inst.dd"
+warn_renamed_arg "dd" "inst.dd"
# re-read the commandline args
unset CMDLINE
diff --git a/dracut/parse-anaconda-repo.sh b/dracut/parse-anaconda-repo.sh
index fdc937a95a..a1f96b3d98 100755
--- a/dracut/parse-anaconda-repo.sh
+++ b/dracut/parse-anaconda-repo.sh
@@ -4,8 +4,8 @@
# If there's a root= arg, we'll just use that
getarg root= >/dev/null && return
-repo="$(getarg inst.repo=)"
-stage2="$(getarg inst.stage2=)"
+repo="$(getarg repo= inst.repo=)"
+stage2="$(getarg stage2= inst.stage2=)"
arg="repo"
# default to using repo, but if we have stage2=, use that
@@ -26,7 +26,7 @@ if [ -n "$repo" ]; then
;;
urls)
root="anaconda-net:urls"
- locations="$(getargs inst.stage2=)"
+ locations="$(getargs stage2= inst.stage2=)"
get_urls "$locations" >/tmp/stage2_urls
set_neednet
;;
--
2.29.2

View File

@ -0,0 +1,59 @@
From 5f066c4125d7a648958b31b909934e02cf397db8 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Mon, 8 Feb 2021 11:27:26 +0100
Subject: [PATCH 2/3] Revert "Do not support no inst. Anaconda boot args in
systemd services (#1912502)" (#1907566)
Allow to use Anaconda kernel boot arguments systemd units to not break beaker.
Beaker needs more time to adaptation so avoid to break it for RHEL-9.
This reverts commit 322e6a847d73ea17fe99aaae4129e14409488b6b.
Related: rhbz#1907566
---
data/systemd/anaconda-noshell.service | 1 +
data/systemd/anaconda-shell@.service | 1 +
data/systemd/anaconda-sshd.service | 2 ++
3 files changed, 4 insertions(+)
diff --git a/data/systemd/anaconda-noshell.service b/data/systemd/anaconda-noshell.service
index ca4dbd328d..f378c67b0c 100644
--- a/data/systemd/anaconda-noshell.service
+++ b/data/systemd/anaconda-noshell.service
@@ -3,6 +3,7 @@ Description=Restrict Anaconda Text Console
After=anaconda.service
Before=anaconda-tmux@.service
ConditionKernelCommandLine=|inst.noshell
+ConditionKernelCommandLine=|noshell
[Service]
Type=oneshot
diff --git a/data/systemd/anaconda-shell@.service b/data/systemd/anaconda-shell@.service
index b0dd4b7c66..bc69fd1208 100644
--- a/data/systemd/anaconda-shell@.service
+++ b/data/systemd/anaconda-shell@.service
@@ -3,6 +3,7 @@
[Unit]
Description=Shell on %I
After=systemd-user-sessions.service plymouth-quit-wait.service
+ConditionKernelCommandLine=!noshell
ConditionKernelCommandLine=!inst.noshell
[Service]
diff --git a/data/systemd/anaconda-sshd.service b/data/systemd/anaconda-sshd.service
index 8b5b16fbbe..8cba2c4bb0 100644
--- a/data/systemd/anaconda-sshd.service
+++ b/data/systemd/anaconda-sshd.service
@@ -3,8 +3,10 @@ Description=OpenSSH server daemon
Before=anaconda.target
After=syslog.target network.target sshd-keygen.target
Wants=sshd-keygen.target
+ConditionKernelCommandLine=|sshd
ConditionKernelCommandLine=|inst.sshd
ConditionKernelCommandLine=!inst.sshd=0
+ConditionKernelCommandLine=!sshd=0
# TODO: use ConditionArchitecture in systemd v210 or later
ConditionPathIsDirectory=|/sys/hypervisor/s390
--
2.29.2

View File

@ -0,0 +1,45 @@
From cf93029a69a5b7d21d9478fad0c5c619ea2008d1 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Mon, 8 Feb 2021 11:32:03 +0100
Subject: [PATCH 3/3] Do not require inst. prefixes for Anaconda boot arguments
(#1907566)
Beaker needs more time for adaptation. Create this change to not break beaker
for RHEL-9.
Related: rhbz#1907566
---
anaconda.py | 3 ---
pyanaconda/argument_parsing.py | 2 +-
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/anaconda.py b/anaconda.py
index edd518046a..3dc424188f 100755
--- a/anaconda.py
+++ b/anaconda.py
@@ -308,9 +308,6 @@ if __name__ == "__main__":
stdout_log.warning("Kernel boot argument '%s' detected. "
"Did you want to use 'inst.%s' for the installer instead?",
arg, arg)
- if removed_no_inst_args:
- stdout_log.warning("All Anaconda kernel boot arguments are now required to use "
- "'inst.' prefix!")
from pyanaconda import isys
diff --git a/pyanaconda/argument_parsing.py b/pyanaconda/argument_parsing.py
index 330a71ed64..096b1eba9e 100644
--- a/pyanaconda/argument_parsing.py
+++ b/pyanaconda/argument_parsing.py
@@ -388,7 +388,7 @@ def getArgumentParser(version_string, boot_cmdline=None):
# If require_prefix is False, it also accepts the option without the
# bootarg_prefix ('repo').
# See anaconda_optparse.py and KernelArguments (in flags.py) for details.
- ap = AnacondaArgumentParser(bootarg_prefix="inst.", require_prefix=True)
+ ap = AnacondaArgumentParser(bootarg_prefix="inst.", require_prefix=False)
help_parser = HelpTextParser(os.path.join(datadir, "anaconda_options.txt"))
# NOTE: store_false options will *not* get negated when the user does
--
2.29.2