]> git.ipfire.org Git - ipfire-2.x.git/blame - config/grub2/00_cloud
grub: Add file with cloud helping stuff
[ipfire-2.x.git] / config / grub2 / 00_cloud
CommitLineData
1e848ad3
MT
1#!/bin/sh
2# This is an IPFire helper script for GRUB to enable the serial console
3# on AWS instances at the time of the first boost
4
5set -e
6
7# Do nothing if first boot isn't enabled
8if [ "${GRUB_FIRST_BOOT}" != "true" ]; then
9 exit 0
10fi
11
12. "${pkgdatadir}/grub-mkconfig_lib"
13
14if [ -z "${boot_device_id}" ]; then
15 boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
16fi
17
18cat <<EOF
19# Read the system manufacturer string from the BIOS
20smbios --type 1 --get-string 4 --set system_manufacturer
21
22# Are we on Amazon EC2?
23if [ "\$system_manufacturer" = "Amazon EC2" ]; then
24 next_entry=gnulinux-serial-${boot_device_id}
25fi
26EOF