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

flatcar-postinst: Control target filename of extracted OEM payload #36

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

pothos
Copy link
Member

@pothos pothos commented Jan 16, 2024

Nebraska servers with self-hosted synced packages use Omaha entries with names like extrafile-amd64-3815.0.0-oem-ami.gz which can't be predicted. The ue-rs matching option is not enough and we also need to control the target filename because otherwise it would be
extrafile-amd64-3815.0.0-oem-ami.raw which we can't know either and using shell globs is not the nicest solution.
Make use of two new ue-rs parameters to control the target filename and make sure that we only use one match result.

How to use

Depends on flatcar/ue-rs#49

Testing done

see scripts branch

Nebraska servers with self-hosted synced packages use Omaha entries with
names like extrafile-amd64-3815.0.0-oem-ami.gz which can't be predicted.
The ue-rs matching option is not enough and we also need to control the
target filename because otherwise it would be
extrafile-amd64-3815.0.0-oem-ami.raw which we can't know either and
using shell globs is not the nicest solution.
Make use of two new ue-rs parameters to control the target filename and
make sure that we only use one match result.
pothos added a commit to flatcar/scripts that referenced this pull request 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.
@pothos pothos requested a review from a team January 17, 2024 11:48
@pothos pothos merged commit 7b7d6b7 into flatcar-master Jan 18, 2024
1 check passed
@pothos pothos deleted the kai/target-filename branch January 18, 2024 10:51
pothos added a commit to flatcar/scripts that referenced this pull request Jan 18, 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.
pothos added a commit to flatcar/scripts that referenced this pull request Jan 18, 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.
jepio added a commit that referenced this pull request Feb 22, 2024
Right now the stable update from 3602.2.3 -> 3815.2.0 fails for airgapped
environment with self-hosted nebraska instances that sync packages, because the
parsing in flatcar-postinst can't handle the names of OEM sysexts in the
nebraska response. These are called "extrafile-<BOARD>-<VERSION>-oem-<OEM>.gz".
Fix this by matching against "*oem-<OEM>.gz" and extracting the remote filename
from the response.

In main this is fixed in #36, but
that depends on switching to ue-rs.

Here is an example response for testing:

<response protocol="3.0" server="nebraska">
  <daystart elapsed_seconds="0"/>
  <app appid="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}" status="ok">
    <ping status="ok"/>
    <updatecheck status="ok">
      <urls>
        <url codebase="https://nebraska-example.org/flatcar/"/>
      </urls>
      <manifest version="3815.2.0">
        <packages>
          <package name="flatcar-amd64-3815.2.0.gz" hash="JLT5o2wJzffAgHY5GesCWymJHng=" size="458309926" required="true"/>
          <package name="extrafile-amd64-3815.2.0-oem-vmware.gz" hash="llmt48kEE1pZxHbhE86zTczZMmY=" hash_sha256="7c4095f16579402d73ea42a63be63b2c92d98457303a080399d2a5bb33f46f88" size="1536465" required="false"/>
        </packages>
    </updatecheck>
  </app>
</response>

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants