Skip to content

Commit

Permalink
Fix network module (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka authored Oct 15, 2023
1 parent 030e223 commit 974753f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/dracut/kairos-network/collection.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
packages:
- name: "kairos-network"
category: "dracut"
version: "1.0.0"
version: "1.1.0"
description: "package for initramfs network modules"
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
omit_dracutmodules+=" systemd-networkd "
add_dracutmodules+=" kairos-network "
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
#!/bin/bash
# This module selects the proper network module to be used by dracut
# while avoiding using systemd-networkd
# This helps it be more generic and work on all kairos flavors easily without having
# to specify the network module directly in our framework packages list

# called by dracut
check() {
return 255
# always include this module
return 0
}

# 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
# Network module: selects underlying network module (conman, networkmanager, network-legacy, systemd-networkd)
# network module needs to be installed for livenet module to work
# network-legacy just uses bash scripts to setup the network
# ubuntu-20 uses network
# ubuntu-22 uses network+network-legacy
# ubuntu-latest, debian, fedora,opensuse-*, almalinux, rockylinux uses network+network-legacy+systemd-networkd
# Im guessing we need the network module in the initramfs in case we set the rd.neednet=1
# but that only affects conman, networkmanager and network-legacy?

if [ -z "$network_handler" ]; then
if check_module "network-legacy"; then
network_handler="network-legacy"
else
network_handler="network"
fi
# shellcheck disable=SC2144
# add network-legacy module if it exists
if [ -d "${dracutbasedir}"/modules.d/??network-legacy ]; then
network_handler="network-legacy"
fi
echo "kernel-network-modules $network_handler"

echo "kernel-network-modules network $network_handler"
return 0
}

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 974753f

Please sign in to comment.