Skip to content

Commit 0ebe7ae

Browse files
authored
Merge pull request #818 from e0ne/kargs-ubuntu
Skip kernel parameters configuration for Ubuntu
2 parents 1ae809e + 81c67cc commit 0ebe7ae

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

bindata/scripts/kargs.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ declare -a kargs=( "$@" )
77
ret=0
88
args=$(chroot /host/ cat /proc/cmdline)
99

10+
IS_OS_UBUNTU=true; [[ "$(chroot /host/ grep -i ubuntu /etc/os-release -c)" == "0" ]] && IS_OS_UBUNTU=false
11+
12+
# Kernel args configuration isn't supported for Ubuntu now, so we shouldn't do anything here
13+
if ${IS_OS_UBUNTU} ; then
14+
echo $ret
15+
exit 0
16+
fi
17+
1018
if chroot /host/ test -f /run/ostree-booted ; then
1119
for t in "${kargs[@]}";do
1220
if [[ $command == "add" ]];then

test/scripts/kargs_test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SUT_SCRIPT="${SCRIPTPATH}/../../bindata/scripts/kargs.sh"
66

77

88
test_RpmOstree_Add_All_Arguments() {
9+
echo "ID=\"rhel\"" > ${FAKE_HOST}/etc/os-release
910
echo "a b c=d eee=fff" > ${FAKE_HOST}/proc/cmdline
1011
touch ${FAKE_HOST}/run/ostree-booted
1112

@@ -19,6 +20,7 @@ test_RpmOstree_Add_All_Arguments() {
1920

2021

2122
test_RpmOstree_Add_Only_Missing_Arguments() {
23+
echo "ID=\"rhel\"" > ${FAKE_HOST}/etc/os-release
2224
echo "a b c=d eee=fff K=L" > ${FAKE_HOST}/proc/cmdline
2325
touch ${FAKE_HOST}/run/ostree-booted
2426

@@ -31,6 +33,7 @@ test_RpmOstree_Add_Only_Missing_Arguments() {
3133
}
3234

3335
test_RpmOstree_Delete_All_Arguments() {
36+
echo "ID=\"rhel\"" > ${FAKE_HOST}/etc/os-release
3437
echo "a b c=d eee=fff X=Y W=Z" > ${FAKE_HOST}/proc/cmdline
3538
touch ${FAKE_HOST}/run/ostree-booted
3639

@@ -43,6 +46,7 @@ test_RpmOstree_Delete_All_Arguments() {
4346
}
4447

4548
test_RpmOstree_Delete_Only_Exist_Arguments() {
49+
echo "ID=\"rhel\"" > ${FAKE_HOST}/etc/os-release
4650
echo "a b c=d eee=fff X=Y" > ${FAKE_HOST}/proc/cmdline
4751
touch ${FAKE_HOST}/run/ostree-booted
4852

0 commit comments

Comments
 (0)