@@ -16,6 +16,7 @@ load_vars() {
16
16
oem_size=" ${OEM_SIZE:- 64} "
17
17
recovery_size=" ${RECOVERY_SIZE:- 2192} "
18
18
default_active_size=" ${DEFAULT_ACTIVE_SIZE:- 2400} "
19
+ menu_entry=" ${DEFAULT_MENU_ENTRY:- Kairos} "
19
20
20
21
# # Repositories
21
22
final_repo=" ${FINAL_REPO:- quay.io/ costoolkit/ releases-teal-arm64} "
@@ -287,6 +288,12 @@ else
287
288
rsync -axq --exclude=' host' --exclude=' mnt' --exclude=' proc' --exclude=' sys' --exclude=' dev' --exclude=' tmp' ${directory} / $TARGET
288
289
fi
289
290
291
+ # We copy the grubmenu.cfg to a temporary location to be copied later in the state partition
292
+ # https://github.com/kairos-io/kairos/blob/62c67e3e61d49435c362014522e5c6696335376f/overlay/files/system/oem/08_grub.yaml#L105
293
+ # This is a hack and we need a better way: https://github.com/kairos-io/kairos/issues/1427
294
+ tmpgrubconfig=$( mktemp /tmp/grubmeny.cfg.XXXXXX)
295
+ cp -rfv $TARGET /etc/kairos/branding/grubmenu.cfg " ${tmpgrubconfig} "
296
+
290
297
umount $TARGET
291
298
sync
292
299
@@ -332,6 +339,8 @@ if [ -n "$EFI" ] && [ -n "$efi_dir" ]; then
332
339
cp -rfv $efi_dir /* $EFI
333
340
fi
334
341
342
+ partprobe
343
+
335
344
echo " >> Writing image and partition table"
336
345
dd if=/dev/zero of=" ${output_image} " bs=1024000 count=" ${size} " || exit 1
337
346
if [ " $model " == " rpi64" ]; then
@@ -419,7 +428,10 @@ mkdir -p $WORKDIR/persistent/cloud-config
419
428
420
429
cp -rfv /defaults.yaml $WORKDIR /persistent/cloud-config/01_defaults.yaml
421
430
422
- grub2-editenv $WORKDIR /state/grub_oem_env set " default_menu_entry=Kairos"
431
+ grub2-editenv $WORKDIR /state/grub_oem_env set " default_menu_entry=$menu_entry "
432
+
433
+ # We copy the file we saved earier to the STATE partition
434
+ cp -rfv " ${tmpgrubconfig} " $WORKDIR /state/grubmenu
423
435
424
436
# Set a OEM config file if specified
425
437
if [ -n " $config " ]; then
0 commit comments