Support legacy BIOS and UEFI deploys from one image
grub-pc and grub-efi-amd64 conflict on Debian, so installing grub-pc at build time removed the UEFI package. Keep grub-efi-amd64 in the image and ship the matching grub-pc .deb under /var/lib/pve-maas/debs instead. curtin-hooks installs it offline before builtin_curthooks when the node booted in legacy BIOS mode; UEFI nodes are left as they are. verify-image.sh now checks for grub-efi-amd64 and the stored grub-pc .deb on amd64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
21f64f0785
commit
cb9309cac2
3 files changed
+66
-14
No files matched your search
@@ -152,24 +152,36 @@ if [ -n "${PVE_EXTRA_PACKAGES}" ]; then
|
||||
$APT install ${PVE_EXTRA_PACKAGES}
|
||||
fi
|
||||
|
||||
# grub-pc: dugumde GRUB'i curtin degil imaj saglasin. Yalnizca amd64'te var
|
||||
# (arm64'te i386-pc hedefi yok). Debian'da grub-pc ile grub-efi-amd64 birbiriyle
|
||||
# catisir; kurulum grub-efi-amd64'u kaldirirsa asagidaki listede gorunur.
|
||||
# grub-pc postinst'i build diskine grub-install yapmasin diye kurulum cihazi bos.
|
||||
if [ "$(dpkg --print-architecture)" = "amd64" ]; then
|
||||
log "grub-pc kuruluyor"
|
||||
# install_devices bos ama install_devices_empty=false ise postinst
|
||||
# etkilesimsiz modda "You must correct your GRUB install devices" ile
|
||||
# dpkg'yi hataya dusuruyor; bos listeyi bilerek onayliyoruz.
|
||||
# Ayni imaj hem UEFI hem legacy BIOS dugumlere deploy edilebilsin.
|
||||
#
|
||||
# Debian'da grub-pc ile grub-efi-amd64 birbiriyle catisir, ikisi birden kurulu
|
||||
# olamaz. Iki platformun GRUB dosyalari (grub-pc-bin, grub-efi-amd64-bin,
|
||||
# imzali shim) zaten imajda; eksik olan yalnizca ince grub-pc paketi. Imaj
|
||||
# grub-efi-amd64 ile kalir, grub-pc .deb'i imajin icine konur ve curtin-hooks
|
||||
# dugum legacy BIOS ile acildiysa onu cevrimdisi kurar (grub-efi-amd64'u
|
||||
# kaldirarak). grub-pc yalnizca amd64'te var.
|
||||
GRUB_DEB_DIR=/var/lib/pve-maas/debs
|
||||
if [ "$(dpkg --print-architecture)" = "amd64" ] \
|
||||
&& dpkg-query -W -f='${Status}' grub-efi-amd64 2>/dev/null | grep -q 'ok installed'; then
|
||||
log "grub-pc .deb'i legacy BIOS deploy icin imaja konuyor: ${GRUB_DEB_DIR}"
|
||||
mkdir -p "${GRUB_DEB_DIR}"
|
||||
# Kurulu grub-pc-bin ile ayni surum olmali, yoksa cevrimdisi kurulum
|
||||
# bagimliliklari cozemez.
|
||||
GRUB_VER="$(dpkg-query -W -f='${Version}' grub-pc-bin)"
|
||||
(cd "${GRUB_DEB_DIR}" && apt-get download "grub-pc=${GRUB_VER}")
|
||||
ls -l "${GRUB_DEB_DIR}"
|
||||
# Deploy aninda postinst build/hedef diskine kendi kafasina gore
|
||||
# grub-install yapmasin; diski curtin kendisi kurar. install_devices_empty
|
||||
# olmadan etkilesimsiz postinst "You must correct your GRUB install
|
||||
# devices" ile dpkg'yi hataya dusuruyor.
|
||||
debconf-set-selections <<'EOF'
|
||||
grub-pc grub-pc/install_devices multiselect
|
||||
grub-pc grub-pc/install_devices_empty boolean true
|
||||
EOF
|
||||
$APT install grub-pc
|
||||
log "Kurulu GRUB paketleri:"
|
||||
dpkg-query -W -f='${db:Status-Abbrev} ${Package} ${Version}\n' 'grub*' 2>/dev/null \
|
||||
| grep '^ii' || true
|
||||
fi
|
||||
log "Kurulu GRUB paketleri:"
|
||||
dpkg-query -W -f='${db:Status-Abbrev} ${Package} ${Version}\n' 'grub*' 'shim*' 2>/dev/null \
|
||||
| grep '^ii' || true
|
||||
|
||||
log "Kurulan surumler:"
|
||||
dpkg-query -W -f='${Package} ${Version}\n' proxmox-ve pve-manager proxmox-default-kernel ifupdown2 || true
|
||||
|
||||
@@ -46,7 +46,10 @@ check "pvesh ikilisi mevcut" 'present "usr/bin/pvesh"'
|
||||
check "ifupdown2 mevcut" 'present "usr/share/ifupdown2"'
|
||||
check "cloud-init mevcut" 'present "usr/bin/cloud-init"'
|
||||
check "curtin-hooks mevcut" 'present "curtin/curtin-hooks"'
|
||||
check "grub-pc kurulu (amd64)" 'present "var/lib/dpkg/info/grub-pc.list" || ! present "usr/lib/grub/x86_64-efi"'
|
||||
# UEFI imaji grub-efi-amd64 ile gelir; legacy BIOS dugumler icin grub-pc .deb'i
|
||||
# imajda durur ve curtin-hooks onu deploy aninda kurar. arm64'te ikisi de yok.
|
||||
check "grub-efi-amd64 kurulu (amd64 UEFI)" 'present "var/lib/dpkg/info/grub-efi-amd64.list" || ! present "usr/lib/grub/x86_64-efi"'
|
||||
check "grub-pc .deb imajda (legacy BIOS icin)" 'grep -qE "^\./var/lib/pve-maas/debs/grub-pc_.*\.deb$" "$TMP/list" || ! present "usr/lib/grub/x86_64-efi"'
|
||||
|
||||
echo
|
||||
echo "==> Olmamasi gerekenler"
|
||||
|
||||
Reference in new issue
Block a user