Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] Use a single network dracut package #1900

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ framework:
END
END

COPY kairos-network /framework/usr/lib/dracut/modules.d/29kairos-network
RUN mkdir -p /framework/etc/dracut.conf.d
COPY net.conf /framework/etc/dracut.conf.d/10-kairos-network.conf
SAVE ARTIFACT --keep-own /framework/ framework

build-framework-image:
Expand Down
24 changes: 0 additions & 24 deletions framework-profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,91 +11,74 @@ flavors:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy
debian-arm-rpi:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy
ubuntu:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy
ubuntu-arm-rpi:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy
ubuntu-20-lts-arm-nvidia-jetson-agx-orin:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy-compat
ubuntu-20-lts-arm-rpi:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy-compat
ubuntu-22-lts-arm-rpi:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy-compat
ubuntu-22-lts:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy-compat
ubuntu-20-lts:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy-compat
fips-systemd:
- common-packages
- kairos-toolchain-fips
- systemd-base
- dracut-network-legacy-compat
fedora:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy-compat
rockylinux:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy-compat
almalinux:
- common-packages
- kairos-toolchain
- systemd-base
- dracut-network-legacy-compat
opensuse-tumbleweed:
- common-packages
- kairos-toolchain
- systemd-base
- systemd-latest
- dracut-network-legacy
opensuse-tumbleweed-arm-rpi:
- common-packages
- kairos-toolchain
- systemd-base
- systemd-latest
- dracut-network-legacy
opensuse-leap:
- common-packages
- kairos-toolchain
- systemd-base
- systemd-latest
- dracut-network-legacy
opensuse-leap-arm-rpi:
- common-packages
- kairos-toolchain
- systemd-base
- systemd-latest
- dracut-network-legacy
alpine-arm-rpi:
- common-packages
- kairos-toolchain
Expand All @@ -111,13 +94,6 @@ flavors:
- kairos-toolchain
- ubuntu-kernel
- openrc
# See https://github.com/kairos-io/packages/pull/67 for rationale
dracut-network-legacy:
packages:
- dracut/network-legacy
dracut-network-legacy-compat:
packages:
- dracut/network-legacy-compat
openrc:
packages:
- init-svc/openrc
Expand Down
40 changes: 40 additions & 0 deletions kairos-network/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
# This module selects the proper network module to be used by dracut
# while avoiding using systemd-networkd

# called by dracut
check() {
return 255
}

# called by dracut
depends() {
is_qemu_virtualized && echo -n "qemu-net "

for module in network network-legacy; do
if dracut_module_included "$module"; then
network_handler="$module"
break
fi
done

if [ -z "$network_handler" ]; then
if check_module "network-legacy"; then
network_handler="network-legacy"
else
network_handler="network"
fi
fi
echo "kernel-network-modules $network_handler"
return 0
}

# called by dracut
installkernel() {
return 0
}

# called by dracut
install() {
dracut_need_initqueue
}
2 changes: 2 additions & 0 deletions net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
omit_dracutmodules+=" systemd-networkd "
add_dracutmodules+=" kairos-network "