Skip to content

Commit

Permalink
Make kairos-sysext be generic enough to include on all flavors
Browse files Browse the repository at this point in the history
It will not install the systemd-sysext package if the binary is not
there

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Oct 10, 2023
1 parent 1e43ee2 commit f0586f2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/dracut/sysext/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image: alpine
package_dir: "/package"
steps:
- mkdir -p /package/etc/systemd/network
- mkdir -p /package/etc/dracut.conf.d
- cp -rfv conf/* /package/etc/dracut.conf.d
- cp files/90-kairos-sysext.conf /package/etc/dracut.conf.d/90-kairos-sysext.conf
- cp -r files/90kairos-sysext /package/usr/lib/dracut/modules.d/90kairos-sysext
4 changes: 2 additions & 2 deletions packages/dracut/sysext/collection.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
packages:
- name: "sysext"
- name: "kairos-sysext"
category: "dracut"
version: "0.9"
version: "1.0.0"
1 change: 0 additions & 1 deletion packages/dracut/sysext/conf/90-kairos-sysext.conf

This file was deleted.

1 change: 1 addition & 0 deletions packages/dracut/sysext/files/90-kairos-sysext.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_dracutmodules+=" kairos-sysext "
26 changes: 26 additions & 0 deletions packages/dracut/sysext/files/90kairos-sysext/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# This module tries to add systemd-sysext module to the initramfs if its in the system, otherwise it does nothing

# called by dracut
check() {
# Return 255 to only include the module, if another module requires it.
return 255
}

# called by dracut
depends() {
# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries systemd-sysext || return 1
echo "systemd-sysext"
return 0
}

# called by dracut
installkernel() {
return 0
}

# called by dracut
install() {
return 0
}

0 comments on commit f0586f2

Please sign in to comment.