windows: 修复 iso 里面文件大小写引起的引导问题

1. iso 里面的 boot 文件夹字母不是全小写,导致用 grub-install --boot-directory=/os/boot 安装后无法从 boot 文件夹读取模块
2. iso 里面的 boot bootmgr 的 boot 大小写不一致导致没有复制 bootmgr

fixes #568
This commit is contained in:
bin456789 2026-03-10 01:07:20 +08:00
parent 5e2f46444c
commit f0b3a475fc
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -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 <<EOF >/os/boot/grub/grub.cfg
grub-install --target i386-pc --boot-directory="$(get_path_in_correct_case /os/boot)" /dev/$xda
cat <<EOF >"$(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