Commit Graph

243 Commits

Author SHA1 Message Date
Thomas Lamprecht
354e6f61a2 bump version to 7.0-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-21 19:38:44 +02:00
Thomas Lamprecht
40da6d6368 bump version to 7.0-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-12 10:32:57 +02:00
Thomas Lamprecht
bbb0debfa8 bump version to 7.0-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-08 10:10:26 +02:00
Thomas Lamprecht
f5ef4a67df grub wrapper: skip if using boot-tool but also booted via EFI
From Fabians feedback:
> this could have another guard for whether the system is even booted
> with grub as if the system was booted using EFI, re-initing all
> ESPs is just busy-work

So skip if proxmox-boot-tool and booted with EFI, as then GRUB is out
of the picture anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-08 10:05:01 +02:00
Thomas Lamprecht
3eec58d08d grub wrapper: log on ignore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-08 09:52:58 +02:00
Thomas Lamprecht
ea065c7e3f grub wrapper: move to simple space indentation and minimal whitespace cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-08 09:27:15 +02:00
Stoiko Ivanov
25c7338c8a proxmox-boot: status: print present kernel versions
gives a better overview in case the system was switched at one time
from uefi to legacy (or the other way around).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-08 08:44:35 +02:00
Stoiko Ivanov
8f256d2772 proxmox-boot: print current boot mode with status output
most support questions w.r.t. proxmox-boot-tool do have us
asking for `stat /sys/firmware/efi` output anyways

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-08 08:44:35 +02:00
Stoiko Ivanov
3a982230c1 proxmox-boot: maintscript: change logic whether to add diversion
Deciding whether or not to add the diversion based on the version
alone fails quite hard in case pve-kernel-helper is in dpkg-state 'rc'
(removed not purged) as reported in our community forum[0]:
* removing pve-kernel-helper removes the diversion of grub-install
* if config-files are still present the preinst script gets called
  with the version of the config-files (the version that got removed)
* if the version was newer than 6.4-1~ then no diversion is added
* unpacking fails, because grub-install would be overwritten leaving
  pve-kernel-helper in state 'ic'

Explicitly checking whether the diversion is in place sounds like a
robust approach here.

downside: documentation on dpkg-divert in maintainer scripts [1] uses
the version approach.

[0] https://forum.proxmox.com/threads/pve-kernel-helper-wont-install.90029/
[1] https://www.debian.org/doc/debian-policy/ap-pkg-diversions.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-08 08:44:35 +02:00
Stoiko Ivanov
5c5008bcd6 proxmox-boot: divert call to grub-install to p-b-t init
This way all ESPs (in case of a legacy booted system) get an
updated grub installation.

running only once between reboots (the markerfile is in /tmp) should
be enough. Sadly the environment does not provide a hint which version
grub is installed to.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-08 08:44:35 +02:00
Stoiko Ivanov
7559f23996 proxmox-boot: ignore call to grub-install from grub maintscripts
in certain cases the postinst script of grub-pc runs grub-install on
the disks it gets from debconf. Simply warn and exit with 0 if
grub-install is called by dpkg and from a grub related package

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-08 08:44:35 +02:00
Stoiko Ivanov
dc3e3e5ca7 proxmox-boot: redirect stdout in update-grub snippet
update-grub (via grub-mkconfig) generates the grub configuration by
concatenating the output of each snippet (from /etc/grub.d).

We need to redirect the output of `proxmox-boot-tool refresh`
to not end up with a syntactically wrong config in /boot/grub/grub.cfg
(which is not used in any case)

quickly tested with a test-installation of mine

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-24 14:21:01 +02:00
Thomas Lamprecht
4e08066556 buildsys: change upload dist to bullseye and add pbs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 10:59:22 +02:00
Thomas Lamprecht
c30ef277d6 bump version to 7.0-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 10:58:57 +02:00
Thomas Lamprecht
75824f97af bump version to 7.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-01 17:23:45 +02:00
Thomas Lamprecht
9a6ae0cb5e d/control: bump debhelper compat to >= 12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-12 17:28:38 +02:00
Thomas Lamprecht
7f1b85c252 bump version to 7.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-12 17:27:30 +02:00
Thomas Lamprecht
2c4fc8f324 d/preinst: fix file diversion for package upgrade
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 13:28:56 +02:00
Thomas Lamprecht
9485516b69 d/postrm: use correct version for check
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 13:28:56 +02:00
Thomas Lamprecht
8b15a09710 d/maintscripts: we will use 6.4-1 as next version
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 13:28:56 +02:00
Thomas Lamprecht
c2395dd2d4 reword update-grup warnign slighty
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 13:28:56 +02:00
Stoiko Ivanov
72ed875819 proxmox-boot: run p-b-t refresh on update-grub
If the system seems to be using proxmox-boot, simply run it, in
addition to warning the user about the situation.

Since the warning is only printed when update-grub is not called
by dpkg or proxmoxmox-boot-tool, this should be safe, and potentially
help keeping systems bootable.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00
Stoiko Ivanov
7290506104 proxmox-boot: add grub-install wrapper
if a (legacy) system is booted with proxmox-boot-tool, running
`grub-install` without being aware of the fact can render the system
unbootable (e.g. when letting the early stage point to an incompatible
zpool instead of the ESP).

To prevent this we add a dpkg-diversion [0], which simply checks if
`proxmox-boot-tool status` indicates that proxmox-boot is used and
errors out in that case, and runs the actual grub-install else.

Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00
Stoiko Ivanov
ff28956d40 proxmox-boot: add grub.cfg header snippet
If the system seems to be booted using proxmox-boot, write a header at
the beginning of the grub.cfg generated when running `update-grub`

Additionally print a warning in case the script is run interactively.
This is determined by checking for DPKG_VERSION, which is set when
running as post-inst task (after a kernel install/removal)
and for PVE_EFIBOOT_UNSHARED, which is set by proxmox-boot-tool when
running `proxmox-boot-tool refresh.`

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00
Stoiko Ivanov
593001de1b proxmox-boot-tool: handle legacy boot zfs installs
This patch adds support for booting non-uefi/legacy/bios-boot ZFS
installs, by using proxmox-boot-tool to copy the kernels to the ESP
and then generate a fitting grub config for booting from the vfat ESP:

* grub is installed onto the ESP and the MBR points to the ESP
* after copying/deleting the kernels proxmox-boot-tool bindmounts the
  ESP on /boot (inside the new mount namespace)
* grub-update then manages to generate a fitting config.

Some paths/sanity-checks needed adaptation (to differentiate between
EFI boot and not (based on the existence of /sys/firmware/efi)

The arguments for grub-install are taken from the pve-installer.

The approach is inspired by @avw in our community-forum [0].

[0] https://forum.proxmox.com/threads/zfs-error-no-such-device-error-unknown-filesystem-entering-rescue-mode.75122/post-374799

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00
Stoiko Ivanov
8c0a22adfe proxmox-boot: rename uuid list file
in order to be consistent with the renaming of pve-efiboot-tool to
proxmox-boot-tool.

Sending as separate patch, since it changes and removes a file in
'/etc', which could be considered part of the external 'api' of
proxmox-boot-tool

Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00
Stoiko Ivanov
33f32d0a30 proxmox-boot-tool: sort and remove duplicates on clean
This is mostly in preparation for renaming pve-efiboot-uuids into
proxmox-boot-uuids, but can help in general (since each duplicate uuid
causes excessive disk i/o upon kernel upgrades).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00
Stoiko Ivanov
182bfa3a0f proxmox-boot-tool: add status command
currently simply checking if $ESP_LIST exists, and indicating via
the exit status if proxmox-boot-tool is used for booting the system.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00
Stoiko Ivanov
b3c980626d proxmox-boot-tool: rename from pve-efiboot-tool
We will be using the mechanics also for ZFS systems booting with BIOS
legacy boot, and the tool is used also in PMG and PBS.

A symlink is kept in place for compatibility reasons

The hook scripts are marked as conffiles (as all files in /etc) and
are handled by dpkg-maintscript-helper(1) via dh_installdeb(1)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-04-23 13:28:56 +02:00
Thomas Lamprecht
f41600a3a6 bump version to 7.0-0+4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-09 11:07:51 +02:00
Thomas Lamprecht
96257df1e3 bump version to 7.0-0+3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-18 19:22:55 +01:00
Thomas Lamprecht
825caa0f5d bump version to 7.0-0+2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-18 16:08:33 +01:00
Thomas Lamprecht
659521a666 bump version to 7.0-0+1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-02 16:20:54 +01:00
Thomas Lamprecht
63e0aae7f4 bump version to 6.3-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-26 14:16:42 +01:00
Thomas Lamprecht
833938ddac bump version to 6.3-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-15 18:21:35 +01:00
Thomas Lamprecht
03c04fd36b bump version to 6.3-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-15 17:23:15 +01:00
Thomas Lamprecht
60956e9ab2 bump version to 6.3-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-01-28 16:00:24 +01:00
Thomas Lamprecht
5ab2d06ce3 bump version to 6.3-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-03 15:11:28 +01:00
Thomas Lamprecht
30645aaef0 bump version to 6.3-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-30 12:05:36 +01:00
Thomas Lamprecht
ad81f6384b bump version to 6.3-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-16 11:28:24 +01:00
Thomas Lamprecht
2006e8c483 bump version to 6.2-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-21 17:17:06 +02:00
Thomas Lamprecht
2ec72b24eb bump version to 6.2-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-31 11:59:14 +02:00
Thomas Lamprecht
ffebe658c4 bump version to 6.2-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-02 07:16:40 +02:00
Thomas Lamprecht
a8f040bc92 bump version to 6.2-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-16 13:43:06 +02:00
Aaron Lauterer
78c0b9cbd1 pve-efiboot-tool: format: show real path in warning if needed
Show the real path of the partition in case when the basename couldn't
be determined and the partition given is a symlinked one like
/dev/disk/by-id/<part>/

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-06-02 12:29:57 +02:00
Aaron Lauterer
5d733131b6 pve-efiboot-tool: format: fix handling of disk/by-id
The format command will fail when using other paths like
/dev/disk/by-id/<part> instead of /dev/sdXY directly. It cannot find
the path /sys/block/<disk>/<part>/partition path.

The part name in /dev/disk/by-id is a symlink to /dev/sdXY. At that
point we already have the symlink resolved to the real path. It is
stored in `bdev`.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-06-02 12:29:54 +02:00
Thomas Lamprecht
723eacb774 bump version to 6.2-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 15:40:17 +02:00
Thomas Lamprecht
04ec22d77d bump version to 6.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-06 10:23:48 +02:00
Thomas Lamprecht
f8b44bc9e5 bump version to 6.1-9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-10 11:34:53 +02:00
Thomas Lamprecht
541cd729b6 bump version to 6.1-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-23 15:03:55 +01:00