]>
Commit | Line | Data |
---|---|---|
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 | ||
5 | set -e | |
6 | ||
7 | # Do nothing if first boot isn't enabled | |
8 | if [ "${GRUB_FIRST_BOOT}" != "true" ]; then | |
9 | exit 0 | |
10 | fi | |
11 | ||
12 | . "${pkgdatadir}/grub-mkconfig_lib" | |
13 | ||
b8b36e96 MT |
14 | if [ -z "${KERNEL_RELEASE}" ]; then |
15 | KERNEL_RELEASE="$(uname -r)" | |
16 | fi | |
17 | ||
1e848ad3 MT |
18 | if [ -z "${boot_device_id}" ]; then |
19 | boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" | |
20 | fi | |
21 | ||
22 | cat <<EOF | |
23 | # Read the system manufacturer string from the BIOS | |
24 | smbios --type 1 --get-string 4 --set system_manufacturer | |
25 | ||
a09578f4 MT |
26 | # Read the chassis asset tag |
27 | smbios --type 3 --get-string 8 --set chassis_asset_tag | |
28 | ||
1e848ad3 MT |
29 | # Are we on Amazon EC2? |
30 | if [ "\$system_manufacturer" = "Amazon EC2" ]; then | |
b8b36e96 | 31 | next_entry=gnulinux-${KERNEL_RELEASE}-serial-${boot_device_id} |
1e848ad3 | 32 | fi |
a09578f4 MT |
33 | |
34 | # Are we on Oracle Cloud? | |
35 | if [ "\$chassis_asset_tag" = "OracleCloud.com" ]; then | |
36 | next_entry=gnulinux-${KERNEL_RELEASE}-serial-${boot_device_id} | |
37 | fi | |
1e848ad3 | 38 | EOF |