From nobody Wed Feb 12 01:44:28 2025 X-Original-To: dev-commits-src-all@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 4Yt1MJ5Wf1z5n7xQ; Wed, 12 Feb 2025 01:44:28 +0000 (UTC) (envelope-from git@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yt1MJ4jwLz3jRC; Wed, 12 Feb 2025 01:44:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739324668; 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=butVo0LG4wn5wnMFNhvfDiGuUNayxsKodGxpuUTtt9k=; b=cM70BayD+/my9zvNJwNpr/HfwOYo4+mxM0CxUumxHwGL0ilaLjNDbP365wJycwQJBMYfc0 igO51LJlIUJ71l+WYDV2cXIyCoPQZEl6TO0VhnxJ2yO2Gx982ZZw04F36/qL3PKBu6oaok sIXadVyNsBPQJ1rBIUBkrGRP/a1txV83A6uGazla1/iiI12djD21OkbWLkrUGRRgtk7ljB w/fOMDBmhL9MhmyBmURCdwn+poovjKJx3oSMgYnwvcZ91l/B+InhhpVJ37S3ZK5GNfx280 b5MyRBT6vMYJHDEIp6HHRa3tvVCWK8QCj4dDCZqv/TawztulO7a4ni0WKC4Yiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739324668; 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=butVo0LG4wn5wnMFNhvfDiGuUNayxsKodGxpuUTtt9k=; b=sJ7G6ObUYb9Rqoy1X6CXo3cuHwLKJY4p3GoyLQj+GDD3Td3E20aGDMKaXj0xL8KHyKNAxQ yqaDAyybe+BPreQZnKoh/aakg7tutJOkujCFUJHA4sR72aGM8+WHnWEXG2DOJ7VuXDNlrL vTzKEK+sbqelOctIzc18qsawAax7vvWsLlE9eoKf+2k8kk86cjBmLFSFM9JtAp1lOVwakU 8zwyoemEYvgi7eZNmXgD1nJUPvjpq32dpatFhZXSts8hvWE8CuQjBA/O2XuI5gll0Oq1Df A+ovMasKfK3FMarSBEBv4dgdRUT3ZzKTdlsXX8T56lew9ZUywQPDI4QSTa3Tig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739324668; a=rsa-sha256; cv=none; b=GqdcGSaDPeaWlLSnEKT84MEVEI1KcoKf4hwQK1pIj6eTKeHl43SloeO5XrEATagfJ6m6vE As6gOtJWX9etmuIW/YExkDdGWF7bBWIlJw1V6LuNpt8jaIgk2d3Xjgb1FmLqaV0xpR5cg9 7/6kWjOK4gG/2J4mfzAtRYJJ+nmO+3kkUdkeNLAtkobfA7WBN0Z9PiWtAoRRmDvAhhrGr2 Iqle805qDAGC0BqnTJk2DF1hUabmexuv8p3V6/8gCS7MZ4SpYJ0BKoNH1sK3hEygtJnvAu lpVveiRLOa2182QJsQlG0Tt6KBQXtDw/OEKbTV8j0ptRQO3JnZOrBidqkGA9UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Yt1MJ3W0Pzf1h; Wed, 12 Feb 2025 01:44:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51C1iSvE052187; Wed, 12 Feb 2025 01:44:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51C1iSu0052184; Wed, 12 Feb 2025 01:44:28 GMT (envelope-from git) Date: Wed, 12 Feb 2025 01:44:28 GMT Message-Id: <202502120144.51C1iSu0052184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 6fc8d02b59dd - stable/13 - nanobsd: Always define the partition index List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6fc8d02b59dd7c343a2ab681e57c13c27c6425f7 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=6fc8d02b59dd7c343a2ab681e57c13c27c6425f7 commit 6fc8d02b59dd7c343a2ab681e57c13c27c6425f7 Author: Jose Luis Duran AuthorDate: 2025-02-04 14:07:00 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-12 01:38:47 +0000 nanobsd: Always define the partition index Print the desired partition index together with the starting LBA and the size. Otherwise, when only one code partition is desired, the configuration partition (/cfg) may not end up in the third slice, thus breaking the scripts that expect it there. This was the previous approach, changed in 587c054bea0f ("nanobsd: Use gpart and create code image before full disk image"). Fix it by printing the index as the last column to reduce the chances of breaking current overrides, and using it as the gpart index. PR: 262098 Reviewed by: imp Approved by: emaste (mentor) Fixes: 587c054bea0f ("nanobsd: Use gpart and create code image before full disk image") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47835 (cherry picked from commit dc4b36b96333f2ab05f3c454f0df2e0a0d4d451d) --- tools/tools/nanobsd/legacy.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh index a45b447337b2..2f689212263e 100644 --- a/tools/tools/nanobsd/legacy.sh +++ b/tools/tools/nanobsd/legacy.sh @@ -64,31 +64,30 @@ calculate_partitioning ( ) ( } # First image partition start at second track - print $3, isl * cs - $3 + print $3, isl * cs - $3, 1 c = isl * cs; # Second image partition (if any) also starts offset one # track to keep them identical. if ($2 > 1) { - print $3 + c, isl * cs - $3 + print $3 + c, isl * cs - $3, 2 c += isl * cs; } # Config partition starts at cylinder boundary. - print c, csl * cs + print c, csl * cs, 3 c += csl * cs # Data partition (if any) starts at cylinder boundary. if ($7 > 0) { - print c, dsl * cs + print c, dsl * cs, 4 } else if ($7 < 0 && $1 > c) { - print c, $1 - c + print c, $1 - c, 4 } else if ($1 < c) { print "Disk space overcommitted by", \ c - $1, "sectors" > "/dev/stderr" exit 2 } - } ' > ${NANO_LOG}/_.partitioning ) @@ -174,7 +173,7 @@ create_diskimage ( ) ( } { # Make partition - print "gpart add -t freebsd -b ", $1, " -s ", $2, " $1" + print "gpart add -t freebsd -b ", $1, " -s ", $2, " -i ", $3, " $1" } END { # Force slice 1 to be marked active. This is necessary