grub: add coreos.first_boot kernel param

This commit is contained in:
Alex Crawford 2015-09-01 14:03:53 -07:00
parent ea2ad35dc3
commit 9fb9442576

View File

@ -11,10 +11,10 @@ insmod all_video
set default="coreos"
set timeout=1
# Default kernel args for root filesystem, console, and Ignition.
# Default kernel args for root filesystem, console, and CoreOS.
set linux_root="root=LABEL=ROOT"
set linux_console=""
set ignition=""
set first_boot=""
# Anything else the OEM adds should use this variable.
set linux_append=""
@ -37,11 +37,11 @@ if [ "$secure_boot" = "0" ]; then
fi
fi
# Determine if this is a first boot. Run Ignition if so.
# Determine if this is a first boot.
search --no-floppy --set first_boot \
--disk-uuid 00000000-0000-0000-0000-000000000001
if [ -n "$first_boot" ]; then
set ignition="coreos.ignition.run=1"
set first_boot="coreos.first_boot=1"
fi
# If no specific console has been set by the OEM then select based on
@ -69,20 +69,20 @@ fi
menuentry "CoreOS default" --id=coreos {
gptprio.next -d usr -u usr_uuid
if [ "$usr_uuid" = "7130c94a-213a-4e5a-8e26-6cce9662f132" ]; then
linux$suf /coreos/vmlinuz-a $ignition $linux_console $linux_root \
linux$suf /coreos/vmlinuz-a $first_boot $linux_console $linux_root \
@@MOUNTUSR@@=PARTUUID=$usr_uuid $linux_append
else
linux$suf /coreos/vmlinuz-b $ignition $linux_console $linux_root \
linux$suf /coreos/vmlinuz-b $first_boot $linux_console $linux_root \
@@MOUNTUSR@@=PARTUUID=$usr_uuid $linux_append
fi
}
menuentry "CoreOS USR-A" --id=coreos-a {
linux$suf /coreos/vmlinuz-a $ignition $linux_console $linux_root \
linux$suf /coreos/vmlinuz-a $first_boot $linux_console $linux_root \
@@MOUNTUSR@@=PARTLABEL=USR-A $linux_append
}
menuentry "CoreOS USR-B" --id=coreos-b {
linux$suf /coreos/vmlinuz-b $ignition $linux_console $linux_root \
linux$suf /coreos/vmlinuz-b $first_boot $linux_console $linux_root \
@@MOUNTUSR@@=PARTLABEL=USR-B $linux_append
}