[4/4] grub cloud: Add kernel release to boot ID

Message ID 20210727100710.5331-4-michael.tremer@ipfire.org
State Accepted
Commit b8b36e969c28375a5274979a7a138d4ff7535046
Headers
Series [1/4] flash-images: Label serial console option as "serial" |

Commit Message

Michael Tremer July 27, 2021, 10:07 a.m. UTC
  Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 config/grub2/00_cloud | 6 +++++-
 lfs/flash-images      | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/config/grub2/00_cloud b/config/grub2/00_cloud
index 3f9c5a185..121cb2fbd 100644
--- a/config/grub2/00_cloud
+++ b/config/grub2/00_cloud
@@ -11,6 +11,10 @@  fi
 
 . "${pkgdatadir}/grub-mkconfig_lib"
 
+if [ -z "${KERNEL_RELEASE}" ]; then
+	KERNEL_RELEASE="$(uname -r)"
+fi
+
 if [ -z "${boot_device_id}" ]; then
 	boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
 fi
@@ -21,6 +25,6 @@  smbios --type 1 --get-string 4 --set system_manufacturer
 
 # Are we on Amazon EC2?
 if [ "\$system_manufacturer" = "Amazon EC2" ]; then
-	next_entry=gnulinux-serial-${boot_device_id}
+	next_entry=gnulinux-${KERNEL_RELEASE}-serial-${boot_device_id}
 fi
 EOF
diff --git a/lfs/flash-images b/lfs/flash-images
index ca1ffa5e0..cdd0fbf7e 100644
--- a/lfs/flash-images
+++ b/lfs/flash-images
@@ -188,7 +188,7 @@  ifeq "$(BOOTLOADER)" "grub"
 
 	# Create configuration
 	mkdir -pv $(MNThdd)/boot/grub
-	GRUB_FIRST_BOOT=true chroot $(MNThdd) \
+	GRUB_FIRST_BOOT=true KERNEL_RELEASE="$(KVER)-ipfire" chroot $(MNThdd) \
 		grub-mkconfig -o /boot/grub/grub.cfg
 
 	# Boot the first kernel by default