Hi,

Quoting Francesco Poli (2023-06-26 20:20:47)
> If I may share my thoughts (daydreams?!?) about this issue, I was hoping to
> see a (relatively) simple command able to create a QEMU/KVM image for
> autopkgtest without requiring superuser privileges. An image that could be
> easily upgraded after creation (without the need to re-create it from
> scratch). Bonus, if the image can then be used also for interactive testing
> of packages and for package building.
> 
> Basically, I was hoping to see [sbuild-qemu-create] drop the requirement
> of superuser privileges (thus dropping the behind-the-scenes use of
> vmdb2 and switching to some other backend)...
> 
> [sbuild-qemu-create]: <https://anarc.at/blog/2022-04-27-sbuild-qemu/>
> 
> I am not sure I clearly understand whether this may happen or whether
> this is actually going to happen soon...

this is not a daydream and I think we have nearly all building blocks in place
to make all of this happen very soon! Here is a summary:

 1. You use `debvm-create --arch $foo` to create a filesystem image for any
    architecture supported by QEMU without superuser privileges. The
    debvm-create utility is a thin wrapper around mmdebstrap and passes all the
    right arguments to create this filesystem image.

 2. You use either autopkgtest-virt-qemu or autopkgtest-virt-ssh (depending on
    whether Simon prefers merge request !236 or !237) to run your autopkgtest
    through qemu with that disk image

 3. ???

 4. Profit!

If you want to upgrade the disk image you can do so by using `debvm-run` which
gives you a root shell for that disk image where you can just run "apt
upgrade".

Now lets get to your "bonus". Once either MR !236 or !237 is accepted I will
rewrite sbuild-qemu-create to not call autopkgtest-build-qemu (which uses vmdb2
which requires root) but debvm-create instead. Similarly, the sbuild-qemu
script will be adapted to call sbuild with the autopkgtest backend and the
right option (again depending on whether MR !236 or !237 get merged). And the
sbuild-qemu-update tool will automate the updating so that you don't have to
run debvm-run yourself.

Of course once either MR !236 or !237 get merged, you do not have to wait for
me to change sbuild-qemu. Even before I have done this work you can always
manually call sbuild with the autopkgtest backend and do your package builds in
the QEMU image created by debvm-create without superuser privileges.

So I don't think it's a daydream. Two merge requests exist that provide the
necessary functionality for debvm support and we hopefully only have to go
through a few more iterations with Simon to get either of them into a state
where they can get merged (or in case of !237, shipped by debvm itself).

So stay tuned! :D

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to