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

Fix ostree admin kargs edit-in-place fails issue #2669

Merged
merged 3 commits into from
Jul 13, 2022

Conversation

HuijingHei
Copy link
Collaborator

@HuijingHei HuijingHei commented Jul 8, 2022

Add func to set kernel arguments in place, instead of create new
deployment

Fix #2664

@HuijingHei HuijingHei changed the title [WIP]Fix https://github.com/ostreedev/ostree/issues/2664 [WIP]Fix ostree admin kargs edit-in-place fails issue Jul 11, 2022
@HuijingHei
Copy link
Collaborator Author

HuijingHei commented Jul 11, 2022

Test locally with the patch, this works

[core@cosa-devsh ~]$ sudo ostree admin kargs edit-in-place --append-if-missing=test1 -v
OT: remounted /sysroot writable
OT: remounted /boot writable
OT: Deployment 3ceadf5fc86a898c654e324f3e66df34ae44de0648ef2a0a195e86751590d1a9.0 unlocked=0
[core@cosa-devsh ~]$ cat /boot/loader.1/entries/ostree*
title Fedora CoreOS 36.20220711.dev.0 (ostree:0)
version 1
options mitigations=auto,nosmt ignition.platform.id=qemu console=tty0 console=ttyS0,115200n8 $ignition_firstboot ostree=/ostree/boot.1/fedora-coreos/0de25aa2ccec0f65ae8c7735d8f195c29c14428828ec19c45802648956ffbe4a/0 root=UUID=17fc46f7-8529-4ce2-a9f9-bd0408a4b637 rw rootflags=prjquota boot=UUID=3750607a-99e7-4957-bcdb-9717120cab8d test1
linux /ostree/fedora-coreos-0de25aa2ccec0f65ae8c7735d8f195c29c14428828ec19c45802648956ffbe4a/vmlinuz-5.18.10-200.fc36.x86_64
initrd /ostree/fedora-coreos-0de25aa2ccec0f65ae8c7735d8f195c29c14428828ec19c45802648956ffbe4a/initramfs-5.18.10-200.fc36.x86_64.img

@HuijingHei
Copy link
Collaborator Author

Thanks for the help of @cgwalters , will try to add a test case to tests/kolainst/destructive

@HuijingHei HuijingHei changed the title [WIP]Fix ostree admin kargs edit-in-place fails issue Fix ostree admin kargs edit-in-place fails issue Jul 11, 2022
@HuijingHei HuijingHei force-pushed the fix-kargs branch 2 times, most recently from eb652b0 to 4d2549b Compare July 12, 2022 08:02
Add func to set kernel arguments in place, instead of create new
deployment
Fix ostreedev#2664
@HuijingHei
Copy link
Collaborator Author

Build ostree with this patch, and copy the installed dir to cosa override/rootfs, then build qcow2 image, run test

[coreos-assembler]$ kola run ext.ostree.destructive.kargs-edit-in-place.sh
=== RUN   ext.ostree.destructive.kargs-edit-in-place.sh
--- PASS: ext.ostree.destructive.kargs-edit-in-place.sh (54.89s)
PASS, output in tmp/kola/qemu-unpriv-2022-07-12-1257-54

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Nice work!

@cgwalters
Copy link
Member

Hmm though actually looks like this broke the unit test case:

error: opendir(loader.1/entries): No such file or directory
++ report_err
++ local exit_status=1
Unexpected nonzero exit status 1 while running: ${CMD_PREFIX} ostree admin kargs edit-in-place --append-if-missing=TESTARG=TESTVALUE --append-if-missing=ARGWITHOUTKEY testos:testos/buildmain/x86_64-runtime

Even without a mount namespace set up.
@cgwalters
Copy link
Member

OK I figured it out and pushed a small-scoped additional commit to this PR.

However, I think this revealed a general issue in libostree that we can discuss and fix separately; will file a PR for that.

@cgwalters
Copy link
Member

#2672 is the more general fix for that bug.

@cgwalters
Copy link
Member

(Also let's do the equivalent of #2673 here too)

@cgwalters cgwalters merged commit ed11467 into ostreedev:main Jul 13, 2022
@HuijingHei
Copy link
Collaborator Author

Thanks @cgwalters for the fix!

@HuijingHei HuijingHei deleted the fix-kargs branch July 14, 2022 01:10
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.

ostree admin kargs edit-in-place fails with error: Attempting to remove booted deployment
2 participants