Skip to content

Commit 1d7c55e

Browse files
committed
add --extra-kargs to customize kernel arguments
Now one can customize the kernel arguments. For example, the podman machine folks don't want composefs so they can pass in: ``` custom-coreos-disk-images.sh --extra-kargs='ostree.prepare-root.composefs=0' ```
1 parent 500642f commit 1d7c55e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

custom-coreos-disk-images.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ check_rpms() {
5252
main() {
5353

5454
# Call getopt to validate the provided input.
55-
options=$(getopt --options - --longoptions 'imgref:,ociarchive:,osname:,platforms:,metal-image-size:,cloud-image-size:' -- "$@")
55+
options=$(getopt --options - --longoptions 'imgref:,ociarchive:,osname:,platforms:,metal-image-size:,cloud-image-size:,extra-kargs:' -- "$@")
5656
if [ $? -ne 0 ]; then
5757
echo "Incorrect options provided"
5858
exit 1
@@ -64,6 +64,10 @@ main() {
6464
shift # The arg is next in position args
6565
cloud_image_size=$1
6666
;;
67+
--extra-kargs)
68+
shift # The arg is next in position args
69+
extra_kargs="$1"
70+
;;
6771
--imgref)
6872
shift # The arg is next in position args
6973
imgref=$1
@@ -137,7 +141,15 @@ main() {
137141
# Default Metal Image Size
138142
metal_image_size="${metal_image_size:-3072}"
139143

140-
# Make a local tmpdir and outidr
144+
# Default kernel arguments are different for FCOS/RHCOS
145+
if [ -z "${extra_kargs:-}" ]; then
146+
extra_kargs="" # RHCOS
147+
if [ "$osname" == 'fedora-coreos' ]; then
148+
extra_kargs="mitigations=auto,nosmt" # FCOS
149+
fi
150+
fi
151+
152+
# Make a local tmpdir and outdir
141153
tmpdir=$(mktemp -d ./tmp-osbuild-XXX)
142154
outdir="${tmpdir}/out"
143155
mkdir $outdir
@@ -171,7 +183,7 @@ main() {
171183
"metal-image-size": "${metal_image_size}",
172184
"cloud-image-size": "${cloud_image_size}",
173185
"rootfs-size": "0",
174-
"extra-kargs-string": ""
186+
"extra-kargs-string": "${extra_kargs}"
175187
}
176188
EOF
177189
"${tmpdir}/runvm-osbuild" \

0 commit comments

Comments
 (0)