git: 2e29bf7a2ae6 - main - ping: tests: Cleanup IPOption()s

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2e29bf7a2ae66acb6e65ffc1c923cfb373af67bd

commit 2e29bf7a2ae66acb6e65ffc1c923cfb373af67bd
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 02:46:45 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-05 02:46:45 +

ping: tests: Cleanup IPOption()s

Scapy now only accepts known options with IPOption(), so our unknown
option must be passed raw.

While here, prefer the named options for EOL and NOP.

Reviewed by:emaste, kp
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D47160
---
 sbin/ping/tests/test_ping.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
index 8ec0f3dc74dc..90df07d0e5b9 100644
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -85,11 +85,11 @@ def generate_ip_options(opts):
 ]
 routers_zero = [0, 0, 0, 0, 0, 0, 0, 0, 0]
 if opts == "EOL":
-options = sc.IPOption(b"\x00")
+options = sc.IPOption_EOL()
 elif opts == "NOP":
-options = sc.IPOption(b"\x01")
+options = sc.IPOption_NOP()
 elif opts == "NOP-40":
-options = sc.IPOption(b"\x01" * 40)
+options = sc.IPOption_NOP() * 40
 elif opts == "RR":
 ToolsHelper.set_sysctl("net.inet.ip.process_options", 0)
 options = sc.IPOption_RR(pointer=40, routers=routers)
@@ -116,7 +116,7 @@ def generate_ip_options(opts):
 options = b"\x9f"
 elif opts == "unk-40":
 ToolsHelper.set_sysctl("net.inet.ip.process_options", 0)
-options = sc.IPOption(b"\x9f" * 40)
+options = b"\x9f" * 40
 else:
 options = ""
 return options



git: 4859030ef193 - main - ping: tests: Align with Scapy defaults

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4859030ef193688153f490915794ae9ab77f012b

commit 4859030ef193688153f490915794ae9ab77f012b
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 02:48:34 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-05 02:48:34 +

ping: tests: Align with Scapy defaults

Align some of pinger() defaults with Scapy to facilitate debugging when
printing packets.

No functional change intended.

Reviewed by:emaste, kp
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D47159
---
 sbin/ping/tests/test_ping.py | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
index 90df07d0e5b9..cf2e46a146c8 100644
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -63,14 +63,14 @@ def build_response_packet(echo, ip, icmp, oip_ihl, special):
 if icmp.type in icmp_id_seq_types:
 pkt = ip / icmp / load
 else:
-ip.options = ""
+del ip.options
 pkt = ip / icmp / oip / oicmp / load
 return pkt
 
 
 def generate_ip_options(opts):
 if not opts:
-return ""
+return []
 
 routers = [
 "192.0.2.10",
@@ -118,7 +118,7 @@ def generate_ip_options(opts):
 ToolsHelper.set_sysctl("net.inet.ip.process_options", 0)
 options = b"\x9f" * 40
 else:
-options = ""
+options = []
 return options
 
 
@@ -134,7 +134,7 @@ def pinger(
 icmp_code: sc.scapy.fields.MultiEnumField,
 # IP arguments
 ihl: Optional[sc.scapy.fields.BitField] = None,
-flags: Optional[sc.scapy.fields.FlagsField] = None,
+flags: Optional[sc.scapy.fields.FlagsField] = 0,
 opts: Optional[str] = None,
 oip_ihl: Optional[sc.scapy.fields.BitField] = None,
 special: Optional[str] = None,
@@ -169,7 +169,7 @@ def pinger(
 
 :keyword ihl: Internet Header Length, defaults to None
 :type ihl: class:`scapy.fields.BitField`, optional
-:keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to None
+:keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to 0
 :type flags: class:`scapy.fields.FlagsField`, optional
 :keyword opts: Include IP options - one of `EOL`, `NOP`, `NOP-40`, `unk`,
 `unk-40`, `RR`, `RR-same`, `RR-trunc`, `LSRR`, `LSRR-trunc`, `SSRR` or



git: 019981e00f23 - main - git-arc: Fix typo s/Truning/Turning/

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=019981e00f23b0458067cbd91007f9f03b3b0b7e

commit 019981e00f23b0458067cbd91007f9f03b3b0b7e
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 01:13:20 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-05 02:10:16 +

git-arc: Fix typo s/Truning/Turning/

While here standardize white space.
No functional change.

Approved by:emaste (mentor)
---
 tools/tools/git/git-arc.sh | 42 +-
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index f3cae28e3009..0df4ac4cd5fc 100644
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -101,10 +101,10 @@ Config Variables:
   Defaults to false.
 
 arc.list [bool]-- Always use "list mode" (-l) with create and update.
- In this mode, the list of git revisions to use
+  In this mode, the list of git revisions to use
   is listed with a single prompt before creating or
   updating reviews.  The diffs for individual commits
- are not shown.
+  are not shown.
 
 arc.verbose [bool] -- Verbose output.  Equivalent to the -v flag.
 
@@ -205,7 +205,7 @@ diff2status()
 arc_call_conduit -- phid.lookup > "$tmp"
 status=$(jq -r "select(.response != []) | .response.${diff}.status" < 
"$tmp")
 summary=$(jq -r "select(.response != []) |
- .response.${diff}.fullName" < "$tmp")
+.response.${diff}.fullName" < "$tmp")
 printf "%-14s %s\n" "${status}" "${summary}"
 }
 
@@ -305,7 +305,7 @@ create_one_review()
 "type": "parents.add",
 "value": ["'"${parentphid}"'"]
 }
- ]}' |
+]}' |
 arc_call_conduit -- differential.revision.edit >&3
 fi
 rm -f "$msg"
@@ -321,15 +321,15 @@ diff2reviewers()
 reviewid=$(diff2phid "$diff")
 userids=$( \
 echo '{
-  "constraints": {"phids": ["'"$reviewid"'"]},
-  "attachments": {"reviewers": true}
-  }' |
+"constraints": {"phids": ["'"$reviewid"'"]},
+"attachments": {"reviewers": true}
+}' |
 arc_call_conduit -- differential.revision.search |
 jq '.response.data[0].attachments.reviewers.reviewers[] | 
select(.status == "accepted").reviewerPHID')
 if [ -n "$userids" ]; then
 echo '{
-  "constraints": {"phids": ['"$(printf "%s" "$userids" | tr 
'[:space:]' ',')"']}
-  }' |
+"constraints": {"phids": ['"$(printf "%s" "$userids" | tr '[:space:]' 
',')"']}
+}' |
 arc_call_conduit -- user.search |
 jq -r '.response.data[].fields.username'
 fi
@@ -427,7 +427,7 @@ gitarc__create()
 
 for commit in ${commits}; do
 if create_one_review "$commit" "$reviewers" "$subscribers" "$prev" \
- "$doprompt"; then
+"$doprompt"; then
 prev=$(commit2diff "$commit")
 else
 prev=""
@@ -448,8 +448,8 @@ gitarc__list()
 
 diff=$(log2diff "$commit")
 if [ -n "$diff" ]; then
-diff2status "$diff"
-continue
+diff2status "$diff"
+continue
 fi
 
 # This does not use commit2diff as it needs to handle errors
@@ -457,7 +457,7 @@ gitarc__list()
 title=$(git show -s --format=%s "$commit")
 diff=$(echo "$openrevs" | \
 awk -F'D[1-9][0-9]*: ' \
-'{if ($2 == "'"$(echo $title | sed 's/"/\\"/g')"'") print $0}')
+'{if ($2 == "'"$(echo $title | sed 's/"/\\"/g')"'") print $0}')
 if [ -z "$diff" ]; then
 echo "No Review: $title"
 elif [ "$(echo "$diff" | wc -l)" -ne 1 ]; then
@@ -491,7 +491,7 @@ find_author()
 # freebsd.org (which isn&#x

git: aa90b92ac289 - main - git-arc: Fix find_author() for external users

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=aa90b92ac289b2a7eec882caf870e56dbed16a5c

commit aa90b92ac289b2a7eec882caf870e56dbed16a5c
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 01:32:25 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-05 02:10:15 +

git-arc: Fix find_author() for external users

When an external user submits a review in Phabricator, the find_author()
subroutine may receive the author_name and author_addr as "null" from
the JSON API with git-arc patch.

This "null" string gets tested for length by "[ -n", and returning that
is greater than zero, in other words, the shell does not understand that
"null" means nothing in this case.

Fix it by adding a guard, that sets an empty string when the content is
"null".

While here, standardize the indentation style for find_author()

Reviewed by:emaste, markj
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D46789
---
 tools/tools/git/git-arc.sh | 38 --
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index cca70f61a4cd..f3cae28e3009 100644
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -493,16 +493,16 @@ find_author()
 case "${addr}" in
 *.*) ;;# external user
 *)
-   echo "${name} <${addr}@FreeBSD.org>"
-   return
-   ;;
+echo "${name} <${addr}@FreeBSD.org>"
+return
+;;
 esac
 
 # Choice 2: author_addr and author_name were set in the bundle, so use
 # that. We may need to filter some known bogus ones, should they crop up.
 if [ -n "$author_name" -a -n "$author_addr" ]; then
-   echo "${author_name} <${author_addr}>"
-   return
+echo "${author_name} <${author_addr}>"
+return
 fi
 
 # Choice 3: We can find this user in the FreeBSD repo. They've submited
@@ -510,8 +510,8 @@ find_author()
 # similar to their phab username.
 email=$(git log -1 --author "$(echo ${addr} | tr _ .)" --pretty="%aN 
<%aE>")
 if [ -n "${email}" ]; then
-   echo "${email}"
-   return
+echo "${email}"
+return
 fi
 
 # Choice 4: We know this user. They've committed before, and they happened
@@ -519,11 +519,11 @@ find_author()
 # might not be a good idea, since names can be somewhat common (there
 # are two Andrew Turners that have contributed to FreeBSD, for example).
 if ! (echo "${name}" | grep -w "[Uu]ser" -q); then
-   email=$(git log -1 --author "${name}" --pretty="%aN <%aE>")
-   if [ -n "$email" ]; then
-   echo "$email"
-   return
-   fi
+email=$(git log -1 --author "${name}" --pretty="%aN <%aE>")
+if [ -n "$email" ]; then
+echo "$email"
+return
+fi
 fi
 
 # Choice 5: Wing it as best we can. In this scenario, we replace the last _
@@ -534,8 +534,8 @@ find_author()
 a=$(printf "%s <%s>\n" "${name}" $(echo "$addr" | sed -e 's/\(.*\)_/\1@/'))
 echo "Making best guess: Truning ${addr} to ${a}"
 if ! prompt; then
-   echo "ABORT"
-   return
+echo "ABORT"
+return
 fi
 echo "${a}"
 }
@@ -572,6 +572,16 @@ patch_commit()
 jq -r '.response | flatten | .[]' > "$diff_data"
 author_addr=$(jq -r ".authorEmail?" "$diff_data" | sort -u)
 author_name=$(jq -r ".authorName?" "$diff_data" | sort -u)
+
+# JSON will return "null" when a field is not populated.
+# Turn this string into an empty one.
+if [ "$author_addr" = "null" ]; then
+author_addr=""
+fi
+if [ "$author_name" = "null" ]; then
+author_name=""
+fi
+
 author=$(find_author "$user_addr" "$user_name" "$author_addr" 
"$author_name")
 rm "$diff_data"
 



git: 2377c19a8c37 - main - git-arc: Trap on every mktemp

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2377c19a8c37c3494d065c2a9e8b155147c1feb4

commit 2377c19a8c37c3494d065c2a9e8b155147c1feb4
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 01:47:52 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-05 02:10:16 +

git-arc: Trap on every mktemp

Trap:

- EXIT (0)
- HUP  (1)
- INT  (2)
- QUIT (3)
- TRAP (5)
- USR1 (10)
- TERM (15)

every time mktemp is called to reduce the chances of leaving stray files
or directories with possible sensitive data inside.

We avoid using a template with mktemp, as some operating systems may use
unpredictable base paths by default (macOS).

Suggested by:   des
Reviewed by:emaste, 0mp, des (earlier), markj
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D47289
---
 tools/tools/git/git-arc.sh | 48 +-
 1 file changed, 30 insertions(+), 18 deletions(-)

diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index 0df4ac4cd5fc..64d1ee2bd63f 100644
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -43,6 +43,14 @@ err()
 exit 1
 }
 
+cleanup()
+{
+rc=$?
+rm -fr "$GITARC_TMPDIR"
+trap - EXIT
+exit $rc
+}
+
 err_usage()
 {
 cat >&2 <<__EOF__
@@ -147,6 +155,12 @@ __EOF__
 exit 1
 }
 
+# Use xmktemp instead of mktemp when creating temporary files.
+xmktemp()
+{
+mktemp "${GITARC_TMPDIR:?}/tmp.XX" || exit 1
+}
+
 #
 # Fetch the value of a boolean config variable ($1) and return true
 # (0) if the variable is true.  The default value to use if the
@@ -200,7 +214,7 @@ diff2status()
 err "invalid diff ID $diff"
 fi
 
-tmp=$(mktemp)
+tmp=$(xmktemp)
 echo '{"names":["'"$diff"'"]}' |
 arc_call_conduit -- phid.lookup > "$tmp"
 status=$(jq -r "select(.response != []) | .response.${diff}.status" < 
"$tmp")
@@ -279,7 +293,7 @@ create_one_review()
 return 1
 fi
 
-msg=$(mktemp)
+msg=$(xmktemp)
 git show -s --format='%B' "$commit" > "$msg"
 printf "\nTest Plan:\n" >> "$msg"
 printf "\nReviewers:\n" >> "$msg"
@@ -308,7 +322,6 @@ create_one_review()
 ]}' |
 arc_call_conduit -- differential.revision.edit >&3
 fi
-rm -f "$msg"
 return 0
 }
 
@@ -542,31 +555,30 @@ find_author()
 
 patch_commit()
 {
-local diff reviewid review_data authorid user_data user_addr user_name 
author
-local tmp author_addr author_name
+local diff reviewid review_data authorid user_data user_addr user_name
+local diff_data author_addr author_name author tmp
 
 diff=$1
 reviewid=$(diff2phid "$diff")
 # Get the author phid for this patch
-review_data=$(mktemp)
+review_data=$(xmktemp)
 echo '{"constraints": {"phids": ["'"$reviewid"'"]}}' | \
 arc_call_conduit -- differential.revision.search > "$review_data"
 authorid=$(jq -r '.response.data[].fields.authorPHID' "$review_data")
 # Get metadata about the user that submitted this patch
-user_data=$(mktemp)
+user_data=$(xmktemp)
 echo '{"constraints": {"phids": ["'"$authorid"'"]}}' | \
 arc_call_conduit -- user.search | \
 jq -r '.response.data[].fields' > "$user_data"
 user_addr=$(jq -r '.username' "$user_data")
 user_name=$(jq -r '.realName' "$user_data")
-rm "$user_data"
 # Dig the data out of querydiffs api endpoint, although it's deprecated,
 # since it's one of the few places we can get email addresses. It's unclear
 # if we can expect multiple difference ones of these. Some records don't
 # have this data, so we remove all the 'null's. We sort the results and
 # remove duplicates 'just to be sure' since we've not seen multiple
 # records that match.
-diff_data=$(mktemp)
+diff_data=$(xmktemp)
 echo '{"revisionIDs": [ '"${diff#D}"' ]}' | \
 arc_call_conduit -- differential.querydiffs |
 jq -r '.response | flatten | .[]' > "$diff_data"
@@ -583,7 +595,6 @@ patch_commit()
 fi
 
 author=$(find_author "$user_addr" "$user_name" "$author_addr" 
"$author_name")
-rm "$diff_data"
 
 # If we had to guess, and the user didn't want to guess, abort
 if [ "${a

git: 9e84289f2c7e - main - git-arc: Prefer echo over printf

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9e84289f2c7e6b632047a75b653fcd587287a8b9

commit 9e84289f2c7e6b632047a75b653fcd587287a8b9
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 01:13:22 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-05 02:10:16 +

git-arc: Prefer echo over printf

Prefer echo over printf.  Prevent the newline character from being
translated by using 'blank' instead of 'space' in the re_format.

This change was reviewed in:

https://reviews.freebsd.org/D47289

Committed separately for clarity.

Suggested by:   des
Approved by:emaste (mentor)
---
 tools/tools/git/git-arc.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index 64d1ee2bd63f..050ec4ec1f2c 100644
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -341,7 +341,7 @@ diff2reviewers()
 jq '.response.data[0].attachments.reviewers.reviewers[] | 
select(.status == "accepted").reviewerPHID')
 if [ -n "$userids" ]; then
 echo '{
-"constraints": {"phids": ['"$(printf "%s" "$userids" | tr '[:space:]' 
',')"']}
+"constraints": {"phids": ['"$(echo "$userids" | tr '[:blank:]' ',')"']}
 }' |
 arc_call_conduit -- user.search |
 jq -r '.response.data[].fields.username'



git: 0187bc8a472e - main - sound: Include snd_cmi only for i386 and amd64

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0187bc8a472ef21ddb901f797d46075fc0d5eb14

commit 0187bc8a472ef21ddb901f797d46075fc0d5eb14
Author: Jose Luis Duran 
AuthorDate: 2024-11-04 19:57:25 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-04 19:57:25 +

sound: Include snd_cmi only for i386 and amd64

When running FreeBSD on an arm64/aarch64 QEMU virtual machine, using the
Intel HD Audio Controller (ich6) (intel-hda), for example, and by
following the procedure in the handbook ("Setting Up the Sound Card"):

kldload snd_driver

The following error is shown:

KLD snd_driver.ko: depends on snd_cmi - not available or version 
mismatch

This is because the CMedia sound driver (snd_cmi) is only built for i386
and amd64.

Add the same guards to the snd_driver metadriver.

Reviewed by:christos, emaste
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D47399
---
 sys/dev/sound/driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/sound/driver.c b/sys/dev/sound/driver.c
index 6bfe6c51fa3e..13218f419a28 100644
--- a/sys/dev/sound/driver.c
+++ b/sys/dev/sound/driver.c
@@ -57,7 +57,9 @@ MODULE_VERSION(snd_driver, 1);
 
 MODULE_DEPEND(snd_driver, snd_als4000, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_atiixp, 1, 1, 1);
+#if defined(__i386__) || defined(__amd64__)
 MODULE_DEPEND(snd_driver, snd_cmi, 1, 1, 1);
+#endif
 MODULE_DEPEND(snd_driver, snd_cs4281, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_csa, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_csapcm, 1, 1, 1);



git: 8934526be184 - main - rc: Update ipfilter example rules location

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8934526be1843ba033e1423f6ecd8b3b3f2a9c23

commit 8934526be1843ba033e1423f6ecd8b3b3f2a9c23
Author: Jose Luis Duran 
AuthorDate: 2024-11-04 20:02:01 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-04 20:02:01 +

rc: Update ipfilter example rules location

It was originally /usr/src/contrib/ipfilter/rules and moved to
/usr/src/share/examples/ipfilter/rules in 41edb306f056.

Point to users to /usr/src/share/examples/ipfilter instead, as the base
directory also contains example rules.

Reviewed by:emaste
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D47392
---
 libexec/rc/rc.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
index a21c587dcc07..6689a2ab85dd 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -212,7 +212,7 @@ natd_flags=""   # Additional flags for 
natd.
 ipfilter_enable="NO"   # Set to YES to enable ipfilter functionality
 ipfilter_program="/sbin/ipf"   # where the ipfilter program lives
 ipfilter_rules="/etc/ipf.rules"# rules definition file for ipfilter, 
see
-   # /usr/src/contrib/ipfilter/rules for examples
+   # /usr/src/share/examples/ipfilter for examples
 ipfilter_flags=""  # additional flags for ipfilter
 ipfilter_optionlist="" # optionlist for ipf(8) -T
 ippool_enable="NO" # Set to YES to enable ip filter pools



git: 8b13cb9d654c - main - ping tests: Silence deprecation warnings

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8b13cb9d654c985534d24a09ec5dab02cc4dea6e

commit 8b13cb9d654c985534d24a09ec5dab02cc4dea6e
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 03:04:53 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-05 03:07:03 +

ping tests: Silence deprecation warnings

Declare some regex patterns as a raw string by prepending `r`.

Reviewed by:markj
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D42174
---
 sbin/ping/tests/test_ping.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
index cf2e46a146c8..93b42d7d53bd 100644
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -270,15 +270,15 @@ def pinger(
 def redact(output):
 """Redact some elements of ping's output"""
 pattern_replacements = [
-("localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"),
-("from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"),
+(r"localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"),
+(r"from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"),
 ("hlim=[0-9]*", "hlim="),
 ("ttl=[0-9]*", "ttl="),
 ("time=[0-9.-]*", "time="),
 ("cp: .*", "cp: xx xx xx xx xx xx xx xx"),
 ("dp: .*", "dp: xx xx xx xx xx xx xx xx"),
-("\(-[0-9\.]+[0-9]+ ms\)", "(- ms)"),
-("[0-9\.]+/[0-9.]+", "/"),
+(r"\(-[0-9\.]+[0-9]+ ms\)", "(- ms)"),
+(r"[0-9\.]+/[0-9.]+", "/"),
 ]
 for pattern, repl in pattern_replacements:
 output = re.sub(pattern, repl, output)



git: 5797a03fe8a7 - main - ping tests: Run tests unprivileged inside a vnet

2024-11-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5797a03fe8a7c3355a727aaaea803ee1f42d106b

commit 5797a03fe8a7c3355a727aaaea803ee1f42d106b
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 03:00:38 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-05 03:07:32 +

ping tests: Run tests unprivileged inside a vnet

In order to create vnet jails, atf_python needs root privileges.
However, once the vnet is created, its privileges inside the vnet can be
demoted, as these tests should not require root in order to pass.

Reviewed by:markj
Approved by:emaste (mentor)
Fixes:  4efaf43c6fa7 ("ping: Require root user for pytests")
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D42175
---
 sbin/ping/tests/test_ping.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
index 93b42d7d53bd..3f9a3aecf924 100644
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -724,6 +724,7 @@ PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
 
 @pytest.mark.parametrize("expected", testdata)
 @pytest.mark.require_user("root")
+@pytest.mark.require_user("unprivileged")
 def test_ping(self, expected):
 """Test ping"""
 ping = subprocess.run(
@@ -753,6 +754,7 @@ PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
 
 @pytest.mark.parametrize("expected", ping46_testdata)
 @pytest.mark.require_user("root")
+@pytest.mark.require_user("unprivileged")
 def test_ping_46(self, expected):
 """Test ping -4/ping -6"""
 for version in [4, 6]:



git: 6baae68d7f31 - main - release: Remove binutils

2024-11-01 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6baae68d7f311f4ee0e844782dbaf4f3c9b223ed

commit 6baae68d7f311f4ee0e844782dbaf4f3c9b223ed
Author: Jose Luis Duran 
AuthorDate: 2024-10-18 03:17:57 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-01 16:49:51 +

release: Remove binutils

Reviewed by:mhorne, emaste
Approved by:emaste (mentor)
Fixes:  74e8d41e0ac8
MFC after:  1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1485
---
 release/packages/Makefile.package | 2 --
 1 file changed, 2 deletions(-)

diff --git a/release/packages/Makefile.package 
b/release/packages/Makefile.package
index 87585f7eac38..4a31406c7c53 100644
--- a/release/packages/Makefile.package
+++ b/release/packages/Makefile.package
@@ -17,8 +17,6 @@ autofs_COMMENT=   Autofs Utilities
 autofs_DESC=   Autofs Utilities
 bhyve_COMMENT= Bhyve Utilities
 bhyve_DESC=Bhyve Utilities
-binutils_COMMENT=  Binutils
-binutils_DESC= Binutils
 blocklist_COMMENT= Blocklist Utilities
 blocklist_DESC=Blocklist Utilities
 bluetooth_COMMENT= Bluetooth Utilities



git: 1fa6daaafd74 - main - ipfilter: Avoid stopping with a lock held

2024-11-11 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1fa6daaafd74c1a457dcfe26e0a5943b5441dc9d

commit 1fa6daaafd74c1a457dcfe26e0a5943b5441dc9d
Author: Jose Luis Duran 
AuthorDate: 2024-11-02 17:58:59 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-12 03:46:15 +

ipfilter: Avoid stopping with a lock held

Avoid calling _callout_stop_safe with a non-sleepable lock held when
detaching by initializing callout_init_rw() with CALLOUT_SHAREDLOCK.

It avoids the following WITNESS warning when stopping the service:

# service ipfilter stop
calling _callout_stop_safe with the following non-sleepable locks held:
shared rw ipf filter load/unload mutex (ipf filter load/unload mutex) r 
= 0 (0x417c7530) locked @ 
/usr/src/sys/netpfil/ipfilter/netinet/fil.c:7926
stack backtrace:
#0 0x0052d394 at witness_debugger+0x60
#1 0x0052e620 at witness_warn+0x404
#2 0x004d4ffc at _callout_stop_safe+0x8c
#3 0xf7236674 at ipfdetach+0x3c
#4 0xf723fa4c at ipf_ipf_ioctl+0x788
#5 0xf72367e0 at ipfioctl+0x144
#6 0x0034abd8 at devfs_ioctl+0x100
#7 0x005c66a0 at vn_ioctl+0xbc
#8 0x0034b2cc at devfs_ioctl_f+0x24
#9 0x005331ec at kern_ioctl+0x2e0
#10 0x00532eb4 at sys_ioctl+0x140
#11 0x00880480 at do_el0_sync+0x604
#12 0x008579ac at handle_el0_sync+0x4c

PR: 282478
Suggested by:   markj
Reviewed by:cy
Approved by:emaste (mentor)
MFC after:  1 week
---
 sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c 
b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
index bcde0d2c7323..b3dea40c3d8c 100644
--- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
@@ -181,7 +181,7 @@ ipf_timer_func(void *arg)
 #if 0
softc->ipf_slow_ch = timeout(ipf_timer_func, softc, hz/2);
 #endif
-   callout_init(&softc->ipf_slow_ch, 1);
+   callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, 
CALLOUT_SHAREDLOCK);
callout_reset(&softc->ipf_slow_ch,
(hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
ipf_timer_func, softc);
@@ -221,7 +221,7 @@ ipfattach(ipf_main_softc_t *softc)
softc->ipf_slow_ch = timeout(ipf_timer_func, softc,
 (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT);
 #endif
-   callout_init(&softc->ipf_slow_ch, 1);
+   callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, 
CALLOUT_SHAREDLOCK);
callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
ipf_timer_func, softc);
return (0);



git: 650900cc2f60 - main - ipfilter: Avoid holding a lock while stopping

2024-11-12 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=650900cc2f607458d32d333bd7ab0aa10be13ba4

commit 650900cc2f607458d32d333bd7ab0aa10be13ba4
Author: Jose Luis Duran 
AuthorDate: 2024-11-12 21:08:50 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-12 21:31:24 +

ipfilter: Avoid holding a lock while stopping

Avoid calling _callout_stop_safe with a non-sleepable lock held when
detaching by initializing callout_init_rw() with CALLOUT_SHAREDLOCK, and
avoiding re-initialization inside the timer function.

PR: 282478
Reviewed by:cy, emaste, jhb, markj
Tested by:  cy
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D47530
---
 sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c 
b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
index 84fac0205ffc..3d3601ede00f 100644
--- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
@@ -172,18 +172,15 @@ ipf_timer_func(void *arg)
SPL_INT(s);
 
SPL_NET(s);
-   READ_ENTER(&softc->ipf_global);
 
if (softc->ipf_running > 0)
ipf_slowtimer(softc);
 
if (softc->ipf_running == -1 || softc->ipf_running == 1) {
-   callout_init(&softc->ipf_slow_ch, 1);
callout_reset(&softc->ipf_slow_ch,
(hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
ipf_timer_func, softc);
}
-   RWLOCK_EXIT(&softc->ipf_global);
SPL_X(s);
 }
 
@@ -218,7 +215,7 @@ ipfattach(ipf_main_softc_t *softc)
softc->ipf_slow_ch = timeout(ipf_timer_func, softc,
 (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT);
 #endif
-   callout_init(&softc->ipf_slow_ch, 1);
+   callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, 
CALLOUT_SHAREDLOCK);
callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
ipf_timer_func, softc);
return (0);



git: a0618fbe19df - main - Revert "ipfilter: Avoid stopping with a lock held"

2024-11-12 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a0618fbe19dfedcdf01b4c232fe6669ae19505c4

commit a0618fbe19dfedcdf01b4c232fe6669ae19505c4
Author: Jose Luis Duran 
AuthorDate: 2024-11-12 18:51:45 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-12 18:53:39 +

Revert "ipfilter: Avoid stopping with a lock held"

The timeout function still tries to acquire the rwlock, and now it
deadlocks, since the callout framework will have already acquired it.

This reverts commit 1fa6daaafd74c1a457dcfe26e0a5943b5441dc9d.

PR: 282478
Reported by:markj
Approved by:emaste (mentor)
---
 sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c 
b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
index 23514907f86e..84fac0205ffc 100644
--- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
@@ -178,7 +178,7 @@ ipf_timer_func(void *arg)
ipf_slowtimer(softc);
 
if (softc->ipf_running == -1 || softc->ipf_running == 1) {
-   callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, 
CALLOUT_SHAREDLOCK);
+   callout_init(&softc->ipf_slow_ch, 1);
callout_reset(&softc->ipf_slow_ch,
(hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
ipf_timer_func, softc);
@@ -218,7 +218,7 @@ ipfattach(ipf_main_softc_t *softc)
softc->ipf_slow_ch = timeout(ipf_timer_func, softc,
 (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT);
 #endif
-   callout_init_rw(&softc->ipf_slow_ch, &softc->ipf_global.ipf_lk, 
CALLOUT_SHAREDLOCK);
+   callout_init(&softc->ipf_slow_ch, 1);
callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
ipf_timer_func, softc);
return (0);



Re: git: 1fa6daaafd74 - main - ipfilter: Avoid stopping with a lock held

2024-11-12 Thread Jose Luis Duran
On Tue, Nov 12, 2024 at 3:41 PM Cy Schubert  wrote:
>
> I'm building a test patch on my sandbox machine. The patches in my git repo
> will,
>
> a) remove another #if 0 from 2013,
> b) revert this commit,
> c) fix the "stopping with lock held" bug
>
> Testing on the sandbox is needed before I submit a review.
>
> You can revert this if you want, or I can push my three commits when my
> testing is complete.

I'll revert the commit, I feel better with this approach, thank you!

>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  https://FreeBSD.org
> NTP:   Web:  https://nwtime.org
>
> e^(i*pi)+1=0
>
>
> In message  om>
> , Jose Luis Duran writes:
> > What would be the recommended approach in this case?
> > Revert, and commit with the fixes, or just fix the problematic code.
> >
> > At any rate, I have created https://reviews.freebsd.org/D47530. Feel
> > free to commandeer it, as my testing is limited to what's currently in
> > the "Test Plan". I was not able to recreate the deadlock described
> > here, but it definitely makes sense.
> >
> > On Tue, Nov 12, 2024 at 1:02=E2=80=AFPM Cy Schubert  > com> wrote:
> > >
> > > In message <20241112155219.2e15a...@slippy.cwsent.com>, Cy Schubert write=
> > s:
> > > > In message <09923ad3-4065-4a31-b35f-74f84e09c...@freebsd.org>, John Bal=
> > dwin
> > > > wri
> > > > tes:
> > > > > On 11/11/24 19:47, Jose Luis Duran wrote:
> > > > > > The branch main has been updated by jlduran:
> > > > > >
> > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1fa6daaafd74c1a457dc=
> > fe26e0a5
> > > > 94
> > > > > 3b5441dc9d
> > > > > >
> > > > > > commit 1fa6daaafd74c1a457dcfe26e0a5943b5441dc9d
> > > > > > Author: Jose Luis Duran 
> > > > > > AuthorDate: 2024-11-02 17:58:59 +
> > > > > > Commit: Jose Luis Duran 
> > > > > > CommitDate: 2024-11-12 03:46:15 +
> > > > > >
> > > > > >  ipfilter: Avoid stopping with a lock held
> > > > > >
> > > > > >  Avoid calling _callout_stop_safe with a non-sleepable lock hel=
> > d when
> > > > > >  detaching by initializing callout_init_rw() with CALLOUT_SHARE=
> > DLOCK.
> > > > > >
> > > > > >  It avoids the following WITNESS warning when stopping the serv=
> > ice:
> > > > > >
> > > > > >  # service ipfilter stop
> > > > > >  calling _callout_stop_safe with the following non-sleepabl=
> > e lock
> > > > s
> > > > > held:
> > > > > >  shared rw ipf filter load/unload mutex (ipf filter load/un=
> > load m
> > > > ut
> > > > > ex) r =3D 0 (0x417c7530) locked @ /usr/src/sys/netpfil/ipfilt=
> > er/netin
> > > > et
> > > > > /fil.c:7926
> > > > > >  stack backtrace:
> > > > > >  #0 0x0052d394 at witness_debugger+0x60
> > > > > >  #1 0x0052e620 at witness_warn+0x404
> > > > > >  #2 0x004d4ffc at _callout_stop_safe+0x8c
> > > > > >  #3 0xf7236674 at ipfdetach+0x3c
> > > > > >  #4 0xf723fa4c at ipf_ipf_ioctl+0x788
> > > > > >  #5 0xf72367e0 at ipfioctl+0x144
> > > > > >  #6 0x0034abd8 at devfs_ioctl+0x100
> > > > > >  #7 0x005c66a0 at vn_ioctl+0xbc
> > > > > >  #8 0x0034b2cc at devfs_ioctl_f+0x24
> > > > > >  #9 0x005331ec at kern_ioctl+0x2e0
> > > > > >  #10 0x00532eb4 at sys_ioctl+0x140
> > > > > >  #11 0x00880480 at do_el0_sync+0x604
> > > > > >  #12 0x008579ac at handle_el0_sync+0x4c
> > > > > >
> > > > > >  PR: 282478
> > > > > >  Suggested by:   markj
> > > > > >  Reviewed by:cy
> > > > > >  Approved by:emaste (mentor)
> > > > > >  MFC after:  1 week
> > > > > > ---
> > > > > >   sys/netpfil/i

Re: git: 1fa6daaafd74 - main - ipfilter: Avoid stopping with a lock held

2024-11-12 Thread Jose Luis Duran
What would be the recommended approach in this case?
Revert, and commit with the fixes, or just fix the problematic code.

At any rate, I have created https://reviews.freebsd.org/D47530. Feel
free to commandeer it, as my testing is limited to what's currently in
the "Test Plan". I was not able to recreate the deadlock described
here, but it definitely makes sense.

On Tue, Nov 12, 2024 at 1:02 PM Cy Schubert  wrote:
>
> In message <20241112155219.2e15a...@slippy.cwsent.com>, Cy Schubert writes:
> > In message <09923ad3-4065-4a31-b35f-74f84e09c...@freebsd.org>, John Baldwin
> > wri
> > tes:
> > > On 11/11/24 19:47, Jose Luis Duran wrote:
> > > > The branch main has been updated by jlduran:
> > > >
> > > > URL: 
> > > > https://cgit.FreeBSD.org/src/commit/?id=1fa6daaafd74c1a457dcfe26e0a5
> > 94
> > > 3b5441dc9d
> > > >
> > > > commit 1fa6daaafd74c1a457dcfe26e0a5943b5441dc9d
> > > > Author: Jose Luis Duran 
> > > > AuthorDate: 2024-11-02 17:58:59 +
> > > > Commit: Jose Luis Duran 
> > > > CommitDate: 2024-11-12 03:46:15 +
> > > >
> > > >  ipfilter: Avoid stopping with a lock held
> > > >
> > > >  Avoid calling _callout_stop_safe with a non-sleepable lock held 
> > > > when
> > > >  detaching by initializing callout_init_rw() with 
> > > > CALLOUT_SHAREDLOCK.
> > > >
> > > >  It avoids the following WITNESS warning when stopping the service:
> > > >
> > > >  # service ipfilter stop
> > > >  calling _callout_stop_safe with the following non-sleepable 
> > > > lock
> > s
> > > held:
> > > >  shared rw ipf filter load/unload mutex (ipf filter load/unload 
> > > > m
> > ut
> > > ex) r = 0 (0x417c7530) locked @ 
> > > /usr/src/sys/netpfil/ipfilter/netin
> > et
> > > /fil.c:7926
> > > >  stack backtrace:
> > > >  #0 0x0052d394 at witness_debugger+0x60
> > > >  #1 0x0052e620 at witness_warn+0x404
> > > >  #2 0x004d4ffc at _callout_stop_safe+0x8c
> > > >  #3 0xf7236674 at ipfdetach+0x3c
> > > >  #4 0xf723fa4c at ipf_ipf_ioctl+0x788
> > > >  #5 0xf72367e0 at ipfioctl+0x144
> > > >  #6 0x0034abd8 at devfs_ioctl+0x100
> > > >  #7 0x005c66a0 at vn_ioctl+0xbc
> > > >  #8 0x0034b2cc at devfs_ioctl_f+0x24
> > > >  #9 0x005331ec at kern_ioctl+0x2e0
> > > >  #10 0x00532eb4 at sys_ioctl+0x140
> > > >  #11 0x00880480 at do_el0_sync+0x604
> > > >  #12 0x008579ac at handle_el0_sync+0x4c
> > > >
> > > >  PR: 282478
> > > >  Suggested by:   markj
> > > >  Reviewed by:cy
> > > >  Approved by:emaste (mentor)
> > > >  MFC after:  1 week
> > > > ---
> > > >   sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 4 ++--
> > > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c 
> > > > b/sys/netpfil/
> > ip
> > > filter/netinet/ip_fil_freebsd.c
> > > > index bcde0d2c7323..b3dea40c3d8c 100644
> > > > --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
> > > > +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
> > > > @@ -181,7 +181,7 @@ ipf_timer_func(void *arg)
> > > >   #if 0
> > > >   softc->ipf_slow_ch = timeout(ipf_timer_func, softc, 
> > > > hz/
> > 2);
> > > >   #endif
> > > > - callout_init(&softc->ipf_slow_ch, 1);
> > > > + callout_init_rw(&softc->ipf_slow_ch, 
> > > > &softc->ipf_global.ipf_lk,
> > >  CALLOUT_SHAREDLOCK);
> > > >   callout_reset(&softc->ipf_slow_ch,
> > > >   (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT,
> > > >   ipf_timer_func, softc);
> > > > @@ -221,7 +221,7 @@ ipfattach(ipf_main_softc_t *softc)
> > > >   softc->ipf_slow_ch = timeout(ipf_timer_func, softc,
> > > >(hz / IPF_HZ_DIVIDE) * 
> > &g

git: 22429a464a5f - main - committers-src: Add jlduran with emaste as mentor

2024-10-29 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=22429a464a5f4f6bb5a056aae1353985db83b721

commit 22429a464a5f4f6bb5a056aae1353985db83b721
Author: Jose Luis Duran 
AuthorDate: 2024-10-30 04:42:11 +
Commit: Jose Luis Duran 
CommitDate: 2024-10-30 04:42:11 +

committers-src: Add jlduran with emaste as mentor

Reviewed by:imp
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D47302
---
 share/misc/committers-src.dot | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot
index ee1bb79b3c0f..6e3464227ff2 100644
--- a/share/misc/committers-src.dot
+++ b/share/misc/committers-src.dot
@@ -225,6 +225,7 @@ jimharris [label="Jim 
Harris\njimhar...@freebsd.org\n2011/12/09"]
 jinmei [label="JINMEI Tatuya\njin...@freebsd.org\n2007/03/17"]
 jkim [label="Jung-uk Kim\nj...@freebsd.org\n2005/07/06"]
 jkoshy [label="A. Joseph Koshy\njko...@freebsd.org\n1998/05/13"]
+jlduran [label="Jose Luis Duran\njldu...@freebsd.org\n2024/09/05"]
 jlh [label="Jeremie Le Hen\n...@freebsd.org\n2012/04/22"]
 jls [label="Jordan Sissel\n...@freebsd.org\n2006/12/06"]
 jmcneill [label="Jared McNeill\njmcne...@freebsd.org\n2016/02/24"]
@@ -547,6 +548,7 @@ eivind -> rwatson
 emaste -> achim
 emaste -> bwidawsk
 emaste -> dteske
+emaste -> jlduran
 emaste -> kd
 emaste -> kevans
 emaste -> lwhsu



git: cdd3234186b1 - main - sound: Include ai2s and davbus for PowerPC

2024-11-09 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=cdd3234186b19e1b9d7cfc985ef8d247552b0f11

commit cdd3234186b19e1b9d7cfc985ef8d247552b0f11
Author: Jose Luis Duran 
AuthorDate: 2024-11-10 02:44:14 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-10 02:44:14 +

sound: Include ai2s and davbus for PowerPC

Include PowerPC ai2s and davbus sound modules in the metadriver.

Reviewed by:christos, emaste
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D47467
---
 sys/dev/sound/driver.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/sys/dev/sound/driver.c b/sys/dev/sound/driver.c
index 13218f419a28..c9219261e08f 100644
--- a/sys/dev/sound/driver.c
+++ b/sys/dev/sound/driver.c
@@ -55,6 +55,9 @@ static moduledata_t snd_mod = {
 DECLARE_MODULE(snd_driver, snd_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
 MODULE_VERSION(snd_driver, 1);
 
+#if defined(__powerpc__)
+MODULE_DEPEND(snd_driver, snd_ai2s, 1, 1, 1);
+#endif
 MODULE_DEPEND(snd_driver, snd_als4000, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_atiixp, 1, 1, 1);
 #if defined(__i386__) || defined(__amd64__)
@@ -63,6 +66,9 @@ MODULE_DEPEND(snd_driver, snd_cmi, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_cs4281, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_csa, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_csapcm, 1, 1, 1);
+#if defined(__powerpc__)
+MODULE_DEPEND(snd_driver, snd_davbus, 1, 1, 1);
+#endif
 MODULE_DEPEND(snd_driver, snd_emu10kx, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_envy24, 1, 1, 1);
 MODULE_DEPEND(snd_driver, snd_envy24ht, 1, 1, 1);



Re: git: bef05a753727 - main - rc.d/var_run: Fix typo in comment

2024-11-25 Thread Jose Luis Duran
On Mon, Nov 25, 2024 at 2:17 PM Cy Schubert  wrote:
>
> The branch main has been updated by cy:
>
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=bef05a753727fa28032e1b5a895c94b2ffaedd46
>
> commit bef05a753727fa28032e1b5a895c94b2ffaedd46
> Author: Cy Schubert 
> AuthorDate: 2024-11-25 17:10:13 +
> Commit: Cy Schubert 
> CommitDate: 2024-11-25 17:10:13 +
>
> rc.d/var_run: Fix typo in comment
> ---
>  libexec/rc/rc.d/var_run | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libexec/rc/rc.d/var_run b/libexec/rc/rc.d/var_run
> index 0dc37698ee76..b3d3c3c5b22f 100755
> --- a/libexec/rc/rc.d/var_run
> +++ b/libexec/rc/rc.d/var_run
> @@ -17,7 +17,7 @@ stop_cmd="_var_run_stop"
>
>  load_rc_config $name
>
> -# doesn't make sense to run in a svcj: config setting
> +# doesn't make sense to run in a svc: config setting

Hello Cy,
I believe the original "svcj" was correct. It stands for "service
jail" (https://www.freebsd.org/status/report-2023-04-2023-06/service-jails/).
Perhaps it should have been fully spelled out. Anyhow, a similar line
is present in a number of rc scripts (grep -B1 -r '_svcj="NO"').

>  var_run_svcj="NO"
>
>  _var_run_load() {

-- 
Jose Luis Duran



git: 87e87fecb139 - main - nanobsd: Remove dependency on bsdlabel

2024-11-20 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=87e87fecb139d60a00837f004de0d37dbecd205c

commit 87e87fecb139d60a00837f004de0d37dbecd205c
Author: Jose Luis Duran 
AuthorDate: 2024-11-18 00:16:50 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-20 22:31:56 +

nanobsd: Remove dependency on bsdlabel

The bsdlabel utility is deprecated, gpart should be used instead:

  - Offset the first 16 sectors, just like bsdlabel did (used for
metadata)
  - Use a freebsd-ufs partition type (regardless bsdlabel creating a
'!0')

Reviewed by:emaste, imp
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47653
---
 tools/tools/nanobsd/legacy.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh
index 58288d063b4a..a45b447337b2 100644
--- a/tools/tools/nanobsd/legacy.sh
+++ b/tools/tools/nanobsd/legacy.sh
@@ -116,14 +116,15 @@ create_code_slice ( ) (
 
trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || 
true ; mdconfig -d -u $MD" 1 2 15 EXIT
 
-   bsdlabel -w ${MD}
+   gpart create -s bsd "${MD}"
+   gpart add -t freebsd-ufs -b 16 "${MD}"
if [ -f ${NANO_WORLDDIR}/boot/boot ]; then
echo "Making bootable partition"
gpart bootcode -b ${NANO_WORLDDIR}/boot/boot ${MD}
else
echo "Partition will not be bootable"
fi
-   bsdlabel ${MD}
+   gpart list ${MD}
 
# Create first image
populate_slice /dev/${MD}${NANO_PARTITION_ROOT} ${NANO_WORLDDIR} ${MNT} 
"${NANO_ROOT}"



git: accf71534c61 - main - geom: Allow BSD type '!0' partitions

2024-11-20 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=accf71534c612b76ee2701f2dfcaa464748e527a

commit accf71534c612b76ee2701f2dfcaa464748e527a
Author: Jose Luis Duran 
AuthorDate: 2024-11-17 23:55:14 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-20 22:28:57 +

geom: Allow BSD type '!0' partitions

Allow the creation of '!0' partition types.

Fix it by not considering "0" an invalid partition type.

Reviewed by:emaste
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47652
---
 sys/geom/part/g_part_bsd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/geom/part/g_part_bsd.c b/sys/geom/part/g_part_bsd.c
index d6d1b7346d9b..51912bedbdc2 100644
--- a/sys/geom/part/g_part_bsd.c
+++ b/sys/geom/part/g_part_bsd.c
@@ -136,7 +136,7 @@ bsd_parse_type(const char *type, uint8_t *fstype)
 
if (type[0] == '!') {
lt = strtol(type + 1, &endp, 0);
-   if (type[1] == '\0' || *endp != '\0' || lt <= 0 || lt >= 256)
+   if (type[1] == '\0' || *endp != '\0' || lt < 0 || lt >= 256)
return (EINVAL);
*fstype = (u_int)lt;
return (0);



git: 4b8e65d12fd7 - main - mtree: Fix BSD.tests.dist sorting

2024-11-27 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4b8e65d12fd7c06c0f670bdb11815971c3bebfed

commit 4b8e65d12fd7c06c0f670bdb11815971c3bebfed
Author: Jose Luis Duran 
AuthorDate: 2024-11-24 01:49:16 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-27 16:10:10 +

mtree: Fix BSD.tests.dist sorting

Reviewed by:imp
Approved by:emaste (mentor)
Fixes:  60d717baf214 ("ctl: add some ATF tests for READ BUFFER")
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D47719
---
 etc/mtree/BSD.tests.dist | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index e9ba0f689678..7ea02758ca4c 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -545,6 +545,10 @@
 ..
 auditpipe
 ..
+cam
+ctl
+..
+..
 capsicum
 ..
 cddl
@@ -795,10 +799,6 @@
 ..
 compat32
 ..
-cam
-ctl
-..
-..
 devrandom
 ..
 dtrace



git: f08dfd819bf7 - main - mtree: Add missing entries in BSD.tests.dist

2024-11-27 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f08dfd819bf73a584bf90da268242a7ed483dc32

commit f08dfd819bf73a584bf90da268242a7ed483dc32
Author: Jose Luis Duran 
AuthorDate: 2024-11-27 16:06:06 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-27 16:10:45 +

mtree: Add missing entries in BSD.tests.dist

Reviewed by:emaste, christos
Approved by:emaste (mentor)
Fixes:  95eb4b873b6a ("sound tests: Add sndstat nvlist ATF test")
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D47724
---
 etc/mtree/BSD.tests.dist | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index 7ea02758ca4c..1762bbfb7bdc 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -949,6 +949,8 @@
 ..
 ses
 ..
+sound
+..
 sys
 ..
 vfs



git: 21ca690b5668 - main - ppp.8: Fix typo cuad0 -> cuau0

2024-11-18 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=21ca690b5668d6b19b93327da3d4a423ea183fe4

commit 21ca690b5668d6b19b93327da3d4a423ea183fe4
Author: Jose Luis Duran 
AuthorDate: 2024-11-05 04:07:07 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-19 01:04:20 +

ppp.8: Fix typo cuad0 -> cuau0

Fix a typo that was missed probably because it was capitalized.
Mark up with .Pa and fix capitalization.

Specify that cuaUX and cuauX are for USB and UART attachments
respectively.

- Silence most lint warnings
- Update outdated links
- Minor style fixes
- Some igor(1) warnings were ignored on purpose

PR: 248359
Reviewed by:imp, mhorne, Alexander Ziaee 

Approved by:emaste (mentor)
Fixes:  839f11a4fe18 ("A number of places in the source tree still 
reference cuad.* after sio(4) was deprecated by uart(4).")
MFC after:  1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1515
---
 usr.sbin/ppp/ppp.8 | 47 ---
 1 file changed, 28 insertions(+), 19 deletions(-)

diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8
index 95b833c73c5c..9242a9c337a0 100644
--- a/usr.sbin/ppp/ppp.8
+++ b/usr.sbin/ppp/ppp.8
@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd June 27, 2022
+.Dd November 18, 2024
 .Dt PPP 8
 .Os
 .Sh NAME
@@ -263,7 +263,8 @@ will force it to exit.
 .It Supports client callback.
 .Nm
 can use either the standard LCP callback protocol or the Microsoft
-CallBack Control Protocol 
(https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CBCP/[MS-CBCP].pdf).
+CallBack Control Protocol
+.Pq Lk 
https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/MS-CBCP/%5bMS-CBCP%5d.pdf
 .
 .It Supports NAT or packet aliasing.
 Packet aliasing (a.k.a.\& IP masquerading) allows computers on a
 private, unregistered network to access the Internet.
@@ -339,7 +340,7 @@ to check the packet flow over the
 link.
 .It Supports PPP over TCP and PPP over UDP.
 If a device name is specified as
-.Em host Ns No : Ns Em port Ns
+.Em host : Ns Em port Ns
 .Xo
 .Op / Ns tcp|udp ,
 .Xc
@@ -353,7 +354,7 @@ into synchronous mode.
 If
 .Nm
 is given a device specification of the format
-.No PPPoE: Ns Ar iface Ns Xo
+.No PPPoE\&: Ns Ar iface Ns Xo
 .Op \&: Ns Ar provider Ns
 .Xc
 and if
@@ -2166,13 +2167,22 @@ set device /dev/cuau0
 set speed 115200
 .Ed
 .Pp
-Cuad0 is the first serial port on
-.Fx .
+.Pa cuaU0
+and
+.Pa cuau0
+are the first
+.Xr usb 4
+and
+.Xr uart 4
+serial ports found by
+.Fx ,
+respectively.
 If you are running
 .Nm
 on
 .Ox ,
-cua00 is the first.
+.Pa cua00
+is the first.
 A speed of 115200 should be specified
 if you have a modem capable of bit rates of 28800 or more.
 In general, the serial speed should be about four times the modem speed.
@@ -2734,7 +2744,7 @@ Default: Disabled and Denied.
 This option allows DNS negotiation.
 .Pp
 If
-.Dq enable Ns No d,
+.Dq enable Ns No d ,
 .Nm
 will request that the peer confirms the entries in
 .Pa /etc/resolv.conf .
@@ -2743,7 +2753,7 @@ If the peer NAKs our request (suggesting new IP numbers),
 is updated and another request is sent to confirm the new entries.
 .Pp
 If
-.Dq accept Ns No ed,
+.Dq accept Ns No ed ,
 .Nm
 will answer any DNS queries requested by the peer rather than rejecting
 them.
@@ -3446,8 +3456,7 @@ This command gives a summary of available nat commands.
 This option causes various NAT statistics and information to
 be logged to the file
 .Pa /var/log/alias.log .
-.It nat port Ar proto Ar targetIP Ns Xo
-.No : Ns Ar targetPort Ns
+.It nat port Ar proto Ar targetIP Ns Xo : Ns Ar targetPort Ns
 .Oo
 .No - Ns Ar targetPort
 .Oc Ar aliasPort Ns
@@ -4390,8 +4399,8 @@ This is required (in addition to one or more other 
callback
 options) if you wish callback to be optional.
 .El
 .It set cbcp Oo
-.No *| Ns Ar number Ns Oo
-.No , Ns Ar number Ns ...\& Oc
+.No *| Ns Ar number Ns
+.Oo , Ns Ar number Ns ...\& Oc
 .Op Ar delay Op Ar retry
 .Oc
 If no arguments are given, CBCP (Microsoft's CallBack Control Protocol)
@@ -4403,7 +4412,7 @@ requesting no callback in the CBCP phase.
 Otherwise,
 .Nm
 attempts to use the given phone
-.Ar number Ns No (s).
+.Ar number Ns No (s) .
 .Pp
 In server mode
 .Pq Fl direct ,
@@ -4421,7 +4430,7 @@ is specified,
 .Nm
 will expect the peer to specify the number.
 .It set cd Oo
-.No off| Ns Ar seconds Ns Op !\&
+.No off\&| Ns Ar seconds Ns Op !\&
 .Oc
 Normally,
 .Nm
@@ -4578,7 +4587,7 @@ does not begin with
 it must either begin with an exclamation mark
 .Pq Dq !\& ,
 be of the format
-.No PPPoE: Ns Ar iface Ns Xo
+.No PPPoE\&: Ns Ar iface Ns Xo
 .Op \&: Ns Ar provider Ns
 .Xc
 (on
@@ -4596,7 +4605,7 @@ Standard input, output and error are fed back to
 and are read and

Re: git: 62e6ca0f07e4 - main - ps(1): clean up after swapout removal

2024-11-13 Thread Jose Luis Duran
or the process to exec or exit.
> -.It Li W
> -The process is swapped out.
>  .It Li X
>  The process is being traced or debugged.
>  .El
> diff --git a/bin/ps/ps.c b/bin/ps/ps.c
> index b0af2bdf37ca..49c69bb76084 100644
> --- a/bin/ps/ps.c
> +++ b/bin/ps/ps.c
> @@ -68,14 +68,6 @@
>  #defineW_SEP   " \t"   /* "Whitespace" list separators */
>  #defineT_SEP   "," /* "Terminate-element" list 
> separators */
>
> -#ifdef LAZY_PS
> -#defineDEF_UREAD   0
> -#defineOPT_LAZY_f  "f"
> -#else
> -#defineDEF_UREAD   1   /* Always do the more-expensive read. 
> */
> -#defineOPT_LAZY_f  /* I.e., the `-f' option is not 
> added. */
> -#endif
> -
>  /*
>   * isdigit takes an `int', but expects values in the range of unsigned char.
>   * This wrapper ensures that values from a 'char' end up in the correct 
> range.
> @@ -92,7 +84,6 @@ intshowthreads;   /* will threads be shown? */
>
>  struct velisthead varlist = STAILQ_HEAD_INITIALIZER(varlist);
>
> -static int  forceuread = DEF_UREAD; /* Do extra work to get u-area. */
>  static kvm_t   *kd;
>  static int  needcomm;  /* -o "command" */
>  static int  needenv;   /* -e */
> @@ -154,7 +145,7 @@ static char vfmt[] = 
> "pid,state,time,sl,re,pagein,vsz,rss,lim,tsiz,"
> "%cpu,%mem,command";
>  static char Zfmt[] = "label";
>
> -#definePS_ARGS "AaCcD:de" OPT_LAZY_f 
> "G:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ"
> +#definePS_ARGS "AaCcD:defG:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ"
>
>  int
>  main(int argc, char *argv[])
> @@ -272,12 +263,9 @@ main(int argc, char *argv[])
> case 'e':   /* XXX set ufmt */
> needenv = 1;
> break;
> -#ifdef LAZY_PS
> case 'f':
> -   if (getuid() == 0 || getgid() == 0)
> -   forceuread = 1;
> +   /* compat */
> break;
> -#endif
> case 'G':
> add_list(&gidlist, optarg);
> xkeep_implied = 1;
> @@ -1276,31 +1264,21 @@ fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, 
> int), KINFO *ki,
> return (s);
>  }
>
> -#define UREADOK(ki)(forceuread || (ki->ki_p->ki_flag & P_INMEM))
> -
>  static void
>  saveuser(KINFO *ki)
>  {
> char tdname[COMMLEN + 1];
> char *argsp;
>
> -   if (ki->ki_p->ki_flag & P_INMEM) {
> -   /*
> -* The u-area might be swapped out, and we can't get
> -* at it because we have a crashdump and no swap.
> -* If it's here fill in these fields, otherwise, just
> -* leave them 0.
> -*/
> -   ki->ki_valid = 1;
> -   } else
> -   ki->ki_valid = 0;
> +   ki->ki_valid = 1;
> +
> /*
>  * save arguments if needed
>  */
> if (needcomm) {
> if (ki->ki_p->ki_stat == SZOMB) {
> ki->ki_args = strdup("");
> -   } else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) {

Apparently this is missing an explicit check of ki->ki_p->ki_flag,
causing the processes in square brackets be printed within
parentheses, that is, taking the else path below, and making test:
https://ci.freebsd.org/view/Test/job/FreeBSD-main-amd64-test/lastCompletedBuild/testReport/bin.pkill/pgrep-_s_test/main/
fail.
I have already sent a message via Phabricator, but I am unsure if it
has visibility there after the commit.
I apologize if this is something that's already known.
Thank you!

> +   } else if (ki->ki_p->ki_args != NULL) {
> (void)snprintf(tdname, sizeof(tdname), "%s%s",
> ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname);
> ki->ki_args = fmt(kvm_getargv, ki,
> @@ -1315,11 +1293,8 @@ saveuser(KINFO *ki)
> ki->ki_args = NULL;
> }
> if (needenv) {
> -   if (UREADOK(ki))
> -   ki->ki_env = fmt(kvm_getenvv, ki,
> -   (char *)NULL, (char *)NULL, 0);
> -   else
> -   ki->ki_env = strdup("()");
> +   ki->ki_env = fmt(kvm_getenvv, ki, (char *)NULL,
> +   (char *)NULL, 0);
> if (ki->ki_env == NULL)
> xo_errx(1, "malloc failed");
> } else {
> @@ -1479,7 +1454,7 @@ pidmax_init(void)
>  static void __dead2
>  usage(void)
>  {
> -#defineSINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]"
> +#defineSINGLE_OPTS "[-aCcdeHhjlmrSTuvwXxZ]"
>
> xo_error("%s\n%s\n%s\n%s\n%s\n",
> "usage: ps [--libxo] " SINGLE_OPTS " [-O fmt | -o fmt]",

-- 
Jose Luis Duran



git: 3c5d19a40de7 - main - nanobsd: Fix parallel make

2024-11-15 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=3c5d19a40de7273bb478163639dd8532af425595

commit 3c5d19a40de7273bb478163639dd8532af425595
Author: Jose Luis Duran 
AuthorDate: 2024-11-07 14:32:01 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-16 06:55:25 +

nanobsd: Fix parallel make

The NANO_NCPU (number of CPUs) value gets ignored by the build script
when setting the NANO_PMAKE (parallel make) value.

Fix it by setting the NANO_PMAKE later in the process.

PR: 277269
Reviewed by:imp, emaste
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47476
---
 tools/tools/nanobsd/defaults.sh | 5 -
 tools/tools/nanobsd/nanobsd.sh  | 4 
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 54e10ba74550..910ec69865df 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -67,7 +67,6 @@ NANO_PKG_META_BASE=/var/db
 # Make & parallel Make
 NANO_MAKE="make"
 NANO_NCPU=$(sysctl -n hw.ncpu)
-NANO_PMAKE="make -j $NANO_NCPU"
 
 # The default name for any image we create.
 NANO_IMGNAME="_.disk.full"
@@ -892,6 +891,10 @@ set_defaults_and_export ( ) {
: ${NANO_DISKIMGDIR:=${NANO_OBJ}}
: ${NANO_WORLDDIR:=${NANO_OBJ}/_.w}
: ${NANO_LOG:=${NANO_OBJ}}
+   : ${NANO_PMAKE:="${NANO_MAKE} -j ${NANO_NCPU}"}
+   if ! $do_clean; then
+   NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN"
+   fi
NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build
NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install
 
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh
index af03d89acece..4c390d8ca371 100755
--- a/tools/tools/nanobsd/nanobsd.sh
+++ b/tools/tools/nanobsd/nanobsd.sh
@@ -156,10 +156,6 @@ if [ ! -d "${NANO_TOOLS}" ]; then
exit 1
 fi
 
-if ! $do_clean; then
-   NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN"
-fi
-
 pprint 1 "NanoBSD image ${NANO_NAME} build starting"
 
 run_early_customize



git: 999f288a0eeb - main - nanobsd: Add missing options to usage()

2024-11-15 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=999f288a0eeb230d3655da94c1186ca03c0cc404

commit 999f288a0eeb230d3655da94c1186ca03c0cc404
Author: Jose Luis Duran 
AuthorDate: 2024-11-07 14:16:50 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-16 06:54:58 +

nanobsd: Add missing options to usage()

-B suppress installs (both kernel and world)
-I build disk image from existing build/install
-W suppress installworld

PR: 277269
Reviewed by:imp, emaste
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47475
---
 tools/tools/nanobsd/defaults.sh | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 165c967de807..54e10ba74550 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -852,17 +852,20 @@ pprint ( ) (
 
 usage ( ) {
(
-   echo "Usage: $0 [-bfhiKknqvwX] [-c config_file]"
+   echo "Usage: $0 [-BbfhIiKknqvWwX] [-c config_file]"
+   echo "  -B  suppress installs (both kernel and world)"
echo "  -b  suppress builds (both kernel and world)"
echo "  -c  specify config file"
echo "  -f  suppress code slice extraction (implies -i)"
echo "  -h  print this help summary page"
+   echo "  -I  build disk image from existing build/install"
echo "  -i  suppress disk image build"
echo "  -K  suppress installkernel"
echo "  -k  suppress buildkernel"
echo "  -n  add -DNO_CLEAN to buildworld, buildkernel, etc"
echo "  -q  make output more quiet"
echo "  -v  make output more verbose"
+   echo "  -W  suppress installworld"
echo "  -w  suppress buildworld"
echo "  -X  make native-xtools"
) 1>&2



git: 12cbad923dbc - main - nanobsd: Fix typos

2024-11-15 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=12cbad923dbcccb3d6f71a77ad3241508f186048

commit 12cbad923dbcccb3d6f71a77ad3241508f186048
Author: Jose Luis Duran 
AuthorDate: 2024-11-15 04:54:09 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-16 07:11:16 +

nanobsd: Fix typos

Fix a number of typos in the code or comments.
Files under dhcpd, embedded, pcengines, and rescue were intentionally
omitted. These directories will be reviewed at a later date.

PR: 269884
Reviewed by:imp, zlei
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47587
---
 tools/tools/nanobsd/Files/root/save_cfg |  2 +-
 tools/tools/nanobsd/defaults.sh | 10 +-
 tools/tools/nanobsd/fill_pkg.sh |  2 +-
 tools/tools/nanobsd/mtree-dedup.awk |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/tools/nanobsd/Files/root/save_cfg 
b/tools/tools/nanobsd/Files/root/save_cfg
index 1931e5c79923..24f812197a68 100644
--- a/tools/tools/nanobsd/Files/root/save_cfg
+++ b/tools/tools/nanobsd/Files/root/save_cfg
@@ -62,7 +62,7 @@ do
# Add to cfg (y/n/i)?
#   y) -> save this file in /cfg
#   n) -> do not save this file in /cfg for current 
script invocation ONLY
-   #   i) -> add file to ignore list (/cfg/.ignore 
hiereachy) and never save
+   #   i) -> add file to ignore list (/cfg/.ignore 
hierarchy) and never save
# try to add this file to /cfg.
#
# touch is used to add files to /cfg to keep the script 
flow straight and easy
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 5cb137a1db94..4ba35ffeb04d 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -497,10 +497,10 @@ run_late_customize ( ) (
 # a user's cfg file would override this.
 #
 fixup_before_diskimage ( ) (
-   # Run the deduplication script that takes the matalog journal and
+   # Run the deduplication script that takes the metalog journal and
# combines multiple entries for the same file (see source for
# details). We take the extra step of removing the size keywords. This
-   # script, and many of the user scripts, copies, appeneds and otherwise
+   # script, and many of the user scripts, copies, appends and otherwise
# modifies files in the build, changing their sizes.  These actions are
# impossible to trap, so go ahead remove the size= keyword. For this
# narrow use, it doesn't buy us any protection and just gets in the way.
@@ -814,7 +814,7 @@ cust_pkgng ( ) (
CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}"
 
(
-   # Expand any glob characters in pacakge list
+   # Expand any glob characters in package list
cd "${NANO_PACKAGE_DIR}"
_PKGS=`find ${NANO_PACKAGE_LIST} -not -name 
"${_NANO_PKG_PACKAGE}" -print | sort | uniq`
 
@@ -905,7 +905,7 @@ usage ( ) {
 # Setup and Export Internal variables
 #
 
-export_var ( ) {   # Don't wawnt a subshell
+export_var ( ) {   # Don't want a subshell
var=$1
# Lookup value of the variable.
eval val=\$$var
@@ -914,7 +914,7 @@ export_var ( ) {# Don't wawnt a subshell
 }
 
 # Call this function to set defaults _after_ parsing options.
-# dont want a subshell otherwise variable setting is thrown away.
+# don't want a subshell otherwise variable setting is thrown away.
 set_defaults_and_export ( ) {
: 
${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}${NANO_LAYOUT:+.${NANO_LAYOUT}}}
: ${MAKEOBJDIRPREFIX:=${NANO_OBJ}}
diff --git a/tools/tools/nanobsd/fill_pkg.sh b/tools/tools/nanobsd/fill_pkg.sh
index 6734498350a9..17d163709f91 100644
--- a/tools/tools/nanobsd/fill_pkg.sh
+++ b/tools/tools/nanobsd/fill_pkg.sh
@@ -160,7 +160,7 @@ for i in `cat "$PL"` ; do
if [ -f "$NANO_PKG_DUMP/$i.pkg" ] ; then
$COPY "$NANO_PKG_DUMP/$i.pkg" "$NANO_PKG_DIR"
else
-   echo "Package $i misssing in $NANO_PKG_DUMP" 1>&2
+   echo "Package $i missing in $NANO_PKG_DUMP" 1>&2
exit 1
fi
 done
diff --git a/tools/tools/nanobsd/mtree-dedup.awk 
b/tools/tools/nanobsd/mtree-dedup.awk
index e30f3100b4da..8840047f5318 100755
--- a/tools/tools/nanobsd/mtree-dedup.awk
+++ b/tools/tools/nanobsd/mtree-dedup.awk
@@ -84,7 +84,7 @@ function mtree_from_kvs(path, kvs)
return lv;
 }
 
-# Parse the mtree line into path + KVs. Use a sentinal value
+# Parse the mtree line into path + KVs. Use a sentinel value
 # for a bare keyword, which is extremely unlikely to be used
 # for real.
 function line2kv(kvs, str)



git: 4db04f5e3a9b - main - nanobsd: Update fill_pkg.sh

2024-11-15 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4db04f5e3a9bd927ba1173bf8d3b6a70178eab5f

commit 4db04f5e3a9bd927ba1173bf8d3b6a70178eab5f
Author: Jose Luis Duran 
AuthorDate: 2024-11-12 07:33:12 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-16 07:01:27 +

nanobsd: Update fill_pkg.sh

fill_pkg.sh is a script that links a package and its dependencies from a
"package dump" directory (like /usr/ports/packages/All) to a specified
directory (NANO_PACKAGE_DIR), for cust_pkgng()[*].

Update the script by:

- Using `make package-name` instead of `make -V pkgname`
- Looking for package files with *.pkg instead of *.txz
- Adding a -c option that copies the files instead of linking them[*]

[*] After 9af130ae8c03 cust_pkgng() cannot be used with a directory
populated by fill_pkg.sh, because it uses a nullfs mount, which doesn't
follow symlinks, therefore the links inside NANO_PACKAGE_DIR will not
work.

PR: 269884
Reviewed by:imp
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47531
---
 tools/tools/nanobsd/fill_pkg.sh | 32 +---
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/tools/tools/nanobsd/fill_pkg.sh b/tools/tools/nanobsd/fill_pkg.sh
index 2869122c5fbf..6734498350a9 100644
--- a/tools/tools/nanobsd/fill_pkg.sh
+++ b/tools/tools/nanobsd/fill_pkg.sh
@@ -27,16 +27,16 @@
 #
 #
 # Usage:
-#  $0 PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar [package.txz]...
+#  $0 [-cv] PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar 
[package.pkg]...
 #
-# Will symlink the packages listed, including their runtime dependencies,
+# Will symlink/copy the packages listed, including their runtime dependencies,
 # from the PACKAGE_DUMP to the NANO_PACKAGE_DIR.
 #
 
 : ${PORTSDIR:=/usr/ports}
 
 usage () {
-   echo "Usage: $0 [-v] package-dump-dir nano-package-dir port-dir-or-pkg 
..." 1>&2
+   echo "Usage: $0 [-cv] package-dump-dir nano-package-dir port-dir-or-pkg 
..." 1>&2
exit 2
 }
 
@@ -53,29 +53,29 @@ ports_recurse() (
for p do
if [ -d "$p" -a -f "$p/Makefile" ] ; then
msg 3 "$p: full path to port"
-   pkgname=`cd "$p" && make -V pkgname`
+   pkgname=`cd "$p" && make package-name`
type=port
fullpath=$p
elif [ -d "${PORTSDIR}/$p" -a -f "${PORTSDIR}/$p/Makefile" ] ; 
then
msg 3 "$p: path to port relative to ${PORTSDIR}}"
-   pkgname=`cd "${PORTSDIR}/$p" && make -V pkgname`
+   pkgname=`cd "${PORTSDIR}/$p" && make package-name`
type=port
fullpath=${PORTSDIR}/$p
-   elif [ "${p%.txz}" != "$p" -a -f "$p" ] && pkg info -F "$p" > 
/dev/null 2>&1 ; then
+   elif [ "${p%.pkg}" != "$p" -a -f "$p" ] && pkg info -F "$p" > 
/dev/null 2>&1 ; then
msg 3 "$p: full package file name"
-   pkgname=`basename "$p" | sed 's/\.txz$//I'`
+   pkgname=`basename "$p" | sed 's/\.pkg$//I'`
type=pkg
fullpath=$p
-   elif [ "${p%.txz}" != "$p" -a -f "$dumpdir/$p" ] && pkg info -F 
"$dumpdir/$p" > /dev/null 2>&1 ; then
+   elif [ "${p%.pkg}" != "$p" -a -f "$dumpdir/$p" ] && pkg info -F 
"$dumpdir/$p" > /dev/null 2>&1 ; then
msg 3 "$p: package file name relative to $dumpdir"
-   pkgname=`basename "$p" | sed 's/\.txz$//I'`
+   pkgname=`basename "$p" | sed 's/\.pkg$//I'`
type=pkg
fullpath=$dumpdir/$p
-   elif [ -f "$dumpdir/$p.txz" ] && pkg info -F "$dumpdir/$p.txz" 
> /dev/null 2>&1 ; then
+   elif [ -f "$dumpdir/$p.pkg" ] && pkg info -F "$dumpdir/$p.pkg" 
> /dev/null 2>&1 ; then
msg 3 "$p: package name relative to $dumpdir"
pkgname=`basename "$p"`
type=pkg
-   fullpath=$dumpdir/$p.txz
+   fullpath=$dumpdir/$p.pk

git: 4223c668e4b9 - main - nanobsd: Use the real path for NANO_PACKAGE_DIR

2024-11-15 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4223c668e4b9ba71e2c6cfabbd66795729b7ff8b

commit 4223c668e4b9ba71e2c6cfabbd66795729b7ff8b
Author: Jose Luis Duran 
AuthorDate: 2024-11-12 20:17:14 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-16 07:06:14 +

nanobsd: Use the real path for NANO_PACKAGE_DIR

As users may have the Pkg directory as a symbolic link to the NanoBSD
"package dump directory".  In commit 9af130ae8c03, cust_pkgng() was
greatly improved, however as a side effect of using a nullfs mount, the
directories and files must not be symlinks.

Fix it by using NANO_PACKAGE_DIR realpath().

PR: 269884
Reviewed by:imp
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47532
---
 tools/tools/nanobsd/defaults.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 0161a8ab8fd3..1e38a07337c7 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -788,6 +788,7 @@ cust_pkgng ( ) (
fi
 
# If the package directory doesn't exist, we're done.
+   NANO_PACKAGE_DIR="$(realpath $NANO_PACKAGE_DIR)"
if [ ! -d ${NANO_PACKAGE_DIR} ]; then
echo "DONE 0 packages"
return 0



git: 0f7b0db5dd07 - main - nanobsd: Fix cust_comconsole search patterns

2024-11-15 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0f7b0db5dd07e7c48285db4cac19e15fc9a42622

commit 0f7b0db5dd07e7c48285db4cac19e15fc9a42622
Author: Jose Luis Duran 
AuthorDate: 2024-11-15 04:28:01 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-16 07:08:24 +

nanobsd: Fix cust_comconsole search patterns

The current patterns are outdated, and may produce "offifexists", after
e310437971b8 ("For video consoles, only launch a getty if the device
exists.").

Fix the expressions to:

1. Disable getty(8) on the virtual syscons(4) or vt(4) terminals
   (/dev/ttyv*).
2. Enable the use of the first serial port as the system console.

Reviewed by:imp
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47586
---
 tools/tools/nanobsd/defaults.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 1e38a07337c7..5cb137a1db94 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -742,10 +742,10 @@ UsbDevice ( ) {
 
 cust_comconsole ( ) (
# Enable getty on console
-   sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys
+   sed -i "" -e '/^tty[du]0/s/off/onifconsole/' ${NANO_WORLDDIR}/etc/ttys
 
-   # Disable getty on syscons devices
-   sed -i "" -e '/^ttyv[0-8]/s/on/ off/' ${NANO_WORLDDIR}/etc/ttys
+   # Disable getty on syscons or vt devices
+   sed -i "" -E '/^ttyv[0-8]/s/\ton(ifexists)?/\toff/' 
${NANO_WORLDDIR}/etc/ttys
 
# Tell loader to use serial console early.
echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config



git: f6f311d8cdac - main - nanobsd.8: Chase usage string updates

2024-11-16 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f6f311d8cdacdc964967e83c8f6377d8465806d5

commit f6f311d8cdacdc964967e83c8f6377d8465806d5
Author: Jose Luis Duran 
AuthorDate: 2024-11-10 06:50:07 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-16 06:58:41 +

nanobsd.8: Chase usage string updates

Update the manual page for NanoBSD to match its usage.

Reviewed by:emaste, imp
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47505
---
 share/man/man8/nanobsd.8 | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/share/man/man8/nanobsd.8 b/share/man/man8/nanobsd.8
index 140a63b3d2f3..2ba072541ada 100644
--- a/share/man/man8/nanobsd.8
+++ b/share/man/man8/nanobsd.8
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 19, 2016
+.Dd November 10, 2024
 .Dt NANOBSD 8
 .Os
 .Sh NAME
@@ -31,7 +31,7 @@
 applications
 .Sh SYNOPSIS
 .Nm
-.Op Fl bfhiKknqvwX
+.Op Fl BbfhIiKknqvWwX
 .Op Fl c Ar config-file
 .Sh DESCRIPTION
 The
@@ -47,6 +47,8 @@ installation and maintenance.
 .Pp
 The following options are available:
 .Bl -tag -width ".Fl c Ar config-file" -offset indent
+.It Fl B
+Skip the install stages (both for kernel and world).
 .It Fl b
 Skip the build stages (both for kernel and world).
 .It Fl c Ar config-file
@@ -55,6 +57,8 @@ Specify the configuration file to use.
 Skip the code slice extraction.
 .It Fl h
 Display usage information.
+.It Fl I
+Build the disk image from an existing build/install.
 .It Fl i
 Skip the disk image build stage.
 .It Fl K
@@ -75,13 +79,17 @@ used for each build stage (world and kernel).
 Make output more quiet.
 .It Fl v
 Make output more verbose.
+.It Fl W
+Skip the
+.Cm installworld
+stage of the build.
 .It Fl w
 Skip the
 .Cm buildworld
 stage of the build.
 .It Fl X
 Make
-.Cm native-xtools.
+.Cm native-xtools .
 .El
 .Pp
 The features of



git: e5579f98c02f - main - nanobsd: Avoid read-only file system warnings

2024-11-16 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e5579f98c02ff64b0c305f6731c3557ba69c2d25

commit e5579f98c02ff64b0c305f6731c3557ba69c2d25
Author: Jose Luis Duran 
AuthorDate: 2024-11-08 18:13:48 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-16 06:55:57 +

nanobsd: Avoid read-only file system warnings

The default setting of some loader or rc variables generate warnings
because the file system is read-only:

Set the following options to avoid printing these warnings:

/boot/defaults/loader.conf:

- hostuuid_load="NO" to disable loading /etc/hostid early at boot time
- entropy_cache_load="NO" to disable loading cached entropy at boot time
- kern.random.initial_seeding.disable_bypass_warnings="1" to disable
  logging a warning if the 'bypass_before_seeding' knob is enabled
  (enabled by default) and a request is submitted prior to initial
  seeding

/etc/defaults/rc.conf:

- kldxref_enable="NO" to disable building linker.hints files with
  kldxref(8)
- entropy_boot_file="NO" to disable very early (used at early boot-time)
  entropy caching through reboots
- entropy_dir="NO" to disable caching entropy via cron

While here, move rc.conf options before sourcing vendor.conf, so they
can be overridden.

PR: 277601
Reviewed by:imp
Approved by:emaste (mentor)
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D47502
---
 tools/tools/nanobsd/defaults.sh | 41 +++--
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 910ec69865df..0161a8ab8fd3 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -570,13 +570,42 @@ setup_nanobsd_etc ( ) (
# create diskless marker file
touch etc/diskless
 
-   [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf
-
-   # Make root filesystem R/O by default
-   echo "root_rw_mount=NO" >> etc/defaults/rc.conf
-   # Disable entropy file, since / is read-only /var/db/entropy should be 
enough?
-   echo "entropy_file=NO" >> etc/defaults/rc.conf
+   [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 boot/defaults/loader.conf
+   {
+   echo
+   echo '###  NanoBSD configuration  
##'
+   echo 'hostuuid_load="NO"'
+   echo 'entropy_cache_load="NO"   # Disable loading 
cached entropy at boot time.'
+   echo 'kern.random.initial_seeding.disable_bypass_warnings="1"   
# Do not log a warning'
+   echo "  # if the 
'bypass_before_seeding' knob is enabled"
+   echo "  # and a request is submitted 
prior to initial"
+   echo "  # seeding."
+   } >> boot/defaults/loader.conf
+   [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 boot/defaults/loader.conf
 
+   [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf
+   if ! ed -s etc/defaults/rc.conf <<\EOF
+/^### Define source_rc_confs, the mechanism used by \/etc\/rc\.\* ##$/i
+###  NanoBSD options  
+##
+
+kldxref_enable="NO"# Disable building linker.hints files with kldxref(8).
+root_rw_mount="NO" # Inhibit remounting root read-write.
+entropy_boot_file="NO" # Disable very early (used at early boot time)
+   # entropy caching through reboots.
+entropy_file="NO"  # Disable late (used when going multi-user)
+   # entropy through reboots.
+entropy_dir="NO"   # Disable caching entropy via cron.
+
+##
+.
+w
+q
+EOF
+   then
+   echo "Regular expression pattern not found"
+   exit 2
+   fi
[ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf
 
# save config file for scripts



git: bccaf0262dca - main - libopencsd: Remove extra slashes

2025-02-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=bccaf0262dcab84be49c42cc6b7a81c279c44b62

commit bccaf0262dcab84be49c42cc6b7a81c279c44b62
Author: Jose Luis Duran 
AuthorDate: 2025-02-04 14:15:37 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-04 14:15:37 +

libopencsd: Remove extra slashes

Remove extra slashes that end up in the metalog.  These double slashes
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.

For example, consider the following metalog excerpt:

./base/aaa type=dir
./base//aaa/bbb type=dir

If sorted, would turn out:

./base//aaa/bbb type=dir
./base/aaa type=dir

Apparently missing the ./base/aaa directory in the specification.

Luckily here are no subdirectories.

Reviewed by:imp, emaste
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D48779
---
 lib/libopencsd/Makefile | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/libopencsd/Makefile b/lib/libopencsd/Makefile
index aae0b795c216..649e756eacf6 100644
--- a/lib/libopencsd/Makefile
+++ b/lib/libopencsd/Makefile
@@ -121,7 +121,7 @@ APIINCS=\
ocsd_c_api_types.h  \
opencsd_c_api.h
 
-APIINCSDIR=${INCLUDEDIR}/opencsd/c_api/
+APIINCSDIR=${INCLUDEDIR}/opencsd/c_api
 
 ETEINCS=   \
ete_decoder.h   \
@@ -129,7 +129,7 @@ ETEINCS=\
trc_dcd_mngr_ete.h  \
trc_pkt_types_ete.h
 
-ETEINCSDIR=${INCLUDEDIR}/opencsd/ete/
+ETEINCSDIR=${INCLUDEDIR}/opencsd/ete
 
 ETMV4INCS= \
etmv4_decoder.h \
@@ -142,7 +142,7 @@ ETMV4INCS=  \
trc_pkt_proc_etmv4i.h   \
trc_pkt_types_etmv4.h
 
-ETMV4INCSDIR=${INCLUDEDIR}/opencsd/etmv4/
+ETMV4INCSDIR=${INCLUDEDIR}/opencsd/etmv4
 
 ETMV3INCS= \
etmv3_decoder.h \
@@ -153,7 +153,7 @@ ETMV3INCS=  \
trc_pkt_proc_etmv3.h\
trc_pkt_types_etmv3.h
 
-ETMV3INCSDIR=${INCLUDEDIR}/opencsd/etmv3/
+ETMV3INCSDIR=${INCLUDEDIR}/opencsd/etmv3
 
 PTMINCS=   \
ptm_decoder.h   \
@@ -164,7 +164,7 @@ PTMINCS=\
trc_pkt_proc_ptm.h  \
trc_pkt_types_ptm.h
 
-PTMINCSDIR=${INCLUDEDIR}/opencsd/ptm/
+PTMINCSDIR=${INCLUDEDIR}/opencsd/ptm
 
 STMINCS=   \
stm_decoder.h   \
@@ -175,7 +175,7 @@ STMINCS=\
trc_pkt_proc_stm.h  \
trc_pkt_types_stm.h
 
-STMINCSDIR=${INCLUDEDIR}/opencsd/stm/
+STMINCSDIR=${INCLUDEDIR}/opencsd/stm
 
 INCSGROUPS=INCS APIINCS ETEINCS ETMV3INCS ETMV4INCS PTMINCS STMINCS
 



git: 88d448ec815c - main - mk: Move vm stack test debug symbols

2025-02-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=88d448ec815c1fda27be94846f88ccd96251febd

commit 88d448ec815c1fda27be94846f88ccd96251febd
Author: Jose Luis Duran 
AuthorDate: 2025-02-04 14:47:24 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-04 14:47:24 +

mk: Move vm stack test debug symbols

Avoid the creation of a /usr/tests/sys/vm/stack/.debug directory by
placing sys/vm/stack test debug symbols under /usr/lib/debug.

Reviewed by:emaste
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D48796
---
 ObsoleteFiles.inc   | 3 +++
 share/mk/bsd.lib.mk | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index e17ca9608cca..aff94af72c17 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -51,6 +51,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20250204: sys/vm/stack test symbols moved to /usr/lib/debug
+OLD_DIRS+=usr/tests/sys/vm/stack/.debug
+
 # 20250129: libdevinfo bumped to version 7
 OLD_LIBS+=lib/libdevinfo.so.6
 
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index cf8057907a1f..a4b2e4d11125 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -254,7 +254,8 @@ SHLIB_NAME_FULL=${SHLIB_NAME}.full
 # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
 .if ${_SHLIBDIR} == "/boot" ||\
 ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
-${SHLIBDIR:C%/usr/(tests/)?lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib"
+${SHLIBDIR:C%/usr/lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" ||
+${SHLIBDIR:C%/usr/tests(/.*)?%/usr/tests%} == "/usr/tests"
 DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
 .else
 DEBUGFILEDIR=${_SHLIBDIR}/.debug



git: 955f974a1a37 - main - mk: Add missing escape character

2025-02-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=955f974a1a37cf3ae8b241327b1fef74c8932855

commit 955f974a1a37cf3ae8b241327b1fef74c8932855
Author: Jose Luis Duran 
AuthorDate: 2025-02-04 15:19:50 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-04 15:23:25 +

mk: Add missing escape character

Add a missing escape character that splits a long line to avoid breaking
the builds.

Reported by:cy
Approved by:emaste (mentor)
Fixes:  88d448ec815c ("mk: Move vm stack test debug symbols")
MFC after:  1 week
---
 share/mk/bsd.lib.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index a4b2e4d11125..b7d6b333523b 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -254,7 +254,7 @@ SHLIB_NAME_FULL=${SHLIB_NAME}.full
 # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
 .if ${_SHLIBDIR} == "/boot" ||\
 ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
-${SHLIBDIR:C%/usr/lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" ||
+${SHLIBDIR:C%/usr/lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" ||\
 ${SHLIBDIR:C%/usr/tests(/.*)?%/usr/tests%} == "/usr/tests"
 DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
 .else



Re: git: 88d448ec815c - main - mk: Move vm stack test debug symbols

2025-02-04 Thread Jose Luis Duran
Thank you, it was a last-minute mistake! Will fix it!

On Tue, Feb 4, 2025 at 12:16 PM Cy Schubert  wrote:
>
> In message <202502041448.514empps004...@gitrepo.freebsd.org>, Jose Luis
> Duran w
> rites:
> > The branch main has been updated by jlduran:
> >
> > URL: 
> > https://cgit.FreeBSD.org/src/commit/?id=88d448ec815c1fda27be94846f88ccd9
> > 6251febd
> >
> > commit 88d448ec815c1fda27be94846f88ccd96251febd
> > Author: Jose Luis Duran 
> > AuthorDate: 2025-02-04 14:47:24 +
> > Commit: Jose Luis Duran 
> > CommitDate: 2025-02-04 14:47:24 +
> >
> > mk: Move vm stack test debug symbols
> >
> > Avoid the creation of a /usr/tests/sys/vm/stack/.debug directory by
> > placing sys/vm/stack test debug symbols under /usr/lib/debug.
> >
> > Reviewed by:emaste
> > Approved by:emaste (mentor)
> > MFC after:  1 week
> > Differential Revision:  https://reviews.freebsd.org/D48796
> > ---
> >  ObsoleteFiles.inc   | 3 +++
> >  share/mk/bsd.lib.mk | 3 ++-
> >  2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
> > index e17ca9608cca..aff94af72c17 100644
> > --- a/ObsoleteFiles.inc
> > +++ b/ObsoleteFiles.inc
> > @@ -51,6 +51,9 @@
> >  #   xargs -n1 | sort | uniq -d;
> >  # done
> >
> > +# 20250204: sys/vm/stack test symbols moved to /usr/lib/debug
> > +OLD_DIRS+=usr/tests/sys/vm/stack/.debug
> > +
> >  # 20250129: libdevinfo bumped to version 7
> >  OLD_LIBS+=lib/libdevinfo.so.6
> >
> > diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
> > index cf8057907a1f..a4b2e4d11125 100644
> > --- a/share/mk/bsd.lib.mk
> > +++ b/share/mk/bsd.lib.mk
> > @@ -254,7 +254,8 @@ SHLIB_NAME_FULL=${SHLIB_NAME}.full
> >  # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
> >  .if ${_SHLIBDIR} == "/boot" ||\
> >  ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
> > -${SHLIBDIR:C%/usr/(tests/)?lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib"
> > +${SHLIBDIR:C%/usr/lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" ||
> > +${SHLIBDIR:C%/usr/tests(/.*)?%/usr/tests%} == "/usr/tests"
> >  DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
> >  .else
> >  DEBUGFILEDIR=${_SHLIBDIR}/.debug
> >
>
> This broke buildworld.
>
> make[5]: "/opt/src/git-src/share/mk/bsd.lib.mk" line 255: Malformed
> conditional '${_SHLIBDIR} == "/boot" || ${SHLIBDIR:C%/lib(/.*)?$%/lib%} ==
> "/lib" || ${SHLIBDIR:C%/usr/lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" ||'
> in /opt/src/git-src/kerberos5/lib/libasn1/Makefile:129
> in directory /opt/src/git-src/kerberos5/lib/libasn1
>
> This patch will fix it.
>
> diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
> index a4b2e4d11125..b7d6b333523b 100644
> --- a/share/mk/bsd.lib.mk
> +++ b/share/mk/bsd.lib.mk
> @@ -254,7 +254,7 @@ SHLIB_NAME_FULL=${SHLIB_NAME}.full
>  # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
>  .if ${_SHLIBDIR} == "/boot" ||\
>  ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
> -${SHLIBDIR:C%/usr/lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" ||
> +${SHLIBDIR:C%/usr/lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" ||\
>  ${SHLIBDIR:C%/usr/tests(/.*)?%/usr/tests%} == "/usr/tests"
>  DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
>  .else
>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  https://FreeBSD.org
> NTP:   Web:  https://nwtime.org
>
> e^(i*pi)+1=0
>
>


-- 
Jose Luis Duran



git: dc4b36b96333 - main - nanobsd: Always define the partition index

2025-02-04 Thread Jose Luis Duran
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 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-04 14:07:00 +

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



git: 841856570e7b - main - csu tests: Remove extra slash

2025-02-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=841856570e7b623c4f1283939936ffa005d2fcf4

commit 841856570e7b623c4f1283939936ffa005d2fcf4
Author: Jose Luis Duran 
AuthorDate: 2025-02-04 14:15:12 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-04 14:15:12 +

csu tests: Remove extra slash

Remove an extra slash that ends up in the metalog.  This double slash
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.

For example, consider the following metalog excerpt:

./base/aaa type=dir
./base//aaa/bbb type=dir

If sorted, would turn out:

./base//aaa/bbb type=dir
./base/aaa type=dir

Apparently missing the ./base/aaa directory in the specification.

Luckily here are no subdirectories.

Reviewed by:imp, emaste
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D48778
---
 lib/csu/tests/dso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/csu/tests/dso/Makefile b/lib/csu/tests/dso/Makefile
index 2f2b8c90ac29..6c1d00e9fb58 100644
--- a/lib/csu/tests/dso/Makefile
+++ b/lib/csu/tests/dso/Makefile
@@ -18,6 +18,6 @@ SRCS+=${src}.c
 SRCS+= ${src}.cc
 .endfor
 
-LIBDIR=${TESTSBASE}/lib/csu/dynamiclib/
+LIBDIR=${TESTSBASE}/lib/csu/dynamiclib
 
 .include 



git: d10deaea12ad - main - mtree: Add missing libxo/encoder path

2025-02-05 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d10deaea12adb73a698d907a148f081c402d5dd6

commit d10deaea12adb73a698d907a148f081c402d5dd6
Author: Jose Luis Duran 
AuthorDate: 2025-02-05 19:50:21 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-05 19:53:23 +

mtree: Add missing libxo/encoder path

Reviewed by:imp
Approved by:emaste (mentor)
Fixes:  d1a0d267b78b ("Upgrade libxo to 0.4.5.")
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D48836
---
 etc/mtree/BSD.debug.dist | 4 
 1 file changed, 4 insertions(+)

diff --git a/etc/mtree/BSD.debug.dist b/etc/mtree/BSD.debug.dist
index d601bd0883aa..5c855f1aaaf8 100644
--- a/etc/mtree/BSD.debug.dist
+++ b/etc/mtree/BSD.debug.dist
@@ -39,6 +39,10 @@
 ..
 i18n
 ..
+libxo
+encoder
+..
+..
 ..
 libexec
 bsdinstall



git: 16197cf147e9 - main - mtree: Add missing ossl-modules entry

2025-02-05 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=16197cf147e98c2ffc0250f8b71f0fa485c03ecc

commit 16197cf147e98c2ffc0250f8b71f0fa485c03ecc
Author: Jose Luis Duran 
AuthorDate: 2025-02-05 19:51:09 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-05 19:53:23 +

mtree: Add missing ossl-modules entry

Reviewed by:imp
Approved by:emaste (mentor)
Fixes:  b077aed33b7b ("Merge OpenSSL 3.0.9")
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D48837
---
 etc/mtree/BSD.debug.dist | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/etc/mtree/BSD.debug.dist b/etc/mtree/BSD.debug.dist
index 5c855f1aaaf8..f64dc79a297f 100644
--- a/etc/mtree/BSD.debug.dist
+++ b/etc/mtree/BSD.debug.dist
@@ -43,6 +43,8 @@
 encoder
 ..
 ..
+ossl-modules
+..
 ..
 libexec
 bsdinstall



git: c587e4c7e4c2 - main - mtree: Add missing flua/freebsd/sys entry

2025-02-05 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c587e4c7e4c28354634b4e13f30743ccdd3fbf91

commit c587e4c7e4c28354634b4e13f30743ccdd3fbf91
Author: Jose Luis Duran 
AuthorDate: 2025-02-05 19:52:03 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-05 19:53:23 +

mtree: Add missing flua/freebsd/sys entry

Reviewed by:imp
Approved by:emaste (mentor)
Fixes:  de1d7d7b87cf ("flua: add freebsd module implementing 
kldload/kldunload")
Differential Revision:  https://reviews.freebsd.org/D48838
---
 etc/mtree/BSD.debug.dist | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/etc/mtree/BSD.debug.dist b/etc/mtree/BSD.debug.dist
index f64dc79a297f..a75edff4f865 100644
--- a/etc/mtree/BSD.debug.dist
+++ b/etc/mtree/BSD.debug.dist
@@ -37,6 +37,12 @@
 ..
 engines-3
 ..
+flua
+freebsd
+sys
+..
+..
+..
 i18n
 ..
 libxo



git: e295e0b8cfd3 - main - tests: Add scapy as a required program

2025-02-11 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e295e0b8cfd34017dbaf5ccc908d3e9bbd505e62

commit e295e0b8cfd34017dbaf5ccc908d3e9bbd505e62
Author: Jose Luis Duran 
AuthorDate: 2025-02-11 16:59:51 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-11 16:59:51 +

tests: Add scapy as a required program

The utils.subr file includes a couple of subroutines
(ping_dummy_check_request and ping_server_check_reply) that require
scapy.

Add this requirement in the header of each test that makes use of them.

Reported by:Jenkins
Reviewed by:kp, ngie
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D48917
---
 tests/sys/netpfil/pf/fragmentation_pass.sh | 3 +++
 tests/sys/netpfil/pf/max_states.sh | 1 +
 tests/sys/netpfil/pf/route_to.sh   | 3 +++
 tests/sys/netpfil/pf/src_track.sh  | 2 ++
 4 files changed, 9 insertions(+)

diff --git a/tests/sys/netpfil/pf/fragmentation_pass.sh 
b/tests/sys/netpfil/pf/fragmentation_pass.sh
index 4e0665094ae6..e72b065b77bb 100644
--- a/tests/sys/netpfil/pf/fragmentation_pass.sh
+++ b/tests/sys/netpfil/pf/fragmentation_pass.sh
@@ -443,6 +443,7 @@ no_df_head()
 {
atf_set descr 'Test removing of DF flag'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 no_df_body()
@@ -481,6 +482,7 @@ reassemble_slowpath_head()
 {
atf_set descr 'Test reassembly on the slow path'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 reassemble_slowpath_body()
@@ -609,6 +611,7 @@ dummynet_fragmented_head()
 {
atf_set descr 'Test dummynet on NATed fragmented traffic'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 dummynet_fragmented_body()
diff --git a/tests/sys/netpfil/pf/max_states.sh 
b/tests/sys/netpfil/pf/max_states.sh
index 03142eeaffa6..3548d838e3a6 100755
--- a/tests/sys/netpfil/pf/max_states.sh
+++ b/tests/sys/netpfil/pf/max_states.sh
@@ -31,6 +31,7 @@ max_states_head()
 {
atf_set descr 'Max states per rule'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 max_states_body()
diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh
index 305ca4c8eddd..06a320f5fac2 100644
--- a/tests/sys/netpfil/pf/route_to.sh
+++ b/tests/sys/netpfil/pf/route_to.sh
@@ -516,6 +516,7 @@ ifbound_reply_to_head()
 {
atf_set descr 'Test that reply-to states bind to the expected interface'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 ifbound_reply_to_body()
@@ -571,6 +572,7 @@ ifbound_reply_to_v6_head()
 {
atf_set descr 'Test that reply-to states bind to the expected interface 
for IPv6'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 ifbound_reply_to_v6_body()
@@ -630,6 +632,7 @@ ifbound_reply_to_rdr_dummynet_head()
 {
atf_set descr 'Test that reply-to states bind to the expected 
non-default-route interface after rdr and dummynet'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 ifbound_reply_to_rdr_dummynet_body()
diff --git a/tests/sys/netpfil/pf/src_track.sh 
b/tests/sys/netpfil/pf/src_track.sh
index 620f1353f9fe..e8873d1dc750 100755
--- a/tests/sys/netpfil/pf/src_track.sh
+++ b/tests/sys/netpfil/pf/src_track.sh
@@ -132,6 +132,7 @@ max_src_conn_rule_head()
 {
atf_set descr 'Max connections per source per rule'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 max_src_conn_rule_body()
@@ -191,6 +192,7 @@ max_src_states_rule_head()
 {
atf_set descr 'Max states per source per rule'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 max_src_states_rule_body()



git: 65cc5af1cf88 - main - sys tests: Add scapy as a required program

2025-02-12 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=65cc5af1cf88ed124ab16091624e918faa61c7f2

commit 65cc5af1cf88ed124ab16091624e918faa61c7f2
Author: Jose Luis Duran 
AuthorDate: 2025-02-12 14:38:44 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-12 14:40:43 +

sys tests: Add scapy as a required program

These atf-python tests rely on scapy to run.
Add it as a required program.

Reported by:glebius, kp
Reviewed by:kp
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D48946
---
 tests/sys/netinet/carp.py | 2 ++
 tests/sys/netinet/igmp.py | 1 +
 tests/sys/netpfil/pf/frag6.py | 3 +++
 tests/sys/netpfil/pf/icmp.py  | 2 ++
 tests/sys/netpfil/pf/nat64.py | 4 
 tests/sys/netpfil/pf/nat66.py | 2 ++
 6 files changed, 14 insertions(+)

diff --git a/tests/sys/netinet/carp.py b/tests/sys/netinet/carp.py
index 0db31e79ba84..e35c9470d035 100644
--- a/tests/sys/netinet/carp.py
+++ b/tests/sys/netinet/carp.py
@@ -39,6 +39,7 @@ class TestCarp(VnetTestTemplate):
 if p.src != "00:00:5e:00:01:01":
 raise
 
+@pytest.mark.require_progs(["scapy"])
 def test_source_mac(self):
 "Test carp packets source address"
 
@@ -52,6 +53,7 @@ class TestCarp(VnetTestTemplate):
 
 self.check_carp_src_mac(carp_pkts)
 
+@pytest.mark.require_progs(["scapy"])
 def test_source_mac_vrrp(self):
 "Test VRRP packets source address"
 
diff --git a/tests/sys/netinet/igmp.py b/tests/sys/netinet/igmp.py
index 4a4e67211bd7..5d3b38cac38f 100644
--- a/tests/sys/netinet/igmp.py
+++ b/tests/sys/netinet/igmp.py
@@ -80,6 +80,7 @@ class TestIGMP(VnetTestTemplate):
 sp = _sp
 super().setup_method(method)
 
+@pytest.mark.require_progs(["scapy"])
 def test_igmp3_join_leave(self):
 "Test that we send the expected join/leave IGMPv2 messages"
 
diff --git a/tests/sys/netpfil/pf/frag6.py b/tests/sys/netpfil/pf/frag6.py
index f274fc28a3bf..108b53874d0b 100644
--- a/tests/sys/netpfil/pf/frag6.py
+++ b/tests/sys/netpfil/pf/frag6.py
@@ -43,6 +43,7 @@ class TestFrag6(VnetTestTemplate):
 return False
 
 @pytest.mark.require_user("root")
+@pytest.mark.require_progs(["scapy"])
 def test_dup_frag_hdr(self):
 "Test packets with duplicate fragment headers"
 srv_vnet = self.vnet_map["vnet2"]
@@ -64,6 +65,7 @@ class TestFrag6(VnetTestTemplate):
 assert not p.getlayer(sp.ICMPv6EchoReply)
 
 @pytest.mark.require_user("root")
+@pytest.mark.require_progs(["scapy"])
 def test_overlong(self):
 "Test overly long fragmented packet"
 
@@ -112,6 +114,7 @@ class TestFrag6_Overlap(VnetTestTemplate):
 ])
 
 @pytest.mark.require_user("root")
+@pytest.mark.require_progs(["scapy"])
 def test_overlap(self):
 "Ensure we discard packets with overlapping fragments"
 
diff --git a/tests/sys/netpfil/pf/icmp.py b/tests/sys/netpfil/pf/icmp.py
index e54f9f20a058..6ab649f62be7 100644
--- a/tests/sys/netpfil/pf/icmp.py
+++ b/tests/sys/netpfil/pf/icmp.py
@@ -86,6 +86,7 @@ class TestICMP(VnetTestTemplate):
 vnet.pipe.send("Got ICMP destination unreachable packet")
 
 @pytest.mark.require_user("root")
+@pytest.mark.require_progs(["scapy"])
 def test_inner_match(self):
 vnet = self.vnet_map["vnet1"]
 dst_vnet = self.vnet_map["vnet3"]
@@ -160,6 +161,7 @@ class TestICMP(VnetTestTemplate):
 return
 
 @pytest.mark.require_user("root")
+@pytest.mark.require_progs(["scapy"])
 def test_fragmentation_needed(self):
 ToolsHelper.print_output("/sbin/route add default 192.0.2.1")
 
diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py
index 64ec5ae15262..070b7a82e6d9 100644
--- a/tests/sys/netpfil/pf/nat64.py
+++ b/tests/sys/netpfil/pf/nat64.py
@@ -93,6 +93,7 @@ class TestNAT64(VnetTestTemplate):
 "pass in on %s inet6 af-to inet from 192.0.2.1" % ifname])
 
 @pytest.mark.require_user("root")
+@pytest.mark.require_progs(["scapy"])
 def test_tcp_rst(self):
 ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1")
 
@@ -126,6 +127,7 @@ class TestNAT64(VnetTestTemplate):
 assert "A" in tcp.flags
 
 @pytest.mark.require_user("root")
+@pytest.mark.require_progs(["scapy"])
 def test_udp_port_closed(self):
 ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1")
 
@@ -147,6 +149,7 @@ class TestNAT64(VnetTestTemplate):
 assert udp.dport == 12

git: 50f18a9b26c3 - main - netinet tests: Move import

2025-02-12 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=50f18a9b26c3431848de94bd1217786dd695f6dd

commit 50f18a9b26c3431848de94bd1217786dd695f6dd
Author: Jose Luis Duran 
AuthorDate: 2025-02-12 14:38:09 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-12 14:38:09 +

netinet tests: Move import

Move the import of 'Sniffer', which depends on scapy into the test so we
don't try (and fail) to import it unless scapy is installed.

Reviewed by:kp, emaste
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D48945
---
 tests/sys/netinet/igmp.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/sys/netinet/igmp.py b/tests/sys/netinet/igmp.py
index b079c5d18664..4a4e67211bd7 100644
--- a/tests/sys/netinet/igmp.py
+++ b/tests/sys/netinet/igmp.py
@@ -36,7 +36,6 @@ logging.getLogger("scapy").setLevel(logging.CRITICAL)
 curdir = os.path.dirname(os.path.realpath(__file__))
 netpfil_common = curdir + "/../netpfil/common"
 sys.path.append(netpfil_common)
-from sniffer import Sniffer
 
 sc = None
 sp = None
@@ -87,6 +86,7 @@ class TestIGMP(VnetTestTemplate):
 if1 = self.vnet.iface_alias_map["if1"]
 
 # Start a background sniff
+from sniffer import Sniffer
 expected_pkt = { "type": "join", "group": "230.0.0.1" }
 sniffer = Sniffer(expected_pkt, check_igmpv3, if1.name, timeout=10)
 



git: 8d9c25c4e171 - main - syslogd: Fix tests when if_epair is not loaded

2025-02-12 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8d9c25c4e1715e54b523cfd03bfb4c788b34ff57

commit 8d9c25c4e1715e54b523cfd03bfb4c788b34ff57
Author: Jose Luis Duran 
AuthorDate: 2025-02-12 14:42:09 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-12 14:42:09 +

syslogd: Fix tests when if_epair is not loaded

Take a cue from vnet.subr and abstract module loading, jail creation and
cleanup.

Note that the way jails are created differs slightly from vnet.subr, to
maintain the current style of the tests.

Reported by:Jenkins
Reviewed by:markj
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D48949
---
 usr.sbin/syslogd/tests/syslogd_test.sh| 23 +++---
 usr.sbin/syslogd/tests/syslogd_test_common.sh | 43 +++
 2 files changed, 55 insertions(+), 11 deletions(-)

diff --git a/usr.sbin/syslogd/tests/syslogd_test.sh 
b/usr.sbin/syslogd/tests/syslogd_test.sh
index fd3d0c49c080..2d093dd80c35 100644
--- a/usr.sbin/syslogd/tests/syslogd_test.sh
+++ b/usr.sbin/syslogd/tests/syslogd_test.sh
@@ -323,7 +323,7 @@ jail_noinet_body()
 {
 local logfile
 
-atf_check jail -c name=syslogd_noinet persist
+syslogd_mkjail syslogd_noinet
 
 logfile="${PWD}/jail_noinet.log"
 printf "user.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}"
@@ -335,7 +335,7 @@ jail_noinet_body()
 }
 jail_noinet_cleanup()
 {
-jail -r syslogd_noinet
+syslogd_cleanup
 }
 
 # Create a pair of jails, connected by an epair.  The idea is to run syslogd in
@@ -344,10 +344,12 @@ jail_noinet_cleanup()
 # 169.254.0.2 or 169.254.0.3.
 allowed_peer_test_setup()
 {
+syslogd_check_req epair
+
 local epair
 
-atf_check jail -c name=syslogd_allowed_peer vnet persist
-atf_check jail -c name=syslogd_client vnet persist
+syslogd_mkjail syslogd_allowed_peer vnet
+syslogd_mkjail syslogd_client vnet
 
 atf_check -o save:epair ifconfig epair create
 epair=$(cat epair)
@@ -364,9 +366,7 @@ allowed_peer_test_setup()
 
 allowed_peer_test_cleanup()
 {
-jail -r syslogd_allowed_peer
-jail -r syslogd_client
-ifconfig $(cat epair) destroy
+syslogd_cleanup
 }
 
 atf_test_case allowed_peer "cleanup"
@@ -499,19 +499,21 @@ forward_head()
 }
 forward_body()
 {
+syslogd_check_req epair
+
 local epair logfile
 
 atf_check -o save:epair ifconfig epair create
 epair=$(cat epair)
 epair=${epair%%a}
 
-atf_check jail -c name=syslogd_server vnet persist
+syslogd_mkjail syslogd_server vnet
 atf_check ifconfig ${epair}a vnet syslogd_server
 atf_check jexec syslogd_server ifconfig ${epair}a inet 169.254.0.1/16
 atf_check jexec syslogd_server ifconfig ${epair}a alias 169.254.0.2/16
 atf_check jexec syslogd_server ifconfig lo0 inet 127.0.0.1/8
 
-atf_check jail -c name=syslogd_client vnet persist
+syslogd_mkjail syslogd_client vnet
 atf_check ifconfig ${epair}b vnet syslogd_client
 atf_check jexec syslogd_client ifconfig ${epair}b inet 169.254.0.3/16
 atf_check jexec syslogd_client ifconfig lo0 inet 127.0.0.1/8
@@ -545,8 +547,7 @@ __EOF__
 }
 forward_cleanup()
 {
-jail -r syslogd_server
-jail -r syslogd_client
+syslogd_cleanup
 }
 
 atf_init_test_cases()
diff --git a/usr.sbin/syslogd/tests/syslogd_test_common.sh 
b/usr.sbin/syslogd/tests/syslogd_test_common.sh
index 34099684a1c2..f06eb417d423 100644
--- a/usr.sbin/syslogd/tests/syslogd_test_common.sh
+++ b/usr.sbin/syslogd/tests/syslogd_test_common.sh
@@ -115,3 +115,46 @@ syslogd_stop()
 rm -f "${pid_file}" "${socket_file}" "${privsocket_file}"
 fi
 }
+
+# Check required kernel module.
+syslogd_check_req()
+{
+type=$1
+
+if kldstat -q -n if_${type}.ko; then
+return
+fi
+
+if ! kldload -n -q if_${type}; then
+atf_skip "if_${type}.ko is required to run this test."
+return
+fi
+}
+
+# Make a jail and save its name to the created_jails.lst file.
+# Accepts a name and optional arguments.
+syslogd_mkjail()
+{
+jailname=$1
+shift
+args=$*
+
+atf_check jail -c name=${jailname} ${args} persist
+
+echo $jailname >> created_jails.lst
+}
+
+# Remove epair interfaces and jails.
+syslogd_cleanup()
+{
+if [ -f created_jails.lst ]; then
+while read jailname; do
+jail -r ${jailname}
+done < created_jails.lst
+rm created_jails.lst
+fi
+
+if [ -f epair ]; then
+ifconfig $(cat epair) destroy
+fi
+}



git: 4b77a9a80cf8 - main - uath: Avoid a NULL dereference

2025-02-12 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4b77a9a80cf8a9cba5607d8d8fa0742334dcf0f4

commit 4b77a9a80cf8a9cba5607d8d8fa0742334dcf0f4
Author: Jose Luis Duran 
AuthorDate: 2025-02-12 15:31:43 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-12 15:33:26 +

uath: Avoid a NULL dereference

PR: 284643
Reviewed by:adrian
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D48948
---
 sys/dev/usb/wlan/if_uath.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c
index 32e3c0325c6e..10e3b50eaeb3 100644
--- a/sys/dev/usb/wlan/if_uath.c
+++ b/sys/dev/usb/wlan/if_uath.c
@@ -2308,10 +2308,12 @@ uath_cmdeof(struct uath_softc *sc, struct uath_cmd *cmd)
__func__, dlen, sizeof(uint32_t));
return;
}
-   /* XXX have submitter do this */
-   /* copy answer into caller's supplied buffer */
-   bcopy(hdr+1, cmd->odata, sizeof(uint32_t));
-   cmd->olen = sizeof(uint32_t);
+   if (cmd->odata != NULL) {
+   /* XXX have submitter do this */
+   /* copy answer into caller's supplied buffer */
+   bcopy(hdr+1, cmd->odata, sizeof(uint32_t));
+   cmd->olen = sizeof(uint32_t);
+   }
wakeup_one(cmd);/* wake up caller */
break;
 



git: 2a657b4ee900 - main - ktrace.1: Add ARGS and ENVS as default trace points

2024-11-17 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2a657b4ee9008207bd099884c1d4697425a67cd1

commit 2a657b4ee9008207bd099884c1d4697425a67cd1
Author: Jose Luis Duran 
AuthorDate: 2024-11-17 18:12:06 +
Commit: Jose Luis Duran 
CommitDate: 2024-11-17 18:12:06 +

ktrace.1: Add ARGS and ENVS as default trace points

After commit 65a4daeaf324 ("ktrace: log execve(2) arguments and
environment"), "a" and "e" are part of the default set of trace points.

Reviewed by:markj
Approved by:emaste (mentor)
Fixes:  65a4daeaf324 ("ktrace: log execve(2) arguments and environment")
Differential Revision:  https://reviews.freebsd.org/D47648
---
 usr.bin/ktrace/ktrace.1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1
index 6d78cb1504b4..6542bb88dffd 100644
--- a/usr.bin/ktrace/ktrace.1
+++ b/usr.bin/ktrace/ktrace.1
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd November 1, 2024
+.Dd November 17, 2024
 .Dt KTRACE 1
 .Os
 .Sh NAME
@@ -152,7 +152,7 @@ trace
 environment variables
 .It Cm +
 trace the default set of trace points -
-.Cm c , i , n , s , t , u , y
+.Cm a, c , e,  i , n , s , t , u , y
 .El
 .It Ar command
 Execute



Re: git: 01ff67f4bdf5 - main - mtree: TESTSBASE directory always starts with a /

2025-01-24 Thread Jose Luis Duran
On Fri, Jan 24, 2025 at 8:22 PM Jessica Clarke  wrote:
>
> On 24 Jan 2025, at 23:10, Jose Luis Duran  wrote:
> >
> > The branch main has been updated by jlduran:
> >
> > URL: 
> > https://cgit.FreeBSD.org/src/commit/?id=01ff67f4bdf5959a719a6511a855f6a60c0e3a93
> >
> > commit 01ff67f4bdf5959a719a6511a855f6a60c0e3a93
> > Author: Jose Luis Duran 
> > AuthorDate: 2025-01-24 23:10:05 +
> > Commit: Jose Luis Duran 
> > CommitDate: 2025-01-24 23:10:05 +
> >
> >mtree: TESTSBASE directory always starts with a /
> >
> >Remove the extra forward slash ("/"), otherwise the mtree specification
> >file will have the double slash and will not be parsed by makefs when
> >attempting to build NanoBSD with NO_ROOT privileges.
>
> Not sure why you’re having issues with this. I can see the duplicate
> slashes do indeed end up in CheriBSD’s METALOG, but the in-tree makefs
> produces a disk image just fine from that.

In my case, I receive the following error:

makefs: ./usr/lib/debug//usr: missing directory in specification
makefs: failed at line 5988 of the specification

I have yet to dig deeper, as a double slash should not be considered
invalid by makefs' mtree. The "right" thing to do is what brooks
suggested, to create libmtree, and just use it for everything
mtree-related.  For now, the simplest thing is just to remove it.

Regards,

>
> Doesn’t mean I’m against fixing our build though :)
>
> Jess
>
> >Fixes:  07670b30fa43 ("Create /usr/tests *.debug file directory 
> > hierarchy")
> >Reviewed by:emaste
> >Approved by:emaste (mentor)
> >Differential Revision:  https://reviews.freebsd.org/D47722
> > ---
> > Makefile.inc1 | 2 +-
> > etc/Makefile  | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/Makefile.inc1 b/Makefile.inc1
> > index efa1299b76a7..4383b4bfe30a 100644
> > --- a/Makefile.inc1
> > +++ b/Makefile.inc1
> > @@ -1506,7 +1506,7 @@ distributeworld installworld stageworld: 
> > _installcheck_world .PHONY
> >-p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
> > .if ${MK_DEBUG_FILES} != "no"
> > ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
> > --p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/null
> > +-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug${TESTSBASE} >/dev/null
> > .endif
> > .endif
> > ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
> > diff --git a/etc/Makefile b/etc/Makefile
> > index fdcad75911c8..d3cb6b679dc5 100644
> > --- a/etc/Makefile
> > +++ b/etc/Makefile
> > @@ -112,7 +112,7 @@ MTREES+= mtree/BSD.lib${libcompat}.dist 
> > /usr/lib/debug/usr
> > .endfor
> > .if ${MK_TESTS} != "no"
> > MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
> > -MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
> > +MTREES+= mtree/BSD.tests.dist /usr/lib/debug${TESTSBASE}
> > .endif
> > .if ${MK_SENDMAIL} != "no"
> > MTREES+= mtree/BSD.sendmail.dist /
>


-- 
Jose Luis Duran



git: e7142d455eeb - main - mtree: Align BSD.usr.dist keywords

2025-01-24 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e7142d455eeb6bce6e90e5e6031bf1e868e6f5b6

commit e7142d455eeb6bce6e90e5e6031bf1e868e6f5b6
Author: Jose Luis Duran 
AuthorDate: 2025-01-24 23:09:41 +
Commit: Jose Luis Duran 
CommitDate: 2025-01-24 23:09:41 +

mtree: Align BSD.usr.dist keywords

Reviewed by:emaste
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D47721
---
 etc/mtree/BSD.usr.dist | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index 9fd0cf326bdf..91500c99271c 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -210,9 +210,9 @@
 calendar
 ..
 certs
-trusted tags=package=caroot
+trusted tags=package=caroot
 ..
-untrusted tags=package=caroot
+untrusted   tags=package=caroot
 ..
 ..
 dict
@@ -222,7 +222,7 @@
 ..
 atf tags=package=tests
 ..
-kyua tags=package=tests
+kyuatags=package=tests
 ..
 legal
 ..
@@ -318,7 +318,7 @@
 ..
 ..
 ..
-kyua tags=package=tests
+kyuatags=package=tests
 ..
 libusb20
 ..
@@ -455,16 +455,16 @@
 ..
 keys
 pkg
-revoked tags=package=runtime
+revoked tags=package=runtime
 ..
-trusted tags=package=runtime
+trusted tags=package=runtime
 ..
 ..
 ..
-kyua tags=package=tests
-misc tags=package=tests
+kyuatags=package=tests
+misctags=package=tests
 ..
-storetags=package=tests
+store   tags=package=tests
 ..
 ..
 locale



git: 01ff67f4bdf5 - main - mtree: TESTSBASE directory always starts with a /

2025-01-24 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=01ff67f4bdf5959a719a6511a855f6a60c0e3a93

commit 01ff67f4bdf5959a719a6511a855f6a60c0e3a93
Author: Jose Luis Duran 
AuthorDate: 2025-01-24 23:10:05 +
Commit: Jose Luis Duran 
CommitDate: 2025-01-24 23:10:05 +

mtree: TESTSBASE directory always starts with a /

Remove the extra forward slash ("/"), otherwise the mtree specification
file will have the double slash and will not be parsed by makefs when
attempting to build NanoBSD with NO_ROOT privileges.

Fixes:  07670b30fa43 ("Create /usr/tests *.debug file directory hierarchy")
Reviewed by:emaste
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D47722
---
 Makefile.inc1 | 2 +-
 etc/Makefile  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index efa1299b76a7..4383b4bfe30a 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1506,7 +1506,7 @@ distributeworld installworld stageworld: 
_installcheck_world .PHONY
-p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
 .if ${MK_DEBUG_FILES} != "no"
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
-   -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} 
>/dev/null
+   -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug${TESTSBASE} 
>/dev/null
 .endif
 .endif
${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
diff --git a/etc/Makefile b/etc/Makefile
index fdcad75911c8..d3cb6b679dc5 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -112,7 +112,7 @@ MTREES+=mtree/BSD.lib${libcompat}.dist  
/usr/lib/debug/usr
 .endfor
 .if ${MK_TESTS} != "no"
 MTREES+=   mtree/BSD.tests.dist${TESTSBASE}
-MTREES+=   mtree/BSD.tests.dist/usr/lib/debug/${TESTSBASE}
+MTREES+=   mtree/BSD.tests.dist/usr/lib/debug${TESTSBASE}
 .endif
 .if ${MK_SENDMAIL} != "no"
 MTREES+=   mtree/BSD.sendmail.dist /



Re: git: 88d448ec815c - main - mk: Move vm stack test debug symbols

2025-02-13 Thread Jose Luis Duran
On Thu, Feb 13, 2025 at 12:18 PM Dag-Erling Smørgrav  wrote:
>
> Jose Luis Duran  writes:
> > diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
> > index e17ca9608cca..aff94af72c17 100644
> > --- a/ObsoleteFiles.inc
> > +++ b/ObsoleteFiles.inc
> > @@ -51,6 +51,9 @@
> >  #   xargs -n1 | sort | uniq -d;
> >  # done
> >
> > +# 20250204: sys/vm/stack test symbols moved to /usr/lib/debug
> > +OLD_DIRS+=usr/tests/sys/vm/stack/.debug
>
> This directory is not empty, you need to delete the file it contains
> (libsoxstack.so.debug) as well.

Thank you!
https://reviews.freebsd.org/D48991

>
> DES
> --
> Dag-Erling Smørgrav - d...@freebsd.org



-- 
Jose Luis Duran



git: e159dcc37e6f - main - ObsoleteFiles.inc: Remove test debug file from wrong dir

2025-02-13 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e159dcc37e6f538d3d61ea3b2d08b052cf0e0ced

commit e159dcc37e6f538d3d61ea3b2d08b052cf0e0ced
Author: Jose Luis Duran 
AuthorDate: 2025-02-13 17:05:33 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-13 17:05:33 +

ObsoleteFiles.inc: Remove test debug file from wrong dir

Reported by:des
Reviewed by:des, emaste
Approved by:emaste (mentor)
Fixes:  88d448ec815c ("mk: Move vm stack test debug symbols")
MFC after:  3 days
Differential Revision:  https://reviews.freebsd.org/D48991
---
 ObsoleteFiles.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 70396c46ca46..70f134960b69 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -55,6 +55,7 @@
 OLD_FILES+=usr/share/man/man9/bus_generic_attach.9.gz
 
 # 20250204: sys/vm/stack test symbols moved to /usr/lib/debug
+OLD_FILES+=usr/tests/sys/vm/stack/.debug/libsoxstack.so.debug
 OLD_DIRS+=usr/tests/sys/vm/stack/.debug
 
 # 20250129: libdevinfo bumped to version 7



git: dcb4ae528d35 - main - openssh: Add GSSAPI and Kerberos support to sshd Makefile

2025-02-19 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=dcb4ae528d357f34e4a4b4882c2757c67c98e395

commit dcb4ae528d357f34e4a4b4882c2757c67c98e395
Author: Jose Luis Duran 
AuthorDate: 2025-02-20 04:11:30 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-20 04:18:04 +

openssh: Add GSSAPI and Kerberos support to sshd Makefile

Reported by:cy
Reviewed by:emaste
Approved by:emaste (mentor)
Fixes:  0fdf8fae8b56 ("openssh: Update to 9.8p1")
---
 secure/usr.sbin/sshd/Makefile | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile
index 4e1f330076b4..d5bcf008e233 100644
--- a/secure/usr.sbin/sshd/Makefile
+++ b/secure/usr.sbin/sshd/Makefile
@@ -16,6 +16,12 @@ moduli: .MADE
 
 LIBADD=ssh util
 
+.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no"
+CFLAGS+= -include krb5_config.h
+SRCS+= krb5_config.h
+LIBADD+=   gssapi_krb5 gssapi krb5
+.endif
+
 .if ${MK_TCP_WRAPPERS} != "no"
 CFLAGS+=   -DLIBWRAP=1
 LIBADD+=   wrap



git: 61d8af38bf1c - main - openssh: Fix blacklistd sshd-session integration

2025-02-24 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16

commit 61d8af38bf1c5328c27ccfcd8a3b73e9e8604d16
Author: Jose Luis Duran 
AuthorDate: 2025-02-24 14:38:52 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-24 14:38:52 +

openssh: Fix blacklistd sshd-session integration

In version 9.8, the server was split into a listener binary, sshd(8),
and a per-session binary "sshd-session".

Our blacklistd changes also have to be moved from sshd.c to
sshd-session.c.

Reviewed by:emaste
Approved by:emaste (mentor)
Fixes:  0fdf8fae8b56 ("openssh: Update to 9.8p1")
MFC after:  3 days
Differential Revision:  https://reviews.freebsd.org/D49116
---
 crypto/openssh/sshd-session.c | 3 +++
 crypto/openssh/sshd.c | 4 
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c
index 3092cd91242e..ee983176d3aa 100644
--- a/crypto/openssh/sshd-session.c
+++ b/crypto/openssh/sshd-session.c
@@ -109,6 +109,7 @@
 #include "sk-api.h"
 #include "srclimit.h"
 #include "dh.h"
+#include "blacklist_client.h"
 
 /* Re-exec fds */
 #define REEXEC_DEVCRYPTO_RESERVED_FD   (STDERR_FILENO + 1)
@@ -1316,6 +1317,8 @@ main(int ac, char **av)
fatal("sshbuf_new loginmsg failed");
auth_debug_reset();
 
+   BLACKLIST_INIT();
+
if (privsep_preauth(ssh) == 1)
goto authenticated;
 
diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c
index 68e48d75369a..fd48835ebd2a 100644
--- a/crypto/openssh/sshd.c
+++ b/crypto/openssh/sshd.c
@@ -101,7 +101,6 @@
 #include "sk-api.h"
 #include "addr.h"
 #include "srclimit.h"
-#include "blacklist_client.h"
 
 #ifdef LIBWRAP
 #include 
@@ -1876,9 +1875,6 @@ main(int ac, char **av)
}
 #endif
 #endif
-
-
-   BLACKLIST_INIT();
 }
 
 /* server specific fatal cleanup */



git: 7d1d7f42302d - main - stand: Fix brand positioning on framebuffer console

2025-02-24 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7d1d7f42302d80c33243501601b77323acc0717f

commit 7d1d7f42302d80c33243501601b77323acc0717f
Author: Jose Luis Duran 
AuthorDate: 2025-02-24 14:36:10 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-24 14:36:10 +

stand: Fix brand positioning on framebuffer console

The drawer.lua script ignores the values in loader_brand_x and
loader_brand_y on framebuffer consoles, always positioning the brand at
(1, 1).

Allow it to be positioned by accepting the x and y values just like the
text version.  For example:

/boot/lua/gfx-nanobsd.lua:

return {
brand = {
graphic = {
""
},
requires_color = true,
image = "/boot/images/freebsd-logo-rev.png"
}
}

/boot/loader.conf.d/bootloader.conf:

loader_logo="none"
loader_brand="nanobsd"
loader_brand_x="15"

PR: 255202
Reviewed by:manu, imp
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D49092
---
 stand/lua/drawer.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
index 2d04e29ac462..1bf741b2373e 100644
--- a/stand/lua/drawer.lua
+++ b/stand/lua/drawer.lua
@@ -327,7 +327,7 @@ local function drawbrand()
if core.isFramebufferConsole() and
gfx.term_putimage ~= nil and
branddef.image ~= nil then
-   if gfx.term_putimage(branddef.image, 1, 1, 0, 7, 0)
+   if gfx.term_putimage(branddef.image, x, y, 0, 7, 0)
then
return true
end



git: b5f60442a03e - main - libefivar: Fix sed pattern

2025-02-20 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b5f60442a03ed53bfc5e16ed445490d1b5f14638

commit b5f60442a03ed53bfc5e16ed445490d1b5f14638
Author: Jose Luis Duran 
AuthorDate: 2025-02-20 20:10:06 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-20 20:10:06 +

libefivar: Fix sed pattern

Add a 'g' flag to allow the replacement to occur more than once on the
same line.

Reviewed by:imp, emaste
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D49058
---
 lib/libefivar/FreeBSD-update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libefivar/FreeBSD-update b/lib/libefivar/FreeBSD-update
index 375f9ceb9536..52d0db4021ef 100644
--- a/lib/libefivar/FreeBSD-update
+++ b/lib/libefivar/FreeBSD-update
@@ -6,7 +6,7 @@ efivar-dp-parse.c is a copy of 
MdePkg/Library/UefiDevicePathLib/DevicePathFromTe
 
 These files are first mechnaically processed with
 
-sed -e "s/L'/'/;"'s/L"/"/g;s/%g/%36s/g;s/%a/%s/g;s/^VOID/static VOID/g;s/ 
*$//g'
+sed -e "s/L'/'/g;"'s/L"/"/g;s/%g/%36s/g;s/%a/%s/g;s/^VOID/static VOID/g;s/ 
*$//g'
 
 for several reasons. We're moving from wide rotuines to narrow routines. The
 UTC-2 this code is written for is a bad match for wchar_t which is an int. It's



git: 39d58c816068 - main - libefivar: Add Display Only format for Hard Drive

2025-02-20 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=39d58c816068178515af0718c47f4f64d1cffc1d

commit 39d58c816068178515af0718c47f4f64d1cffc1d
Author: Jose Luis Duran 
AuthorDate: 2025-02-20 20:10:44 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-20 20:14:26 +

libefivar: Add Display Only format for Hard Drive

Ref: UEFI Specification Version 2.1 (Errata D) (released October 2008)

Reviewed by:imp, emaste
Approved by:emaste (mentor)
Obtained from:  
https://github.com/tianocore/edk2/commit/9e6537469d4700d9d793ee21e9c2f2e7ddbb2176
Differential Revision:  https://reviews.freebsd.org/D49060
---
 lib/libefivar/efivar-dp-format.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c
index b4300573e41c..3fa2833a7e7a 100644
--- a/lib/libefivar/efivar-dp-format.c
+++ b/lib/libefivar/efivar-dp-format.c
@@ -1944,7 +1944,7 @@ DevPathToTextHardDrive (
 case SIGNATURE_TYPE_MBR:
   UefiDevicePathLibCatPrint (
 Str,
-"HD(%d,%s,0x%08x,",
+"HD(%d,%s,0x%08x",
 Hd->PartitionNumber,
 "MBR",
 //  *((UINT32 *)(&(Hd->Signature[0])))
@@ -1955,7 +1955,7 @@ DevPathToTextHardDrive (
 case SIGNATURE_TYPE_GUID:
   UefiDevicePathLibCatPrint (
 Str,
-"HD(%d,%s,%36s,",
+"HD(%d,%s,%36s",
 Hd->PartitionNumber,
 "GPT",
 G(&(Hd->Signature[0]))
@@ -1965,14 +1965,18 @@ DevPathToTextHardDrive (
 default:
   UefiDevicePathLibCatPrint (
 Str,
-"HD(%d,%d,0,",
+"HD(%d,%d,0",
 Hd->PartitionNumber,
 Hd->SignatureType
 );
   break;
   }
 
-  UefiDevicePathLibCatPrint (Str, "0x%lx,0x%lx)", Hd->PartitionStart, 
Hd->PartitionSize);
+  if (DisplayOnly) {
+UefiDevicePathLibCatPrint (Str, ")");
+  } else {
+UefiDevicePathLibCatPrint (Str, ",0x%lx,0x%lx)", Hd->PartitionStart, 
Hd->PartitionSize);
+  }
 }
 
 /**



git: 05653fc774ff - main - libefivar: CodeQL Fixes

2025-02-20 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=05653fc774ffc97856507b871d05d7a232e899a5

commit 05653fc774ffc97856507b871d05d7a232e899a5
Author: Jose Luis Duran 
AuthorDate: 2025-02-20 20:10:20 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-20 20:11:52 +

libefivar: CodeQL Fixes

These libefivar files correspond to the following EDK2 Tianocore
routines:

efivar-dp-format.c -> MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
efivar-dp-parse.c  -> MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c

The following changes were apparently applied upstream to appease their
CodeQL workflows on GitHub.  Note that some of these changes are
logically contradictory, however avoiding differences between the two
code bases is a priority, as noted in the review.

Commit message from upstream:

Includes changes across the repo for the following CodeQL rules:
- cpp/comparison-with-wider-type
- cpp/overflow-buffer
- cpp/redundant-null-check-param
- cpp/uselesstest

Reviewed by:imp
Approved by:emaste (mentor)
Obtained from:  
https://github.com/tianocore/edk2/commit/b7735a087afce6a5157b61e5450b6848ed535a14
Differential Revision:  https://reviews.freebsd.org/D49059
---
 lib/libefivar/efivar-dp-format.c |   6 +-
 lib/libefivar/efivar-dp-parse.c  | 488 +++
 2 files changed, 340 insertions(+), 154 deletions(-)

diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c
index 72e024470a11..b4300573e41c 100644
--- a/lib/libefivar/efivar-dp-format.c
+++ b/lib/libefivar/efivar-dp-format.c
@@ -1904,7 +1904,11 @@ DevPathToTextUri (
   Uri   = DevPath;
   UriLength = DevicePathNodeLength (Uri) - sizeof (URI_DEVICE_PATH);
   UriStr= AllocatePool (UriLength + 1);
-  ASSERT (UriStr != NULL);
+
+  if (UriStr == NULL) {
+ASSERT (UriStr != NULL);
+return;
+  }
 
   CopyMem (UriStr, Uri->Uri, UriLength);
   UriStr[UriLength] = '\0';
diff --git a/lib/libefivar/efivar-dp-parse.c b/lib/libefivar/efivar-dp-parse.c
index f68c9798fb2e..3382666730c4 100644
--- a/lib/libefivar/efivar-dp-parse.c
+++ b/lib/libefivar/efivar-dp-parse.c
@@ -337,14 +337,14 @@ IsHexStr (
   //
   // skip preceeding white space
   //
-  while ((*Str != 0) && *Str == ' ') {
+  while (*Str == ' ') {
 Str++;
   }
 
   //
   // skip preceeding zeros
   //
-  while ((*Str != 0) && *Str == '0') {
+  while (*Str == '0') {
 Str++;
   }
 
@@ -461,7 +461,10 @@ DevPathFromTextGenericPath (
(UINT16)(sizeof (EFI_DEVICE_PATH_PROTOCOL) + DataLength)
);
 
-  StrHexToBytes (DataStr, DataLength * 2, (UINT8 *)(Node + 1), DataLength);
+  if (Node != NULL) {
+StrHexToBytes (DataStr, DataLength * 2, (UINT8 *)(Node + 1), DataLength);
+  }
+
   return Node;
 }
 
@@ -529,8 +532,10 @@ DevPathFromTextPci (
  (UINT16)sizeof (PCI_DEVICE_PATH)
  );
 
-  Pci->Function = (UINT8)Strtoi (FunctionStr);
-  Pci->Device   = (UINT8)Strtoi (DeviceStr);
+  if (Pci != NULL) {
+Pci->Function = (UINT8)Strtoi (FunctionStr);
+Pci->Device   = (UINT8)Strtoi (DeviceStr);
+  }
 
   return (EFI_DEVICE_PATH_PROTOCOL *)Pci;
 }
@@ -559,7 +564,9 @@ DevPathFromTextPcCard (
   (UINT16)sizeof 
(PCCARD_DEVICE_PATH)
   );
 
-  Pccard->FunctionNumber = (UINT8)Strtoi (FunctionNumberStr);
+  if (Pccard != NULL) {
+Pccard->FunctionNumber = (UINT8)Strtoi (FunctionNumberStr);
+  }
 
   return (EFI_DEVICE_PATH_PROTOCOL *)Pccard;
 }
@@ -592,9 +599,11 @@ DevPathFromTextMemoryMapped (
(UINT16)sizeof 
(MEMMAP_DEVICE_PATH)
);
 
-  MemMap->MemoryType = (UINT32)Strtoi (MemoryTypeStr);
-  Strtoi64 (StartingAddressStr, &MemMap->StartingAddress);
-  Strtoi64 (EndingAddressStr, &MemMap->EndingAddress);
+  if (MemMap != NULL) {
+MemMap->MemoryType = (UINT32)Strtoi (MemoryTypeStr);
+Strtoi64 (StartingAddressStr, &MemMap->StartingAddress);
+Strtoi64 (EndingAddressStr, &MemMap->EndingAddress);
+  }
 
   return (EFI_DEVICE_PATH_PROTOCOL *)MemMap;
 }
@@ -638,8 +647,10 @@ ConvertFromTextVendor (
(UINT16)(sizeof (VENDOR_DEVICE_PATH) + 
Length)
);
 
-  StrToGuid (GuidStr, &Vendor->Guid);
-  StrHexToBytes (DataStr, Length * 2, (UINT8 *)(Vendor + 1), Length);
+  if (Vendor != NULL) {
+StrToGuid (GuidStr, &Vendor->Guid);
+StrHexToBytes (DataStr, Length * 2, (UINT8 *)(Vendor + 1), Length);
+  }
 
   return (EFI_DEVICE_PATH_PROTOCOL *)Vendor;
 }
@@ -688,7 +699,10 @@ DevPath

git: 1f1963bd32d6 - main - pf tests: Remove Scapy as a required program

2025-02-17 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=1f1963bd32d669f89ea3b044636de0cb7a33134b

commit 1f1963bd32d669f89ea3b044636de0cb7a33134b
Author: Jose Luis Duran 
AuthorDate: 2025-02-17 19:52:46 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-17 19:57:00 +

pf tests: Remove Scapy as a required program

Scapy is not needed to run this test.  Remove it from the required
programs list.

Reviewed by:kp
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D49006
---
 tests/sys/netpfil/pf/rdr.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh
index 135bfd42c1f4..a7a8c77c0515 100644
--- a/tests/sys/netpfil/pf/rdr.sh
+++ b/tests/sys/netpfil/pf/rdr.sh
@@ -32,7 +32,7 @@ tcp_v6_head()
 {
atf_set descr 'TCP rdr with IPv6'
atf_set require.user root
-   atf_set require.progs scapy python3
+   atf_set require.progs python3
 }
 
 #



git: ec60176e7d29 - main - netinet6 tests: Add Scapy as a required program

2025-02-17 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ec60176e7d29d1e9f11121146603ce5b6b5f40b8

commit ec60176e7d29d1e9f11121146603ce5b6b5f40b8
Author: Jose Luis Duran 
AuthorDate: 2025-02-17 19:50:24 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-17 19:56:59 +

netinet6 tests: Add Scapy as a required program

The ra.py script requires Scapy.  Invoke it using the python3 symlink.
While technically, at the moment, python points to python3, and python3
points to the current version of python, it is recommended to use
python3.  No functional change intended.

Add the Scapy requirement in the header of each test that makes use of
it.

Reviewed by:kp
Approved by:emaste (mentor)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D49005
---
 tests/sys/netinet6/ndp.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh
index 038a640f331e..378759eb9ba4 100755
--- a/tests/sys/netinet6/ndp.sh
+++ b/tests/sys/netinet6/ndp.sh
@@ -134,7 +134,7 @@ atf_test_case "ndp_slaac_default_route" "cleanup"
 ndp_slaac_default_route_head() {
atf_set descr 'Test default route installation via SLAAC'
atf_set require.user root
-   atf_set require.progs "python"
+   atf_set require.progs scapy
 }
 
 ndp_slaac_default_route_body() {
@@ -153,7 +153,7 @@ ndp_slaac_default_route_body() {
atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv
 
 # Send an RA advertising a prefix.
-   atf_check -e ignore python $(atf_get_srcdir)/ra.py \
+   atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \
--sendif ${epair0}b \
--dst $(ndp_if_lladdr ${epair0}a ${jname}) \
--src $(ndp_if_lladdr ${epair0}b) \
@@ -172,7 +172,7 @@ ndp_slaac_default_route_body() {
jexec ${jname} netstat -rn -6
 
# Send another RA, make sure that the default route is installed again.
-   atf_check -e ignore python $(atf_get_srcdir)/ra.py \
+   atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \
--sendif ${epair0}b \
--dst $(ndp_if_lladdr ${epair0}a ${jname}) \
--src $(ndp_if_lladdr ${epair0}b) \



git: cf4a4e4fab6b - main - pf tests: Add Scapy as a required program

2025-02-17 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=cf4a4e4fab6b3b1197f5ebf9e168935b0919f3ef

commit cf4a4e4fab6b3b1197f5ebf9e168935b0919f3ef
Author: Jose Luis Duran 
AuthorDate: 2025-02-17 19:50:03 +
Commit: Jose Luis Duran 
CommitDate: 2025-02-17 19:56:47 +

pf tests: Add Scapy as a required program

The utils.subr file includes a couple of subroutines
(ping_dummy_check_request and ping_server_check_reply) that require
Scapy.

Add this requirement in the header of each test that makes use of them.

Reported by:Jenkins
Reviewed by:kp
Approved by:emaste (mentor)
Fixes:  07e070ef0869 ("pf: Add support for multiple source node types")
Differential Revision:  https://reviews.freebsd.org/D49004
---
 tests/sys/netpfil/pf/src_track.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/sys/netpfil/pf/src_track.sh 
b/tests/sys/netpfil/pf/src_track.sh
index e79183fd9f72..a9d723bb68a5 100755
--- a/tests/sys/netpfil/pf/src_track.sh
+++ b/tests/sys/netpfil/pf/src_track.sh
@@ -261,6 +261,7 @@ max_src_states_global_head()
 {
atf_set descr 'Max states per source global'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 max_src_states_global_body()
@@ -310,6 +311,7 @@ route_to_head()
 {
atf_set descr 'Max states per source per rule with route-to'
atf_set require.user root
+   atf_set require.progs scapy
 }
 
 route_to_body()



git: c46af893cd7a - main - tests: Require python3 when using Scapy

2025-03-02 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c46af893cd7aaff322b6f867539bc8fe5bcde6f9

commit c46af893cd7aaff322b6f867539bc8fe5bcde6f9
Author: Jose Luis Duran 
AuthorDate: 2025-03-03 07:52:33 +
Commit: Jose Luis Duran 
CommitDate: 2025-03-03 07:52:33 +

tests: Require python3 when using Scapy

python3 is a symbolic link that points to the current python 3.X
version.

It is possible for a system to have python (python 3.X) without the
python3 (symlink) package.

Test scripts that use Scapy are invoked using python3, so add it as a
required program.

Reviewed by:ngie, asomers
Approved by:emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D49007
---
 tests/sys/net/if_bridge_test.sh |  4 ++--
 tests/sys/net/if_vlan.sh|  2 +-
 tests/sys/netinet/divert.sh |  4 ++--
 tests/sys/netinet/forward.sh|  8 
 tests/sys/netinet/redirect.sh   |  2 +-
 tests/sys/netinet6/divert.sh|  2 +-
 tests/sys/netinet6/exthdr.sh|  2 +-
 tests/sys/netinet6/forward6.sh  | 12 ++--
 tests/sys/netinet6/frag6/frag6.subr |  2 +-
 tests/sys/netinet6/mld.sh   |  2 +-
 tests/sys/netinet6/ndp.sh   |  2 +-
 tests/sys/netinet6/redirect.sh  |  2 +-
 tests/sys/netinet6/scapyi386.sh |  2 +-
 tests/sys/netpfil/common/forward.sh |  2 +-
 tests/sys/netpfil/common/tos.sh |  2 +-
 tests/sys/netpfil/pf/dup.sh |  2 +-
 tests/sys/netpfil/pf/ether.sh   |  4 ++--
 tests/sys/netpfil/pf/forward.sh |  4 ++--
 tests/sys/netpfil/pf/fragmentation_compat.sh|  8 
 tests/sys/netpfil/pf/fragmentation_no_reassembly.sh |  6 +++---
 tests/sys/netpfil/pf/fragmentation_pass.sh  | 18 +-
 tests/sys/netpfil/pf/get_state.sh   |  2 +-
 tests/sys/netpfil/pf/icmp.sh|  2 +-
 tests/sys/netpfil/pf/icmp6.sh   |  2 +-
 tests/sys/netpfil/pf/killstate.sh   | 16 
 tests/sys/netpfil/pf/max_states.sh  |  2 +-
 tests/sys/netpfil/pf/modulate.sh|  4 ++--
 tests/sys/netpfil/pf/pass_block.sh  |  2 +-
 tests/sys/netpfil/pf/pflog.sh   |  2 +-
 tests/sys/netpfil/pf/pflow.sh   |  8 
 tests/sys/netpfil/pf/pfsync.sh  | 12 ++--
 tests/sys/netpfil/pf/route_to.sh|  8 
 tests/sys/netpfil/pf/rtable.sh  |  4 ++--
 tests/sys/netpfil/pf/scrub.sh   | 16 
 tests/sys/netpfil/pf/scrub_compat.sh| 16 
 tests/sys/netpfil/pf/scrub_pass.sh  | 12 ++--
 tests/sys/netpfil/pf/set_tos.sh |  4 ++--
 tests/sys/netpfil/pf/src_track.sh   |  8 
 tests/sys/netpfil/pf/syncookie.sh   |  6 +++---
 tests/sys/netpfil/pf/tcp.sh |  2 +-
 40 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh
index 66656be1d84f..46ebb17edbdc 100755
--- a/tests/sys/net/if_bridge_test.sh
+++ b/tests/sys/net/if_bridge_test.sh
@@ -271,7 +271,7 @@ span_head()
 {
atf_set descr 'Bridge span test'
atf_set require.user root
-   atf_set require.progs scapy
+   atf_set require.progs python3 scapy
 }
 
 span_body()
@@ -420,7 +420,7 @@ stp_validation_head()
 {
atf_set descr 'Check STP validation'
atf_set require.user root
-   atf_set require.progs scapy
+   atf_set require.progs python3 scapy
 }
 
 stp_validation_body()
diff --git a/tests/sys/net/if_vlan.sh b/tests/sys/net/if_vlan.sh
index 41dac6222cbb..424eac705b94 100755
--- a/tests/sys/net/if_vlan.sh
+++ b/tests/sys/net/if_vlan.sh
@@ -257,7 +257,7 @@ bpf_pcp_head()
 {
atf_set descr 'Set VLAN PCP through BPF'
atf_set require.user root
-   atf_set require.progs scapy
+   atf_set require.progs python3 scapy
 }
 
 bpf_pcp_body()
diff --git a/tests/sys/netinet/divert.sh b/tests/sys/netinet/divert.sh
index c3b1896b995e..d50620d94a09 100755
--- a/tests/sys/netinet/divert.sh
+++ b/tests/sys/netinet/divert.sh
@@ -41,7 +41,7 @@ ipdivert_ip_output_remote_success_head() {
 
atf_set descr 'Test diverting IPv4 packet to remote destination'
atf_set require.user root
-   atf_set require.progs scapy
+   atf_set require.progs python3 scapy
 }
 
 ipdivert_ip_output_remote_success_body() {
@@ -96,7 +96,7

git: 49a4838a0d94 - main - vmm: Emulate testb imm8,r/m8

2025-03-04 Thread Jose Luis Duran
The branch main has been updated by jlduran:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=49a4838a0d94e145a826abf02aa03ff444e614e3

commit 49a4838a0d94e145a826abf02aa03ff444e614e3
Author: Jose Luis Duran 
AuthorDate: 2025-03-04 13:51:47 +
Commit: Jose Luis Duran 
CommitDate: 2025-03-04 13:51:47 +

vmm: Emulate testb imm8,r/m8

Add support for "testb imm8,r/m8" emulation.

PR: 261940
PR: 282852
Reviewed by:markj, emaste
Approved by:emaste (mentor)
Obtained from:  Illumos (https://www.illumos.org/issues/14483)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D49208
---
 sys/amd64/vmm/vmm_instruction_emul.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/sys/amd64/vmm/vmm_instruction_emul.c 
b/sys/amd64/vmm/vmm_instruction_emul.c
index 51769faf5893..c53e32889000 100644
--- a/sys/amd64/vmm/vmm_instruction_emul.c
+++ b/sys/amd64/vmm/vmm_instruction_emul.c
@@ -236,6 +236,12 @@ static const struct vie_op one_byte_opcodes[256] = {
.op_byte = 0x8F,
.op_type = VIE_OP_TYPE_POP,
},
+   [0xF6] = {
+   /* XXX Group 3 extended opcode - not just TEST */
+   .op_byte = 0xF6,
+   .op_type = VIE_OP_TYPE_TEST,
+   .op_flags = VIE_OP_F_IMM8,
+   },
[0xF7] = {
/* XXX Group 3 extended opcode - not just TEST */
.op_byte = 0xF7,
@@ -1284,6 +1290,12 @@ emulate_test(struct vcpu *vcpu, uint64_t gpa, struct vie 
*vie,
error = EINVAL;
 
switch (vie->op.op_byte) {
+   case 0xF6:
+   /*
+* F6 /0test r/m8, imm8
+*/
+   size = 1;   /* override for byte operation */
+   /* FALLTHROUGH */
case 0xF7:
/*
 * F7 /0test r/m16, imm16