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

run_qemu.sh: make ndctl compilation compatible with mkosi v15+ #80

Merged
merged 6 commits into from
Dec 13, 2024

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Dec 12, 2024

6 commits. Some finer-grained testing in #78

Regroup all ndctl stuff in the same place. Zero-functional change yet;
bug-for-bug compatible. This including the bad error handling when
$ndctl is not a directory.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Obvious typos and misconfiguration should not be reported after minutes.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb marc-hb force-pushed the ndctl-v15 branch 2 times, most recently from 365bb7a to 44a6651 Compare December 12, 2024 22:46
@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 12, 2024

Both 22.04 and 24.04 building ndctl now
https://github.com/pmem/run_qemu/actions/runs/12306102075/job/34347115663?pr=80

@marc-hb marc-hb force-pushed the ndctl-v15 branch 2 times, most recently from bc6aa47 to 02bd882 Compare December 12, 2024 23:19
@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 13, 2024

Really weird error in https://github.com/pmem/run_qemu/actions/runs/12306483889/job/34348289945?pr=80, looks like a glitch...

EDIT: passed after hitting "re-run" https://github.com/pmem/run_qemu/actions/runs/12306483889/job/34350101049?pr=80

‣ Running second (final) stage…
‣  Basing off cached image root.img.cache-pre-inst
‣  Copied cached image as /home/runner/work/run_qemu/run_qemu/kernel/qbuild/.mkosi-ge6d__zg
‣  Refreshing partition table…
Partition #1 contains a vfat signature.
Partition #2 contains a ext4 signature.
‣  Refreshed partition table.
‣  Attaching /home/runner/work/run_qemu/run_qemu/kernel/qbuild/.mkosi-ge6d__zg as loopback…
‣  Attached /dev/loop3
‣  Refreshing file system /dev/loop3p2…
tune2fs 1.46.5 (30-Dec-2021)
This operation requires a freshly checked filesystem.
Please run e2fsck -f on the filesystem.
‣  (Detaching /dev/loop3)

@stellarhopper
Copy link
Member

stellarhopper commented Dec 13, 2024

Really weird error in https://github.com/pmem/run_qemu/actions/runs/12306483889/job/34348289945?pr=80, looks like a glitch...

‣ Running second (final) stage…
‣  Basing off cached image root.img.cache-pre-inst
‣  Copied cached image as /home/runner/work/run_qemu/run_qemu/kernel/qbuild/.mkosi-ge6d__zg
‣  Refreshing partition table…
Partition #1 contains a vfat signature.
Partition #2 contains a ext4 signature.
‣  Refreshed partition table.
‣  Attaching /home/runner/work/run_qemu/run_qemu/kernel/qbuild/.mkosi-ge6d__zg as loopback…
‣  Attached /dev/loop3
‣  Refreshing file system /dev/loop3p2…
tune2fs 1.46.5 (30-Dec-2021)
This operation requires a freshly checked filesystem.
Please run e2fsck -f on the filesystem.
‣  (Detaching /dev/loop3)

Yeah we've seen this infrequently in the past, must have to do with certain versions of mkosi and/or filesystem tooling - hasn't appeared in a while (over a year I'd say), and yeah the solution was to just rebuild the image.

Copy link
Member

@stellarhopper stellarhopper left a comment

Choose a reason for hiding this comment

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

s/ndclt/ndctl/ in the commit message body for "run_qemu.sh: do not silently fail to compile missing ndctl/"

@stellarhopper
Copy link
Member

Otherwise, tested on Fedora 40 with both mkosi14, and mkosi 22, and both look good!

Abort when trying to compile a missing ndctl/

This unhides the current mkosi.postinst incompatibility with mkosi v15
(see systemd/mkosi@9b626c647037bc8a)

Simplify the ndctl logic:

1. either we really try to copy, compile and install ndctl - and abort
   when anything goes wrong;
2. or we don't try any of that at all.

Remove intermediate, very confusing and very time-consuming
states like this "opportunistic" compilation logic.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
mkosi v15 moved .postinst and others outside the container, see
systemd/mkosi@9b626c647037bc8a

Extract new, re-usable "reinstall.sh" script. This is left in the image
for either interactive testing, use or possibly by
update_existing_rootfs() in the future.

Prefix reinstall.sh invocation with 'mkosi-chroot' when needed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
pkg-config is gone in 24.04. Ubuntu 22.04 can install either.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
As --ndctl-build is on by default, the "real" way to enable ndctl is to
define $ndctl.

Add --ndctl-build anyway in case the default ever changes.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 13, 2024

s/ndclt/ndctl/ in the commit message body for "run_qemu.sh: do not silently fail to compile missing ndctl/"

Should be good now.

(Zero code change)

@stellarhopper stellarhopper merged commit 0f1ee24 into pmem:main Dec 13, 2024
2 checks passed
@marc-hb marc-hb deleted the ndctl-v15 branch December 13, 2024 19:42
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.

2 participants