mbox series

[bug#42634,0/3] Add image-type support.

Message ID 20200731144825.703211-1-othacehe@gnu.org
Headers show
Series Add image-type support. | expand

Message

Mathieu Othacehe July 31, 2020, 2:48 p.m. UTC
Hello,

This is the missing piece for the new image API. It has been previously
discussed here[1].

I think this is close to what Ludo suggested and it addresses janneke concerns
about composability.

The idea is to introduce the concept of "image-type". An image type is a
converter from an <operating-system> record to an <image> record.

I have created in this serie 4 new image type records:
- raw
- iso9660
- uncompressed-iso9660
- hurd-raw

I also adapted the "guix system" command by removing the "file-system-type"
argument and replaced it by the "image-type" argument.

The default is still to create a raw disk-image, but one can now call:

guix system disk-image -t iso9660 my-config.scm
guix system disk-image -t uncompressed-iso9660 my-config.scm
guix system disk-image -t hurd-raw my-config.scm

and so on. Maybe we should also rename "disk-image" command to "image" that
would be somehow more accurate.

The only missing bit is the documentation update, as I prefer to wait for this
change to be approved first.

WDYT?

Thanks,

Mathieu

[1]: https://lists.gnu.org/archive/html/guix-devel/2020-05/msg00417.html

Mathieu Othacehe (3):
  image: Add image-type support.
  system: image: Add image-type support.
  scripts: system: Add support for image-type.

 gnu/image.scm              | 29 ++++++++++++++-
 gnu/system/image.scm       | 75 ++++++++++++++++++++++++++++++++++++--
 gnu/system/images/hurd.scm | 13 +++++--
 guix/scripts/system.scm    | 56 +++++++++++++++++-----------
 4 files changed, 145 insertions(+), 28 deletions(-)

Comments

Ludovic Courtès Sept. 24, 2020, 3:34 p.m. UTC | #1
Hi!

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> I think this is close to what Ludo suggested and it addresses janneke concerns
> about composability.
>
> The idea is to introduce the concept of "image-type". An image type is a
> converter from an <operating-system> record to an <image> record.
>
> I have created in this serie 4 new image type records:
> - raw
> - iso9660
> - uncompressed-iso9660
> - hurd-raw
>
> I also adapted the "guix system" command by removing the "file-system-type"
> argument and replaced it by the "image-type" argument.
>
> The default is still to create a raw disk-image, but one can now call:
>
> guix system disk-image -t iso9660 my-config.scm
> guix system disk-image -t uncompressed-iso9660 my-config.scm
> guix system disk-image -t hurd-raw my-config.scm

Neat!

> and so on. Maybe we should also rename "disk-image" command to "image" that
> would be somehow more accurate.

Yes.  We can do that separately, but I agree that it would make sense.

I wonder if ‘docker-image’ could also fit in there.

Apologies for taking so long to reply!

Ludo’.
Mathieu Othacehe Sept. 30, 2020, 9:50 a.m. UTC | #2
Hey Ludo,

> I wonder if ‘docker-image’ could also fit in there.

Yes I think that 'docker-image' and 'vm-image' can both be absorbed by
the upcoming 'image' option.  Turns out, 'hurd-qcow2' image type already
produces what would be expected from 'vm-image'.

Thanks for reviewing :)

Mathieu