Really, really, this time for sure, fix the network stack (#523)

This commit is contained in:
Itxaka 2023-10-25 11:24:39 +02:00 committed by GitHub
parent 362058eda5
commit 93f1b62c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 4 deletions

View File

@ -1,4 +1,4 @@
packages: packages:
- name: "kairos-overlay-files" - name: "kairos-overlay-files"
category: "static" category: "static"
version: "1.1.10" version: "1.1.11"

View File

@ -1,6 +1,6 @@
name: "Default network configuration" name: "Default network configuration"
stages: stages:
rootfs: rootfs.before:
- name: "Enable systemd-network config files for DHCP" # Needed if systemd-networkd runs in the initramfs! - name: "Enable systemd-network config files for DHCP" # Needed if systemd-networkd runs in the initramfs!
if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]' if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]'
directories: directories:
@ -15,9 +15,20 @@ stages:
group: 0 group: 0
content: | content: |
[Match] [Match]
Name=en* eth* Name=en*
[Network] [Network]
DHCP=yes DHCP=yes
- path: /etc/systemd/network/20-dhcp-legacy.network
permissions: 0644
owner: 0
group: 0
content: |
[Match]
Name=eth*
[Network]
DHCP=yes
commands:
- networkctl reload # make sure it reloads our config files
initramfs: initramfs:
- name: "Enable systemd-network config files for DHCP" - name: "Enable systemd-network config files for DHCP"
if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]' if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]'
@ -28,9 +39,20 @@ stages:
group: 0 group: 0
content: | content: |
[Match] [Match]
Name=en* eth* Name=en*
[Network] [Network]
DHCP=yes DHCP=yes
- path: /etc/systemd/network/20-dhcp-legacy.network
permissions: 0644
owner: 0
group: 0
content: |
[Match]
Name=eth*
[Network]
DHCP=yes
commands:
- networkctl reload # make sure it reloads our config files
- name: "Disable NetworkManager and wicked" - name: "Disable NetworkManager and wicked"
if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]' if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]'
systemctl: systemctl:
@ -48,6 +70,16 @@ stages:
commands: commands:
- rm /etc/resolv.conf - rm /etc/resolv.conf
- ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf - ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
boot:
- name: "Reload systemd-networkd config"
if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]'
commands:
- networkctl reload # make sure it reloads our config files
fs:
- name: "Reload systemd-networkd config"
if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]'
commands:
- networkctl reload # make sure it reloads our config files
# dns: # dns:
# path: /etc/resolv.conf # path: /etc/resolv.conf
# nameservers: # nameservers: