Add generic network package valid for all flavors (#476)

This commit is contained in:
Itxaka 2023-10-10 13:49:36 +02:00 committed by GitHub
parent d8b416baab
commit adc4d0714f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 55 additions and 21 deletions

View File

@ -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

View File

@ -0,0 +1,5 @@
packages:
- name: "kairos-network"
category: "dracut"
version: "1.0.0"
description: "package for initramfs network modules"

View File

@ -1,2 +1,2 @@
omit_dracutmodules+=" systemd-networkd " omit_dracutmodules+=" systemd-networkd "
add_dracutmodules+=" network-legacy " add_dracutmodules+=" kairos-network "

View File

@ -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
}

View File

@ -1,5 +0,0 @@
image: alpine
package_dir: "/package"
steps:
- mkdir -p /package/etc/dracut.conf.d
- cp -rfv conf/* /package/etc/dracut.conf.d

View File

@ -1,4 +0,0 @@
packages:
- name: "network-legacy-compat"
category: "dracut"
version: "0.9"

View File

@ -1,2 +0,0 @@
omit_dracutmodules+=" systemd-networkd "
add_dracutmodules+=" network "

View File

@ -1,5 +0,0 @@
image: alpine
package_dir: "/package"
steps:
- mkdir -p /package/etc/dracut.conf.d
- cp -rfv conf/* /package/etc/dracut.conf.d

View File

@ -1,4 +0,0 @@
packages:
- name: "network-legacy"
category: "dracut"
version: "0.9"