Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jobs/build-arch: update hack for aarch64/aws serial console #533

Merged

Conversation

dustymabe
Copy link
Member

@dustymabe dustymabe commented May 31, 2022

This is an update to the serial console hack added in ddd9da9.
This needed updating because of [1] that will update and
rename gf-platformid to gf-set-platform. Eventually once
platforms.yaml exists everywhere we will finally be able
to drop this patch.

[1] coreos/coreos-assembler#2400

The decoded version of this patch looks like:

diff --git a/src/gf-set-platform b/src/gf-set-platform
index 3b1c5ae31..df5e0f9d7 100755
--- a/src/gf-set-platform
+++ b/src/gf-set-platform
@@ -59,7 +59,13 @@ blscfg_path=$(coreos_gf glob-expand /boot/loader/entries/ostree-*.conf)
 coreos_gf download "${blscfg_path}" "${tmpd}"/bls.conf
 # Remove any platformid currently there
 sed -i -e 's, ignition.platform.id=[a-zA-Z0-9]*,,g' "${tmpd}"/bls.conf
-sed -i -e '/^options / s,$, ignition.platform.id='"${platformid}"',' "${tmpd}"/bls.conf
+if [ "$(coreos_gf exists /boot/coreos/platforms.json)" != "true" -a "${platformid}" == 'aws' ]; then
+    # Our platform is AWS and we still need the console=ttyS0 hack for the legacy
+    # (no platforms.yaml) path.
+    sed -i -e 's|^\(options .*\)|\1 ignition.platform.id='"${platformid}"' console=ttyS0,115200n8|' "${tmpd}"/bls.conf
+else
+    sed -i -e '/^options / s,$, ignition.platform.id='"${platformid}"',' "${tmpd}"/bls.conf
+fi
 if [ -n "$remove_kargs" ]; then
     # Remove existing qemu-specific kargs
     sed -i -e '/^options / s@ '"${remove_kargs}"'@@' "${tmpd}"/bls.conf

This is an update to the serial console hack added in ddd9da9.
This needed updating because of [1] that will update and
rename gf-platformid to gf-set-platform. Eventually once
platforms.yaml exists everywhere we will finally be able
to drop this patch.

[1] coreos/coreos-assembler#2400

The decoded version of this patch looks like:

```diff
diff --git a/src/gf-set-platform b/src/gf-set-platform
index 3b1c5ae31..df5e0f9d7 100755
--- a/src/gf-set-platform
+++ b/src/gf-set-platform
@@ -59,7 +59,13 @@ blscfg_path=$(coreos_gf glob-expand /boot/loader/entries/ostree-*.conf)
 coreos_gf download "${blscfg_path}" "${tmpd}"/bls.conf
 # Remove any platformid currently there
 sed -i -e 's, ignition.platform.id=[a-zA-Z0-9]*,,g' "${tmpd}"/bls.conf
-sed -i -e '/^options / s,$, ignition.platform.id='"${platformid}"',' "${tmpd}"/bls.conf
+if [ "$(coreos_gf exists /boot/coreos/platforms.json)" != "true" -a "${platformid}" == 'aws' ]; then
+    # Our platform is AWS and we still need the console=ttyS0 hack for the legacy
+    # (no platforms.yaml) path.
+    sed -i -e 's|^\(options .*\)|\1 ignition.platform.id='"${platformid}"' console=ttyS0,115200n8|' "${tmpd}"/bls.conf
+else
+    sed -i -e '/^options / s,$, ignition.platform.id='"${platformid}"',' "${tmpd}"/bls.conf
+fi
 if [ -n "$remove_kargs" ]; then
     # Remove existing qemu-specific kargs
     sed -i -e '/^options / s@ '"${remove_kargs}"'@@' "${tmpd}"/bls.conf

```
@dustymabe dustymabe force-pushed the dusty-update-aarch64-aws-console-hack branch from 0280a82 to d7965f8 Compare May 31, 2022 15:19
@dustymabe
Copy link
Member Author

needs testing

Copy link
Contributor

@bgilbert bgilbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dustymabe
Copy link
Member Author

Local testing of this went well.

@bgilbert bgilbert merged commit 3216680 into coreos:main Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants