Preview a GRUB 2.x theme using KVM/QEMU
Project description
About
grub2-theme-preview came into life when I was looking around for available GRUB 2.x themes and wanted a way to quickly see a theme in action without rebooting real hardware.
It takes a theme folder (or just a single picture),
creates a temporary bootable image using grub2-mkrescue
and launches
that image in a virtual machine using KVM/QEMU, all without root privileges.
(Showing theme gutsblack-archlinux)
Installation
To install the latest release from PyPI:
# pip install --user grub2-theme-preview
To install from a Git clone for development:
# pip install --user --editable .
Please make sure to install these non-PyPI dependencies as well:
grub-mkrescue
of GRUB 2 (packagegrub-common
on Debian and Ubuntu)- QEMU — hypervisor that performs hardware virtualization
- OVMF — EFI bios image for use with QEMU
- mtools — collection of utilities to access MS-DOS
xorriso
of libisoburn — frontend which enables creation and expansion of the ISO format
Usage
# grub2-theme-preview --help
usage: grub2-theme-preview [-h] [--grub-cfg PATH] [--verbose]
[--resolution WxH] [--timeout SECONDS] [--version]
[--grub2-mkrescue COMMAND] [--qemu COMMAND]
[--xorriso COMMAND] [--no-kvm] [--debug]
[--plain-rescue-image]
PATH
positional arguments:
PATH Path of theme directory (or PNG/TGA image file) to
preview
optional arguments:
-h, --help show this help message and exit
--grub-cfg PATH Path of custom grub.cfg file to use (default:
/boot/grub{2,}/grub.cfg)
--verbose Increase verbosity
--resolution WxH Set a custom resolution, e.g. 800x600
--timeout SECONDS Set timeout in whole seconds or -1 to disable
(default: 30 seconds)
--version show program's version number and exit
command location arguments:
--grub2-mkrescue COMMAND
grub2-mkrescue command (default: auto-detect)
--qemu COMMAND KVM/QEMU command (default: qemu-system-<machine>)
--xorriso COMMAND xorriso command (default: xorriso)
arguments related to invokation of QEMU/KVM:
--no-kvm Do not pass -enable-kvm to QEMU (and hence fall back
to acceleration "tcg" which is significantly slower
than KVM)
debugging arguments:
--debug Enable debugging output
--plain-rescue-image Use unprocessed GRUB rescue image with no theme
patched in; useful for checking if a plain GRUB rescue
image shows up a GRUB shell, successfully.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file grub2-theme-preview-2.3.0.tar.gz
.
File metadata
- Download URL: grub2-theme-preview-2.3.0.tar.gz
- Upload date:
- Size: 201.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 574ac02da19965afa2845ca4c9c7319ec78082e6ca955a50c6d7a20a381c0943 |
|
MD5 | 0aef4f1e1db49a2c56363b509775e1e3 |
|
BLAKE2b-256 | a6f70fe4b1869b1bc2879f4e12599d1fcf0ae118097541748608bb49a536d8bd |
File details
Details for the file grub2_theme_preview-2.3.0-py3-none-any.whl
.
File metadata
- Download URL: grub2_theme_preview-2.3.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64d02412efef5848ff0a4b3d3f8c64b42968213e2b5bf23c7ef57118be99d82c |
|
MD5 | 933cd966eaf9647645493616333e696f |
|
BLAKE2b-256 | 698a94b97e15f5960c2a49bb82896dc23977ec7747d93ab0320aa686077bf1cf |