Skip to content

Commit

Permalink
Compare needs to be quoted else it throws error on empty
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Dec 12, 2024
1 parent 023bc8d commit 0a257fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/json/config.system.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
],
"status": "Stable",
"author": "@armbian",
"condition": "! module_zfs status && linux-version compare ${KERNELID} le $(module_zfs kernel_max)"
"condition": "! module_zfs status && linux-version compare \"${KERNELID}\" le \"$(module_zfs kernel_max)\""
},
{
"id": "SY221",
Expand Down
9 changes: 7 additions & 2 deletions tools/modules/functions/set_runtime_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ function set_runtime_variables() {
[[ -z "${DEFAULT_ADAPTER// /}" ]] && DEFAULT_ADAPTER="lo"
# zfs subsystem - determine if our kernel is not too recent
ZFS_DKMS_VERSION=$(LC_ALL=C apt-cache policy zfs-dkms | grep Candidate | xargs | cut -d" " -f2 | cut -c-5)
ZFS_KERNEL_MAX=$(wget -qO- https://github.com/openzfs/zfs/raw/refs/tags/zfs-${ZFS_DKMS_VERSION}/META | grep Maximum | cut -d" " -f2)

ZFS_KERNEL_MAX=$(wget -qO- https://raw.githubusercontent.com/openzfs/zfs/refs/tags/zfs-${ZFS_DKMS_VERSION}/META | grep Maximum | cut -d" " -f2)
# sometimes Ubuntu sets higher version then existing tag. Lets probe previous version
if [[ -z "${ZFS_KERNEL_MAX}" ]]; then
local previous_version="$(printf "%03d" "$(expr "$(echo $ZFS_DKMS_VERSION | sed 's/\.//g')" - 1)")"
local previous_version=$(echo "${previous_version:0:1}.${previous_version:1:1}.${previous_version:2:1}")
ZFS_KERNEL_MAX=$(wget -qO- https://raw.githubusercontent.com/openzfs/zfs/refs/tags/zfs-${previous_version}/META | grep Maximum | cut -d" " -f2)
fi
# detect desktop
check_desktop

Expand Down

0 comments on commit 0a257fd

Please sign in to comment.