Commit Graph

13382 Commits

Author SHA1 Message Date
christos 514871bdef use __func__ 2024-04-24 14:23:37 +00:00
christos c7e1aa689d make a separate sorting function and KNF (thanks rillig) 2024-04-24 14:02:39 +00:00
christos a3d65a98f9 For the NetBSD tools build we provide our own fts.h not FreeBSD's so the
comparator should have the NetBSD signature.
2024-04-24 01:44:51 +00:00
christos a5d2beee4d pass lint, simplify 2024-04-23 22:18:56 +00:00
christos c7526c4ece makefs: Fix symlink permission bits
Permission bits for symlinks are taken straight from `lstat()`. However, the
actual bits presented to the user are filesystem/kernel specific. For example,
Linux with ext2/3/4 will use 0777 for symlinks, whereas NetBSD/FFS will
show 0755. As far as `makefs` is in the loop, the target filesystem will likely
be FFS, so use 0755.
2024-04-23 22:12:48 +00:00
christos c50dd23e93 makefs: Sort directory contents by name (Jan-Benedict Glaw)
`makefs` inserts nodes into its internal data structures in the order as
returned by `readdir()` calls. As this is unpredictable, sort entries by
name before creating the target filesystem.

  This is done by first converting the (per-directory) linked list into
a plain array, sort it, finally re-link the list. Special case for the
sorting function: The "." directory entry seems to be ment to be always
at the front, so always check that first.
2024-04-23 22:12:16 +00:00
nia f7dfb79875 Move MIPS N64 compat out of {base,debug}32 into {base,debug}64
martin requested separation by ABI and it doesn't make much sense
to have 64-bit binaries in a set called 32.
2024-04-22 14:41:24 +00:00
rillig f56f0d26c4 {usr.,}{s,}bin: replace LINT_SUPPORTED with the standard NOLINT
While here, re-enable lint in those cases where lint was skipped due to
a bug in interpreting abstract types, which was fixed in cgram.y 1.469
from 2023-08-02.
2024-04-20 13:24:48 +00:00
andvar 65b579494c fix typo in method name: part_attr_fornat_str -> part_attr_format_str. 2024-04-11 06:42:18 +00:00
nia 545236f400 Add new sets: base32, debug32, manhtml
- base32 contains (when MKCOMPAT=yes) shared libraries for 32-bit
  compatibility, previously included in base

- debug32 contains (when MKCOMPAT=yes) debug symbols and static libraries
  containing debug symbols for 32-bit compatiblity, previously included
  in debug

- manhtml contains (when MKHTML=yes) the HTML files previously included
  in 'man', which are of limited utility without third-party software.

The motivation for this change is to be able to easily exclude sets
from CD-ROM images that go over the size limit without xz compression
(which many NetBSD platforms struggle to extract at acceptable speeds).
2024-04-09 15:17:21 +00:00
christos 2179683207 remove dup named dir 2024-04-05 16:44:54 +00:00
riastradh ad49149131 elftoolchain: Be consistent about which ELF header files we use.
1. For tools that use elftoolchain: always use elftoolchain's
   elfdefinitions.h.  Don't even think about looking at the host's
   sys/exec_elf.h, which makes no sense and should never happen.

   (ELF tools that don't use elftoolchain, like m68k-elf2coff,
   continue to use nbincludes/sys/exec_elf.h.  But no more nbincludes
   hacks in elftoolchain.)

2. For kernel components (solaris, zfs, dtrace): always use
   sys/exec_elf.h, even in Solaris components via sys/elf.h.
   elfdefinitions.h is not wired up in the kernel build at all.

3. For most userland components that involve libelf: use
   elfdefinitions.h via libelf header files (libelf.h, gelf.h).

   libdtrace in particular requires _all_ R_* reloc type definitions,
   but sys/exec_elf.h brings in only the _current machine's_ R_*
   reloc type definitions.  (While here: Use uintptr_t instead of
   Elf_Addr for pointer-to-integer cast, since Elf_Addr is MD and
   provided only by sys/exec_elf.h, not by elfdefinitions.h.)

   And most userland components using libelf don't rely on any
   properties of the current machine from sys/exec_elf.h, so they can
   use libelf's elfdefinition.h.

   Exceptions:

   - dtrace drti.c relies on link.h -> link_elf.h -> sys/exec_elf.h,
     but it also relies on sys/dtrace.h -> sys/elf.h ->
     elfdefinitions.h like other userland components using sys/elf.h.

   - kdump-ioctl.c uses sys/exec_elf.h directly and sys/dtrace.h ->
     sys/elf.h -> elfdefinitions like other userland components using
     sys/elf.h.

   - t_ptrace_wait.c (via t_ptrace_core_wait.h) uses libelf to parse
     core files, but relies on sys/exec_elf.h for struct
     netbsd_elfcore_procinfo.

   None of these exceptions needs all R_* reloc type definitions, so
   as a workaround, we can just suppress libelf's elfdefinitions.h by
   defining _SYS_ELFDEFINITIONS_H_ and use sys/exec_elf.h in these
   exceptions.

And undo the whole BUILTIN_ELF_HEADERS mistake.  This was:

- half bogus workarounds for missing build_install dependencies in
  tools/Makefile, which are no longer missing now, and
- half futile attempt to use src/sys/sys/exec_elf.h via nbincludes in
  tools involving libelf instead of libelf's elfdefinitions.h, which
  collides.

Longer-term, we may wish to unify sys/exec_elf.h and libelf's
elfdefinitions.h, so we don't have to play these games.

But at least now the games are limited to three .c files (one of
which is generated by Makefile.ioctl-c), rather than haphazardly
applied tree-wide by monstrous kludges in widely used .h files with
broken hackarounds to get the tools build lurching to completion.
2024-04-01 18:33:22 +00:00
uwe 74c925d1be exports(5): mark up the list of groups to --maproot &c as optional 2024-03-29 22:50:27 +00:00
riastradh 5ee7326feb exports(5): Tiny punctuation fix in man page. 2024-03-29 14:15:02 +00:00
rillig fa5625f426 moused: remove undocumented and unused option 'C' 2024-03-29 06:13:40 +00:00
snj bc157922b7 pick some nits 2024-03-29 00:23:05 +00:00
uwe 35565e90ce exports(5): improve mark up 2024-03-27 13:11:14 +00:00
riastradh 4d24788653 exports(5): Substantially rewrite for clarity.
Hope this is an improvement over the turgid paragraphs all about
first/second/third cases of everything.

PR misc/58063
2024-03-27 01:43:26 +00:00
riastradh 4c0b782a41 exports(5): Revert warning about `-ro' on read/write file systems.
Looks like the nfs server does enforce that after all, in spite of
the rather oblique commentary in the BUGS section about export
options being tied to local mount point options with which they must
be noncontradictory.

And there's no reason in principle it shouldn't enforce this -- it
just need to block various file system _operations_, rather than the
subtree issue where the criteria for evaluating whether operations
are allowed on particular _file handles_ are too painful to
contemplate.

PR misc/58063
2024-03-27 00:46:17 +00:00
riastradh 205c5a0017 exports(5), mountd(8): First pass at clarifying export semantics.
The exports(5) man page is full of walls of turgid prose that should
be itemized lists with syntax templates, and I'm itching to rewrite
it, but let's get the security-relevant warnings out of the way
first.

PR misc/58063
2024-03-26 23:32:43 +00:00
martin 5aa145f6e7 PR 58061: fix bug in the GPT backend: when inserting a partition
(i.e. not adding it at the end) a bogus ID was returned for the new
partition.
2024-03-24 17:29:58 +00:00
martin 96b81bf6d3 PR 58062: fix a bug I introduced with the https support: update
the pkgsrc/binary pkgs download URL not only when https transport
is selected.
2024-03-24 16:06:37 +00:00
mrg c3c0699382 usbdevs(8): don't assume usb bus count is the same as max usb bus unit
keep track of the highest usbN value, not the count of busses.

fixes a problem where you do "drvctl -d usb0" (or a parent), and then
"usbdevs" won't print info on the last bus.
2024-03-24 03:23:19 +00:00
nia b2466d56c6 sysinst: Clarify that usernames are maximum 8 characters
At least one user reported thinking that the previous wording implied
that usernames required padding to 8 characters.

This syncs the english translation with the german.
2024-03-21 02:24:35 +00:00
gutteridge eac9df6f33 cpuctl.8: fix grammar in a sentence 2024-03-19 01:19:11 +00:00
rillig b3253318bb postinstall: fix parameter order in usage message 2024-03-10 18:23:18 +00:00
rillig 3f5e8f7d32 postinstall: fix endless loop (since 2024-03-07) 2024-03-09 06:51:40 +00:00
rillig 88b554245c cpuctl: fix i386 bit descriptions for CPUID_SEF_FLAGS1
warning: non-printing character '\31' in description
    'BUS_LOCK_DETECT""b\31' [363]
2024-03-08 20:29:17 +00:00
christos fd2cfa10fe no local in loops, simplify eval (thanks kre) 2024-03-07 22:03:16 +00:00
christos 2a38a1154f - fix named.conf (remove dnssec-enable option)
- use proper local variables instead of adding _ or other prefixes.
- centralize rm use
- use grep -q instead of > /dev/null
- reduce constant duplication
2024-03-07 16:54:16 +00:00
riastradh fa5a04837c certctl(8): Pacify formal POSIX sh syntax.
According to POSIX 2018, the syntax between `then' and `elif' and
`fi' must be a _non-empty_ list of commands:

compound_list    : linebreak term
                 | linebreak term separator
                 ;
...
if_clause        : If compound_list Then compound_list else_part Fi
                 | If compound_list Then compound_list           Fi
                 ;
else_part        : Elif compound_list Then compound_list
                 | Elif compound_list Then compound_list else_part
                 | Else compound_list
                 ;

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02

NetBSD's sh(1) currently doesn't enforce this and allows an empty
sequence of commands, but let's not rely on that nonstandard quirk.

Noted in PR 57997.
2024-03-04 20:37:31 +00:00
riastradh 43f394c011 certctl(8): Avoid basename(1).
Saves some time running subprocesses.  Since this is only used for
non-directories (i.e., there's never trailing / on the inputs), it
suffices to delete the longest prefix matching glob `*/' with shell
parameter expansion -- much cheaper than spawning a subprocess.

Shaves off about 1/3 of the time spent in `certctl list' on an
aarch64 VM in qemu.

PR bin/57993
2024-03-03 15:53:55 +00:00
tkusumi 0b920f749a makefs/msdos: Fix broken [extra-directory ...] case
"path + cur->name" is not same as "cur->root + cur->path + cur->name"
for extra-directory files, as extra-directory files are
in different location. Do what makefs ffs code does.
2024-02-29 08:13:52 +00:00
martin f436dff43b Defer deletion of any color menu options untill the final menu (in the
selected language) has been loaded.
2024-02-21 20:31:57 +00:00
christos 855b7dce54 Add an options pretty-printer, pass some lint. 2024-02-18 16:59:16 +00:00
christos ca46f897d1 PR/57945: Jan-Benedict Glaw: makefs: msdos filesystems with label not
reproducible.
When we specify a label, the volume label is used to create the root dir
and it gets stamped by the timestamp. We were trying to set the timestamp
in the fs-specific part of the options parsing which did not work since
the method was called only for fs_specific options. Move setting of the
timestamp just before we create the fs, where we reconcile the rest of
the options.
2024-02-18 16:58:51 +00:00
martin 4013f0cf31 PR 57927: when comparing old and new partition state during renumbering,
ignore differences in the install target flag - the backend might have
flipped it off already to ensure only a single partition is marked
as install target.
2024-02-14 13:52:11 +00:00
andvar 1cd43426d5 Fix various typos in comments, log messages and documentation. 2024-02-10 18:43:51 +00:00
andvar 100a3398b8 fix spelling mistakes, mainly in comments and log messages. 2024-02-09 22:08:30 +00:00
andvar 749ce5c9e6 s/connetion/connection/ in messages. 2024-02-09 20:55:15 +00:00
andvar d378954346 fix misplaced or missing "e" in words with "ment" ending (argument, implement,
increment, decrement, alignment), in comments, documentation, log messages.
2024-02-08 20:51:24 +00:00
msaitoh 90313c06e6 Remove ryo@'s mail addresses. 2024-02-07 04:20:25 +00:00
msaitoh 6da2a6ed01 s/strucutre/structure/ in comment. 2024-02-07 04:00:10 +00:00
andvar 82bba4e936 fix various typos in comments. 2024-02-05 21:46:04 +00:00
andvar d30e897588 s/dependancies/dependencies/ and s/independantly/independently/ in comments and
distrib notes.
2024-02-05 21:39:51 +00:00
riastradh 83020821ca postinstall(8): Don't say /etc/openssl/certs.conf already exists.
It's confusing when all the other `postinstall fix' actions are
silent in the event they don't have anything to do.

PR install/57885
2024-01-29 00:57:38 +00:00
andvar 98a4945edb s/errer/error/ in log message. 2024-01-28 10:09:54 +00:00
jmcneill 8d626ee2f8 evbppc: Add initial support for the Nintendo Wii 2024-01-20 21:35:59 +00:00
christos 1e8c95cf5c simplify, we need to hard code the constant for tools anyway. 2024-01-19 19:08:49 +00:00
msaitoh 4dfb580c4d Add Meteor Lake and Emerald Rapids. 2024-01-18 03:19:26 +00:00