windows: 修复了错误判断 sda 只读,导致无法安装 iso

This commit is contained in:
bin456789 2023-11-04 00:50:50 +08:00
parent e2e829b0b5
commit 275a3fc36f
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -1754,7 +1754,7 @@ install_windows() {
# sda 只读,放的是 cloud-init 配置,通常 win 有驱动,能识别 # sda 只读,放的是 cloud-init 配置,通常 win 有驱动,能识别
# 而 vda/nvme/xen 加载驱动后才能识别,所以这时 disk_id 应该为 1 # 而 vda/nvme/xen 加载驱动后才能识别,所以这时 disk_id 应该为 1
if [ -e "/sys/class/block/sda/ro" ] && if [ -e "/sys/class/block/sda/ro" ] &&
[ "$(cat /sys/class/block/sda/ro)" = 0 ]; then [ "$(cat /sys/class/block/sda/ro)" = 1 ]; then
disk_id=1 disk_id=1
else else
disk_id=0 disk_id=0