跳转到主要内容

使用KVM/QEMU预览GRUB 2.x主题

项目描述

pre-commit Run Python test suite

关于

grub2-theme-preview 在我寻找可用的GRUB 2.x主题并希望快速查看主题效果而无需重启真实硬件时诞生。

它接受一个主题文件夹(或只是一个单张图片),使用 grub2-mkrescue 创建一个临时可启动镜像,并使用KVM/QEMU在虚拟机中启动该镜像,所有操作无需root权限。

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

(显示主题 gutsblack-archlinux)

安装

PyPI安装最新版本

# pip install --user grub2-theme-preview

从Git克隆(开发使用)

# pip install --user --editable .

请确保安装以下非PyPI依赖项

  • grub-mkrescue of GRUB 2(Debian和Ubuntu上的grub-common包)
  • QEMU —— 执行硬件虚拟化的虚拟机管理程序
  • OVMF —— 用于QEMU的EFI bios镜像
  • mtools —— 访问MS-DOS的实用程序集合
  • xorriso of libisoburn —— 启用创建和扩展ISO格式的用户界面

使用方法

# grub2-theme-preview --help
usage: grub2-theme-preview [-h] [--grub-cfg PATH] [--verbose]
                           [--resolution WxH] [--timeout SECONDS]
                           [--add TARGET=/SOURCE] [--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 GRUB timeout in whole seconds or -1 to disable
                        (default: 30 seconds)
  --add TARGET=/SOURCE  make grub2-mkrescue add file(s) from /SOURCE to
                        /TARGET in the rescue image (can be passed multiple
                        times)
  --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:
  --display DISPLAY     pass "-display DISPLAY" to QEMU, see "man qemu" for
                        details (default: use QEMU's default display)
  --full-screen         pass "-full-screen" to QEMU
  --no-kvm              do not pass -enable-kvm to QEMU (and hence fall back
                        to acceleration "tcg" which is significantly slower
                        than KVM)
  --vga CARD            pass "-vga CARD" to QEMU, see "man qemu" for details
                        (default: use QEMU's default VGA card)

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.

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

grub2-theme-preview-2.8.0.tar.gz (207.7 kB 查看散列值)

上传时间

构建分发

grub2_theme_preview-2.8.0-py3-none-any.whl (12.1 kB 查看散列值)

上传时间 Python 3

支持者