kern.post.mk: Early fail the build in case of any duplicate objs
Since all the kernel objects are built and placed in the same directory,
a conflict is quite possible when two modules have a file with the same
name. Another conflict possibility is that the source is specified
twice in conf/files.
In order to avoid running into mysterious/unexpected issues caused by
duplicate objects, simply abort the build when such a duplicate is
found.
Of course, a better solution is to refactor the build framework to
eliminate such a limitation, so that a module may choose whatever
filename it likes.
bsd.kern.mk: Remove -finline-limit and related compiler parameters
These compiler flags/parameter were inherited from FreeBSD. They
basically meant to ALWAYS inline the functions mark with the 'inline'
keyword. Since modern GCC provides with the 'always_inline' attribute,
it's better to use '__always_inline' annotation for those functions that
must be inlined. As a result, remove the '-finline-limit' and related
parameters to achieve better inlining results; e.g., it avoids
unnecessary over-inlining.
kernel: Adjust inlining annotations for better results
We will be removing the '-finline-limit=8000 ...' compiler flags, which
can change the inlining results. By adjusting the inlining annoations
with proper '__always_inline' annotations, the inlining results become
better and more deterministic.
In the meantime, a few unnecessary '__inline' annotations are removed.
Discussed-with: dillon
kern.pre.mk: Remove 'gcc2_compiled.' symbol stripping
This was inherited from FreeBSD and has long been obsolete since GCC 3.
See also: FreeBSD (https://reviews.freebsd.org/D38764)
ddb - Try AcpiReset() when invoking DDB's reset command.
- This allows some modern notebooks to successfully reset from DDB, where
the classic outb(0x64, 0xFE) method no longer works. For some notebooks,
we'll also need to support EFI Reset here, but that will require further
work.
efirt - Register EFI Reset with the shutdown_final EVENTHANDLER.
- This adds a safeguard to efi_enter() to fail gracefully when called from
a kernel thread, where curthread->td_lwp is NULL.
- Further work is needed to allow EFI Reset to work more simply without
messing with the current LWP's vmspace.
periodic: Do not use colon (:) in hammer2 snapshot names
As shown in the previous commit, a PFS label can be specified in
'vfs.root.realroot' to mount the root partition from a custom PFS,
including a snapshot. However, such a PFS label cannot have the colon
(:) symbol, which is used as a field separator. Therefore, adjust the
162.snapshot-hammer2 script to not name an auto created snapshot with a
colon in the names, so that those snapshots may be used to mount the
real root partition.
Note, the 'vfs.root.realroot' is only necessary to mount an encrypted
root partition or an LVM-based root partition.
initrd: Support to specify a PFS label in 'vfs.root.realroot'
The 'vfs.root.realroot' syntax previously didn't support to specify a
PFS label for a HAMMER/HAMMER2 filesystem on an encrypted partition.
There was a hack to work around this limitation by naming the mapped
device with 'd' in the end (e.g., use 'rootd' rather than 'root'), so
the kernel would auto mount the '@ROOT' PFS from it.
However, it was impossible to work around the limitation when the target
PFS uses a custom label, e.g., '@ROOT.20260616'.
This commit fixes the limitation by extending the rcmount_{crypt,tcplay}
scripts to support to directly specify the PFS label in
'vfs.root.realroot'.
Update and improve the initrd(7) man page accordingly.
Reported-by: vjkarbo (via IRC)
periodic: Do not use colon (:) in hammer2 snapshot names
As shown in the previous commit, a PFS label can be specified in
'vfs.root.realroot' to mount the root partition from a custom PFS,
including a snapshot. However, such a PFS label cannot have the colon
(:) symbol, which is used as a field separator. Therefore, adjust the
162.snapshot-hammer2 script to not name an auto created snapshot with a
colon in the names, so that those snapshots may be used to mount the
real root partition.
Note, the 'vfs.root.realroot' is only necessary to mount an encrypted
root partition or an LVM-based root partition.
initrd: Support to specify a PFS label in 'vfs.root.realroot'
The 'vfs.root.realroot' syntax previously didn't support to specify a
PFS label for a HAMMER/HAMMER2 filesystem on an encrypted partition.
There was a hack to work around this limitation by naming the mapped
device with 'd' in the end (e.g., use 'rootd' rather than 'root'), so
the kernel would auto mount the '@ROOT' PFS from it.
However, it was impossible to work around the limitation when the target
PFS uses a custom label, e.g., '@ROOT.20260616'.
This commit fixes the limitation by extending the rcmount_{crypt,tcplay}
scripts to support to directly specify the PFS label in
'vfs.root.realroot'.
Update and improve the initrd(7) man page accordingly.
Reported-by: vjkarbo (via IRC)
nrelease: Add root_rw_mount="NO" to rc.conf to fix ISO boot
The ISO root filesystem is obviously readonly and cannot be remounted to
'rw'. Without setting 'root_rw_mount=NO', the ISO boot would abort
after failing to remount the root filesystem.
This is a follow-up fix to my previous commit
31b00396377857ebb62259aa944f9351fa62ea44.
Reported-by: Sergey Zigachev (servik)
nrelease: Simplify the adjustments to loader.conf for IMG boot
Use 'sed' similar to fstab adjustments instead of grep+echo to adjust
'boot/loader.conf' to the IMG boot.
rc.conf: Add and document the missing root_rw_mount=YES
The 'root_rw_mount' variable was missing, and it caused the rc.d/root
script to always ignore the 'mount -u -o rw /' command. Nevertheless,
the '/' root filesystem was still remounted to be 'rw' because the later
'mount -a' command, according to /etc/fstab.
With this 'root_rw_mount=YES' placed, the '/' entry should now be
optional in /etc/fstab because the '/' root filesystem can be correctly
remounted to be 'rw'.
Obtained-from: FreeBSD (commit 6e1b226)
Reported-by: robstinge (IRC)
nrelease: Adjust fstab and reuse it for IMG boot
The root '/' filesystem is mounted by the kernel, so it can be omitted
from 'etc/fstab'. This also makes the 'fstab' file be used by the IMG
boot, so just reuse it.
nrelease: Adjust fstab to remove '-C' option for /tmp tmpfs mount
For the /tmp mount, no need to copy the origin contents; also, there
shouldn't be any contents at this early boot stage.
dsynth - Add "list-only" directive
This directive generates a list of build dependencies for the requested
ports to the file "build.txt". Each line is formatted:
port at flavor pkgfilename
Which should be easily parseable with an awk or sed filter.
Example: dsynth list-only everything
Requested-by: daftaupe
Bump __DragonFly_version for struct changes in the last commit
The last commit added 'rm_cpuid' to 'struct u_rman' in <sys/rman.h>, and
added 'dm_cpuid' to 'struct devinfo_rman' in <devinfo.h>. Both are
public headers to userland, so bump __DragonFly_version for the change.
devinfo - Print the cpuid of rman resources if it's set.
* This adds the cpuid field to the u_rman and devinfo_rman structs, and
exports this value from struct rman in the rman sysctl.
* This is meant for IRQ resources, where "devinfo -r" will now print the
CPU where each IRQ is allocated, which is especially useful for drivers
that use multiple MSI-X interrupts.
fix(firewire): fix tcode switch fallthrough on little-endian
The break statements in fwohci_arcv_swap() were inside
#if BYTE_ORDER == BIG_ENDIAN guards, causing all cases to fall
through to the default "Unknown tcode" handler on little-endian
(x86) systems. This meant every received packet was dropped,
breaking bus manager election, split transactions, and all
asynchronous communication.
Move break statements outside the #if guards to match FreeBSD.
fix(syslogd): check f_prevline content instead of array address
f_prevline is a char[] struct member, so its address is always
non-NULL. Check f_prevline[0] to test whether the previous line
buffer contains a message, matching the existing check at line 1010.
fix(kcollect): mark unused total_count parameter in dump_influxdb()
total_count is required by the function pointer signature but not
used in the influxdb output path. Mark it __unused and remove the
dead ++total_count increment.
fix(iostat): remove unused tflag variable
tflag was set when -t was parsed but never checked; the -t option's
effect is handled entirely by buildmatch().