windows: 修复 iso 链接重定向后,容量计算错误

This commit is contained in:
bin456789 2023-10-09 23:37:44 +08:00
parent 673808d00e
commit 2929b5ed74
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -521,7 +521,8 @@ create_part() {
fi fi
# 按iso容量计算分区大小512m用于驱动和文件系统自身占用 # 按iso容量计算分区大小512m用于驱动和文件系统自身占用
part_size=$(grep 'Content-Length:' /tmp/headers.log | awk '{print int($2/1024/1024+512)}') # 网址重定向可能得到多个 Content-Length, 选最后一个
part_size=$(grep 'Content-Length:' /tmp/headers.log | tail -1 | awk '{print int($2/1024/1024+512)}')
if [ -z "$part_size" ]; then if [ -z "$part_size" ]; then
# 默认值最大的iso 23h2 需要7g # 默认值最大的iso 23h2 需要7g
part_size=$((7 * 1024)) part_size=$((7 * 1024))