[__jool] Use explorer to determine alpine kernel version.

This commit is contained in:
sparrowhawk 2021-04-21 11:03:00 +02:00
parent 272e4669fe
commit 40d19f0ad6
No known key found for this signature in database
GPG key ID: 6778C9C29C02D691
3 changed files with 15 additions and 17 deletions

View file

@ -0,0 +1,13 @@
#!/bin/sh
# Explorer for the __jool type to determine if we need the -virt or the -lts modules.
[ "$(sh -e "${__explorer:?}"/os)" = 'alpine' ] || exit 0
case $(uname -r) in
*-virt)
printf "jool-modules-virt"
;;
*-lts)
printf "jool-modules-lts"
;;
esac

View file

@ -36,13 +36,6 @@ pool6
The IPv6 prefix used to map IPv4 addresses, `64:ff9b::/96` if unspecified. The IPv6 prefix used to map IPv4 addresses, `64:ff9b::/96` if unspecified.
BOOLEAN PARAMETERS
------------------
vm
Wether this instance is running in a VM or not: configures the kernel
modules that will be installed.
EXAMPLES EXAMPLES
-------- --------

View file

@ -23,7 +23,7 @@ os=$(cat "${__global:?}/explorer/os")
case "$os" in case "$os" in
'alpine') 'alpine')
: packages="jool-tools jool-tools-openrc $(cat "${__object:?}"/explorer/alpine-kernel-modules)"
;; ;;
*) *)
printf "This type has no implementation for %s. Please contribute one if you can.\n" "$os" printf "This type has no implementation for %s. Please contribute one if you can.\n" "$os"
@ -31,15 +31,7 @@ case "$os" in
;; ;;
esac esac
for pkg in $packages;
if [ -f "${__object:?}/parameter/vm" ];
then
kernel_modules="jool-modules-virt"
else
kernel_modules="jool-modules-lts"
fi
for pkg in jool-tools jool-tools-openrc "$kernel_modules";
do do
__package "$pkg" __package "$pkg"
done done