Все пункты загрузочного меню ISO были переименованы в установку Virtuality

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019LEUXMcdZo7b87mjkUsPgg
Этот коммит содержится в:
Claude
2026-09-25 06:33:17 +00:00
родитель d92b1b9bda
Коммит 85648739dc
+8 -11
Просмотреть файл
@@ -206,18 +206,15 @@ import sys
path, unattended, version = sys.argv[1], sys.argv[2] == "1", sys.argv[3] path, unattended, version = sys.argv[1], sys.argv[2] == "1", sys.argv[3]
text = open(path).read() text = open(path).read()
match = re.search(r'menuentry "[^"]*" \{\n(.*?)\n\}', text, re.S) # /autoinstall.yaml applies to every entry, so all Ubuntu entries become Virtuality entries.
if not match: suffix = " (UNATTENDED: erases disk)" if unattended else ""
raise SystemExit("no menuentry found in grub.cfg") text = text.replace('menuentry "Try or Install Ubuntu Server"', 'menuentry "Install Virtuality %s%s"' % (version, suffix), 1)
body = match.group(1) text = text.replace('menuentry "Ubuntu Server with the HWE kernel"', 'menuentry "Install Virtuality %s with the HWE kernel%s"' % (version, suffix), 1)
if "linux" not in body or "---" not in body: if "Install Virtuality" not in text:
raise SystemExit("unexpected grub.cfg layout: " + body) raise SystemExit("unexpected grub.cfg menu titles")
kernel_args = "autoinstall ---" if unattended else "---" if unattended:
title = "Install Virtuality %s%s" % (version, " (UNATTENDED: erases disk)" if unattended else "") text = re.sub(r"^(\s*linux\s+\S+\s+)---", r"\1autoinstall ---", text, flags=re.M)
entry = 'menuentry "%s" {\n%s\n}\n' % (title, body.replace("---", kernel_args, 1))
text = text[: match.start()] + entry + text[match.start():]
text = re.sub(r"^set timeout=\d+", "set default=0\nset timeout=10", text, count=1, flags=re.M) text = re.sub(r"^set timeout=\d+", "set default=0\nset timeout=10", text, count=1, flags=re.M)
text = text.replace('menuentry "Try or Install Ubuntu Server"', 'menuentry "Ubuntu Server (without Virtuality)"')
open(path, "w").write(text) open(path, "w").write(text)
PYEOF PYEOF
new_md5="$(md5sum "${WORK_DIR}/grub.cfg" | cut -d' ' -f1)" new_md5="$(md5sum "${WORK_DIR}/grub.cfg" | cut -d' ' -f1)"