From: Michael Tremer Date: Tue, 27 Jul 2021 10:07:08 +0000 (+0000) Subject: grub: Add file with cloud helping stuff X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e848ad3d45814977f950aeabfbeb7b32bc8d196;p=people%2Fms%2Fipfire-2.x.git 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 --- 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 <