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

TEST ignore - mkosi v15+ #68

Closed
wants to merge 6 commits into from
Closed

TEST ignore - mkosi v15+ #68

wants to merge 6 commits into from

Conversation

marc-hb
Copy link
Collaborator

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

No description provided.

@marc-hb marc-hb changed the title Mkosiv15 TEST ignore - mkosi v15+ Dec 4, 2024
@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 4, 2024

Ubuntu 24 failed with some obscure apt dependency error but it went MUCH further than before.
https://github.com/pmem/run_qemu/actions/runs/12154785183/job/33895125366?pr=68

Ubuntu 22 is still passing as before.

I successfully tested this with Fedora 40 + mkosi v22 and a recent Arch Linux with a large range of mkosi versions installed from source.

@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 4, 2024

Ubuntu 24 failed with some obscure apt dependency error

Same libtss-mu apt error again in
https://github.com/pmem/run_qemu/actions/runs/12165333624/job/33929040418?pr=68

Is this some GitHub-specific, apt inconsistency like actions/runner-images#2924 ?

Setting up login (1:4.13+dfsg1-4ubuntu3.2) ...
Setting up bash (5.2.21-2ubuntu4) ...
update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package libtss2-mu0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libtss2-mu-4.0.1-0t64

E: Package 'libtss2-mu0' has no installation candidate
‣ "env APT_CONFIG=/var/tmp/mkosi-workspacez9o_np5m/apt.conf DEBIAN_FRONTEND=noninteractive DEBCONF_INTERACTIVE_SEEN=true INITRD=No apt-get -o APT::Architecture=amd64 -o APT::Architectures=amd64 -o APT::Install-Recommends=false -o APT::Immediate-Configure=off -o APT::Get::Assume-Yes=true -o APT::Get::AutomaticRemove=true -o APT::Get::Allow-Change-Held-Packages=true -o APT::Get::Allow-Remove-Essential=true -o APT::Sandbox::User=root -o Dir::Cache=/var/cache/apt -o Dir::State=/var/lib/apt -o Dir::State::Status=/var/tmp/mkosi-workspacez9o_np5m/root/var/lib/dpkg/status -o Dir::Log=/var/tmp/mkosi-workspacez9o_np5m -o Dir::Bin::DPkg=/usr/bin/dpkg -o Debug::NoLocking=true -o DPkg::Options::=--root=/var/tmp/mkosi-workspacez9o_np5m/root -o DPkg::Options::=--force-unsafe-io -o DPkg::Options::=--force-architecture -o DPkg::Options::=--force-depends -o DPkg::Options::=--no-debsig -o DPkg::Use-Pty=false -o DPkg::Install::Recursive::Minimum=1000 -o pkgCacheGen::ForceEssential=, -o 'DPkg::Options::=--path-exclude=/usr/share/doc/*' -o 'DPkg::Options::=--path-include=/usr/share/doc/*/copyright' -o 'DPkg::Options::=--path-exclude=/usr/share/man/*' -o 'DPkg::Options::=--path-exclude=/usr/share/groff/*' -o 'DPkg::Options::=--path-exclude=/usr/share/info/*' install '^libtss2-esys-[0-9\.]+-0$' bash dmsetup e2fsprogs kmod less libfido2-1 libtss2-mu0 libtss2-rc0 libtss2-tcti-device0 lvm2 p11-kit systemd udev util-linux" returned non-zero exit code 100.
+ cleanup
+ kill_guest

@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 4, 2024

Unfortunately the built-in mkosi version on my Ubuntu 24 system fails in a totally different way :-(

Both Fedora and Arch boot fine with this PR :-(

‣  Generating disk image
Pre-populating ext4 filesystem of partition 10-root.conf twice to calculate minimal partition size
Populating ext4 filesystem.
Successfully populated ext4 filesystem.
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done
Warning: could not erase sector 2: No space left on device
Creating filesystem with 268435456 4k blocks and 67108864 inodes
Filesystem UUID: e60af626-3381-4d4f-a258-53ab222049a8
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848

Allocating group tables: done
Warning: could not erase sector 0: No space left on device
Writing inode tables: done
Creating journal (262144 blocks): mkfs.ext4: No space left on device
        while trying to create journal
(mkfs) failed with exit status 1.
‣ "systemd-repart --empty=allow --size=auto --dry-run=no --json=pretty --no-pager --offline=yes --seed random /srv/mherber2/.cache/mkosi-workspacesjdeb347/staging/root.img.raw --root /srv/mherber2/.cache/mkosi-workspacesjdeb347/root --empty=create --defer-partitions esp,xbootldr --definitions /srv/mherber2/.cache/mkosi-workspacesjdeb347/repart-definitions" returned non-zero exit code 1.
+ cleanup
+ kill_guest

@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 4, 2024

I got this working on my local Ubuntu 24 but only after:

  • manually upgrading to mkosi v24.3
  • disabling AppArmor (which breaks BubbleWrap; known issue)

Every different mkosi version seems to fail in a slightly different way...

@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 5, 2024

Never a dull moment: while trying to git bisect mkosi v20->v21 to find something relevant to a cryptic "read-only filesystem" error, I landed on this v21 commit instead:

commit 7637bcaf654a2d124f64e263c7c628941090e2f3
Author: Daan De Meyer <[email protected]>
Date:   Mon Feb 5 10:41:42 2024 +0100

    Update libtss2-mu to use apt search pattern

    This package changed name so let's update to use a search pattern
    to always pull in the right package.

 mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-ubuntu.conf | 2 +-
--- a/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-ubuntu.conf
+++ b/mkosi/resources/mkosi-initrd/mkosi.conf.d/10-debian-ubuntu.conf
@@ -19,7 +19,7 @@ Packages=
         libfido2-1
         ^libtss2-esys-[0-9\.]+-0$
         libtss2-rc0
-        libtss2-mu0
+        ^libtss2-mu[0-9\.-]+$
         libtss2-tcti-device0

 RemovePackages=

@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 5, 2024

while trying to git bisect mkosi v20->v21 to find something relevant to a cryptic "read-only filesystem" error,...

‣ Building default image
mkdir: cannot create directory ‘linux/qbuild/mkosi.builddir/ubuntu~noble~x86-64’: Read-only file system
commit c82a4783a0e419785f92e4fbd57537a82d4be7f9
Author: Daan De Meyer <[email protected]>
Date:   Thu Jan 18 09:56:45 2024 +0100

    Don't mount /srv and /mnt read-only

    It seems there are use cases where users expect to write their output
    to a directory in /srv or /mnt so let's make that writable. This should
    be safe as we set up a custom sandbox now so none of the tools we run
    will have access to /srv and /mnt in the first place.

 mkosi/__init__.py | 2 +-

@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 6, 2024

This mkosi v21 commit is also required on my Ubuntu 24.04 system to solve the following error:

systemd-repart: "no space left on device"

commit d94ae85d858b332961283de504525587c1f6feb4 (HEAD)
Author: Daan De Meyer <[email protected]>
Date:   Wed Jan 24 09:58:26 2024 +0100

    Use a subdirectory of the workspace as TMPDIR

    Let's properly distinguish temporary files from workspace files by
    putting the temporary files in a subdirectory of the workspace.

All three v21 commits above cherry-pick cleanly on top of v20

The -P scan is performed in the background. This can be observed with
this simple sequence:

```
losetup -P...
ls -l /dev/disk/by-loop-ref/ # => not found
sleep 1
ls -l /dev/disk/by-loop-ref/ # => found
```

Signed-off-by: Marc Herbert <[email protected]>
marc-hb added a commit to marc-hb/run_qemu that referenced this pull request Dec 7, 2024
marc-hb and others added 5 commits December 6, 2024 23:30
Sample output below.

Also dump a bit more information when the ESP is missing (or any other
failure)

```
Disk /dev/loop0: 1.85 GiB, 1990021120 bytes, 3886760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5F47EB3F-917E-4BB8-BD9F-2F291E73A5A4

Device         Start     End Sectors  Size Type
/dev/loop0p1    2048 1050623 1048576  512M EFI System
/dev/loop0p2 1050624 3886719 2836096  1.4G Linux root (x86-64)
```

Signed-off-by: Marc Herbert <[email protected]>
Make run_qemu.sh preprocessing more flexible ready for mkosi versions 15
and above.

Create new, v14-specific password.tmpl file

Signed-off-by: Marc Herbert <[email protected]>
Support mkosi versions 15 above.

Signed-off-by: Marc Herbert <[email protected]>
Fixes:
 bwrap: loopback: Failed RTM_NEWADDR: Permission denied

Signed-off-by: Marc Herbert <[email protected]>
marc-hb added a commit to marc-hb/run_qemu that referenced this pull request Dec 7, 2024
@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 7, 2024

Clean version submitted in #74

stellarhopper pushed a commit that referenced this pull request Dec 9, 2024
@marc-hb marc-hb closed this Dec 10, 2024
@marc-hb marc-hb deleted the mkosiv15 branch December 10, 2024 00:49
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.

1 participant