Skip to main content

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.

grub2-theme-preview showing theme "gutsblack-archlinux"

(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 (package grub-common on Debian and Ubuntu)
  • QEMUhypervisor that performs hardware virtualization
  • OVMF — EFI bios image for use with QEMU
  • mtoolscollection of utilities to access MS-DOS
  • xorriso of libisoburnfrontend which enables creation and expansion of the ISO format

Usage

# grub2-theme-preview --help
usage: grub2-theme-preview [-h] [--image] [--grub-cfg PATH] [--verbose]
                           [--resolution WxH] [--timeout SECONDS] [--version]
                           [--grub2-mkrescue COMMAND] [--qemu COMMAND]
                           [--xorriso COMMAND] [--debug]
                           [--plain-rescue-image]
                           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 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)

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


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-1.5.0.tar.gz (199.6 kB view details)

Uploaded Source

Built Distribution

grub2_theme_preview-1.5.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file grub2-theme-preview-1.5.0.tar.gz.

File metadata

  • Download URL: grub2-theme-preview-1.5.0.tar.gz
  • Upload date:
  • Size: 199.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for grub2-theme-preview-1.5.0.tar.gz
Algorithm Hash digest
SHA256 0c6afa8743d2adf7fe7925cf2f37a8e4a8a87c27fbd532955021a81ebc6eb190
MD5 1e551db23c88685af75b405058434fde
BLAKE2b-256 8bcfab9a12fea862f53e86955a4d72087dc22c6f0daa7dfa52545e7c9734b574

See more details on using hashes here.

File details

Details for the file grub2_theme_preview-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: grub2_theme_preview-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for grub2_theme_preview-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30a53926f48db9a5da826d86da7d2f4a531ec081c3c472ba346fcc2728bb6b2c
MD5 a95e5d4f940c61c1e285f175d60286e3
BLAKE2b-256 be11d5c2ab674c52b0fb7f8d435afc3b2aff3818a26549888ad199ee6b639f5c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page