Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions package/harvester-os/files/system/oem/90_network.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
name: "Network configuration"
stages:
# dracut's network-manager module runs at the very end of initrd process, after cOS' "rootfs" and "initramfs" stages,
# so we need to copy these connection profile files at the boot stage
boot:
- name: Copy NetworkManager connections generated by dracut
if: cat /proc/cmdline | grep -q "harvester.install.automatic=true"
commands:
- |
echo "Copy NetworkManager connection profiles generated by dracut to sysroot"
cp /run/initramfs/state/etc/NetworkManager/system-connections/* /etc/NetworkManager/system-connections/

- name: Copy resolv.conf generated by dracut
if: cat /proc/cmdline | grep -q "harvester.install.automatic=true"
commands:
- |
generated_resolv="/run/initramfs/state/etc/resolv.conf"
if [ -f $generated_resolv ]; then
cp $generated_resolv /etc/resolv.conf
echo "Copied $generated_resolv to /etc/resolv.conf"
else
# TODO: Figure out if this section is necessary or not for NetworkManager
# ifcfg module does not recognize the net.*.resolv.conf.ipv4 because of those ipv4 suffix.
# We need to gather them by ourselves
for i in /run/initramfs/net.*.resolv.conf*; do
[ -f "$i" ] && cat "$i"
done | sort -u > /etc/resolv.conf
echo "/etc/resolv.conf is generated from each interface's resolv.conf"
fi
network:
- name: Bring up interfaces
commands:
Expand Down
Loading