diff options
author | Jonathan Bauer | 2017-03-07 11:14:32 +0100 |
---|---|---|
committer | Jonathan Bauer | 2017-03-07 11:14:32 +0100 |
commit | 9b61577c3ceb809c2473d4757590a01054466eaf (patch) | |
tree | 2bbbd2dc0a7e79f8509b53bef2f1aba939900489 /builder/modules.d/bootnet-conf | |
parent | Yannick Bilger's WLAN boot prototype (diff) | |
download | systemd-init-9b61577c3ceb809c2473d4757590a01054466eaf.tar.gz systemd-init-9b61577c3ceb809c2473d4757590a01054466eaf.tar.xz systemd-init-9b61577c3ceb809c2473d4757590a01054466eaf.zip |
moved all dracut modules to modules.d/ + support
Diffstat (limited to 'builder/modules.d/bootnet-conf')
-rwxr-xr-x | builder/modules.d/bootnet-conf/module-setup.sh | 13 | ||||
-rwxr-xr-x | builder/modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh | 18 |
2 files changed, 31 insertions, 0 deletions
diff --git a/builder/modules.d/bootnet-conf/module-setup.sh b/builder/modules.d/bootnet-conf/module-setup.sh new file mode 100755 index 00000000..f1d6697f --- /dev/null +++ b/builder/modules.d/bootnet-conf/module-setup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +check() { + # Tell dracut that this module should only be included if it is required + # explicitly. + return 255 +} +depends() { + echo dnbd3-rootfs +} +install() { + inst_hook pre-pivot 50 "$moddir/scripts/gen-bootnet-conf.sh" +} diff --git a/builder/modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh b/builder/modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh new file mode 100755 index 00000000..ec82f143 --- /dev/null +++ b/builder/modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh + +mac="$(getargs BOOTIF=)" +mac="$(echo $mac | cut -c 4- | tr '-' ':')" +if [ -n "${mac}" ]; then + cat << EOF >> "${NEWROOT}/etc/sysconfig/network-scripts/ifcfg-bootnet" +DEVICE=bootnet +NAME=bootnet +HWADDR=${mac} +BOOTPROTO=dhcp +ONBOOT=yes +NM_CONTROLLED=yes +EOF +else + echo "Could not parse MAC" +fi |