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: grub-mkrescue)
--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
grub2-theme-preview-2.1.0.tar.gz
(200.3 kB
view hashes)
Built Distribution
Close
Hashes for grub2-theme-preview-2.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8a45f456db20f271d3e25450e28214dd274e4f5c7ccfc33f0a78c7904237808 |
|
MD5 | 549bf73bdc3ef5f88e07849bdc49accd |
|
BLAKE2b-256 | f4bfefca6ebebfab066076fcc34c16f8cf20923ac027b7798101a4a13cb28985 |
Close
Hashes for grub2_theme_preview-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df1adb66ab2d514ff7e8738cc91ad4f3575af4f708ce7f7c89dab795aebc4ad |
|
MD5 | 9e151a2fd9cb24891c4ab2a40bacae2a |
|
BLAKE2b-256 | 9d02f2ecc18df81928e0bcb0b66f551c1eba9051c7f5e968580947ed164a4907 |