From nobody Fri Sep 15 07:58:35 2023 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rn6583bryz4t6dQ for ; Fri, 15 Sep 2023 07:58:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rn6576zG2z4MDg for ; Fri, 15 Sep 2023 07:58:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694764716; a=rsa-sha256; cv=none; b=IWOty52zPgoetM36bgluRuotgU/F2XOOT4Eeb3mfrIJg+oLBrulDKCQ772GYtP8QgwRjAp 7B/4vERpwmaxU5cXHpaFrD2nThhwUsNQtwbU6jKwXWtuRzLktPvU3V254Whc/xhtukz+x0 Twjm8d68BlZBqOifsCt9HmrlUNQU1qur7grOxhGkpQu4SlthOctqsLhSAIp/zOcXT4zM6X 8gixUk6c82YLXz/qV4My8HkC+Sn9d0uQOgD3fhXPhFR7P/HykRLlmZpu1LhtAEPJdNhn2w lPnFIyOvbYTw1df5OAjyIcc01t4Nw9VFX2NieKm9ZNAPlc6GmDMx8ESedGcy3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694764716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9wHsNHXsrOEsRUgz5GQcV/PcS14u/y2IawvPARbo60=; b=E2Y02VTx48p4ksKV7qua3ubAsgxNjl77AmxRXAOOsF1vNekCYB1IIZYwBw7XEgXvkQ4RLa U6y60LvVIxFEiG3TtHzy6FLRKo3Q+5LzuXt7GoXq/5e3bIvSB9L5UlO+US9+szUZTAr9cC 0e8PH2IjmCVl5gXFVuhPjCpiNwf7tNL8VDl07zNBsf+vBmM0jBxXFIE9DFfhysEHG0Gwee 5Tep+4z6v7GYUyDrCKH0sD1jd3pk7fQ6Ei2GrnscRIpjfGrCyG1s7HPziCPPZy7NZwTd3C gxQJQpUV5gh8/HN/7+mdMY8tcJ9SxCZgMFSlANOFxIhKXpBSzoSCT12ETH/URg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rn6575wsyz1V5 for ; Fri, 15 Sep 2023 07:58:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 38F7wZKh035590 for ; Fri, 15 Sep 2023 07:58:35 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38F7wZD2035589 for ports-bugs@FreeBSD.org; Fri, 15 Sep 2023 07:58:35 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 273814] sysutils/grub2-bhyve: fails to boot OpenBSD Current kernel Date: Fri, 15 Sep 2023 07:58:35 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: naito.yuichiro@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273814 Bug ID: 273814 Summary: sysutils/grub2-bhyve: fails to boot OpenBSD Current kernel Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: naito.yuichiro@gmail.com Created attachment 244872 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D244872&action= =3Dedit grub2-bhyve.patch By the following commit, OpenBSD Current kernel has dropped supporting old console device structure. It causes grub-bhyve not to boot the OpenBSD Curr= ent kernel. The new release 7.4 is coming soon will also unbootable from the current grub2-bhyve. https://github.com/Openbsd/src/commit/745c2f60e98fd1f418c104960a567e120624d= 705 I wrote a patch for this problem that changes to use the new console device structure by default. And my patch switches to use the old console device structure if the loading kernel is older than '7.3' release. The version number is written in the value of 'osrelease' symbol in the Ope= nBSD kernel. My patch reads it to see if the kernel is older than '7.3' or not. All the previous releases contain symbol tables, so no problem. If users st= rip the OpenBSD kernel, reading the version number will fail. I added 'kopenbsd= -l' option to force to use the old console device structure. If users boot the OpenBSD Current or newer kernel, just 'kopenbsd' command works fine although the kernel is stripped. Because the new console device structure is chosen = by default. Implementation Note: (record for maintainers) Reading symbol tables is already implemented in 'grub_openbsd_find_ramdisk' function. I added reading the value of 'osrelease' symbol in this function = to share the symbol lookup code. And building console device structure is implemented in 'grub_cmd_openbsd' function, but it is called earlier than 'grub_openbsd_find_ramdisk' function. So 'grub_cmd_openbsd' function never knows the version number. I changed to build both the new and old console device structures in 'grub_cmd_openbsd'. They are added to 'tag' list and 'grub_openbsd_boot' function reads the 'tag' list and build stack frame tha= t is passed to OpenBSD kernel. I changed the building stack frame code to ignore unnecessary console device structure checked by the 'osrelease' value. I also added 'openbsd_force_legacy_console' global variable. It's a flag to force to use the old console device structure. This flag is set by '-l' opt= ion. Testing:=20 My poudriere build successfully finished with my patch. And I confirmed my patch booted OpenBSD kernel from 6.9 to 7.3 and Current successfully. And also the installers of OpenBSD 6.9 - 7.3 was booted successfully. Please apply the attached 'grub2-bhyve.patch' to Ports tree. --=20 You are receiving this mail because: You are the assignee for the bug.=