Hi Lennart,
Thank you for your reply and for setting me straight.
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.
I'm still a little confused on a couple of things...
With specific reference to my config here , and the resulting output from systemd-repart here:
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.
Is this normal or am I doing something wrong here?
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.
![](attachments/pngy3VQuANOrB.png)
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.
Is this normal or am I doing something wrong here?
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.
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.
Thanks again.
Cooper.
On 10/11/2022 3:56 AM NZDT Lennart Poettering <lennart@xxxxxxxxxxxxxx> wrote:Greetings to you all,I read through thistimes and was inspired to try build thishttps://0pointer.net/blog/images/partitions.svg, as an exercise tohelp me learn.I've got this https://gitlab.com/baaash/aio/-/blob/main/aio.org sofar. (probably worthy of a chuckle for some, but we all startsomewhere right?)anyways, when I do a:sudo mkosithe image builds fine. cool.when i boot into with systemd-nspawn I see no such growing ofpartitions, and furthermore am prompted to enter a new rootpassword.systemd-nspawn will boot the image for you. It will mount the filesystems in the image first, and it will issue the fsgrow ioctls on themounted file systems if that's requested in the GPT partitionflags. But it will *not* grow the partitions, that's what systemd-repartcan do for you. You may use the "--image=" switch to invoke itdirectly on the disk image. You can also specify "--size=" to grow theimage file on disk first. (this will work only if you have somesuitable /usr/lib/repart.d/ drop-ins in place that tell repart what toactually grow)So, if you build an image with mkosi, you could then grow/complete itwith systemd-repart, and then boot it up with nspawn, and thingsshould just work.The password thing I assume is because I need to remove thereference in mkosi, and pass this to systemd-nspawn, as described inthe systemd.firstboot man page...[edit:confirmed], But the repartthing has me stumped.you can either provision a root pw:1. in mkosi via the mkosi.rootpw file2. at first boot by padding in a credential via nspawn's new--set-credential=passwd.hashed-password.root:… switch3. at first boot interactively via systemd-firstboot.the systemd-firstboot stuff is done only on first boot, and if no rootpw has been configured yet. First boot is defined by whether/etc/machine-id being initialized or not. Recent mkosi versions willensure that file is reset properly ensure this works. (in fact, fornow I'd recommend working with git versions of mkosi)Asking in IRC it was pointed out systemd-repart should just workautomatically provided the partition info was sitting in/usr/lib/repart.d directory, but that it needs no MachineID set inorder to qualify as "first.boot".Correct.I don't have one set but one is being created in the process. I'mmissing a piece to this puzzle.my eyes burn, my head hurts, and i'm no closer to understandingthis, so i wondered if anyone on the list can succinctly explainthis to me or perhaps provide a link to a basic working example ican try get my head around; provided of course, someone has alreadyundertaken this exercise on their own, and wouldn't mind sharing.Happy to help!We should probably open a group chat somewhere for people who want tobuild images like that. Since I am usually at home in Signal forthings like that, maybe we should open a chat room there for that?(nah, not an IRC fan, not gonna return there, sorry)Lennart--Lennart Poettering, Berlin