18
This commit is contained in:
13
backend.py
13
backend.py
@@ -2198,11 +2198,18 @@ def chroot_and_repair_grub(mount_point: str, target_disk: str,
|
|||||||
|
|
||||||
# 检查 /boot 是否已挂载(在 chroot 内)
|
# 检查 /boot 是否已挂载(在 chroot 内)
|
||||||
success, stdout, _ = run_command(
|
success, stdout, _ = run_command(
|
||||||
chroot_cmd_prefix + ["mount", "|", "grep", "boot"],
|
chroot_cmd_prefix + ["mount"],
|
||||||
"检查 /boot 挂载状态",
|
"检查挂载状态",
|
||||||
timeout=5
|
timeout=5
|
||||||
)
|
)
|
||||||
log_info(f"/boot 挂载状态: {stdout if success else '未显示或检查失败'}")
|
if success:
|
||||||
|
boot_mounts = [line for line in stdout.split('\n') if 'boot' in line.lower()]
|
||||||
|
if boot_mounts:
|
||||||
|
log_info(f"/boot 挂载状态: {', '.join(boot_mounts)}")
|
||||||
|
else:
|
||||||
|
log_info("/boot 挂载状态: 未找到相关挂载")
|
||||||
|
else:
|
||||||
|
log_info("/boot 挂载状态: 检查失败")
|
||||||
|
|
||||||
# 方法1: 使用 grub2-editenv 创建
|
# 方法1: 使用 grub2-editenv 创建
|
||||||
editenv_cmd = None
|
editenv_cmd = None
|
||||||
|
|||||||
Reference in New Issue
Block a user