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/dns | |
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/dns')
-rwxr-xr-x | builder/modules.d/dns/module-setup.sh | 13 | ||||
-rwxr-xr-x | builder/modules.d/dns/scripts/gen-resolv-conf.sh | 11 |
2 files changed, 24 insertions, 0 deletions
diff --git a/builder/modules.d/dns/module-setup.sh b/builder/modules.d/dns/module-setup.sh new file mode 100755 index 00000000..3bad6548 --- /dev/null +++ b/builder/modules.d/dns/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 base +} +install() { + inst_hook pre-mount 50 "$moddir/scripts/gen-resolv-conf.sh" +} diff --git a/builder/modules.d/dns/scripts/gen-resolv-conf.sh b/builder/modules.d/dns/scripts/gen-resolv-conf.sh new file mode 100755 index 00000000..1601bb12 --- /dev/null +++ b/builder/modules.d/dns/scripts/gen-resolv-conf.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh + +CONFFILE="/etc/resolv.conf" + +DNS=$(getargs dns=) +HOSTNAME=$(getargs hostname=) + +[ -n "$DNS" ] && echo "nameserver $DNS" >> "$CONFFILE" +[ -n "$HOSTNAME" ] && echo "$HOSTNAME" >> /etc/hostname |