Skip to content

Commit

Permalink
Skip kernel parameters configuration for Ubuntu
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
e0ne committed Dec 31, 2024
1 parent d172b52 commit 81c67cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bindata/scripts/kargs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/scripts/kargs_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 81c67cc

Please sign in to comment.