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

coreos-base/(ue-rs|update_engine): Control extracted OEM payload name #1580

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

pothos
Copy link
Member

@pothos pothos commented Jan 16, 2024

This pulls in flatcar/ue-rs#49 and flatcar/update_engine#36 to fix the handling of OEM update payloads in a Nebraska response with self-hosted packages. Before this fix the processing failed and had to rely on the fallback download from the release server.

How to use

Backport to new Alpha

Testing done

Tested that updating to the built payload works when using this patch for flatcar-update and running sudo ./flatcar-update -V 1.2.3 -D -P flatcar_test_update.gz -E extrafile-amd64-3760.1.1-oem-qemu.gz:

diff --git a/bin/flatcar-update b/bin/flatcar-update
index d1ca303..42bf086 100755
--- a/bin/flatcar-update
+++ b/bin/flatcar-update
@@ -59,9 +59,6 @@ while true; do
     if [ "$1" = "" ]; then
       echo "Error: --extension must not have an empty value" > /dev/stderr ; exit 1
     fi
-    if [[ ! "$(basename -- "$1")" =~ ^(flatcar|oem).*gz$ ]]; then
-      echo "Error: --extension expects paths to files named oem-OEMID.gz or flatcar-NAME.gz (with possible 'flatcar_test_update-' prefix), found: $1" > /dev/stderr ; exit 1
-    fi
     EXTENSIONS+=("$1")
     ;;
   -L|--listen-port-1)
@@ -121,8 +118,6 @@ OEMID=$({ grep -m 1 -o "^ID=.*" /usr/share/oem/oem-release 2> /dev/null || true
 if [ "${OEMID}" != "" ] && { [ -e "/usr/share/flatcar/oems/${OEMID}" ] || [ -e "/usr/share/oem/sysext/active-oem-${OEMID}" ]; }; then
   if [ "$PAYLOAD" = "" ]; then
     EXTENSIONS+=("/var/tmp/flatcar-update/oem-${OEMID}.gz")
-  elif ! echo " ${EXTENSIONS[*]} " | grep -q -P "[ /](flatcar_test_update-)?oem-${OEMID}.gz "; then # Surrounded with space to only match base name
-    echo "Error: system requires '${OEMID}' OEM extension but not passed in --extension" > /dev/stderr ; exit 1
   fi
 fi
 for NAME in $(grep -h -o '^[^#]*' /etc/flatcar/enabled-sysext.conf /usr/share/flatcar/enabled-sysext.conf 2> /dev/null | grep -v -x -f <(grep '^-' /etc/flatcar/enabled-sysext.conf 2> /dev/null | cut -d - -f 2-) | grep -v -P '^(-).*'); do

Jenkins build

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

Copy link

github-actions bot commented Jan 16, 2024

Build action triggered: https://github.com/flatcar/scripts/actions/runs/8047475506

Copy link
Member

@dongsupark dongsupark left a comment

Choose a reason for hiding this comment

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

CROS_WORKON_COMMITs need updates before merging it.

This pulls in flatcar/ue-rs#49 and
flatcar/update_engine#36 to fix the handling
of OEM update payloads in a Nebraska response with self-hosted packages.
Before this fix the processing failed and had to rely on the fallback
download from the release server.
@pothos pothos force-pushed the kai/ue-rs-target-filename branch from 45ec246 to d05773b Compare January 18, 2024 10:54
@pothos pothos merged commit b4f3392 into main Jan 18, 2024
1 check failed
@pothos pothos deleted the kai/ue-rs-target-filename branch January 18, 2024 10:54
pothos added a commit that referenced this pull request Jan 18, 2024
coreos-base/(ue-rs|update_engine): Control extracted OEM payload name
@jepio
Copy link
Member

jepio commented Feb 22, 2024

We need this in stable too, i'm going to prepare a PR with a backport.

@jepio
Copy link
Member

jepio commented Feb 22, 2024

Stable isn't using ue-rs yet.

@pothos Do you prefer to update stable to ue-rs or flatcar/update_engine#39?

@pothos
Copy link
Member Author

pothos commented Feb 26, 2024

Your prepared fix looks good, thanks

@jepio jepio mentioned this pull request Feb 26, 2024
2 tasks
jepio added a commit that referenced this pull request Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants