From 81c67cce3f56d53fb935835bbeab042ac4ebac6f Mon Sep 17 00:00:00 2001 From: Ivan Kolodiazhnyi Date: Tue, 17 Dec 2024 14:19:38 +0200 Subject: [PATCH] Skip kernel parameters configuration for Ubuntu It's enouph to configure ib_core module in /etc/moprobe.d/ for Ubuntu OS to change RDMA subsystem mode. Also this commit add OS check into kargs.sh error because 'grubby' isn't available in official Ubuntu repositories. Kernel param configuration support in Ubuntu should be implemented in a separate commit. Signed-off-by: Ivan Kolodiazhnyi --- bindata/scripts/kargs.sh | 8 ++++++++ test/scripts/kargs_test.sh | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/bindata/scripts/kargs.sh b/bindata/scripts/kargs.sh index 8d118456e..07e283600 100755 --- a/bindata/scripts/kargs.sh +++ b/bindata/scripts/kargs.sh @@ -7,6 +7,14 @@ declare -a kargs=( "$@" ) ret=0 args=$(chroot /host/ cat /proc/cmdline) +IS_OS_UBUNTU=true; [[ "$(chroot /host/ grep -i ubuntu /etc/os-release -c)" == "0" ]] && IS_OS_UBUNTU=false + +# Kernel args configuration isn't supported for Ubuntu now, so we shouldn't do anything here +if ${IS_OS_UBUNTU} ; then + echo $ret + exit 0 +fi + if chroot /host/ test -f /run/ostree-booted ; then for t in "${kargs[@]}";do if [[ $command == "add" ]];then diff --git a/test/scripts/kargs_test.sh b/test/scripts/kargs_test.sh index 053bd5200..3e191f230 100755 --- a/test/scripts/kargs_test.sh +++ b/test/scripts/kargs_test.sh @@ -6,6 +6,7 @@ SUT_SCRIPT="${SCRIPTPATH}/../../bindata/scripts/kargs.sh" test_RpmOstree_Add_All_Arguments() { + echo "ID=\"rhel\"" > ${FAKE_HOST}/etc/os-release echo "a b c=d eee=fff" > ${FAKE_HOST}/proc/cmdline touch ${FAKE_HOST}/run/ostree-booted @@ -19,6 +20,7 @@ test_RpmOstree_Add_All_Arguments() { test_RpmOstree_Add_Only_Missing_Arguments() { + echo "ID=\"rhel\"" > ${FAKE_HOST}/etc/os-release echo "a b c=d eee=fff K=L" > ${FAKE_HOST}/proc/cmdline touch ${FAKE_HOST}/run/ostree-booted @@ -31,6 +33,7 @@ test_RpmOstree_Add_Only_Missing_Arguments() { } test_RpmOstree_Delete_All_Arguments() { + echo "ID=\"rhel\"" > ${FAKE_HOST}/etc/os-release echo "a b c=d eee=fff X=Y W=Z" > ${FAKE_HOST}/proc/cmdline touch ${FAKE_HOST}/run/ostree-booted @@ -43,6 +46,7 @@ test_RpmOstree_Delete_All_Arguments() { } test_RpmOstree_Delete_Only_Exist_Arguments() { + echo "ID=\"rhel\"" > ${FAKE_HOST}/etc/os-release echo "a b c=d eee=fff X=Y" > ${FAKE_HOST}/proc/cmdline touch ${FAKE_HOST}/run/ostree-booted