Skip to content

Commit 77c3a41

Browse files
committed
feature/kickstart: allow to disable kickstart from cmdline
A default value has been added to avoid requiring the ksfile= parameter to be present at all times. Now if the ksfile= parameter is not specified, "/etc/ks.conf.d/default" will be used. At the same time, the "noksfile" parameter was added to turn off kickstart execution or alternatively specify ksfile=none. Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
1 parent 7879a05 commit 77c3a41

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

features/kickstart/bin/get-ks-configs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
DIR="$WORKDIR/root"
55
mkdir -p -- "$DIR/etc/ks.conf.d"
6+
:> "$DIR"/etc/ks.conf.d/none
67

78
for ks in ${KICKSTART_CONFIGS-}; do
89
cp -f -- "$ks" "$DIR"/etc/ks.conf.d/
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
register_parameter string KSFILE
1+
register_parameter string KSFILE default
2+
register_parameter bool NOKSFILE

features/kickstart/data/etc/rc.d/init.d/kickstart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
. /.initrd/initenv
1818

19-
[ -n "${KSFILE-}" ] || exit 0
19+
[ -z "${NOKSFILE-}" ] || exit 0
2020

21-
[ -z "${KSFILE##/*}" ] ||
21+
[ -n "${KSFILE-}" ] && [ -z "${KSFILE##/*}" ] ||
2222
KSFILE="/etc/ks.conf.d/$KSFILE"
2323

2424
if [ -s "$KSFILE" ]; then

features/kickstart/data/etc/rc.d/init.d/kickstart-prepare

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@
1717

1818
. /.initrd/initenv
1919

20-
[ -n "${KSFILE-}" ] || exit 0
20+
[ -z "${NOKSFILE-}" ] || exit 0
2121

22-
. uevent-sh-functions
22+
[ -n "${KSFILE-}" ] && [ -z "${KSFILE##/*}" ] ||
23+
KSFILE="/etc/ks.conf.d/$KSFILE"
2324

24-
mkdir -p -- "$uevent_confdb/queue/pause/udev"
25-
mkdir -p -- "$uevent_confdb/queue/pause/md-raid-member"
25+
if [ -s "$KSFILE" ]; then
26+
. uevent-sh-functions
27+
28+
mkdir -p -- "$uevent_confdb/queue/pause/udev"
29+
mkdir -p -- "$uevent_confdb/queue/pause/md-raid-member"
30+
fi

0 commit comments

Comments
 (0)