From eca399100c678e039257e01824fe4968b515658e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 21 Jul 2021 16:41:28 +0000 Subject: [PATCH] grub: Add file with cloud helping stuff This file will detect whether to do certain actions depending on the environment it is running on. Currently this detects whether IPFire is booting up on AWS EC2 and selects the serial console boot entry. Signed-off-by: Michael Tremer --- config/grub2/00_cloud | 26 ++++++++++++++++++++++++++ config/rootfiles/common/aarch64/grub | 1 + config/rootfiles/common/i586/grub | 1 + config/rootfiles/common/x86_64/grub | 1 + lfs/grub | 4 ++++ 5 files changed, 33 insertions(+) create mode 100644 config/grub2/00_cloud diff --git a/config/grub2/00_cloud b/config/grub2/00_cloud new file mode 100644 index 0000000000..3f9c5a1854 --- /dev/null +++ b/config/grub2/00_cloud @@ -0,0 +1,26 @@ +#!/bin/sh +# This is an IPFire helper script for GRUB to enable the serial console +# on AWS instances at the time of the first boost + +set -e + +# Do nothing if first boot isn't enabled +if [ "${GRUB_FIRST_BOOT}" != "true" ]; then + exit 0 +fi + +. "${pkgdatadir}/grub-mkconfig_lib" + +if [ -z "${boot_device_id}" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" +fi + +cat <