Skip to content

Commit

Permalink
Merge pull request #818 from e0ne/kargs-ubuntu
Browse files Browse the repository at this point in the history
Skip kernel parameters configuration for Ubuntu
  • Loading branch information
SchSeba authored Jan 2, 2025
2 parents 1ae809e + 81c67cc commit 0ebe7ae
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 0ebe7ae

Please sign in to comment.