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-update: Replace ncat with socat #124

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

krnowak
Copy link
Member

@krnowak krnowak commented Jul 5, 2024

This replaces ncat with socat, because ncat will be replaced with some openbsd variant, which doesn't have an option for running a script on the established connection. We already are using socat for serving the payload, so this just follows suit.

Testing:

  • spin up a qemu vm with Flatcar 4012.0.1
  • inside the vm:
    • wget https://raw.githubusercontent.com/flatcar/init/krnowak/openbsd-netcat/bin/flatcar-update
    • wget https://bincache.flatcar-linux.net/images/amd64/4048.0.0+nightly-20240731-2100/flatcar_test_update.gz
    • wget https://bincache.flatcar-linux.net/images/amd64/4048.0.0+nightly-20240731-2100/flatcar_test_update-oem-qemu.gz
    • sudo ./flatcar-update --to-version 4048.0.0+nightly-20240731-2100 --to-payload flatcar_test_update.gz --extension flatcar_test_update-oem-qemu.gz --force-dev-key

The payload server already uses socat, so let's use the same for
response server. We do it, because we are about to replace nmap's ncat
with openbsd netcat due to licensing issues.
@krnowak krnowak force-pushed the krnowak/openbsd-netcat branch from 0388013 to e0a94b4 Compare August 1, 2024 15:25
@krnowak krnowak changed the title flatcar-update: Prepare to use openbsd-netcat flatcar-update: Replace ncat with socat Aug 1, 2024
@krnowak krnowak marked this pull request as ready for review August 1, 2024 15:32
@krnowak krnowak requested a review from a team August 1, 2024 15:32
Copy link
Contributor

@chewi chewi left a comment

Choose a reason for hiding this comment

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

Not sure why you used tee instead of cat, but your test worked for me. 😃

@krnowak
Copy link
Member Author

krnowak commented Aug 1, 2024

Not sure why you used tee instead of cat, but your test worked for me. 😃

Copy pasta from the socat setup for the payload server. :)

@krnowak krnowak merged commit 52eebc0 into flatcar-master Aug 9, 2024
@krnowak krnowak deleted the krnowak/openbsd-netcat branch August 9, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants