diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh index f43281b5dce..eaed0fba110 100644 --- a/package/base-files/files/lib/functions/system.sh +++ b/package/base-files/files/lib/functions/system.sh @@ -315,3 +315,10 @@ macaddr_canonicalize() { dt_is_enabled() { grep -q okay "/proc/device-tree/$1/status" } + +get_linux_version() { + local ver=$(uname -r) + local minor=${ver%\.*} + + printf "%d%02d%03d" ${ver%%\.*} ${minor#*\.} ${ver##*\.} 2>/dev/null +}