tail(1): Almost sync with FreeBSD
The most important change is that the '-F' flag now supports files that
are not yet exist; it will persist in trying to open the files instead
of giving up. This behavior is the same as GNU tail.
Another major fix is that "tail -f" now works on non-local filesystems.
Things excluded from the sync:
- long options
- style changes
- capability/capsicum support
- expand_number(3) support (our libutil(3) doesn't have it)
In addition, improve the BOOTSTRAPPING handling a bit. The program
simply exits when -f/-F is specified.
tail(1): Fix '-r' (reverse) to work on pseudo filesystems
Pseudo filesystems (e.g., procfs) advertize a zero file size. Fix
reverse() to handle such a case so that '-r' works on pseudo
filesystems.
lagg.4: Improve the wired-wireless failover example
Adjust the failover example to change the MAC address of the *wired*
device instead of the *wireless* device, because some common wireless
devices do not support to change the MAC address.
Obtained-from: FreeBSD
nrelease - Preliminary Makefile adjustment to use dsynth (2)
* Add "binpkgs" option back in
* Add www/chromium to the gui build
* Use the -t option to du (calculate apparent size) so it does not
undercount the size of the root on a compressed H2 volume in order
to size a USB stick that is currently formatting UFS.
(we really need to adjust that whole mess to a dual-partition scheme
and use hammer2, but for now its still all in one UFS partition).
* Improve console output
dsynth - Don't auto-upgrade on basic directives, exit code on FAILUREs
* Don't auto-upgrade with the "build" and "force" directives. The
"install" and "upgrade-system" directives will will issue the
upgrade.
* Exit with code 1 if any builds fail with "FAILURE". Skipped packages
alone do not cause an exit code of 1.
nrelease - Preliminary Makefile adjustment to use dsynth
* Use dsynth to build packages. Note that we still have to bootstrap
"pkg" (chicken-and-egg issue).
* dsynth environment is placed in /usr/obj/release/build and is null-mounted
into the chroot.
* dsynth is run from the chroot to build and install packages.
* Output from buildworld/buildkernel/installworld/installkernel now written
to log files in /usr/obj/release instead of spewing to the console
to reduce clutter.
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.
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]
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
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
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.
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
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.
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.
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