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 11, 2024
1 parent dc9c652 commit 16dce6c
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 newversion="$(printf "%03d" "$(expr "$(echo $ZFS_DKMS_VERSION | sed 's/\.//g')" - 1)")"
local zfs_dkms_version=$(echo "${newversion:1:1}.${newversion:2:1}.${newversion:2:3}")
ZFS_KERNEL_MAX=$(wget -qO- https://raw.githubusercontent.com/openzfs/zfs/refs/tags/zfs-${zfs_dkms_version}/META | grep Maximum | cut -d" " -f2)
fi
# detect desktop
check_desktop

Expand Down

0 comments on commit 16dce6c

Please sign in to comment.