mirror of
https://github.com/bin456789/reinstall.git
synced 2026-03-22 12:34:17 +08:00
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:
15
trans.sh
15
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 <<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
|
||||
|
||||
Reference in New Issue
Block a user