From 1e848ad3d45814977f950aeabfbeb7b32bc8d196 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 27 Jul 2021 10:07:08 +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 Signed-off-by: Arne Fitzenreiter --- 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 <