diff --git a/client/Cargo.toml b/client/Cargo.toml index 2887c49..56d7aa1 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -4,7 +4,7 @@ path = "src/main.rs" [package] name = "lesavka_client" -version = "0.11.27" +version = "0.11.28" edition = "2024" [dependencies] diff --git a/common/Cargo.toml b/common/Cargo.toml index 3067c98..b40b303 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lesavka_common" -version = "0.11.27" +version = "0.11.28" edition = "2024" build = "build.rs" diff --git a/common/src/cli.rs b/common/src/cli.rs index 2b09a41..f12c38c 100644 --- a/common/src/cli.rs +++ b/common/src/cli.rs @@ -17,6 +17,6 @@ mod tests { #[test] fn banner_includes_version() { - assert_eq!(banner("0.11.27"), "lesavka-common CLI (v0.11.27)"); + assert_eq!(banner("0.11.28"), "lesavka-common CLI (v0.11.28)"); } } diff --git a/scripts/install/client.sh b/scripts/install/client.sh index 3c8f90d..56fc2e8 100755 --- a/scripts/install/client.sh +++ b/scripts/install/client.sh @@ -16,6 +16,23 @@ log() { printf '==> %s\n' "$*" } +installed_kernel_module_trees() { + local roots=(/usr/lib/modules /lib/modules) + local seen=() + local root entry + for root in "${roots[@]}"; do + [[ -d $root ]] || continue + for entry in "$root"/*; do + [[ -d $entry ]] || continue + seen+=("$(basename "$entry")") + done + done + if [[ ${#seen[@]} -eq 0 ]]; then + return 0 + fi + printf '%s\n' "${seen[@]}" | awk '!seen[$0]++' +} + require_command() { local cmd=$1 local pkg_hint=$2 @@ -51,10 +68,23 @@ require_kernel_module() { if modinfo "$module" >/dev/null 2>&1; then return 0 fi + local running_kernel + running_kernel=$(uname -r) + mapfile -t module_trees < <(installed_kernel_module_trees) echo "❌ required kernel module '$module' is unavailable for the running kernel $(uname -r)." >&2 echo " Lesavka needs it for $why." >&2 - echo " This usually means the machine booted an older kernel than the modules that are currently installed." >&2 - echo " Reboot into the freshly installed kernel, then rerun the installer." >&2 + if [[ ${#module_trees[@]} -eq 0 ]]; then + echo " No kernel module trees are currently installed under /usr/lib/modules or /lib/modules." >&2 + else + echo " Installed kernel module trees: ${module_trees[*]}" >&2 + if [[ ! " ${module_trees[*]} " =~ [[:space:]]${running_kernel}[[:space:]] ]]; then + echo " The machine is booted into an older kernel than the modules that are currently installed." >&2 + echo " Reboot into one of the installed kernels above, then rerun the installer." >&2 + else + echo " The current kernel tree exists, but modinfo still cannot resolve '$module'." >&2 + echo " Verify the kernel package and headers are healthy, then rerun the installer." >&2 + fi + fi exit 1 } @@ -121,11 +151,6 @@ require_linkable "$(command -v protoc)" "protoc" if [[ -e /usr/lib/libclang.so ]]; then require_linkable /usr/lib/libclang.so "libclang" fi -if [[ ! -d /lib/modules/$(uname -r) ]]; then - echo "❌ no kernel module tree exists for the running kernel $(uname -r)." >&2 - echo " Reboot into the freshly installed kernel, then rerun the installer." >&2 - exit 1 -fi require_kernel_module snd_usb_audio "USB microphones and USB headsets" require_gst_element pulsesrc require_gst_element pulsesink diff --git a/server/Cargo.toml b/server/Cargo.toml index f94f2cd..083fcfc 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -10,7 +10,7 @@ bench = false [package] name = "lesavka_server" -version = "0.11.27" +version = "0.11.28" edition = "2024" autobins = false