DragonFlyBSD/src 51591afsys/bus/pci pcivar.h pci.c, sys/dev/acpica acpi_powerres.c acpivar.h

Add functions that translate an acpi/pci power state to a string.

Use it whereever we previously printed "D%d". This is in preparation
for the upcoming ACPICA upgrade that will break the assumption that
it is always "D<value>".

Inspired by similar changes in FreeBSD.
DeltaFile
+13-9sys/dev/acpica/acpi_powerres.c
+12-2sys/bus/pci/pcivar.h
+11-3sys/sys/power.h
+5-4sys/bus/pci/pci.c
+9-0sys/dev/acpica/acpivar.h
+3-5sys/dev/acpica/acpi_pci.c
+53-2332 files not shown
+149-8738 files

DragonFlyBSD/src b73d6e4sys/dev/disk/vn vn.c, sys/kern subr_diskmbr.c

kernel: Assume s0 (compatibility slice) for any unformatted disk

In commit 8cf8601ebae6a54f01fe9a7aed045832fc6a903b I changed the kernel
to ignore a disk without MBR or GPT, instead of assuming there is the
compatibility slice (s0) covering the whole disk.  A later commit
f687b277b90809ae7df59f012ba2c7312b608545 only made a special case
for vn(4) disk because our nrelease procedure uses such a behavior.

This behavior change might cause real trouble for those users that
actually use the compatibility slice.  A filesystem previously created
directly on an unformatted disk would disappear and unusable on the new
kernel.  What's worse, there is no empty space at the disk beginning to
create a MBR for migration.

This partially reverts commit f687b277b90809ae7df59f012ba2c7312b608545
and brings back the s0 compatibility slice for any disk that doesn't
have a MBR/GPT header (i.e., unformatted disks).

While there, adjust the kernel message to be more descriptive.

    [2 lines not shown]
DeltaFile
+2-7sys/kern/subr_diskmbr.c
+1-5sys/sys/disk.h
+2-2sys/dev/disk/vn/vn.c
+2-1sys/sys/param.h
+7-154 files

DragonFlyBSD/src ab499a6. Makefile.inc1

Makefile.inc1: Abort building if MAKEOBJDIRPREFIX not set as an env var

As described in <bsd.obj.mk>, MAKEOBJDIRPREFIX works properly only if
set as an *environment* variable, not as a global or command-line
variable.  This change adds a check for MAKEOBJDIRPREFIX and aborts the
building if it's specified as a make variable on the command line.

Although build(7) lists quite a few environment variables, but most of
them (e.g., KERNCONF, DESTDIR) just work as well when specified as a
make variable.  However, MAKEOBJDIRPREFIX is special and doesn't work
in the same way.

We decided to simply abort the building if MAKEOBJDIRPREFIX is
mis-specified, being simple and following build(7) as well, although we
can also convert it to an environment variable by using:

        .MAKEOVERRIDES:= ${.MAKEOVERRIDES:NMAKEOBJDIRPREFIX}
        .export MAKEOBJDIRPREFIX

Discussed-with: swildner
DeltaFile
+8-0Makefile.inc1
+8-01 files

DragonFlyBSD/src 52ef6d3. Makefile.inc1

Makefile.inc1: Abort building if MAKEOBJDIRPREFIX not set as an env var

As described in <bsd.obj.mk>, MAKEOBJDIRPREFIX works properly only if
set as an *environment* variable, not as a global or command-line
variable.  This change adds a check for MAKEOBJDIRPREFIX and aborts the
building if it's specified as a make variable on the command line.

Although build(7) lists quite a few environment variables, but most of
them (e.g., KERNCONF, DESTDIR) just work as well when specified as a
make variable.  However, MAKEOBJDIRPREFIX is special and doesn't work
in the same way.

We decided to simply abort the building if MAKEOBJDIRPREFIX is
mis-specified, being simple and following build(7) as well, although we
can also convert it to an environment variable by using:

        .MAKEOVERRIDES:= ${.MAKEOVERRIDES:NMAKEOBJDIRPREFIX}
        .export MAKEOBJDIRPREFIX

Discussed-with: swildner
DeltaFile
+8-0Makefile.inc1
+8-01 files

DragonFlyBSD/src 27a697fshare/mk bsd.obj.mk

<bsd.obj.mk>: Whitespace cleanups
DeltaFile
+4-4share/mk/bsd.obj.mk
+4-41 files

DragonFlyBSD/src 24a81dd. Makefile.inc1

Makefile.inc1: Adjust _bwcleanup to create ${DESTDIRBASE} for build-all

The 'build-all' target requires ${DESTDIRBASE} exist for writing the
log, so adjust the '_bwcleanup' target to recreate ${DESTDIRBASE} after
cleanup.

This is a follow-up fix to my previous commit
b931e3c28f1501a705efe03cc2a8a6ea4792099d.
DeltaFile
+2-2Makefile.inc1
+2-21 files

DragonFlyBSD/src ad858cbinitrd Makefile

initrd: Use '&&' to chain shell commands to avoid partial failures
DeltaFile
+2-2initrd/Makefile
+2-21 files

DragonFlyBSD/src 2298f74sbin/dhclient bpf.c

Revert "dhclient(8): Fix send_packet() to not convert ip_len/ip_off byteorder"

This reverts commit 683751a6ca60d9dd39c7c6b8c5fd88b8c2d4b5c3.

The commit 2ba12c9ccce24e5186e60a8be059faf55cd27e21 mentioned in the
reverted commit was in the master/6.5 branch and didn't affect the 6.4
stable branch.
DeltaFile
+9-0sbin/dhclient/bpf.c
+9-01 files

DragonFlyBSD/src 683751asbin/dhclient bpf.c

dhclient(8): Fix send_packet() to not convert ip_len/ip_off byteorder

After commit 2ba12c9ccce24e5186e60a8be059faf55cd27e21, kernel requires
the 'ip_len' and 'ip_off' fields in the network byte order.

This fixes the 'send_packet: Invalid argument' error appeared upon lease
renewal.

This reverts commit c02c89a76ecc16d518c56d610e571018048a43dd .
DeltaFile
+0-9sbin/dhclient/bpf.c
+0-91 files

DragonFlyBSD/src 500b5a7sbin/dhclient bpf.c

dhclient(8): Fix send_packet() to not convert ip_len/ip_off byteorder

After commit 2ba12c9ccce24e5186e60a8be059faf55cd27e21, kernel requires
the 'ip_len' and 'ip_off' fields in the network byte order.

This fixes the 'send_packet: Invalid argument' error appeared upon lease
renewal.

This reverts commit c02c89a76ecc16d518c56d610e571018048a43dd .
DeltaFile
+0-9sbin/dhclient/bpf.c
+0-91 files

DragonFlyBSD/src 0969469sbin/ping ping.c

ping(8): Fix pr_iph() to use ntohs() for ip_off field

The ip_off (flags + fragment offset) is a 16-bit field, so we should use
ntohs() instead of ntohl() to read it.

See also: https://reviews.freebsd.org/D38479
DeltaFile
+3-3sbin/ping/ping.c
+3-31 files

DragonFlyBSD/src 52d6fee. Makefile.inc1

Makefile.inc1: Remove obsolete comment about '.makeenv'
DeltaFile
+0-3Makefile.inc1
+0-31 files

DragonFlyBSD/src b931e3c. Makefile.inc1

Makefile.inc1: Fix build-all/install-all/buildportschroot log directory

The log directory was ${GENLOGDIR} which hardcoded the "/usr/obj"
top-level directory.  If user defines a custom MAKEOBJDIRPREFIX, the
GENLOGDIR would become wrong.  Fix the issue by replacing GENLOGDIR with
DESTDIRBASE.  In addition, remove the unnecessary 'mkdir ${GENLOGDIR}'.

While there, change the 'ldconfig' command in chroot to be
'/bin/sh -c "rcrestart ldconfig"', aligning with the one used in
nrelease/Makefile.
DeltaFile
+20-23Makefile.inc1
+20-231 files

DragonFlyBSD/src 6062496. Makefile.inc1

Makefile.inc1: Remove obsolete build-tools remnants

The build-tools was disabled and marked obsolete by zrj in commit
ce2989fe1212f664d615268edc64a57801fc7404, and then was removed by dillon
in commit 2a89766ae0591bf31ec51e6298cf4e4d050f4a1a, leaving only the
undefined BTOOLSDIRS.

This commit removes the remnants.
DeltaFile
+12-57Makefile.inc1
+12-571 files

DragonFlyBSD/src 52c924blib/libc/secure stack_protector.c

libc: Remove unused <sys/sysctl.h> header from stack_protector.c
DeltaFile
+0-1lib/libc/secure/stack_protector.c
+0-11 files

DragonFlyBSD/src bc10b6egnu/usr.bin/cc47/cc_prep auto-host.h, gnu/usr.bin/cc47/libcpp config.h

gnu: Fix libcpp/config.h and cc_prep/auto-host.h for unlocked stdio

This change was missed in commit 794d56434eb286a928220fda3d0eec22f5c8b9a2.
DeltaFile
+5-5gnu/usr.bin/cc47/cc_prep/auto-host.h
+5-5gnu/usr.bin/cc47/libcpp/config.h
+5-5gnu/usr.bin/cc80/cc_prep/auto-host.h
+5-5gnu/usr.bin/cc80/support-libs/libcpp/config.h
+20-204 files

DragonFlyBSD/src 8dd5dbcsys/dev/virtual/virtio/virtio virtqueue.c

virtio: Fix cpu_lfence() wrong placement in virtqueue_dequeue()

The cpu_lfence() should be placed just after reading the 'used->idx',
before the 'vq_used_cons_idx' equality check and 'used->ring[]' access.
This is the correct use pattern of lfence.

More importantly, this fix an infinite loop in virtqueue_poll() that
happened when GCC 12.5 inlined the whole virtqueue_dequeue().  GCC
thought 'vq->vq_ring.used->idx' wouldn't change during the loop, so
hoisted the 'if (vq->vq_used_cons_idx == vq->vq_ring.used->idx)' into
its own loop and thus an infinite loop.

Maybe it's better to use atomic ops to read the 'vq_ring.used->idx' and
'vq_ring.used->flags' fields, which are updated by the host side.  Need
to investigate this later.
DeltaFile
+4-2sys/dev/virtual/virtio/virtio/virtqueue.c
+4-21 files

DragonFlyBSD/src 6e99b78sbin/ping ping.c

ping(8): Fix pr_iph() to use ntohs() for ip_off field

The ip_off (flags + fragment offset) is a 16-bit field, so we should use
ntohs() instead of ntohl() to read it.

See also: https://reviews.freebsd.org/D38479
DeltaFile
+3-3sbin/ping/ping.c
+3-31 files

DragonFlyBSD/src 9ef3d71sys/sys serialize2.h serialize.h

<sys/serialize.h>, <sys/serialize2.h>: Add missing license header
DeltaFile
+34-0sys/sys/serialize2.h
+33-0sys/sys/serialize.h
+67-02 files

DragonFlyBSD/src 467c5b0usr.sbin/traceroute traceroute.c

traceroute(8): Fix ip_len byteorder to network order

Commit 2ba12c9ccce24e5186e60a8be059faf55cd27e21 changed the kernel to
accept 'ip_len' in the network byte order.  That commit adjusted ping(8)
but missed traceroute(8).

Without this fix, traceroute(8) simply failed with sendto() returning
the EINVAL errno.

While there, simply assign 0 instead of htons(0) to ip_off field.
DeltaFile
+2-2usr.sbin/traceroute/traceroute.c
+2-21 files

DragonFlyBSD/src 447e693sys/conf files, sys/kern kern_sysctl.c

kernel: Fix a few build conflicts between optional and standard code.

In this case kernels without either KTRACE, acpi or pci.
DeltaFile
+4-4sys/conf/files
+4-1sys/platform/pc64/x86_64/machdep.c
+2-0sys/kern/kern_sysctl.c
+10-53 files

DragonFlyBSD/src 065436fstand/contrib/edk2/MdePkg/Include/Library DebugLib.h BaseLib.h

edk2: Sync our TianoCore EDK II headers with the edk2-stable202602 tag.
DeltaFile
+25-25stand/contrib/edk2/MdePkg/Include/Library/DebugLib.h
+22-22stand/contrib/edk2/MdePkg/Include/Library/BaseLib.h
+47-472 files

DragonFlyBSD/src 2f464f7usr.sbin/installer/dfuibe_installer fn_configure.c

installer(8): Auto fill default router in fn_assign_ip()

Add field change callbacks for "interface_ip" and "interface_netmask"
fields to auto fill/update the default router according to the IP and
netmask.

In addition, set the default netmask to "255.255.255.0".

Fix bug #3382

Bug: https://bugs.dragonflybsd.org/issues/3382
Reported-by: Nelson H. F. Beebe
DeltaFile
+80-1usr.sbin/installer/dfuibe_installer/fn_configure.c
+80-11 files

DragonFlyBSD/src 703449fusr.sbin/installer/dfuibe_installer fn_configure.c

installer(8): Fix hostname FQDN handling in fn_assign_ip()

Append domain to create FQDN only when the domain is not empty, similar
to the logic in fn_assign_hostname_domain().
DeltaFile
+4-1usr.sbin/installer/dfuibe_installer/fn_configure.c
+4-11 files

DragonFlyBSD/src ee87404usr.sbin/installer/dfuibe_installer fn_configure.c

installer(8): Avoid prompting for hostname and domain twice

During the manual IP configuration, the installer prompted for the
hostname and domain.  Later, the main configuration menu prompted for
them again.

Retrieve the hostname and domain from rc_conf/resolv_conf variables, and
pre-populate the form fields to avoid the duplicate prompts.

In addition, pre-populate the DNS server field from resolv_conf vars.

Fix bug #3383.

Bug: https://bugs.dragonflybsd.org/issues/3383
Reported-by: Nelson H. F. Beebe
DeltaFile
+46-15usr.sbin/installer/dfuibe_installer/fn_configure.c
+46-151 files

DragonFlyBSD/src 39a5f8eusr.sbin/installer/dfuife_curses curses_form.c curses_xlat.c, usr.sbin/installer/libdfui connection.c form.c

installer(8): Implement form field change callback mechanism

Implement a callback mechanism for form field change.  This allows the
backend to dynamically update the dependent form fields when user
modifies one field.

The whole interaction flow is:
1. Set the callback function for a form field;
2. The frontend presents the form;
3. User fills the field and changes focus;
4. The frontend sends the FIELD_CHANGED message and waits for the reply;
5. The backend handles the message, triggers the callback, and replies
   the FIELD_CHANGED_ACK message with the full dataset;
6. The frontend applies the dataset to present the updated form.

For example, when user fills the interface IP address, the callback will
auto fill the default router / gateway address.

TODO: The following low-priority features are missing:

    [4 lines not shown]
DeltaFile
+78-16usr.sbin/installer/libdfui/connection.c
+77-2usr.sbin/installer/dfuife_curses/curses_form.c
+63-0usr.sbin/installer/libdfui/form.c
+45-1usr.sbin/installer/dfuife_curses/curses_xlat.c
+35-0usr.sbin/installer/libdfui/dfui.h
+11-0usr.sbin/installer/dfuife_curses/curses_widget.c
+309-197 files not shown
+329-2613 files

DragonFlyBSD/src 85a02fcusr.sbin/installer/dfuibe_installer fn_configure.c flow.c

installer(8): Refactor vars handling to avoid writing duplicates

config_vars_write() appends the in-memory vars to the target config
file.  fn_assign_hostname_domain() fn_assign_ip() previously both read
the 'resolv.conf' and then write the updated vars, resulting duplicate
items being written to 'resolv.conf'.

Refactor the vars handling to start with empty 'rc_conf' and
'resolv_conf' vars, adjust the above configure functions to add/set
variables, and only write the config files once at the end.
DeltaFile
+61-77usr.sbin/installer/dfuibe_installer/fn_configure.c
+38-17usr.sbin/installer/dfuibe_installer/flow.c
+6-2usr.sbin/installer/dfuibe_installer/fn_install.c
+1-0usr.sbin/installer/dfuibe_installer/fn.h
+106-964 files

DragonFlyBSD/src ef90661usr.sbin/installer/libinstaller confed.c

installer(8): Improve config_vars_read() to support CONFIG_TYPE_RESOLV

The config_vars_read() function previously only supported CONFIG_TYPE_SH
and ignored CONFIG_TYPE_RESOLV that's supported by config_vars_write().
Add the CONFIG_TYPE_RESOLV file support to config_vars_read().  This
change is required in later commits that improve/simplify the
installation flow.
DeltaFile
+99-17usr.sbin/installer/libinstaller/confed.c
+99-171 files

DragonFlyBSD/src e2e1ce5usr.sbin/installer/installer installer.sh

installer(8): Use pgrep(1) to check frontend/backend processes

Use 'pgrep -x' to correctly match the frontend/backend processes.  This
is simpler than the original ps+grep method and fixes the partial match
problem.  For example, the old grep would incorrectly match the tail(1)
process that was checking the `dfuibe_installer_debug.log` or
`dfuife_curses_debug.log` debug logs.
DeltaFile
+4-21usr.sbin/installer/installer/installer.sh
+4-211 files

DragonFlyBSD/src a19fa47usr.sbin/installer/dfuibe_installer flow.c main.c, usr.sbin/installer/installer installer.sh

installer(8): Whitespace cleanups
DeltaFile
+114-116usr.sbin/installer/dfuibe_installer/flow.c
+14-14usr.sbin/installer/installer/installer.sh
+8-8usr.sbin/installer/libdfui/connection.c
+1-2usr.sbin/installer/dfuibe_installer/main.c
+1-1usr.sbin/installer/dfuibe_installer/fn_configure.c
+0-1usr.sbin/installer/libinstaller/confed.c
+138-1426 files