Tool to preview Grub2 themes easily (using KVM)
The short version: To preview a Grub2 theme live does not have to be hard.
- Create an overlay dedicated to Grub2 themes and add some content to it — done (more information)
- Make a Grub2 version of
media-gfx/grub-splashes
with free/libre background-image-only themes — TODO (join me!) - Package grub2-splashimages of Debian for Gentoo (probably in betagarden, initially) — TODO (interested?)
- Create a tool to preview Grub2 themes
live without rebooting or need for running
losetup
/grub2-install
/ .. yourself — done!
So this post is about that new tool: grub2-theme-preview. Basically, it does the steps I blogged about in 2012, automated:
- Creates a sparse disk as a regular file
- Adds a partition to it and formats using ext2
- Installs Grub2, copies a theme of your choice and a config file to make it work
- Starts KVM
That way, a theme creator can concentrate on the actual work on the theme. To give an example, to preview theme "Archxion" off GitHub as of today you could run:
git clone https://github.com/hartwork/grub2-theme-preview.git git clone https://github.com/Generator/Grub2-themes.git cd grub2-theme-preview ./grub2-theme-preview ../Grub2-themes/Archxion/
Once grub2-theme-preview has distutils/setuputils packaging and a Gentoo ebuild, that gets a bite easier, still. The current usage is:
# ./grub2-theme-preview --help usage: grub2-theme-preview [-h] [--image] [--grub-cfg PATH] [--version] PATH positional arguments: PATH Path of theme directory (or image file) to preview optional arguments: -h, --help show this help message and exit --image Preview a background image rather than a whole theme --grub-cfg PATH Path grub.cfg file to apply --version show program's version number and exit
Before using the tool, be warned that:
- it is alpha/beta software that
- needs root permissions in some part (calling
sudo
). - So I don't take any warranty for anything right now!
Here is what to expect from running
# ./grub2-theme-preview /usr/share/grub/themes/gutsblack-archlinux/
assuming you have
grub2-themes/gutsblack-archlinux
off the grub2-themes overlay
installed with
this grub.cfg file:
Another
example using the --image
switch for background-image-only themes, using a
640x480 rendering of vector remake of gentoo-cow:
The latter is a good candidate for that Grub2 version of media-gfx/grub-
splashes
I mentioned earlier. I'm looking forward to your patches and pull
requests!