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().
fix(vmstat): remove unused zfreecnt_prev in dozmem()
zfreecnt_prev was accumulated from saved per-cpu zone stats but
never displayed. Only znalloc_prev is used for the delta output.
fix(diff): remove unused jackpot counter in check()
The jackpot variable tracked hash collision false-matches but was
only referenced in a commented-out debug fprintf. Remove the variable,
its increment, and the dead comment block.
fix(growfs): remove unused dupper variable in updjcg()
dupper was computed from cgdmin() but never referenced in this
function. The other growfs functions that use dupper are unaffected.
fix(libfetch): remove unused base64 length counter in http_base64()
The 'r' variable tracked output length but was never returned or
used. The function returns the NUL-terminated string directly.
fix(monop): remove unused rnt variable in printsq()
The railroad rent was computed into 'rnt' but never used; the printf
already calculates the same value inline via 25 << (num_rr - 1).
fix(libkvm): return close() error status from kvm_close()
kvm_close() accumulated close() return values into 'error' via |=
but always returned 0, silently discarding close failures.
Return the accumulated error to match the function's int return type
and the kvm_close(3) manpage contract.
hammer2: fix HAMMER2IOC_RECLUSTER ioctl failing on local mounts
iroot->cluster.focus is lazily set during I/O via hammer2_cluster_resolve
and is NULL at mount time, causing HAMMER2IOC_RECLUSTER to always fail with
EINVAL and log a misleading "not a local device mount" message.
Use cluster->focus->hmp when focus is set (priority), falling back to
array[0].chain->hmp for single-chain clusters where focus has not yet
been resolved. Remove the spurious diagnostic kprintfs.
libnvmm: Revert unneeded '-Wdangling-pointer' #pragma diagnostic
The in-base GCC 12.5 does not give such warnings, so just revert this
unneeded #pragma hack added in commit
bdbecb468706b0d4afd30f9aeb119c342f6f4e29.
In addition, we don't really like such #pragma hacks all over the place;
better to identify the cause and fix the code or adjust the warning
flags to suppress false positives.
fix: iconv: move NULL checks before pointer arithmetic in iconvctl()
strchr() result was used in pointer arithmetic and incremented before
being checked for NULL. Move the guards above the strlcpy() call.
tcplay/cryptdisks: Suppress GCC 15 false-positive -Wmaybe-uninitialized.
GCC 15 cannot see that mem is always initialized after the
malloc NULL check. Use a guarded diagnostic pragma to suppress
the warning only on GCC >= 15.
various: Fix -Wstringop-overread and -Wdangling-pointer warnings.
Fix sizeof(&sum) vs sizeof(sum) bug in adventure save/restore.
Fix strcmp() on non-NUL-terminated fgetln() buffer in libfetch.
Suppress false positives in libefivar and libnvmm.
libc/rs: Fix use-after-free on realloc (-Wuse-after-free).
GCC 15 warns when pointer arithmetic references a pointer that was
passed to realloc(). Save the offset before the realloc call and
recompute the pointer from the new allocation afterwards.
various: Fix always-true/false address comparisons (-Waddress).
GCC 15 warns when comparing the address of a struct member against
NULL, since such addresses can never be NULL. Replace with emptiness
checks where intent was "is it set", remove dead guards otherwise.
Also fixes a latent bug in telnet ring.c where a pointer expression
was used as a boolean instead of as the RHS of a comparison.
various: Fix -Wunterminated-string-initialization warnings.
GCC 15 warns when a string literal exactly fills a char array,
truncating the NUL terminator. Extend arrays used as strings.
Use char array initializers for intentionally non-terminated arrays.