public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-kernel-meta/pve-installer] boot ZFS on legacy BIOS systems from vfat
Date: Thu, 22 Apr 2021 13:17:53 +0200	[thread overview]
Message-ID: <20210422111801.4193-1-s.ivanov@proxmox.com> (raw)

the pve-kernel-meta patches were prepared on top of the pve-kernel-5.4 branch
rfc->v1:
* Thanks to Fabian's great feedback this version handles a few cases I did not
  think of for the RFC (e.g. an update to grub which runs grub-install and
  removes the core.img/stage0 pointing to the ESP (instead of the zfs pool)
* pve-kernel-helper now adds a diversion (dpkg-divert(1)) to grub-install,
  which should prevent users/grub-upgrades accidentally overwriting grub
  with a config which tries to boot from the zpool
* both `update-grub` and the config it generates adds a banner/warning if
  proxmox-boot is used (notifying the user where the correct place for editing
  is)
* the renaming from pve-efiboot-tool to proxmox-boot-tool was carried further
  to also include all hooks and snippets
* a first version of a patch for pve-installer was added (and very roughly
  tested)

original cover-letter for the RFC:
This patchset has been long overdue, and complements the solution to booting
ZFS on UEFI systems using systemd-boot.

With the upgrade of ZFS 2.0.0 (and it's support for ZSTD compression), quite
a few users found out that their systems were still booted with legacy bios
boot and were consequently rendered unbootable with enabling zstd
compression on (a dataset on rpool).

The solution is inspired by our community-forum, especially @avw, and seems
rather lightweight (patch 2/2 is best viewed with '-w').
My first approach was to generate a working grub-config ourselves, but
given that grub has a few years of handling special cases - bind-mounting
the ESP on /boot and running 'update-grub' seems like a less painful way.

* patch 1/2 renames pve-efiboot-tool to proxmox-boot-tool (which seems more
appropriate by now)
* patch 2/2 adds support for installing grub appropriately on the ESPs
  and running the kernel sync-logic in a way that update-grub feels fine
  with

Sending as RFC, because this is a proof-of-concept and missing quite a few
things.

What works:
* installing this version on a root ZFS RAID-Z@ PVE (based on an old pre 6.2
  install)
* reformatting all 4 ESPs `proxmox-boot-tool format /dev/sda2 --force)
* initializing them
* rebooting into 5.4.106 and zfs 2.0.0
* upgrading the pool, setting compression=zstd, writing a file, rebooting
  (successfully)
* rebooting into an old 5.3 kernel - and getting greeted by busy-box instead
  of grub-rescue

What's missing (at least):
* support in the installer
* the renaming is not quite through (the kernel-hooks are still containing
  pve/efi in their name)
* testing the removal part of the$kernel-sync

pve-kernel-meta:
Stoiko Ivanov (7):
  proxmox-boot-tool: rename from pve-efiboot-tool
  proxmox-boot-tool: add status command
  proxmox-boot-tool: sort and remove duplicates on clean
  proxmox-boot: rename uuid list file
  proxmox-boot-tool: handle legacy boot zfs installs
  proxmox-boot: add grub.cfg header snippet
  proxmox-boot: add grub-install wrapper

 Makefile                                      |  2 +-
 bin/Makefile                                  |  3 +-
 bin/grub-install-wrapper                      | 12 +++
 bin/{pve-efiboot-tool => proxmox-boot-tool}   | 52 +++++++++---
 debian/pve-kernel-helper.install              |  5 +-
 debian/pve-kernel-helper.links                |  1 +
 debian/pve-kernel-helper.postinst             | 10 +++
 debian/pve-kernel-helper.postrm               | 14 ++++
 debian/pve-kernel-helper.preinst              |  9 +++
 proxmox-boot/000_proxmox_boot_header          | 22 +++++
 {efiboot => proxmox-boot}/Makefile            |  8 +-
 {efiboot => proxmox-boot}/functions           |  2 +-
 .../proxmox-auto-removal                      |  0
 .../proxmox-boot-sync                         |  2 +-
 .../zz-proxmox-boot                           | 81 +++++++++++++------
 15 files changed, 182 insertions(+), 41 deletions(-)
 create mode 100755 bin/grub-install-wrapper
 rename bin/{pve-efiboot-tool => proxmox-boot-tool} (88%)
 create mode 100644 debian/pve-kernel-helper.links
 create mode 100644 debian/pve-kernel-helper.postinst
 create mode 100644 debian/pve-kernel-helper.postrm
 create mode 100644 debian/pve-kernel-helper.preinst
 create mode 100755 proxmox-boot/000_proxmox_boot_header
 rename {efiboot => proxmox-boot}/Makefile (72%)
 rename {efiboot => proxmox-boot}/functions (98%)
 rename efiboot/pve-auto-removal => proxmox-boot/proxmox-auto-removal (100%)
 rename efiboot/pve-efiboot-sync => proxmox-boot/proxmox-boot-sync (84%)
 rename efiboot/zz-pve-efiboot => proxmox-boot/zz-proxmox-boot (69%)

pve-installer:
Stoiko Ivanov (1):
  always boot zfs with proxmox-boot-tool

 proxinstall | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

-- 
2.20.1





             reply	other threads:[~2021-04-22 11:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 11:17 Stoiko Ivanov [this message]
2021-04-22 11:17 ` [pve-devel] [PATCH pve-kernel-meta 1/7] proxmox-boot-tool: rename from pve-efiboot-tool Stoiko Ivanov
2021-04-22 13:27   ` Fabian Grünbichler
2021-04-22 11:17 ` [pve-devel] [PATCH pve-kernel-meta 2/7] proxmox-boot-tool: add status command Stoiko Ivanov
2021-04-22 14:01   ` Fabian Grünbichler
2021-04-22 11:17 ` [pve-devel] [PATCH pve-kernel-meta 3/7] proxmox-boot-tool: sort and remove duplicates on clean Stoiko Ivanov
2021-04-22 11:17 ` [pve-devel] [PATCH pve-kernel-meta 4/7] proxmox-boot: rename uuid list file Stoiko Ivanov
2021-04-22 11:17 ` [pve-devel] [PATCH pve-kernel-meta 5/7] proxmox-boot-tool: handle legacy boot zfs installs Stoiko Ivanov
2021-04-22 11:17 ` [pve-devel] [PATCH pve-kernel-meta 6/7] proxmox-boot: add grub.cfg header snippet Stoiko Ivanov
2021-04-22 11:18 ` [pve-devel] [PATCH pve-kernel-meta 7/7] proxmox-boot: add grub-install wrapper Stoiko Ivanov
2021-04-22 11:18 ` [pve-devel] [PATCH installer 1/1] always boot zfs with proxmox-boot-tool Stoiko Ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210422111801.4193-1-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal