[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
declarative partition and format with Guix (was Re: Guix System automate
From: |
Giovanni Biscuolo |
Subject: |
declarative partition and format with Guix (was Re: Guix System automated installation) |
Date: |
Wed, 28 Feb 2024 08:33:43 +0100 |
Hello Ian,
Ian Eure <ian@retrospec.tv> writes:
> Giovanni Biscuolo <g@xelera.eu> writes:
[...]
>> Please consider that a preseed file is very limited compared to
>> a
>> full-fledged operating-system declaration since the latter
>> contains the
>> declaration for *all* OS configuration, not just the installed
>> packages.
>
> I appreciate where you’re coming from, I also like the one-file
> system configuration, but this is inaccurate.
Yes you are right, I completely misrepresented the functionality of the
Debian preseed utility, sorry! (...and I used that in a remote past)
[...]
> installed packages. Right now, Debian’s system allows you to do
> things which Guix does not.
[...]
> means you can use a preseed file to tell the installer to
> partition disks, set up LUKS-encrypted volumes (and specify one or
> more passwords for them), format those with filesystems
Yes, this is what is missing from the Guix installer system
> With Debian, I can create a custom installer image with a preseed
> file, boot it, and without touching a single other thing, it’ll
> install and configure the target machine, and reboot into it. That
> boot-and-it-just-works experience is what I want from Guix.
I understand that it's just a workaround but you can achieve this
boot-and-it-just-works (if there isn't bugs in the script/preseed)
experience with a simple bash script to automate "manual installation"
I wrote it in bash because I'm not able to write it in Guile and/or
extend the "guix system" command to be able to manage the missing bits,
but that is a solution (more a workaround now)
[...]
> There’s no facility for specifying disk partitioning or *creating*
> filesystems in the system config -- it can only be pointed at ones
> which have been created already.
Yes: those facilities are missing, we (still?) cannot do that
declaratively... let's do that imperatively, automatically :-)
[...]
>> I would really Love So Much™ to avoid writing imperative bash
>> scripts
>> and just write Scheme code to be able to do a "full automatic"
>> Guix
>> System install, using a workflow like this one:
>>
>> 1. guix system prepare --include preseed.scm disk-layout.scm
>> /mnt
>>
>> where disk-layout.scm is a declarative gexp used to partition,
>> format
>> and mount all needed filesystems
>>
>> the resulting config.scm would be an operating-system
>> declaration with
>> included the contents of preseed.scm (packages and services
>> declarations)
>>
>> 2. guix system init config.scm /mnt (already working now)
>>
>> ...unfortunately I'm (still?!?) not able to contribute such code
>> :-(
>>
>
> I don’t think there’s any need for a preseed.scm file, and I’m not
> sure what would be in that,
preseed.scm is "just" the part of "operating-system" declaration without
the (bootloader [...]), (file-systems [...]) and (swap-devices [...])
declaration, that is automatically generated by "guix system prepare"
based on disk-layout.scm
> but I think this is close to the right track. Either operating-system
> should be extended to support things like disk partitioning, and
> effect those changes at reconfigure time (with suitable safeguards to
> avoid wrecking existing installs),
I would prefer not, such "reconfigurations" should be done "out of band"
and not "in band", IMHO
> or the operating-system config could get
> embedded in another struct which contains that, similar to the
> (image ...) config for `guix system image'. I think there are
> some interesting possibilities here: you could change your
> partition layout and have Guix resize them
Root (/) partition resizing must be done with root unmounted, no?
Also, since the resize (shrink?) of filesystem is a very sensitive
operation, I'd exclude that from "normal" operations done via "guix
system reconfigure"... it's more "guix system prepare..." with one or
more disk partitions (i.e. /home) resized/shrinked or kept as is,
_without_ file system (re)formatting.
One interesting thing that could be done at "guix system prepare" time
is to restore one or more filesystem content from a (possibly remote)
backup, useful in a disaster recovery scenario.
> / create new ones for you.
[...]
Meanwhile: WDYT to work togheter on a simple _configurable_ bash script
to help users automate the very first installation of a Guix System and
try to upstream it?
Thanks! Gio'
--
Giovanni Biscuolo
Xelera IT Infrastructures
signature.asc
Description: PGP signature