OCI: Enable serial console by default

Message ID 20211014120031.11989-1-michael.tremer@ipfire.org
State Accepted
Commit a09578f4eb954ea982926daab53c34492df05b43
Headers
Series OCI: Enable serial console by default |

Commit Message

Michael Tremer Oct. 14, 2021, noon UTC
  Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 config/grub2/00_cloud             | 8 ++++++++
 src/initscripts/system/partresize | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)
  

Patch

diff --git a/config/grub2/00_cloud b/config/grub2/00_cloud
index 121cb2fbd..1ef5053e5 100644
--- a/config/grub2/00_cloud
+++ b/config/grub2/00_cloud
@@ -23,8 +23,16 @@  cat <<EOF
 # Read the system manufacturer string from the BIOS
 smbios --type 1 --get-string 4 --set system_manufacturer
 
+# Read the chassis asset tag
+smbios --type 3 --get-string 8 --set chassis_asset_tag
+
 # Are we on Amazon EC2?
 if [ "\$system_manufacturer" = "Amazon EC2" ]; then
 	next_entry=gnulinux-${KERNEL_RELEASE}-serial-${boot_device_id}
 fi
+
+# Are we on Oracle Cloud?
+if [ "\$chassis_asset_tag" = "OracleCloud.com" ]; then
+	next_entry=gnulinux-${KERNEL_RELEASE}-serial-${boot_device_id}
+fi
 EOF
diff --git a/src/initscripts/system/partresize b/src/initscripts/system/partresize
index 4fa1906d0..2206ca451 100644
--- a/src/initscripts/system/partresize
+++ b/src/initscripts/system/partresize
@@ -45,9 +45,9 @@  case "${1}" in
 				esac
 			fi
 
-			# Enable the serial console on all systems on AWS EC2, Azure
-			# and Google Compute Platform
-			if running_on_ec2 || running_on_azure || running_on_gcp; then
+			# Enable the serial console on all systems on AWS EC2, Oracle Cloud,
+			# Azure and Google Compute Platform
+			if running_on_ec2 || running_on_oci || running_on_azure || running_on_gcp; then
 				scon="on"
 			fi