<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.sbin/bsdinstall/scripts/checksum, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>bsdinstall: Encode dists to valid variable names in checksum script</title>
<updated>2023-12-06T21:37:32+00:00</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@FreeBSD.org</email>
</author>
<published>2023-12-06T21:37:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=47d669f10ea3eb92a3783376549728b42c9e22b9'/>
<id>47d669f10ea3eb92a3783376549728b42c9e22b9</id>
<content type='text'>
Currently we just strip the .txz of the dist name (and add a status_
prefix) to get the shell variable name for its status, but this doesn't
give a valid result for dists like base-dbg, kernel-dbg and lib32-dbg,
or even kernel.KERNCONF (or, combining the two, kernel.KERNCONF-dbg). As
a result, four things go wrong for such dists:

1. If there is a dot and/or a dash in the name, writing to the variable
   fails and spits an error out on stderr to the log
3. If there is a dot in the name before any dash, the syntax is always
   invalid, reading the variable fails, spits an error out on stderr to
   the log, the result is the empty string and that is interpreted as
   being 0%
2. If there is a dash in the name before any dot, and there is a dist
   whose name is the substring up to that first dash, and it has already
   had its status written to, reading the variable instead reads that
   dist's variable and so the status of that dist is displayed instead
3. If there is a dash in the name before any dot, and either there is
   not a dist whose name is the substring up to that first dash or there
   is such a dist but it has not already had its status written to,
   reading the varaible instead results in the substring after the first
   dash, including any additional string expansion syntax that follows
   (i.e. ${status_kernel-dbg:--11}, the expression used to read the
   variable, is interpreted as reading status_kernel with a default
   value of "dbg:--11")

For example, in a default install with base, kernel, kernel-dbg and
lib32, the following sequence of displays happens:

1. base is In Progress, kernel is Pending, kernel-dbg is 0% (what shows
   for the garbage input "dbg:--11") and lib32 is Pending
2. base is Passed, kernel is In Progress, kernel-dbg is In Progress
   (since kernel has now had its status written to) and lib32 is
   Pending
3. base is Passed, kernel is Passed, kernel-dbg is Passed (again, since
   that is the status of kernel, despite that kernel-dbg is being
   verified at this point) and lib32 is Pending
4. base is Passed, kernel is Passed, kernel-dbg is Passed and lib32 is
   In Progress

Fix this with a crude encoding scheme. More special characters can
easily be added if needed in future.

Note that, prior to bsddialog being used (and thus for branches this is
MFC'ed to where dialog is still used), the same problem existed but
displayed slightly differently due to a combination of different default
values and different behaviour for unintended inputs.

Fixes:		b70047d41362 ("Add generation of an installation manifest containing SHA256 checksums as ...")
MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently we just strip the .txz of the dist name (and add a status_
prefix) to get the shell variable name for its status, but this doesn't
give a valid result for dists like base-dbg, kernel-dbg and lib32-dbg,
or even kernel.KERNCONF (or, combining the two, kernel.KERNCONF-dbg). As
a result, four things go wrong for such dists:

1. If there is a dot and/or a dash in the name, writing to the variable
   fails and spits an error out on stderr to the log
3. If there is a dot in the name before any dash, the syntax is always
   invalid, reading the variable fails, spits an error out on stderr to
   the log, the result is the empty string and that is interpreted as
   being 0%
2. If there is a dash in the name before any dot, and there is a dist
   whose name is the substring up to that first dash, and it has already
   had its status written to, reading the variable instead reads that
   dist's variable and so the status of that dist is displayed instead
3. If there is a dash in the name before any dot, and either there is
   not a dist whose name is the substring up to that first dash or there
   is such a dist but it has not already had its status written to,
   reading the varaible instead results in the substring after the first
   dash, including any additional string expansion syntax that follows
   (i.e. ${status_kernel-dbg:--11}, the expression used to read the
   variable, is interpreted as reading status_kernel with a default
   value of "dbg:--11")

For example, in a default install with base, kernel, kernel-dbg and
lib32, the following sequence of displays happens:

1. base is In Progress, kernel is Pending, kernel-dbg is 0% (what shows
   for the garbage input "dbg:--11") and lib32 is Pending
2. base is Passed, kernel is In Progress, kernel-dbg is In Progress
   (since kernel has now had its status written to) and lib32 is
   Pending
3. base is Passed, kernel is Passed, kernel-dbg is Passed (again, since
   that is the status of kernel, despite that kernel-dbg is being
   verified at this point) and lib32 is Pending
4. base is Passed, kernel is Passed, kernel-dbg is Passed and lib32 is
   In Progress

Fix this with a crude encoding scheme. More special characters can
easily be added if needed in future.

Note that, prior to bsddialog being used (and thus for branches this is
MFC'ed to where dialog is still used), the same problem existed but
displayed slightly differently due to a combination of different default
values and different behaviour for unintended inputs.

Fixes:		b70047d41362 ("Add generation of an installation manifest containing SHA256 checksums as ...")
MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:55:03+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>bsdinstall: fix a couple stragglers in whitelabeling the scripts</title>
<updated>2022-09-14T17:06:11+00:00</updated>
<author>
<name>Brad Davis</name>
<email>brd@FreeBSD.org</email>
</author>
<published>2022-09-14T17:04:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2913e785f057f54f7ee825fe4f9fe3c039c0f78f'/>
<id>2913e785f057f54f7ee825fe4f9fe3c039c0f78f</id>
<content type='text'>
PR:		265797
Reviewed by:	allanjude, asiciliano
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36235
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR:		265797
Reviewed by:	allanjude, asiciliano
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36235
</pre>
</div>
</content>
</entry>
<entry>
<title>bsdinstall: allow whitelabeling the scripts</title>
<updated>2022-05-24T15:49:06+00:00</updated>
<author>
<name>Brad Davis</name>
<email>brd@FreeBSD.org</email>
</author>
<published>2022-05-24T15:49:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cc42ef5328963ee55c3305b136e9a86145f24594'/>
<id>cc42ef5328963ee55c3305b136e9a86145f24594</id>
<content type='text'>
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35197
Sponsored by:		Rubicon Communications, LLC ("Netgate")
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Approved by:		allanjude, asiciliano
Differential Revision:	https://reviews.freebsd.org/D35197
Sponsored by:		Rubicon Communications, LLC ("Netgate")
</pre>
</div>
</content>
</entry>
<entry>
<title>bsdinstall checksum: Replace dialog with bsddialog</title>
<updated>2022-03-26T00:37:59+00:00</updated>
<author>
<name>Alfonso S. Siciliano</name>
<email>asiciliano@FreeBSD.org</email>
</author>
<published>2022-03-26T00:36:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0868f621762a949ef2b791c3199817436a79d3a1'/>
<id>0868f621762a949ef2b791c3199817436a79d3a1</id>
<content type='text'>
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34660
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34660
</pre>
</div>
</content>
</entry>
<entry>
<title>bsdinstall: improve checksum mismatch error for snapshots</title>
<updated>2017-07-19T18:25:52+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2017-07-19T18:25:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2775c1d7d5f7ba8cea66a060f6700d49d4c06a8a'/>
<id>2775c1d7d5f7ba8cea66a060f6700d49d4c06a8a</id>
<content type='text'>
The usual case of a mismatched checksum for installer snapshots
(e.g., -CURRENT, -ALPHA*) is that a newer snapshot has been built and
the old install sets have been replaced.  Provide a specific error
message for checksum mismatches there that suggests looking for a newer
snapshot.

Submitted by:	Guangyuan Yang &lt;yzgyyang@outlook.com&gt;
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11641
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The usual case of a mismatched checksum for installer snapshots
(e.g., -CURRENT, -ALPHA*) is that a newer snapshot has been built and
the old install sets have been replaced.  Provide a specific error
message for checksum mismatches there that suggests looking for a newer
snapshot.

Submitted by:	Guangyuan Yang &lt;yzgyyang@outlook.com&gt;
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11641
</pre>
</div>
</content>
</entry>
<entry>
<title>bsdinstall: remove EOL whitespace</title>
<updated>2017-07-18T23:35:19+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2017-07-18T23:35:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9acc90414602a7f00776746f0c560019c868ca29'/>
<id>9acc90414602a7f00776746f0c560019c868ca29</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Mark any distfiles with no checksum entries in the manifest "Skipped"</title>
<updated>2011-03-23T13:43:56+00:00</updated>
<author>
<name>Nathan Whitehorn</name>
<email>nwhitehorn@FreeBSD.org</email>
</author>
<published>2011-03-23T13:43:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c31153ad4d5a0095664ab815772ad1879d19e2fb'/>
<id>c31153ad4d5a0095664ab815772ad1879d19e2fb</id>
<content type='text'>
instead of "Passed".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
instead of "Passed".
</pre>
</div>
</content>
</entry>
<entry>
<title>Add generation of an installation manifest containing SHA256 checksums as</title>
<updated>2011-03-13T17:15:31+00:00</updated>
<author>
<name>Nathan Whitehorn</name>
<email>nwhitehorn@FreeBSD.org</email>
</author>
<published>2011-03-13T17:15:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b70047d4136285ce8e5046c379143f4813228855'/>
<id>b70047d4136285ce8e5046c379143f4813228855</id>
<content type='text'>
well as package descriptions and add code in the installer to check the
checksums.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
well as package descriptions and add code in the installer to check the
checksums.
</pre>
</div>
</content>
</entry>
</feed>
