summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Yeh <[email protected]>2022-05-18 09:17:05 +0800
committerKevin Yeh <[email protected]>2022-05-18 09:17:05 +0800
commit0e58657eb100ef23cd9e55b6c84f684c4becca01 (patch)
treeab687bf738816c9615581e65a86ed72b661b4041
parentd428d6da6c4062025c5796c822f27b974c722a39 (diff)
add a variable to recognize which ubuntu release is running since the output format of "dkms status" is different on Jammy.
-rwxr-xr-xbin/dkms_build_validation11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/dkms_build_validation b/bin/dkms_build_validation
index a53441d..2444064 100755
--- a/bin/dkms_build_validation
+++ b/bin/dkms_build_validation
@@ -15,8 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-kernel_ver_min=`dkms status | awk -F ', ' {'print $3'} | sort -V | uniq | head -1`
-kernel_ver_max=`dkms status | awk -F ', ' {'print $3'} | sort -V | uniq | tail -1`
+ubuntu_release=`lsb_release -r | cut -d ':' -f 2 | xargs`
+
+if [ $ubuntu_release = '22.04' ]; then
+ kernel_ver_min=`dkms status | awk -F ', ' {'print $2'} | sort -V | uniq | head -1`
+ kernel_ver_max=`dkms status | awk -F ', ' {'print $2'} | sort -V | uniq | tail -1`
+else
+ kernel_ver_min=`dkms status | awk -F ', ' {'print $3'} | sort -V | uniq | head -1`
+ kernel_ver_max=`dkms status | awk -F ', ' {'print $3'} | sort -V | uniq | tail -1`
+fi
kernel_ver_current=`uname -r`
number_dkms_min=`dkms status | grep $kernel_ver_min | grep installed | wc -l`