This repository has been archived by the owner on Aug 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dracut/30ignition: support
coreos.no_persist_ip
When `coreos.no_persist_ip` is not specified in a true value persist ifcfg files created by the `write-ifcfg.sh` script run as part of the dracut `45ifcfg` module to the real root.
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | ||
# ex: ts=8 sw=4 sts=4 et filetype=sh | ||
|
||
set -e | ||
|
||
cmdline=( $(</proc/cmdline) ) | ||
|
||
cmdline_arg() { | ||
local name="$1" value="$2" | ||
for arg in "${cmdline[@]}"; do | ||
if [[ "${arg%%=*}" == "${name}" ]]; then | ||
value="${arg#*=}" | ||
fi | ||
done | ||
echo "${value}" | ||
} | ||
|
||
cmdline_bool() { | ||
local value=$(cmdline_arg "$@") | ||
case "$value" in | ||
""|0|no|off) return 1;; | ||
*) return 0;; | ||
esac | ||
} | ||
|
||
if ! $(cmdline_bool 'coreos.no_persist_ip' 0); then | ||
cp /tmp/ifcfg/* /sysroot/etc/sysconfig/network-scripts/ | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters