From e39283780b4e8e728e30500e688d927de4e3a7ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 10 Jul 2019 17:05:06 +0200 Subject: [PATCH] esptool: move more variables to functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit which is sourced by all scripts anyway. Signed-off-by: Fabian Grünbichler --- efiboot/functions | 7 +++++++ efiboot/zz-pve-efiboot | 11 ++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/efiboot/functions b/efiboot/functions index 1327bb4..cb6cd62 100755 --- a/efiboot/functions +++ b/efiboot/functions @@ -1,6 +1,13 @@ #! /bin/sh set -e +ESP_LIST="/etc/kernel/pve-efiboot-uuids" +ESPTYPE='c12a7328-f81f-11d2-ba4b-00a0c93ec93b' + +# relative to the ESP mountpoint +PMX_ESP_DIR="EFI/proxmox" +PMX_LOADER_CONF="loader/loader.conf" + # adapted from /etc/kernel/postinst.d/apt-auto-removal as present in # debian's apt package: # diff --git a/efiboot/zz-pve-efiboot b/efiboot/zz-pve-efiboot index 8d5d625..560856f 100755 --- a/efiboot/zz-pve-efiboot +++ b/efiboot/zz-pve-efiboot @@ -5,9 +5,6 @@ set -e # /usr/lib/kernel/install.d/90-loaderentry.install, see also # https://kernel-team.pages.debian.net/kernel-handbook/ch-update-hooks.html -# relative to the ESP mountpoint -ESP_LIST="/etc/kernel/pve-efiboot-uuids" -PMX_ESP_DIR="EFI/proxmox" MOUNTROOT="${TMPDIR:-/var/tmp}/espmounts" @@ -49,7 +46,7 @@ potential_esps(){ update_esps() { if [ ! -f "${ESP_LIST}" ]; then - warn "No ${ESP_LIST} found cannot update installed kernels - exiting" + warn "No ${ESP_LIST} found, cannot update installed kernels - exiting" esps="$(potential_esps)" warn "add the UUIDs of one of the following devices to ${ESP_LIST}:" warn "${esps}" @@ -71,12 +68,12 @@ update_esps() { mkdir -p "${mountpoint}" mount "${path}" "${mountpoint}" || \ { warn "mount of ${path} failed - skipping"; continue; } - if [ ! -f "${mountpoint}/loader/loader.conf" ]; then + if [ ! -f "${mountpoint}/$PMX_LOADER_CONF" ]; then warn "${path} contains no loader.conf - skipping" continue fi - if [ ! -d "${mountpoint}/EFI/proxmox" ]; then - warn "${path} contains no EFI/proxmox - skipping" + if [ ! -d "${mountpoint}/$PMX_ESP_DIR" ]; then + warn "${path}/$PMX_ESP_DIR does not exist- skipping" continue fi -- 2.39.2