All checks were successful
infra/kickstart/pipeline/head This commit looks good
51 lines
1.2 KiB
Django/Jinja
51 lines
1.2 KiB
Django/Jinja
{# vim: set ft=sh.jinja sw=4 ts=4 sts=4 et : -#}
|
|
|
|
bootloader --location mbr
|
|
clearpart --all --initlabel
|
|
reqpart
|
|
|
|
{% include "fedora-disk-dch.ks" %}
|
|
{% include "fedora-common.ks" %}
|
|
|
|
%packages
|
|
qemu-guest-agent
|
|
-*-firmware
|
|
-fwupd
|
|
%end
|
|
|
|
%post --erroronfail
|
|
set -e
|
|
|
|
rm -rf /etc/sysconfig/network-scripts /etc/sysconfig/network
|
|
|
|
ifname=$(ip -o route get 1.1.1.1 | awk '{print $5}')
|
|
gateway=$(ip -o route get 1.1.1.1 | awk '{print $3}')
|
|
macaddr=$(ip address show dev ${ifname} | awk '$1=="link/ether"{print $2}')
|
|
ipaddr=$(ip address show dev ${ifname} | awk '$1=="inet"{print $2;exit}')
|
|
if [ -f /run/systemd/resolve/resolv.conf ]; then
|
|
resolv_conf=/run/systemd/resolve/resolv.conf
|
|
else
|
|
resolv_conf=/etc/resolv.conf
|
|
fi
|
|
nameservers=$(awk '$1=="nameserver"{print $2}' "${resolv_conf}" | xargs)
|
|
|
|
cat > /etc/systemd/network/40-pyrocufflink.network <<EOF
|
|
[Match]
|
|
MACAddress=${macaddr}
|
|
|
|
[Network]
|
|
Description=pyrocufflink.blue network
|
|
Address=${ipaddr}
|
|
Gateway=${gateway}
|
|
DNS=${nameservers}
|
|
Domains=pyrocufflink.blue
|
|
EOF
|
|
|
|
ln -srf /run/systemd/resolve/resolv.conf /etc/resolv.conf
|
|
mkdir -p /etc/systemd/resolved.conf.d
|
|
cat > /etc/systemd/resolved.conf.d/no-stub-listener.conf <<'EOF'
|
|
[Resolve]
|
|
DNSStubListener=no
|
|
EOF
|
|
%end
|