<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
Hi Lennart,
</div>
<div>
</div>
<div>
Thank you for your reply and for setting me straight.
</div>
<div>
</div>
<div>
I have now switched over to the git version of mkosi and better understand that mkosi is not performing all the functions I assumed it to be doing.
</div>
<div>
</div>
<div>
I'm still a little confused on a couple of things...
</div>
<div>
</div>
<div>
With specific reference to <a href="https://gitlab.com/baaash/aio/-/blob/main/aio.org">my config here</a> , and the resulting output from systemd-repart here:
<br>
<br>
<img class="aspect-ratio" style="max-width: 100%;" src="cid:55b4ae1a1c6c4f13b85ddfe9d6363dfb@open-xchange.com" alt="">
<br>
<br>it seems the img being created using mkosi doesn't have the partitions created in accordance with the discoverable-partitions spec, ie, there are discrepancies with UUIDs between what is asked for in the spec, and what is provided after running mkosi.
<br>
<br>Is this normal or am I doing something wrong here?
<br>
<br>Is there a way to ensure strict compliance to the discoverable-partitions spec within mkosi? - I can't see anything in the man pages regarding this.
</div>
<div>
</div>
<div>
For partitions we create using systemd-repart, we can set the UUID as well as the type. Setting the type only, also creates discrepancies between UUID's detailed in the spec and what is provided by systemd-repart. Setting the UUID has no effect on partitions that have already been created, as documented in the systemd-repart man page.
</div>
<div>
<br>Thanks again.
<br>
<br>Cooper.
</div>
<div>
</div>
<blockquote type="cite">
<div>
On 10/11/2022 3:56 AM NZDT Lennart Poettering <<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>> wrote:
</div>
<div>
</div>
<div>
</div>
<div>
On Mo, 03.10.22 22:04, <a href="mailto:bleat@baaa.sh">bleat@baaa.sh</a> <a href="mailto:bleat@baaa.sh">bleat@baaa.sh</a> (<a href="mailto:bleat@baaa.sh">bleat@baaa.sh</a>) wrote:
</div>
<div>
</div>
<blockquote type="cite">
<div>
Greetings to you all,
</div>
<div>
</div>
<div>
I read through this
</div>
<div> <a href="https://0pointer.net/blog/fitting-everything-together.html" target="_blank" rel="noopener">https://0pointer.net/blog/fitting-everything-together.html</a>, several
</div>
<div>
times and was inspired to try build this
</div>
<div> <a href="https://0pointer.net/blog/images/partitions.svg" target="_blank" rel="noopener">https://0pointer.net/blog/images/partitions.svg</a>, as an exercise to
</div>
<div>
help me learn.
</div>
<div>
</div>
<div>
I've got this <a href="https://gitlab.com/baaash/aio/-/blob/main/aio.org" target="_blank" rel="noopener">https://gitlab.com/baaash/aio/-/blob/main/aio.org</a> so
</div>
<div>
far. (probably worthy of a chuckle for some, but we all start
</div>
<div>
somewhere right?)
</div>
<div>
</div>
<div>
anyways, when I do a:
</div>
<div>
</div>
<div>
sudo mkosi
</div>
<div>
</div>
<div>
the image builds fine. cool.
</div>
<div>
</div>
<div>
when i boot into with systemd-nspawn I see no such growing of
</div>
<div>
partitions, and furthermore am prompted to enter a new root
</div>
<div>
password.
</div>
</blockquote>
<div>
</div>
<div>
systemd-nspawn will boot the image for you. It will mount the file
</div>
<div>
systems in the image first, and it will issue the fsgrow ioctls on the
</div>
<div>
mounted file systems if that's requested in the GPT partition
</div>
<div>
flags. But it will *not* grow the partitions, that's what systemd-repart
</div>
<div>
can do for you. You may use the "--image=" switch to invoke it
</div>
<div>
directly on the disk image. You can also specify "--size=" to grow the
</div>
<div>
image file on disk first. (this will work only if you have some
</div>
<div>
suitable /usr/lib/repart.d/ drop-ins in place that tell repart what to
</div>
<div>
actually grow)
</div>
<div>
</div>
<div>
So, if you build an image with mkosi, you could then grow/complete it
</div>
<div>
with systemd-repart, and then boot it up with nspawn, and things
</div>
<div>
should just work.
</div>
<div>
</div>
<blockquote type="cite">
<div>
The password thing I assume is because I need to remove the
</div>
<div>
reference in mkosi, and pass this to systemd-nspawn, as described in
</div>
<div>
the systemd.firstboot man page...[edit:confirmed], But the repart
</div>
<div>
thing has me stumped.
</div>
</blockquote>
<div>
</div>
<div>
you can either provision a root pw:
</div>
<div>
</div>
<div>
1. in mkosi via the mkosi.rootpw file
</div>
<div>
2. at first boot by padding in a credential via nspawn's new
</div>
<div>
--set-credential=passwd.hashed-password.root:… switch
</div>
<div>
3. at first boot interactively via systemd-firstboot.
</div>
<div>
</div>
<div>
the systemd-firstboot stuff is done only on first boot, and if no root
</div>
<div>
pw has been configured yet. First boot is defined by whether
</div>
<div>
/etc/machine-id being initialized or not. Recent mkosi versions will
</div>
<div>
ensure that file is reset properly ensure this works. (in fact, for
</div>
<div>
now I'd recommend working with git versions of mkosi)
</div>
<div>
</div>
<blockquote type="cite">
<div>
Asking in IRC it was pointed out systemd-repart should just work
</div>
<div>
automatically provided the partition info was sitting in
</div>
<div>
/usr/lib/repart.d directory, but that it needs no MachineID set in
</div>
<div>
order to qualify as "first.boot".
</div>
</blockquote>
<div>
</div>
<div>
Correct.
</div>
<div>
</div>
<blockquote type="cite">
<div>
I don't have one set but one is being created in the process. I'm
</div>
<div>
missing a piece to this puzzle.
</div>
<div>
</div>
<div>
my eyes burn, my head hurts, and i'm no closer to understanding
</div>
<div>
this, so i wondered if anyone on the list can succinctly explain
</div>
<div>
this to me or perhaps provide a link to a basic working example i
</div>
<div>
can try get my head around; provided of course, someone has already
</div>
<div>
undertaken this exercise on their own, and wouldn't mind sharing.
</div>
</blockquote>
<div>
</div>
<div>
Happy to help!
</div>
<div>
</div>
<div>
We should probably open a group chat somewhere for people who want to
</div>
<div>
build images like that. Since I am usually at home in Signal for
</div>
<div>
things like that, maybe we should open a chat room there for that?
</div>
<div>
</div>
<div>
(nah, not an IRC fan, not gonna return there, sorry)
</div>
<div>
</div>
<div>
Lennart
</div>
<div>
</div>
<div>
--
</div>
<div>
Lennart Poettering, Berlin
</div>
</blockquote>
</body>
</html>