gnu: grub: Allow a PNG image and replace "aspect-ratio" with "resolution".
authorStefan <stefan-guix@vodafonemail.de>
Sun, 17 May 2020 21:53:50 +0000 (23:53 +0200)
committerMathieu Othacehe <othacehe@gnu.org>
Tue, 19 May 2020 07:09:21 +0000 (09:09 +0200)
commit9cdb10d52e34f7e8fa3b6238fe268646a4bbb877
tree2b994ed53f81b4a9948fd0b52398194dbe418b68
parent2e59ae238426df3f886c6a1aeca08ddc96b61143
gnu: grub: Allow a PNG image and replace "aspect-ratio" with "resolution".

* gnu/bootloaders/grub.scm (<grub-image>): Remove this record and replace it
by ...
(<grub-theme>)[image]: ... this field with the default from %background-image,
(<grub-theme>)[resolution]: ... this field with the defaults from 'width' and
'height' of 'grub-background-image'.
(<grub-theme>)[images]: Remove this field.
(svg->png): Rename to ...
(image->png): ... and use 'copy-file' instead of 'svg->png', if the suffix of
the image file is not ".svg".
(grub-background-image): Remove the arguments 'width' and 'height'.
(grub-theme-image): Add function.
(grub-theme-resolution): Add function.
(grub-theme-gfxmode): Add function.
(grub-image): Remove function.
(grub-image?): Remove function.
(grub-image-aspect-ratio): Remove function.
(grub-image-file): Remove function.
(grub-theme-images): Remove function.
(%default-theme): Remove variable.
(%background-image): Remove variable.

Using image formats different to SVG was not possible.

For a <grub-image> to be chosen, the 'aspect-ratio' of it had to be 4/3, as the
resolution of any image was defaulting to 1024 x 768.

There was no code to determine the proper boot-resolution to make any use of a
list of images with different aspect-ratios.

It seems to be a better solution to only define a single image with any format,
and use a given resolution only for the conversion from a SVG file. This also
makes the use of a special <grub-image> record unnecessary.

Moving the default values from '%background-image' and '%default-theme' into
<grub-theme> makes a customisation easier without (inherit) and allows to remove
the undocumented variables %background-image' and '%default-theme'.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
gnu/bootloader/grub.scm