dracut/0017-deprecate-old-command-line-options.patch
Harald Hoyer 12f6cc01aa dracut-022-63.git20120727
- fixed dracut-install bug if /var/tmp contains a symlink
- fixed some partx issues
2012-07-27 06:28:40 +02:00

785 lines
32 KiB
Diff

From 68e7661ca7625978f3a2b6f906d16a44043c4fbb Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 25 Jul 2012 10:32:42 +0200
Subject: [PATCH] deprecate old command line options
---
modules.d/10i18n/parse-i18n.sh | 8 ++---
modules.d/50gensplash/gensplash-pretrigger.sh | 2 +-
modules.d/50plymouth/plymouth-pretrigger.sh | 2 +-
modules.d/90crypt/crypt-cleanup.sh | 2 +-
modules.d/90crypt/cryptroot-ask.sh | 2 +-
modules.d/90crypt/parse-crypt.sh | 4 +--
modules.d/90dmraid/dmraid.sh | 2 +-
modules.d/90dmraid/parse-dm.sh | 6 ++--
modules.d/90dmsquash-live/dmsquash-live-root.sh | 14 ++++----
modules.d/90dmsquash-live/parse-dmsquash-live.sh | 2 +-
modules.d/90kernel-modules/insmodpost.sh | 2 +-
modules.d/90kernel-modules/parse-kernel.sh | 6 ++--
modules.d/90lvm/lvm_scan.sh | 8 ++---
modules.d/90lvm/parse-lvm.sh | 6 ++--
modules.d/90mdraid/parse-md.sh | 12 +++----
modules.d/95dasd/parse-dasd.sh | 2 +-
modules.d/95dasd_mod/parse-dasd-mod.sh | 2 +-
modules.d/95iscsi/iscsiroot.sh | 24 +++++++-------
modules.d/95nfs/parse-nfsroot.sh | 2 +-
modules.d/95rootfs-block/mount-root.sh | 2 +-
modules.d/95zfcp/parse-zfcp.sh | 4 +--
modules.d/95znet/parse-ccw.sh | 2 +-
modules.d/98syslog/parse-syslog-opts.sh | 6 ++--
modules.d/98systemd/dracut-cmdline.sh | 2 +-
modules.d/98systemd/dracut-initqueue.sh | 8 ++---
modules.d/98systemd/dracut-pre-pivot.sh | 2 +-
modules.d/98systemd/dracut-pre-trigger.sh | 4 +--
modules.d/99base/dracut-lib.sh | 42 ++++++++++++++++++++----
modules.d/99base/init.sh | 24 +++++++-------
modules.d/99base/mount-hook.sh | 2 +-
30 files changed, 117 insertions(+), 89 deletions(-)
diff --git a/modules.d/10i18n/parse-i18n.sh b/modules.d/10i18n/parse-i18n.sh
index b9bd5bb..5530136 100755
--- a/modules.d/10i18n/parse-i18n.sh
+++ b/modules.d/10i18n/parse-i18n.sh
@@ -19,10 +19,10 @@ inst_key_val() {
unset _value
}
-inst_key_val '' /etc/vconsole.conf KEYMAP vconsole.keymap KEYTABLE
-inst_key_val '' /etc/vconsole.conf FONT vconsole.font SYSFONT
-inst_key_val '' /etc/vconsole.conf FONT_MAP vconsole.font.map CONTRANS
-inst_key_val '' /etc/vconsole.conf FONT_UNIMAP vconsole.font.unimap UNIMAP
+inst_key_val '' /etc/vconsole.conf KEYMAP vconsole.keymap -d KEYTABLE
+inst_key_val '' /etc/vconsole.conf FONT vconsole.font -d SYSFONT
+inst_key_val '' /etc/vconsole.conf FONT_MAP vconsole.font.map -d CONTRANS
+inst_key_val '' /etc/vconsole.conf FONT_UNIMAP vconsole.font.unimap -d UNIMAP
inst_key_val 1 /etc/vconsole.conf UNICODE vconsole.unicode vconsole.font.unicode
inst_key_val '' /etc/vconsole.conf EXT_KEYMAP vconsole.keymap.ext
diff --git a/modules.d/50gensplash/gensplash-pretrigger.sh b/modules.d/50gensplash/gensplash-pretrigger.sh
index b697438..6b85bbf 100755
--- a/modules.d/50gensplash/gensplash-pretrigger.sh
+++ b/modules.d/50gensplash/gensplash-pretrigger.sh
@@ -2,7 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-if getargbool 1 rd.splash -n rd_NO_SPLASH; then
+if getargbool 1 rd.splash -d -n rd_NO_SPLASH; then
info "Starting Gentoo Splash"
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
diff --git a/modules.d/50plymouth/plymouth-pretrigger.sh b/modules.d/50plymouth/plymouth-pretrigger.sh
index 5cc9112..ddb8ddb 100755
--- a/modules.d/50plymouth/plymouth-pretrigger.sh
+++ b/modules.d/50plymouth/plymouth-pretrigger.sh
@@ -3,7 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
if [ -x /bin/plymouthd ]; then
- if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -n rd_NO_PLYMOUTH; then
+ if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -d -n rd_NO_PLYMOUTH; then
# first trigger graphics subsystem
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
# first trigger graphics and tty subsystem
diff --git a/modules.d/90crypt/crypt-cleanup.sh b/modules.d/90crypt/crypt-cleanup.sh
index e6beb83..04defde 100755
--- a/modules.d/90crypt/crypt-cleanup.sh
+++ b/modules.d/90crypt/crypt-cleanup.sh
@@ -4,7 +4,7 @@
# close everything which is not busy
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
-if ! getarg rd.luks.uuid rd_LUKS_UUID >/dev/null 2>&1 && getargbool 1 rd.luks -n rd_NO_LUKS >/dev/null 2>&1; then
+if ! getarg rd.luks.uuid -d rd_LUKS_UUID >/dev/null 2>&1 && getargbool 1 rd.luks -d -n rd_NO_LUKS >/dev/null 2>&1; then
while true; do
local do_break="y"
for i in /dev/mapper/luks-*; do
diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh
index d373a90..17955ec 100755
--- a/modules.d/90crypt/cryptroot-ask.sh
+++ b/modules.d/90crypt/cryptroot-ask.sh
@@ -36,7 +36,7 @@ fi
numtries=${3:-10}
# TODO: improve to support what cmdline does
-if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
+if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; then
while read name dev luksfile luksoptions; do
# ignore blank lines and comments
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh
index f96b59a..a2b157f 100755
--- a/modules.d/90crypt/parse-crypt.sh
+++ b/modules.d/90crypt/parse-crypt.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-if ! getargbool 1 rd.luks -n rd_NO_LUKS; then
+if ! getargbool 1 rd.luks -d -n rd_NO_LUKS; then
info "rd.luks=0: removing cryptoluks activation"
rm -f /etc/udev/rules.d/70-luks.rules
else
@@ -10,7 +10,7 @@ else
echo 'ACTION!="add|change", GOTO="luks_end"'
} > /etc/udev/rules.d/70-luks.rules.new
- LUKS=$(getargs rd.luks.uuid rd_LUKS_UUID)
+ LUKS=$(getargs rd.luks.uuid -d rd_LUKS_UUID)
tout=$(getarg rd.luks.key.tout)
if [ -n "$LUKS" ]; then
diff --git a/modules.d/90dmraid/dmraid.sh b/modules.d/90dmraid/dmraid.sh
index 574dc3b..e4f8799 100755
--- a/modules.d/90dmraid/dmraid.sh
+++ b/modules.d/90dmraid/dmraid.sh
@@ -4,7 +4,7 @@
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
-DM_RAIDS=$(getargs rd.dm.uuid rd_DM_UUID=)
+DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=)
DM_CLEANUP="no"
diff --git a/modules.d/90dmraid/parse-dm.sh b/modules.d/90dmraid/parse-dm.sh
index fe38d35..bc7ed42 100755
--- a/modules.d/90dmraid/parse-dm.sh
+++ b/modules.d/90dmraid/parse-dm.sh
@@ -2,17 +2,17 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# nodmraid for anaconda / rc.sysinit compatibility
-if ! getargbool 1 rd.dm -n rd_NO_DM || getarg nodmraid; then
+if ! getargbool 1 rd.dm -d -n rd_NO_DM || getarg "rd.dm=0" -d nodmraid; then
info "rd.dm=0: removing DM RAID activation"
udevproperty rd_NO_DM=1
fi
-if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.imsm -n rd_NO_MDIMSM || getarg noiswmd; then
+if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd; then
info "rd.md.imsm=0: no MD RAID for imsm/isw raids"
udevproperty rd_NO_MDIMSM=1
fi
-if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF || getarg noddfmd; then
+if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd; then
info "rd.md.ddf=0: no MD RAID for SNIA ddf raids"
udevproperty rd_NO_MDDDF=1
fi
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
index 08f2381..15f166b 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
@@ -6,7 +6,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
-if getargbool 0 rd.live.debug -y rdlivedebug; then
+if getargbool 0 rd.live.debug -n -y rdlivedebug; then
exec > /tmp/liveroot.$$.out
exec 2>> /tmp/liveroot.$$.out
set -x
@@ -17,19 +17,19 @@ livedev="$1"
# parse various live image specific options that make sense to be
# specified as their own things
-live_dir=$(getarg rd.live.dir live_dir)
+live_dir=$(getarg rd.live.dir -d live_dir)
[ -z "$live_dir" ] && live_dir="LiveOS"
-getargbool 0 rd.live.ram -y live_ram && live_ram="yes"
-getargbool 0 rd.live.overlay.reset -y reset_overlay && reset_overlay="yes"
-getargbool 0 rd.live.overlay.readonly -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
-overlay=$(getarg rd.live.overlay overlay)
+getargbool 0 rd.live.ram -d -y live_ram && live_ram="yes"
+getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes"
+getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
+overlay=$(getarg rd.live.overlay -d overlay)
# CD/DVD media check
[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
check="yes"
fi
-getarg rd.live.check check || check=""
+getarg rd.live.check -d check || check=""
if [ -n "$check" ]; then
[ -x /bin/plymouth ] && /bin/plymouth --hide-splash
checkisomd5 --verbose $livedev
diff --git a/modules.d/90dmsquash-live/parse-dmsquash-live.sh b/modules.d/90dmsquash-live/parse-dmsquash-live.sh
index 5ccc0d0..3e9a347 100755
--- a/modules.d/90dmsquash-live/parse-dmsquash-live.sh
+++ b/modules.d/90dmsquash-live/parse-dmsquash-live.sh
@@ -7,7 +7,7 @@
[ -z "$root" ] && root=$(getarg root=)
# support legacy syntax of passing liveimg and then just the base root
-if getargbool 0 rd.live.image -y liveimg; then
+if getargbool 0 rd.live.image -d -y liveimg; then
liveroot="live:$root"
fi
diff --git a/modules.d/90kernel-modules/insmodpost.sh b/modules.d/90kernel-modules/insmodpost.sh
index 168a907..d2b8723 100755
--- a/modules.d/90kernel-modules/insmodpost.sh
+++ b/modules.d/90kernel-modules/insmodpost.sh
@@ -4,7 +4,7 @@
. /lib/dracut-lib.sh
-for modlist in $(getargs rd.driver.post rdinsmodpost=); do
+for modlist in $(getargs rd.driver.post -d rdinsmodpost=); do
(
IFS=,
for m in $modlist; do
diff --git a/modules.d/90kernel-modules/parse-kernel.sh b/modules.d/90kernel-modules/parse-kernel.sh
index 285ee90..485528b 100755
--- a/modules.d/90kernel-modules/parse-kernel.sh
+++ b/modules.d/90kernel-modules/parse-kernel.sh
@@ -2,7 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-for i in $(getargs rd.driver.pre rdloaddriver=); do
+for i in $(getargs rd.driver.pre -d rdloaddriver=); do
(
IFS=,
for p in $i; do
@@ -11,7 +11,7 @@ for i in $(getargs rd.driver.pre rdloaddriver=); do
)
done
-for i in $(getargs rd.driver.blacklist rdblacklist=); do
+for i in $(getargs rd.driver.blacklist -d rdblacklist=); do
(
IFS=,
for p in $i; do
@@ -20,7 +20,7 @@ for i in $(getargs rd.driver.blacklist rdblacklist=); do
)
done
-for p in $(getargs rd.driver.post rdinsmodpost=); do
+for p in $(getargs rd.driver.post -d rdinsmodpost=); do
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
_do_insmodpost=1
done
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
index d86be9b..f5f5fcd 100755
--- a/modules.d/90lvm/lvm_scan.sh
+++ b/modules.d/90lvm/lvm_scan.sh
@@ -7,10 +7,10 @@
extraargs="$@"
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
-VGS=$(getargs rd.lvm.vg rd_LVM_VG=)
-LVS=$(getargs rd.lvm.lv rd_LVM_LV=)
-SNAPSHOT=$(getargs rd.lvm.snapshot rd_LVM_SNAPSHOT=)
-SNAPSIZE=$(getargs rd.lvm.snapsize rd_LVM_SNAPSIZE=)
+VGS=$(getargs rd.lvm.vg -d rd_LVM_VG=)
+LVS=$(getargs rd.lvm.lv -d rd_LVM_LV=)
+SNAPSHOT=$(getargs rd.lvm.snapshot -d rd_LVM_SNAPSHOT=)
+SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=)
[ -d /etc/lvm ] || mkdir -m 0755 -p /etc/lvm
# build a list of devices to scan
diff --git a/modules.d/90lvm/parse-lvm.sh b/modules.d/90lvm/parse-lvm.sh
index c1d00c6..2194abd 100755
--- a/modules.d/90lvm/parse-lvm.sh
+++ b/modules.d/90lvm/parse-lvm.sh
@@ -1,15 +1,15 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-if [ -e /etc/lvm/lvm.conf ] && ! getargbool 1 rd.lvm.conf -n rd_NO_LVMCONF; then
+if [ -e /etc/lvm/lvm.conf ] && ! getargbool 1 rd.lvm.conf -d -n rd_NO_LVMCONF; then
rm -f /etc/lvm/lvm.conf
fi
-if ! getargbool 1 rd.lvm -n rd_NO_LVM; then
+if ! getargbool 1 rd.lvm -d -n rd_NO_LVM; then
info "rd.lvm=0: removing LVM activation"
rm -f /etc/udev/rules.d/64-lvm*.rules
else
- for dev in $(getargs rd.lvm.vg rd_LVM_VG=) $(getargs rd.lvm.lv rd_LVM_LV=); do
+ for dev in $(getargs rd.lvm.vg -d rd_LVM_VG=) $(getargs rd.lvm.lv -d rd_LVM_LV=); do
wait_for_dev "/dev/$dev"
done
fi
diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh
index 1482f2f..6920f40 100755
--- a/modules.d/90mdraid/parse-md.sh
+++ b/modules.d/90mdraid/parse-md.sh
@@ -1,11 +1,11 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-if ! getargbool 1 rd.md -n rd_NO_MD; then
+if ! getargbool 1 rd.md -d -n rd_NO_MD; then
info "rd.md=0: removing MD RAID activation"
udevproperty rd_NO_MD=1
else
- MD_UUID=$(getargs rd.md.uuid rd_MD_UUID=)
+ MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
# rewrite the md rules to only process the specified raid array
if [ -n "$MD_UUID" ]; then
@@ -29,25 +29,25 @@ else
fi
-if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -n rd_NO_MDADMCONF; then
+if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then
udevproperty rd_MDADMCONF=1
rm -f $hookdir/pre-pivot/*mdraid-cleanup.sh
fi
-if ! getargbool 1 rd.md.conf -n rd_NO_MDADMCONF; then
+if ! getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then
rm -f /etc/mdadm/mdadm.conf /etc/mdadm.conf
ln -s $(command -v mdraid-cleanup) $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
fi
# noiswmd nodmraid for anaconda / rc.sysinit compatibility
# note nodmraid really means nobiosraid, so we don't want MDIMSM then either
-if ! getargbool 1 rd.md.imsm -n rd_NO_MDIMSM || getarg noiswmd || getarg nodmraid; then
+if ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd -n nodmraid; then
info "no MD RAID for imsm/isw raids"
udevproperty rd_NO_MDIMSM=1
fi
# same thing with ddf containers
-if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF || getarg noddfmd || getarg nodmraid; then
+if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd -n nodmraid; then
info "no MD RAID for SNIA ddf raids"
udevproperty rd_NO_MDDDF=1
fi
diff --git a/modules.d/95dasd/parse-dasd.sh b/modules.d/95dasd/parse-dasd.sh
index b3d18fa..772ea47 100755
--- a/modules.d/95dasd/parse-dasd.sh
+++ b/modules.d/95dasd/parse-dasd.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-for dasd_arg in $(getargs rd.dasd= rd_DASD= DASD=); do
+for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do
(
IFS=","
set $dasd_arg
diff --git a/modules.d/95dasd_mod/parse-dasd-mod.sh b/modules.d/95dasd_mod/parse-dasd-mod.sh
index c37aca8..87c88ed 100755
--- a/modules.d/95dasd_mod/parse-dasd-mod.sh
+++ b/modules.d/95dasd_mod/parse-dasd-mod.sh
@@ -3,7 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
mod_args=""
-for dasd_arg in $(getargs rd.dasd= rd_DASD= DASD=); do
+for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do
mod_args="$mod_args,$dasd_arg"
done
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index 19c5c1d..87b7fa7 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -40,14 +40,14 @@ modprobe crc32c 2>/dev/null
[ -e /sys/module/bnx2i ] && iscsiuio
-if getargbool 0 rd.iscsi.firmware -y iscsi_firmware ; then
+if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
if [ -z "$root" -o -n "${root%%block:*}" ]; then
# if root is not specified try to mount the whole iSCSI LUN
printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
udevadm control --reload
fi
- for p in $(getargs rd.iscsi.param iscsi_param); do
+ for p in $(getargs rd.iscsi.param -d iscsi_param); do
iscsi_param="$iscsi_param --param $p"
done
@@ -66,25 +66,25 @@ handle_netroot()
local p
# override conf settings by command line options
- arg=$(getargs rd.iscsi.initiator iscsi_initiator=)
+ arg=$(getargs rd.iscsi.initiator -d iscsi_initiator=)
[ -n "$arg" ] && iscsi_initiator=$arg
- arg=$(getargs rd.iscsi.target.name iscsi_target_name=)
+ arg=$(getargs rd.iscsi.target.name -d iscsi_target_name=)
[ -n "$arg" ] && iscsi_target_name=$arg
- arg=$(getargs rd.iscsi.target.ip iscsi_target_ip)
+ arg=$(getargs rd.iscsi.target.ip -d iscsi_target_ip)
[ -n "$arg" ] && iscsi_target_ip=$arg
- arg=$(getargs rd.iscsi.target.port iscsi_target_port=)
+ arg=$(getargs rd.iscsi.target.port -d iscsi_target_port=)
[ -n "$arg" ] && iscsi_target_port=$arg
- arg=$(getargs rd.iscsi.target.group iscsi_target_group=)
+ arg=$(getargs rd.iscsi.target.group -d iscsi_target_group=)
[ -n "$arg" ] && iscsi_target_group=$arg
- arg=$(getargs rd.iscsi.username iscsi_username=)
+ arg=$(getargs rd.iscsi.username -d iscsi_username=)
[ -n "$arg" ] && iscsi_username=$arg
- arg=$(getargs rd.iscsi.password iscsi_password)
+ arg=$(getargs rd.iscsi.password -d iscsi_password)
[ -n "$arg" ] && iscsi_password=$arg
- arg=$(getargs rd.iscsi.in.username iscsi_in_username=)
+ arg=$(getargs rd.iscsi.in.username -d iscsi_in_username=)
[ -n "$arg" ] && iscsi_in_username=$arg
- arg=$(getargs rd.iscsi.in.password iscsi_in_password=)
+ arg=$(getargs rd.iscsi.in.password -d iscsi_in_password=)
[ -n "$arg" ] && iscsi_in_password=$arg
- for p in $(getargs rd.iscsi.param iscsi_param); do
+ for p in $(getargs rd.iscsi.param -d iscsi_param); do
iscsi_param="$iscsi_param --param $p"
done
diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh
index 769d233..283420a 100755
--- a/modules.d/95nfs/parse-nfsroot.sh
+++ b/modules.d/95nfs/parse-nfsroot.sh
@@ -72,7 +72,7 @@ esac
# Check required arguments
-if nfsdomain=$(getarg rd.nfs.domain rd_NFS_DOMAIN); then
+if nfsdomain=$(getarg rd.nfs.domain -d rd_NFS_DOMAIN); then
if [ -f /etc/idmapd.conf ]; then
sed -i -e \
"s/^[[:space:]#]*Domain[[:space:]]*=.*/Domain = $nfsdomain/g" \
diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh
index e61b0e8..670f6e3 100755
--- a/modules.d/95rootfs-block/mount-root.sh
+++ b/modules.d/95rootfs-block/mount-root.sh
@@ -76,7 +76,7 @@ mount_root() {
fi
rootopts=
- if getargbool 1 rd.fstab -n rd_NO_FSTAB \
+ if getargbool 1 rd.fstab -d -n rd_NO_FSTAB \
&& ! getarg rootflags \
&& [ -f "$NEWROOT/etc/fstab" ] \
&& ! [ -L "$NEWROOT/etc/fstab" ]; then
diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh
index 5af454a..9b22d93 100755
--- a/modules.d/95zfcp/parse-zfcp.sh
+++ b/modules.d/95zfcp/parse-zfcp.sh
@@ -2,9 +2,9 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-getargbool 1 rd.zfcp.conf -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
+getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
-for zfcp_arg in $(getargs rd.zfcp 'rd_ZFCP='); do
+for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do
(
IFS=","
set $zfcp_arg
diff --git a/modules.d/95znet/parse-ccw.sh b/modules.d/95znet/parse-ccw.sh
index 876671c..cf1f41d 100755
--- a/modules.d/95znet/parse-ccw.sh
+++ b/modules.d/95znet/parse-ccw.sh
@@ -2,7 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-for ccw_arg in $(getargs rd.ccw 'rd_CCW=') $(getargs rd.znet 'rd_ZNET='); do
+for ccw_arg in $(getargs rd.ccw -d 'rd_CCW=') $(getargs rd.znet -d 'rd_ZNET='); do
echo $ccw_arg >> /etc/ccw.conf
done
diff --git a/modules.d/98syslog/parse-syslog-opts.sh b/modules.d/98syslog/parse-syslog-opts.sh
index 02788dd..e58c8f5 100755
--- a/modules.d/98syslog/parse-syslog-opts.sh
+++ b/modules.d/98syslog/parse-syslog-opts.sh
@@ -11,9 +11,9 @@
# Don't auto detect syslog but set it
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
-syslogserver=$(getarg syslog.server syslog)
-syslogfilters=$(getargs syslog.filter filter)
-syslogtype=$(getarg syslog.type syslogtype)
+syslogserver=$(getarg syslog.server -d syslog)
+syslogfilters=$(getargs syslog.filter -d filter)
+syslogtype=$(getarg syslog.type -d syslogtype)
[ -n "$syslogserver" ] && echo $syslogserver > /tmp/syslog.server
[ -n "$syslogfilters" ] && echo "$syslogfilters" > /tmp/syslog.filters
diff --git a/modules.d/98systemd/dracut-cmdline.sh b/modules.d/98systemd/dracut-cmdline.sh
index 6a44815..77ad121 100755
--- a/modules.d/98systemd/dracut-cmdline.sh
+++ b/modules.d/98systemd/dracut-cmdline.sh
@@ -15,7 +15,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
source_conf /etc/conf.d
# run scriptlets to parse the command line
-getarg 'rd.break=cmdline' 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
+getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
source_hook cmdline
[ -z "$root" ] && die "No or empty root= argument"
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index cfdb12d..112d2a8 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -9,9 +9,9 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
source_conf /etc/conf.d
-getarg 'rd.break=initqueue' 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"
+getarg 'rd.break=initqueue' -d 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"
-RDRETRY=$(getarg rd.retry 'rd_retry=')
+RDRETRY=$(getarg rd.retry -d 'rd_retry=')
RDRETRY=${RDRETRY:-20}
RDRETRY=$(($RDRETRY*2))
export RDRETRY
@@ -71,11 +71,11 @@ unset RDRETRY
# pre-mount happens before we try to mount the root filesystem,
# and happens once.
-getarg 'rd.break=pre-mount' 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
+getarg 'rd.break=pre-mount' -d 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
source_hook pre-mount
-getarg 'rd.break=mount' 'rdbreak=mount' && emergency_shell -n mount "Break mount"
+getarg 'rd.break=mount' -d 'rdbreak=mount' && emergency_shell -n mount "Break mount"
# mount scripts actually try to mount the root filesystem, and may
# be sourced any number of times. As soon as one suceeds, no more are sourced.
i=0
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index 31dded5..3fd7957 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -37,6 +37,6 @@ echo "NEWROOT=\"$NEWROOT\"" >> /run/initramfs/switch-root.conf
# remove helper symlink
[ -h /dev/root ] && rm -f /dev/root
-getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
+getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root"
exit 0
diff --git a/modules.d/98systemd/dracut-pre-trigger.sh b/modules.d/98systemd/dracut-pre-trigger.sh
index 52ecfaf..9850124 100755
--- a/modules.d/98systemd/dracut-pre-trigger.sh
+++ b/modules.d/98systemd/dracut-pre-trigger.sh
@@ -9,8 +9,8 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
source_conf /etc/conf.d
-getargbool 0 rd.udev.info -y rdudevinfo && udevadm control --log-priority=info
-getargbool 0 rd.udev.debug -y rdudevdebug && udevadm control --log-priority=debug
+getargbool 0 rd.udev.info -n -y rdudevinfo && udevadm control --log-priority=info
+getargbool 0 rd.udev.debug -n -y rdudevdebug && udevadm control --log-priority=debug
udevproperty "hookdir=$hookdir"
source_hook pre-trigger
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 1ee671e..786661e 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -103,24 +103,41 @@ _dogetarg() {
getarg() {
debug_off
+ local _deprecated _newoption
while [ $# -gt 0 ]; do
case $1 in
+ -d) _deprecated=1; shift;;
-y) if _dogetarg $2 >/dev/null; then
+ if [ "$_deprecated" = "1" ]; then
+ [ -n "$_newoption" ] && warn "Option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated."
+ fi
echo 1
debug_on
return 0
fi
+ _deprecated=0
shift 2;;
-n) if _dogetarg $2 >/dev/null; then
echo 0;
+ if [ "$_deprecated" = "1" ]; then
+ [ -n "$_newoption" ] && warn "Option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated."
+ fi
debug_on
return 1
fi
+ _deprecated=0
shift 2;;
- *) if _dogetarg $1; then
+ *) if [ -z "$_newoption" ]; then
+ _newoption=$1
+ fi
+ if _dogetarg $1; then
+ if [ "$_deprecated" = "1" ]; then
+ [ -n "$_newoption" ] && warn "Option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated."
+ fi
debug_on
return 0;
fi
+ _deprecated=0
shift;;
esac
done
@@ -168,15 +185,26 @@ _dogetargs() {
getargs() {
debug_off
- local _val _i _args _gfound
+ local _val _i _args _gfound _deprecated
unset _val
unset _gfound
+ _newoption="$1"
_args="$@"
set --
for _i in $_args; do
+ if [ "$i" = "-d" ]; then
+ _deprecated=1
+ continue
+ fi
_val="$(_dogetargs $_i)"
- [ $? -eq 0 ] && _gfound=1
+ if [ $? -eq 0 ]; then
+ if [ "$_deprecated" = "1" ]; then
+ [ -n "$_newoption" ] && warn "Option '$_i' is deprecated, use '$_newoption' instead." || warn "Option $_i is deprecated!"
+ fi
+ _gfound=1
+ fi
[ -n "$_val" ] && set -- "$@" "$_val"
+ _deprecated=0
done
if [ -n "$_gfound" ]; then
if [ $# -gt 0 ]; then
@@ -250,7 +278,7 @@ setdebug() {
if [ -z "$RD_DEBUG" ]; then
if [ -e /proc/cmdline ]; then
RD_DEBUG=no
- if getargbool 0 rd.debug -y rdinitdebug -y rdnetdebug; then
+ if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
RD_DEBUG=yes
[ -n "$BASH" ] && \
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
@@ -314,8 +342,8 @@ die() {
check_quiet() {
if [ -z "$DRACUT_QUIET" ]; then
DRACUT_QUIET="yes"
- getargbool 0 rd.info -y rdinfo && DRACUT_QUIET="no"
- getargbool 0 rd.debug -y rdinitdebug && DRACUT_QUIET="no"
+ getargbool 0 rd.info -d -y rdinfo && DRACUT_QUIET="no"
+ getargbool 0 rd.debug -d -y rdinitdebug && DRACUT_QUIET="no"
getarg quiet || DRACUT_QUIET="yes"
a=$(getarg loglevel=)
[ -n "$a" ] && [ $a -ge 28 ] && DRACUT_QUIET="yes"
@@ -831,7 +859,7 @@ emergency_shell()
source_hook "$hook"
echo
- if getargbool 1 rd.shell -y rdshell || getarg rd.break rdbreak; then
+ if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
if [ -x /lib/systemd/systemd ]; then
> /.console_lock
echo "PS1=\"$_rdshell_name:\${PWD}# \"" >/etc/profile
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 3eb6424..c33f182 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -108,7 +108,7 @@ fi
source_conf /etc/conf.d
# run scriptlets to parse the command line
-getarg 'rd.break=cmdline' 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
+getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
source_hook cmdline
[ -z "$root" ] && die "No or empty root= argument"
@@ -117,7 +117,7 @@ source_hook cmdline
export root rflags fstype netroot NEWROOT
# pre-udev scripts run before udev starts, and are run only once.
-getarg 'rd.break=pre-udev' 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break before pre-udev"
+getarg 'rd.break=pre-udev' -d 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break before pre-udev"
source_hook pre-udev
# start up udev and trigger cold plugs
@@ -131,11 +131,11 @@ if [ $UDEVVERSION -lt 140 ]; then
UDEV_QUEUE_EMPTY="udevadm settle --timeout=1"
fi
-getargbool 0 rd.udev.info -y rdudevinfo && udevadm control "$UDEV_LOG_PRIO_ARG=info"
-getargbool 0 rd.udev.debug -y rdudevdebug && udevadm control "$UDEV_LOG_PRIO_ARG=debug"
+getargbool 0 rd.udev.info -d -y rdudevinfo && udevadm control "$UDEV_LOG_PRIO_ARG=info"
+getargbool 0 rd.udev.debug -d -y rdudevdebug && udevadm control "$UDEV_LOG_PRIO_ARG=debug"
udevproperty "hookdir=$hookdir"
-getarg 'rd.break=pre-trigger' 'rdbreak=pre-trigger' && emergency_shell -n pre-trigger "Break before pre-trigger"
+getarg 'rd.break=pre-trigger' -d 'rdbreak=pre-trigger' && emergency_shell -n pre-trigger "Break before pre-trigger"
source_hook pre-trigger
udevadm control --reload >/dev/null 2>&1 || :
@@ -143,9 +143,9 @@ udevadm control --reload >/dev/null 2>&1 || :
udevadm trigger --type=subsystems --action=add >/dev/null 2>&1
udevadm trigger --type=devices --action=add >/dev/null 2>&1
-getarg 'rd.break=initqueue' 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"
+getarg 'rd.break=initqueue' -d 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"
-RDRETRY=$(getarg rd.retry 'rd_retry=')
+RDRETRY=$(getarg rd.retry -d 'rd_retry=')
RDRETRY=${RDRETRY:-20}
RDRETRY=$(($RDRETRY*2))
export RDRETRY
@@ -202,11 +202,11 @@ unset RDRETRY
# pre-mount happens before we try to mount the root filesystem,
# and happens once.
-getarg 'rd.break=pre-mount' 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
+getarg 'rd.break=pre-mount' -d 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
source_hook pre-mount
-getarg 'rd.break=mount' 'rdbreak=mount' && emergency_shell -n mount "Break mount"
+getarg 'rd.break=mount' -d 'rdbreak=mount' && emergency_shell -n mount "Break mount"
# mount scripts actually try to mount the root filesystem, and may
# be sourced any number of times. As soon as one suceeds, no more are sourced.
i=0
@@ -237,11 +237,11 @@ done
# pre pivot scripts are sourced just before we doing cleanup and switch over
# to the new root.
-getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot"
+getarg 'rd.break=pre-pivot' -d 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot"
source_hook pre-pivot
# pre pivot cleanup scripts are sourced just before we switch over to the new root.
-getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
+getarg 'rd.break=cleanup' -d 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
source_hook cleanup
# By the time we get here, the root filesystem should be mounted.
@@ -340,7 +340,7 @@ wait_for_loginit
# remove helper symlink
[ -h /dev/root ] && rm -f /dev/root
-getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
+getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root"
info "Switching root"
diff --git a/modules.d/99base/mount-hook.sh b/modules.d/99base/mount-hook.sh
index db07866..e32ecae 100755
--- a/modules.d/99base/mount-hook.sh
+++ b/modules.d/99base/mount-hook.sh
@@ -81,7 +81,7 @@ mount_root() {
fi
rootopts=
- if getargbool 1 rd.fstab -n rd_NO_FSTAB \
+ if getargbool 1 rd.fstab -d -n rd_NO_FSTAB \
&& ! getarg rootflags \
&& [ -f "$NEWROOT/etc/fstab" ] \
&& ! [ -L "$NEWROOT/etc/fstab" ]; then