From f0b3a475fc6932282cdbe3b4b01f32dddae002bb Mon Sep 17 00:00:00 2001 From: bin456789 Date: Tue, 10 Mar 2026 01:07:20 +0800 Subject: [PATCH] =?UTF-8?q?windows:=20=E4=BF=AE=E5=A4=8D=20iso=20=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F=E5=86=99=E5=BC=95?= =?UTF-8?q?=E8=B5=B7=E7=9A=84=E5=BC=95=E5=AF=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. iso 里面的 boot 文件夹字母不是全小写,导致用 grub-install --boot-directory=/os/boot 安装后无法从 boot 文件夹读取模块 2. iso 里面的 boot bootmgr 的 boot 大小写不一致导致没有复制 bootmgr fixes #568 --- trans.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/trans.sh b/trans.sh index 4d34233..9b85bdb 100644 --- a/trans.sh +++ b/trans.sh @@ -6063,13 +6063,14 @@ install_windows() { boot_dir=/os fi - # 复制启动相关的文件 - # efi 额外复制efi目录 + # 复制 iso 根目录 boot 开头的文件 echo 'Copying boot files...' - cp -r "$(get_path_in_correct_case /iso/boot)"* $boot_dir + find /iso -maxdepth 1 -iname 'boot*' -exec cp -r {} "$boot_dir" \; + + # efi 额外复制 iso 根目录 efi 文件夹 if is_efi; then echo 'Copying efi files...' - cp -r "$(get_path_in_correct_case /iso/efi)" $boot_dir + find /iso -maxdepth 1 -type d -iname efi -exec cp -r {} "$boot_dir" \; fi # 复制iso全部文件(除了boot.wim)到installer分区 @@ -7185,12 +7186,12 @@ EOF # 或者用 ms-sys apk add grub-bios # efi 下,强制安装 mbr 引导,需要添加 --target i386-pc - grub-install --target i386-pc --boot-directory=/os/boot /dev/$xda - cat </os/boot/grub/grub.cfg + grub-install --target i386-pc --boot-directory="$(get_path_in_correct_case /os/boot)" /dev/$xda + cat <"$(get_path_in_correct_case /os/boot/grub/grub.cfg)" set timeout=5 menuentry "reinstall" { search --no-floppy --label --set=root os - ntldr /bootmgr + ntldr /$(cd /os && get_path_in_correct_case bootmgr) } EOF fi