Skip to content

Commit

Permalink
Add generic network package valid for all flavors
Browse files Browse the repository at this point in the history
Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Oct 10, 2023
1 parent 1e43ee2 commit 02f4337
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 21 deletions.
7 changes: 7 additions & 0 deletions packages/dracut/kairos-network/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
image: alpine
package_dir: "/package"
steps:
- mkdir -p /package/etc/dracut.conf.d
- mkdir -p /package/usr/lib/dracut/modules.d/
- cp files/90-kairos-network.conf /package/etc/dracut.conf.d/90-kairos-network.conf
- cp -r files/90kairos-network /package/usr/lib/dracut/modules.d/90kairos-network
5 changes: 5 additions & 0 deletions packages/dracut/kairos-network/collection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packages:
- name: "kairos-network"
category: "dracut"
version: "1.0.0"
description: "package for initramfs network modules"
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
omit_dracutmodules+=" systemd-networkd "
add_dracutmodules+=" network-legacy "
add_dracutmodules+=" kairos-network "
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/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
}

# 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
}
5 changes: 0 additions & 5 deletions packages/dracut/network-legacy-compat/build.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions packages/dracut/network-legacy-compat/collection.yaml

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/dracut/network-legacy/build.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions packages/dracut/network-legacy/collection.yaml

This file was deleted.

0 comments on commit 02f4337

Please sign in to comment.