From 85648739dcfaa215b85fb85d026eafbfc4753702 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 25 Sep 2026 06:33:17 +0000 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=81=D0=B5=20=D0=BF=D1=83=D0=BD=D0=BA?= =?UTF-8?q?=D1=82=D1=8B=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BE=D1=87?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BC=D0=B5=D0=BD=D1=8E=20ISO=20?= =?UTF-8?q?=D0=B1=D1=8B=D0=BB=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D1=8B=20=D0=B2=20=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D1=83=20Virtuality?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019LEUXMcdZo7b87mjkUsPgg --- image/build-iso.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/image/build-iso.sh b/image/build-iso.sh index 29e6cdc..c468727 100755 --- a/image/build-iso.sh +++ b/image/build-iso.sh @@ -206,18 +206,15 @@ import sys path, unattended, version = sys.argv[1], sys.argv[2] == "1", sys.argv[3] text = open(path).read() -match = re.search(r'menuentry "[^"]*" \{\n(.*?)\n\}', text, re.S) -if not match: - raise SystemExit("no menuentry found in grub.cfg") -body = match.group(1) -if "linux" not in body or "---" not in body: - raise SystemExit("unexpected grub.cfg layout: " + body) -kernel_args = "autoinstall ---" if unattended else "---" -title = "Install Virtuality %s%s" % (version, " (UNATTENDED: erases disk)" if unattended else "") -entry = 'menuentry "%s" {\n%s\n}\n' % (title, body.replace("---", kernel_args, 1)) -text = text[: match.start()] + entry + text[match.start():] +# /autoinstall.yaml applies to every entry, so all Ubuntu entries become Virtuality entries. +suffix = " (UNATTENDED: erases disk)" if unattended else "" +text = text.replace('menuentry "Try or Install Ubuntu Server"', 'menuentry "Install Virtuality %s%s"' % (version, suffix), 1) +text = text.replace('menuentry "Ubuntu Server with the HWE kernel"', 'menuentry "Install Virtuality %s with the HWE kernel%s"' % (version, suffix), 1) +if "Install Virtuality" not in text: + raise SystemExit("unexpected grub.cfg menu titles") +if unattended: + text = re.sub(r"^(\s*linux\s+\S+\s+)---", r"\1autoinstall ---", text, 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) PYEOF new_md5="$(md5sum "${WORK_DIR}/grub.cfg" | cut -d' ' -f1)"