[systemd-devel] systemd-repart help requested please
bleat@baaa.sh bleat@baaa.sh
bleat at baaa.sh
Tue Oct 11 06:43:01 UTC 2022
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 https://gitlab.com/baaash/aio/-/blob/main/aio.org , 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.
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 at poettering.net mailto:lennart at poettering.net> wrote:
>
>
> On Mo, 03.10.22 22:04, bleat at baaa.sh mailto:bleat at baaa.sh bleat at baaa.sh mailto:bleat at baaa.sh (bleat at baaa.sh mailto:bleat at baaa.sh) wrote:
>
>
> > Greetings to you all,
> >
> > I read through this
> > https://0pointer.net/blog/fitting-everything-together.html, several
> > times and was inspired to try build this
> > https://0pointer.net/blog/images/partitions.svg, as an exercise to
> > help me learn.
> >
> > I've got this https://gitlab.com/baaash/aio/-/blob/main/aio.org so
> > far. (probably worthy of a chuckle for some, but we all start
> > somewhere right?)
> >
> > anyways, when I do a:
> >
> > sudo mkosi
> >
> > the image builds fine. cool.
> >
> > when i boot into with systemd-nspawn I see no such growing of
> > partitions, and furthermore am prompted to enter a new root
> > password.
> >
>
> systemd-nspawn will boot the image for you. It will mount the file
> systems in the image first, and it will issue the fsgrow ioctls on the
> mounted file systems if that's requested in the GPT partition
> flags. But it will *not* grow the partitions, that's what systemd-repart
> can do for you. You may use the "--image=" switch to invoke it
> directly on the disk image. You can also specify "--size=" to grow the
> image file on disk first. (this will work only if you have some
> suitable /usr/lib/repart.d/ drop-ins in place that tell repart what to
> actually grow)
>
> So, if you build an image with mkosi, you could then grow/complete it
> with systemd-repart, and then boot it up with nspawn, and things
> should just work.
>
>
> > The password thing I assume is because I need to remove the
> > reference in mkosi, and pass this to systemd-nspawn, as described in
> > the systemd.firstboot man page...[edit:confirmed], But the repart
> > thing has me stumped.
> >
>
> you can either provision a root pw:
>
> 1. in mkosi via the mkosi.rootpw file
> 2. at first boot by padding in a credential via nspawn's new
> --set-credential=passwd.hashed-password.root:… switch
> 3. at first boot interactively via systemd-firstboot.
>
> the systemd-firstboot stuff is done only on first boot, and if no root
> pw has been configured yet. First boot is defined by whether
> /etc/machine-id being initialized or not. Recent mkosi versions will
> ensure that file is reset properly ensure this works. (in fact, for
> now I'd recommend working with git versions of mkosi)
>
>
> > Asking in IRC it was pointed out systemd-repart should just work
> > automatically provided the partition info was sitting in
> > /usr/lib/repart.d directory, but that it needs no MachineID set in
> > order to qualify as "first.boot".
> >
>
> Correct.
>
>
> > I don't have one set but one is being created in the process. I'm
> > missing a piece to this puzzle.
> >
> > my eyes burn, my head hurts, and i'm no closer to understanding
> > this, so i wondered if anyone on the list can succinctly explain
> > this to me or perhaps provide a link to a basic working example i
> > can try get my head around; provided of course, someone has already
> > undertaken 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 to
> build images like that. Since I am usually at home in Signal for
> things 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20221011/6498b102/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: systemd-repart.png
Type: image/png
Size: 150777 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20221011/6498b102/attachment-0001.png>
More information about the systemd-devel
mailing list