]> git.proxmox.com Git - pve-kernel-meta.git/log
pve-kernel-meta.git
2 years agoproxmox-boot: ignore call to grub-install from grub maintscripts
Stoiko Ivanov [Wed, 7 Jul 2021 21:09:50 +0000 (23:09 +0200)]
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>
2 years agoproxmox-boot: redirect stdout in update-grub snippet
Stoiko Ivanov [Thu, 24 Jun 2021 11:20:25 +0000 (13:20 +0200)]
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>
2 years agobuildsys: change upload dist to bullseye and add pbs
Thomas Lamprecht [Wed, 23 Jun 2021 08:59:22 +0000 (10:59 +0200)]
buildsys: change upload dist to bullseye and add pbs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.0-3
Thomas Lamprecht [Wed, 23 Jun 2021 08:58:53 +0000 (10:58 +0200)]
bump version to 7.0-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.0-2
Thomas Lamprecht [Tue, 1 Jun 2021 15:23:45 +0000 (17:23 +0200)]
bump version to 7.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/control: bump debhelper compat to >= 12
Thomas Lamprecht [Wed, 12 May 2021 15:28:38 +0000 (17:28 +0200)]
d/control: bump debhelper compat to >= 12

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 7.0-1
Thomas Lamprecht [Wed, 12 May 2021 15:27:30 +0000 (17:27 +0200)]
bump version to 7.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/preinst: fix file diversion for package upgrade
Thomas Lamprecht [Fri, 23 Apr 2021 11:14:07 +0000 (13:14 +0200)]
d/preinst: fix  file diversion for package upgrade

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/postrm: use correct version for check
Thomas Lamprecht [Fri, 23 Apr 2021 11:12:54 +0000 (13:12 +0200)]
d/postrm: use correct version for check

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/maintscripts: we will use 6.4-1 as next version
Thomas Lamprecht [Fri, 23 Apr 2021 09:29:00 +0000 (11:29 +0200)]
d/maintscripts: we will use 6.4-1 as next version

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoreword update-grup warnign slighty
Thomas Lamprecht [Fri, 23 Apr 2021 09:28:01 +0000 (11:28 +0200)]
reword update-grup warnign slighty

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoproxmox-boot: run p-b-t refresh on update-grub
Stoiko Ivanov [Fri, 23 Apr 2021 09:04:50 +0000 (11:04 +0200)]
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>
3 years agoproxmox-boot: add grub-install wrapper
Stoiko Ivanov [Fri, 23 Apr 2021 09:04:49 +0000 (11:04 +0200)]
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>
3 years agoproxmox-boot: add grub.cfg header snippet
Stoiko Ivanov [Fri, 23 Apr 2021 09:04:48 +0000 (11:04 +0200)]
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>
3 years agoproxmox-boot-tool: handle legacy boot zfs installs
Stoiko Ivanov [Fri, 23 Apr 2021 09:04:47 +0000 (11:04 +0200)]
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>
3 years agoproxmox-boot: rename uuid list file
Stoiko Ivanov [Fri, 23 Apr 2021 09:04:46 +0000 (11:04 +0200)]
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>
3 years agoproxmox-boot-tool: sort and remove duplicates on clean
Stoiko Ivanov [Fri, 23 Apr 2021 09:04:45 +0000 (11:04 +0200)]
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>
3 years agoproxmox-boot-tool: add status command
Stoiko Ivanov [Fri, 23 Apr 2021 09:04:44 +0000 (11:04 +0200)]
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>
3 years agoproxmox-boot-tool: rename from pve-efiboot-tool
Stoiko Ivanov [Fri, 23 Apr 2021 09:04:43 +0000 (11:04 +0200)]
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>
3 years agobump version to 7.0-0+4
Thomas Lamprecht [Fri, 9 Apr 2021 09:07:47 +0000 (11:07 +0200)]
bump version to 7.0-0+4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 7.0-0+3
Thomas Lamprecht [Thu, 18 Mar 2021 18:22:55 +0000 (19:22 +0100)]
bump version to 7.0-0+3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 7.0-0+2
Thomas Lamprecht [Thu, 18 Mar 2021 15:08:33 +0000 (16:08 +0100)]
bump version to 7.0-0+2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 7.0-0+1
Thomas Lamprecht [Tue, 2 Mar 2021 15:20:54 +0000 (16:20 +0100)]
bump version to 7.0-0+1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.3-6
Thomas Lamprecht [Fri, 26 Feb 2021 13:16:42 +0000 (14:16 +0100)]
bump version to 6.3-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.3-5
Thomas Lamprecht [Mon, 15 Feb 2021 17:21:35 +0000 (18:21 +0100)]
bump version to 6.3-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.3-4
Thomas Lamprecht [Mon, 15 Feb 2021 16:23:15 +0000 (17:23 +0100)]
bump version to 6.3-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.3-4
Thomas Lamprecht [Thu, 28 Jan 2021 15:00:24 +0000 (16:00 +0100)]
bump version to 6.3-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.3-3
Thomas Lamprecht [Thu, 3 Dec 2020 14:11:28 +0000 (15:11 +0100)]
bump version to 6.3-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.3-2
Thomas Lamprecht [Mon, 30 Nov 2020 11:05:36 +0000 (12:05 +0100)]
bump version to 6.3-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.3-1
Thomas Lamprecht [Mon, 16 Nov 2020 10:28:24 +0000 (11:28 +0100)]
bump version to 6.3-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.2-7
Thomas Lamprecht [Mon, 21 Sep 2020 15:17:06 +0000 (17:17 +0200)]
bump version to 6.2-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.2-6
Thomas Lamprecht [Mon, 31 Aug 2020 08:38:36 +0000 (10:38 +0200)]
bump version to 6.2-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.2-4
Thomas Lamprecht [Thu, 2 Jul 2020 05:16:40 +0000 (07:16 +0200)]
bump version to 6.2-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.2-3
Thomas Lamprecht [Tue, 16 Jun 2020 11:43:02 +0000 (13:43 +0200)]
bump version to 6.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agopve-efiboot-tool: format: show real path in warning if needed
Aaron Lauterer [Tue, 19 May 2020 07:59:44 +0000 (09:59 +0200)]
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>
3 years agopve-efiboot-tool: format: fix handling of disk/by-id
Aaron Lauterer [Tue, 19 May 2020 07:59:43 +0000 (09:59 +0200)]
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>
4 years agobump version to 6.2-2
Thomas Lamprecht [Fri, 15 May 2020 13:40:14 +0000 (15:40 +0200)]
bump version to 6.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.2-1
Thomas Lamprecht [Wed, 6 May 2020 08:23:48 +0000 (10:23 +0200)]
bump version to 6.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-9
Thomas Lamprecht [Sat, 4 Apr 2020 14:23:44 +0000 (16:23 +0200)]
bump version to 6.1-9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-8
Thomas Lamprecht [Mon, 23 Mar 2020 14:03:55 +0000 (15:03 +0100)]
bump version to 6.1-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-7
Thomas Lamprecht [Mon, 9 Mar 2020 15:08:46 +0000 (16:08 +0100)]
bump version to 6.1-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-6
Thomas Lamprecht [Mon, 2 Mar 2020 17:59:43 +0000 (18:59 +0100)]
bump version to 6.1-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-5
Thomas Lamprecht [Sat, 15 Feb 2020 16:24:40 +0000 (17:24 +0100)]
bump version to 6.1-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2595: less false positives when filtering out meta packages
Thomas Lamprecht [Sat, 15 Feb 2020 16:17:26 +0000 (17:17 +0100)]
fix #2595: less false positives when filtering out meta packages

This fixes selecting kernels for manual inclusion in the ESP which do
not come with a "-pve" in name.
It fixes listing, by just printing out the whole list as is. refresh
complains already if there's a kernel selected but no respective
vmlinuz got found. Additionally, we already plainly add the "manual
kernel list" in kernel_keep_versions, but filter then out any kernel
not containing a "-pve" in boot_kernel_list.

But boot_kernel_list should actually only filter out the kernel meta
packages.

So, use a inverse match and check for a /\d+\.\d+/ pattern, this
seems to work well enough.

Note that kernel_keep_versions doesn't picks up non-pve kernels
anyway, so this only really alters manual selection.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-4
Thomas Lamprecht [Wed, 5 Feb 2020 12:15:54 +0000 (13:15 +0100)]
bump version to 6.1-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-3
Thomas Lamprecht [Fri, 31 Jan 2020 13:13:44 +0000 (14:13 +0100)]
bump version to 6.1-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agozz-pve-efiboot: improve loader title detection
Oguz Bektas [Thu, 30 Jan 2020 15:18:05 +0000 (16:18 +0100)]
zz-pve-efiboot: improve loader title detection

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agobump version to 6.1-2
Thomas Lamprecht [Fri, 24 Jan 2020 11:22:23 +0000 (12:22 +0100)]
bump version to 6.1-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-1
Thomas Lamprecht [Thu, 5 Dec 2019 08:28:47 +0000 (09:28 +0100)]
bump version to 6.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-12
Thomas Lamprecht [Thu, 14 Nov 2019 09:46:12 +0000 (10:46 +0100)]
bump version to 6.0-12

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agouse perl instead of (g)awk to clean /proc/cmdline
Oguz Bektas [Fri, 8 Nov 2019 12:47:22 +0000 (13:47 +0100)]
use perl instead of (g)awk to clean /proc/cmdline

this awk line only works with gawk because of implementation differences
between awk alternatives.
debian has mawk installed by default, and mawk does not implement word
boundary regex. to avoid having to depend on gawk, we can just use perl
instead.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agoefiboot/autorm functions: ignore running kernel if it was removed
Thomas Lamprecht [Thu, 7 Nov 2019 17:37:02 +0000 (18:37 +0100)]
efiboot/autorm functions: ignore running kernel if it was removed

In the case were someone removes the current kernel we do not can
"keep" it anymore. While this was obviously no issue for the
autoremoval logic, it is an issue for the pve-efiboot-tool refresh
command, which reuses this helper to see which kernels it needs to
keep on the ESP.

Without this a running kernel was never removed from the EFI System
Partitions if de-installed from a host, so if it sorted as newest one
it was then booted again, which naturally confuses users (it was just
removed!!). So to ensure that we cannot get such zombie kernels
ensure that only installed kernels are included in the list.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-11 with ABI 5.3.7-1-pve
Thomas Lamprecht [Wed, 23 Oct 2019 17:44:18 +0000 (19:44 +0200)]
bump version to 6.0-11 with ABI 5.3.7-1-pve

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: code cleanup
Thomas Lamprecht [Thu, 17 Oct 2019 05:44:50 +0000 (07:44 +0200)]
followup: code cleanup

* add some spaces for separation, increasing readability
* do not use the non-existent variable x as replacement, but an actual
  empty string ""
* don't use the "truth-y action" at end to make awk print the line ($0)
  but explicitly print $0 after the gsub, makes it easier to get for
  people with not much awk background

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2403: exclude initrd entries from /proc/cmdline
Oguz Bektas [Wed, 16 Oct 2019 11:17:31 +0000 (13:17 +0200)]
fix #2403: exclude initrd entries from /proc/cmdline

if we fallback to /proc/cmdline, it can include the booted initrd.

to avoid loader entries with initrd 'options' lines, we have to parse
them out.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agobump version to 6.0-10
Thomas Lamprecht [Wed, 2 Oct 2019 06:42:21 +0000 (08:42 +0200)]
bump version to 6.0-10

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-9
Thomas Lamprecht [Mon, 30 Sep 2019 07:41:17 +0000 (09:41 +0200)]
bump version to 6.0-9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: adapt to lintian change regarding empty-binary-package
Thomas Lamprecht [Mon, 30 Sep 2019 07:45:40 +0000 (09:45 +0200)]
d/control: adapt to lintian change regarding empty-binary-package

Previously, mentioning "virtual package" in the package long
description was enough to supress the "empty-binary-package" linitian
tag[0]. That changed, so let's use "metapackage", which is suggested
as one of the replacement options.

[0]: https://lintian.debian.org/tags/empty-binary-package.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-8
Thomas Lamprecht [Thu, 5 Sep 2019 13:37:53 +0000 (15:37 +0200)]
bump version to 6.0-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-7 with ABI 5.0.21-1-pve
Thomas Lamprecht [Wed, 21 Aug 2019 07:44:32 +0000 (09:44 +0200)]
bump version to 6.0-7 with ABI 5.0.21-1-pve

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoAdd efiboot refresh hook to update-initramfs
Stefan Reiter [Thu, 1 Aug 2019 11:01:03 +0000 (13:01 +0200)]
Add efiboot refresh hook to update-initramfs

As explained in [0], we can add a hook script that will be called after
update-initramfs did its job (and thus, a new initrd has been created).

We can use this to automatically sync the ESPs using 'pve-efiboot-tool
refresh', if update-initramfs was called manually (on kernel upgrade we
already have a hook that does this).

[0]: https://kernel-team.pages.debian.net/kernel-handbook/ch-update-hooks.html

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agoefiboot refresh: check --hook parameter
Fabian Grünbichler [Mon, 5 Aug 2019 11:25:13 +0000 (13:25 +0200)]
efiboot refresh: check --hook parameter

against list of default hook scripts.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoAdd parameter '--hook' to 'refresh' command
Stefan Reiter [Thu, 1 Aug 2019 11:01:02 +0000 (13:01 +0200)]
Add parameter '--hook' to 'refresh' command

Mostly to avoid calling hooks directly in other scripts, future-proofing.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agobump version to 6.0-6
Thomas Lamprecht [Wed, 24 Jul 2019 14:47:37 +0000 (16:47 +0200)]
bump version to 6.0-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-5
Thomas Lamprecht [Mon, 15 Jul 2019 13:08:59 +0000 (15:08 +0200)]
bump version to 6.0-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopve-efiboot-tool: accept also 'kernel' for the 'kernels' command
Thomas Lamprecht [Mon, 15 Jul 2019 13:07:40 +0000 (15:07 +0200)]
pve-efiboot-tool: accept also 'kernel' for the 'kernels' command

As all operations are done on a single or no version, thus "kernel"
fits minimally better, IMO. But just accept both, for convenience

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agozz-efiboot: output ESP_LIST fn quoted, to avoid copying the !
Thomas Lamprecht [Mon, 15 Jul 2019 13:06:01 +0000 (15:06 +0200)]
zz-efiboot: output ESP_LIST fn quoted, to avoid copying the !

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopve-efiboot-tool: small output hints and cleanups
Thomas Lamprecht [Mon, 15 Jul 2019 13:02:31 +0000 (15:02 +0200)]
pve-efiboot-tool: small output hints and cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agozz-pve-efiboot: make loader title product dependent
Thomas Lamprecht [Mon, 15 Jul 2019 12:35:41 +0000 (14:35 +0200)]
zz-pve-efiboot: make loader title product dependent

default to "Proxmox Virtual Environment", and if the
proxmox-mailgateway package is installed (we simply check the docs
path) use "Proxmox Mailgateway" instead

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoefiboot: guard against grep returning non-zero
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:51 +0000 (15:16 +0200)]
efiboot: guard against grep returning non-zero

which would trigger 'set -e', instead of continuing with correct (empty)
strings.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: only keep last two series metapackages
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:50 +0000 (15:16 +0200)]
efiboot: only keep last two series metapackages

namely, the current/latest and previous one, for which we also keep the
last kernel installed and synced.

the pipe to 'head' has the added bonus of guarding against 'grep'
returnin non-zero and triggering 'set -e'

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agopve-efiboot-tool: also refresh autoremove config
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:49 +0000 (15:16 +0200)]
pve-efiboot-tool: also refresh autoremove config

especially after modifying the manually selected kernels list, we don't
want this to be skipped.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agozz-pve-efiboot: use loop_esp_list helper
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:48 +0000 (15:16 +0200)]
zz-pve-efiboot: use loop_esp_list helper

to loop over list of ESPs, like in pve-efiboot-tool

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agopve-efiboot-tool: add 'kernels list' subcommand
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:47 +0000 (15:16 +0200)]
pve-efiboot-tool: add 'kernels list' subcommand

to list custom and automatically selected kernel versions that are synced to configured ESPs

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: add manual kernel list
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:46 +0000 (15:16 +0200)]
efiboot: add manual kernel list

with 'kernels <add|remove>' command in pve-efiboot-tool to add/remove
kernels to/from manual kernel list, and honor it when generating lists
of kernels to not autoremove/sync to ESPs

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agopve-efiboot-tool: add clean command
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:45 +0000 (15:16 +0200)]
pve-efiboot-tool: add clean command

to remove outdated entries from the ESP list

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agopve-efiboot-tool: add and use list file helpers
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:44 +0000 (15:16 +0200)]
pve-efiboot-tool: add and use list file helpers

in preparation of adding another file for custom kernels with the same semantics

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: add loop_esp_list helper
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:43 +0000 (15:16 +0200)]
efiboot: add loop_esp_list helper

that calls the passed-in function+args for each UUID

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: actually sync last kernel of old series
Fabian Grünbichler [Fri, 12 Jul 2019 13:16:42 +0000 (15:16 +0200)]
efiboot: actually sync last kernel of old series

and not just keep it from being autoremoved

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobump version to 6.0-4
Thomas Lamprecht [Thu, 11 Jul 2019 16:35:53 +0000 (18:35 +0200)]
bump version to 6.0-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopve-efiboot-tool: initialize in mount namespace
Fabian Grünbichler [Thu, 11 Jul 2019 09:22:51 +0000 (11:22 +0200)]
pve-efiboot-tool: initialize in mount namespace

by re-executing the whole 'pve-efiboot-tool init' command inside a new mount namespace

Co-Developed-By: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agozz-pve-efiboot: re-exec in mount namespace
Fabian Grünbichler [Thu, 11 Jul 2019 09:22:50 +0000 (11:22 +0200)]
zz-pve-efiboot: re-exec in mount namespace

to avoid affecting the running system negatively, e.g. because the
target paths for mounting the ESPs have been modified via symlinks or
similar attacks.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: add new mount namespace helper
Fabian Grünbichler [Thu, 11 Jul 2019 09:22:49 +0000 (11:22 +0200)]
efiboot: add new mount namespace helper

to re-execute the currently running script in an unshared mount name
space.

Co-Developed-By: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobump version to 6.0-3
Thomas Lamprecht [Wed, 10 Jul 2019 19:13:08 +0000 (21:13 +0200)]
bump version to 6.0-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agorename pveesptool to pve-efiboot-tool
Thomas Lamprecht [Wed, 10 Jul 2019 19:11:28 +0000 (21:11 +0200)]
rename pveesptool to pve-efiboot-tool

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopveesptool: document 'help' command in usage
Thomas Lamprecht [Wed, 10 Jul 2019 18:34:02 +0000 (20:34 +0200)]
pveesptool: document 'help' command in usage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd B=R on proxmox-ve << 6.0-2~
Fabian Grünbichler [Wed, 10 Jul 2019 15:05:11 +0000 (17:05 +0200)]
add B=R on proxmox-ve << 6.0-2~

since we took over the efiboot files from there.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: call on kernel removal as well
Fabian Grünbichler [Wed, 10 Jul 2019 15:05:10 +0000 (17:05 +0200)]
efiboot: call on kernel removal as well

but don't pass in newly 'installed' kernel version

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: always exit cleanly
Fabian Grünbichler [Wed, 10 Jul 2019 15:05:09 +0000 (17:05 +0200)]
efiboot: always exit cleanly

otherwise the whole apt process stops.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: be less verbose if UUID file does not exist
Fabian Grünbichler [Wed, 10 Jul 2019 15:05:08 +0000 (17:05 +0200)]
efiboot: be less verbose if UUID file does not exist

this is the default for upgraded systems after all.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoefiboot: move kernel CMDLINE check
Fabian Grünbichler [Wed, 10 Jul 2019 15:05:07 +0000 (17:05 +0200)]
efiboot: move kernel CMDLINE check

from global scope to where it is actually used, otherwise this gets
called/printed too often/early.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoesptool: move more variables to functions
Fabian Grünbichler [Wed, 10 Jul 2019 15:05:06 +0000 (17:05 +0200)]
esptool: move more variables to functions

which is sourced by all scripts anyway.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agopve-kernel-helper: add new package
Stoiko Ivanov [Wed, 10 Jul 2019 15:05:05 +0000 (17:05 +0200)]
pve-kernel-helper: add new package

with (sh) pveesptool to format, initialize and refresh synced ESPs, as
well as the hooks previously shipped via proxmox-ve.

pveesptool based on a never-released version written in perl by Stoiko
Ivanov.

Co-Developed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobuildsys: minor cleanups
Stoiko Ivanov [Wed, 10 Jul 2019 15:05:04 +0000 (17:05 +0200)]
buildsys: minor cleanups

4 years agozz-pve-efiboot: remove unmount warning
Stoiko Ivanov [Wed, 10 Jul 2019 15:05:03 +0000 (17:05 +0200)]
zz-pve-efiboot: remove unmount warning

it is printed everytime (also on clean exit) and distracting

4 years agozz-pve-efiboot: adapt to static list of ESPs
Stoiko Ivanov [Wed, 10 Jul 2019 15:05:02 +0000 (17:05 +0200)]
zz-pve-efiboot: adapt to static list of ESPs

read a list of vfat UUIDs from /etc/kernel/pve-efiboot-uuids instead of
taking all blockdevices with vfat and the proper partition type

Otherwise all guests having an ESP would get it mounted and potentially
modified

4 years agozz-pve-efiboot: remove outdated comments
Stoiko Ivanov [Wed, 10 Jul 2019 15:05:01 +0000 (17:05 +0200)]
zz-pve-efiboot: remove outdated comments

4 years agoefiboot: adapt includepaths to new package
Stoiko Ivanov [Wed, 10 Jul 2019 15:05:00 +0000 (17:05 +0200)]
efiboot: adapt includepaths to new package

4 years agoadd efiboot and autoremoval hooks
Stoiko Ivanov [Wed, 10 Jul 2019 15:04:57 +0000 (17:04 +0200)]
add efiboot and autoremoval hooks

moved from proxmox-ve, in order to provide one package which contains all
relevant helper functions for pve-kernels

4 years agobump version to 6.0-2 with ABI 5.0.15-1-pve
Thomas Lamprecht [Wed, 3 Jul 2019 10:55:03 +0000 (12:55 +0200)]
bump version to 6.0-2 with ABI 5.0.15-1-pve

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>