From nobody Tue Feb 4 14:07:30 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 4YnQDM1w63z5msGp; Tue, 04 Feb 2025 14:07:31 +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 4YnQDM17fSz41v2; Tue, 04 Feb 2025 14:07:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738678051; 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=tO2Ed5GlU8bj7XdiT3YHRWKG8cP4EVOGaCHZvVUMU2M=; b=uuNLI9OThK3hW+NwiM7Rd3NogiZOsWhWMsOyOG/Eoi6u/G9BJw6RjydYstFhn89O6umcEl z2tLHCw+q4d5bmpPaHUqQlwx7D0168j/7UufEt9IG7iiX1O/Burt/UEh5YQ9pQFvTJ8d3p Dztetz3xlFGNL3qRYNih9EqWvH0tWmSRyaxlQ37lWCQ0KgBfRY2xLlVBqfUCLmz3oumgLd 2tR4CiJY+GNZ0zEykuBeE7/uz/qOFvrx0xfB9w1PfstSZ5bUqWfNwh4h/b0XU3Fg4Kp4Iy ECj12mQfA0eqFLOL7NJUz71ooaYYFHv6SiibS2O+qt9yk+PhNLeyEXaFYex7KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738678051; 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=tO2Ed5GlU8bj7XdiT3YHRWKG8cP4EVOGaCHZvVUMU2M=; b=uJ4/jHqsdZswfikfjOpea3VvbJgeu8u0/JWXW6tIussen0kkzIb4pN6I1iuTzm25t2yR64 olRpI7FnM1x3NxUbUHR3O8CNRu1zGKwVFR3HOHDnoYypAo5AsFB79dsBh/2ezMfhdAGQPb KZU4jFOu2VZOqE8FLFqiS+j7vugqWks7m+6gTw9oMnIgcr/JRruWWdMbSAsDcdnjNG4dJh 0WNLYgf9aWlC15KDaa86Ac/4l7RTUui9TJDioi0gOmcBvQyXbWsdCYxDoJNdo43r4ZicbF 2SsrOqz/ihRTt/0zZRzClxONDPrxDMr4QQCk/WdN/g7XLfyE4oDGP+PQ+2pkjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738678051; a=rsa-sha256; cv=none; b=J5ZBaGxeQFFbbq6y/U3rKAQgW2/PiKTKgvmrZmXxX2n3DMxgeur+3+pbWK5tEjLNw2V6v5 ryBgU4Y+HtqcuhdHjWkdKp8NcbfOhy/64xdUm7b0Kzbr9RIWVIKu734RCOTlST41ExXfrG VT61b+h/OErO2tm3HSJswEm5XxhWEFkpHk35RxrIKT/joFrcjNfKmXUurPnVTDJtZDc9wn JS0sOiXThC8QYsn1SGRVvWXIf3bR5ztC38pXe7Oek/501p36IESgWpvln0LM1+RPkIsX7R CjlXNODbg9oVpv/ECELy3bDI+Ce+rDd5PkI93KvgxB2gaXd1BmJc3YngsdggKA== 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 4YnQDM0FPNz1NsQ; Tue, 04 Feb 2025 14:07:31 +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 514E7USK029376; Tue, 4 Feb 2025 14:07:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 514E7UFw029373; Tue, 4 Feb 2025 14:07:30 GMT (envelope-from git) Date: Tue, 4 Feb 2025 14:07:30 GMT Message-Id: <202502041407.514E7UFw029373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: dc4b36b96333 - main - 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/main X-Git-Reftype: branch X-Git-Commit: dc4b36b96333f2ab05f3c454f0df2e0a0d4d451d Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=dc4b36b96333f2ab05f3c454f0df2e0a0d4d451d commit dc4b36b96333f2ab05f3c454f0df2e0a0d4d451d Author: Jose Luis Duran AuthorDate: 2025-02-04 14:07:00 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-04 14:07:00 +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 --- 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