From 135576e95cd0d5d138a54863e19aaeebd19304e6 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Wed, 22 May 2024 21:27:06 +0800 Subject: [PATCH] =?UTF-8?q?debian:=20=E4=BF=AE=E5=A4=8D=E9=87=8D=E8=A3=85?= =?UTF-8?q?=E5=90=8E=E8=BF=98=E6=AE=8B=E7=95=99=E7=9D=80=E6=97=A7=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=9A=84=20efi=20=E6=96=87=E4=BB=B6=20(debian-install?= =?UTF-8?q?er=20=E7=9A=84=20bug)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian.cfg | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/debian.cfg b/debian.cfg index 862a220..36e7348 100644 --- a/debian.cfg +++ b/debian.cfg @@ -62,15 +62,17 @@ d-i partman-basicfilesystems/no_swap boolean false # 最小值 膨胀权重 最大值 # https://salsa.debian.org/installer-team/partman-auto/-/blob/master/recipes/atomic?ref_type=heads # https://salsa.debian.org/installer-team/partman-auto/-/blob/master/recipes-amd64-efi/atomic?ref_type=heads +# shellcheck disable=SC1083,SC2086,SC2154 d-i partman-auto/expert_recipe_efi string efi :: \ 106 1 106 free \ - $iflabel{ gpt } $reusemethod{ } method{ efi } format{ } . \ + $iflabel{ gpt } method{ efi } format{ } . \ 1 1 -1 $default_filesystem \ method{ format } format{ } use_filesystem{ } $default_filesystem{ } mountpoint{ / } . +# shellcheck disable=SC1083,SC2086,SC2154 d-i partman-auto/expert_recipe_bios string bios :: \ 1 1 1 free \ - $iflabel{ gpt } $reusemethod{ } method{ biosgrub } . \ + $iflabel{ gpt } method{ biosgrub } . \ 1 1 -1 $default_filesystem \ method{ format } format{ } use_filesystem{ } $default_filesystem{ } mountpoint{ / } . @@ -108,7 +110,7 @@ d-i finish-install/reboot_in_progress note # debian 11 initrd 没有 xargs awk # debian 12 initrd 没有 xargs -d-i partman/early_command string \ +# efi 分区大小未改变时,不会被格式化,因此需要手动删除旧系统的 efi 文件 confhome="$(grep -o 'extra\.confhome=[^ ]*' /proc/cmdline | cut -d= -f2)"; \ swapfile=/target/swapfile; \ @@ -123,7 +125,9 @@ d-i partman/early_command string \ echo "swapoff -a; rm -f $swapfile" >/usr/lib/finish-install.d/95swapoff; \ chmod a+x /usr/lib/finish-install.d/95swapoff; \ - xda=$(wget --tries=5 $confhome/get-xda.sh -O- | sh -s); \ + echo "rm -rf /target/boot/efi/*; $postinst.orig" >>$postinst; \ + + xda=$(wget --tries=5 "$confhome/get-xda.sh" -O- | sh -s); \ debconf-set partman-auto/disk "/dev/$xda"; \ debconf-set grub-installer/bootdev "/dev/$xda"; \ rm -rf /usr/sbin/fdisk /usr/sbin/sfdisk; \