Commit Graph

13399 Commits

Author SHA1 Message Date
gutteridge 791da06dc8 installboot.8: reflect current evbmips support 2024-06-01 20:19:41 +00:00
andvar a310e615a3 s/SO_ACCEPTFITLER/SO_ACCEPTFILTER/. 2024-05-24 21:55:13 +00:00
tsutsui 2e1ec38629 Fix tools build errors on Cygwin. 2024-05-24 09:59:42 +00:00
tsutsui c1ac8e1a1f Remove no-op emips stuff.
It seems blindly copied and modified from pmax, but emips bootloader
can be specified by "Ml40x_2ace.plx" config file on the Giano simulator.
(not sure what on the real Xilinx ML401 board, but maybe hardcoded)
2024-05-22 15:42:42 +00:00
tsutsui 4882e3f0bf Add cd9660 support to search a bootloader file in the target file system.
Also add CD boot support for hp300, using a bootloader file in cd9660 fs.
This is a tool's part to close PR/54455.

HP 9000/300 machines read LIF directory entry allocated after
the LIF volume header at the top of the boot disk during bootstrap,
and a bootstrap file must be contiguously allocated on the disk
due to limitation of the LIF specification.

Current NetBSD/hp300's bootloader is larger than ~80KB so we have
to prepare a special 'boot' partition for FFS (that has only 8KB (ffsv1)
or 32KB (ffsv2) spaces) disks to put such a large bootloader.

On the other hand, on ISO9660 fs all files are allocated contiguously
so we can specify a bootloader file in the target ISO9660 directly
in the LIF directory entry.

Note we can simply use the existing "append" option to create bootable
CD ISO for hp300, but it looks some emulators (at leaset MAME) reject
such non-standard ISO files, i.e. with an appended bootloader file at
the end of the image.
2024-05-19 15:48:57 +00:00
tsutsui 448aa2ad53 Reorder function prototypes per source files. 2024-05-19 15:44:21 +00:00
rillig e040c24146 usr.sbin/flashctl: skip lint's strict bool mode with Clang
The strict bool mode is already checked in GCC mode, so restore the
previous idiomatic code.
2024-05-13 20:38:05 +00:00
msaitoh 636c2f2b35 s/iast/iasl/ from FreeBSD. 2024-05-12 23:00:21 +00:00
rillig fe00c2837e flashctl: fix lint's strict bool mode with Clang preprocessor
Treating the return value from the <ctype.h> character classification
functions as an 'int' is neither elegant nor idiomatic, but it works for
now.
2024-05-12 19:03:55 +00:00
rillig 0866d10930 lint: suppress "used but not defined" for bin, sbin, usr.bin, usr.sbin
These diagnostics are emitted by lint2, and like all diagnostics from
lint2, they don't affect the exit status.

In libc, lint cannot handle the renamings from namespace.h, generating
many false positive diagnostics since 'libc_function' is used but
'_libc_function' is defined. Until this situation is handled properly,
suppress this diagnostic.
2024-05-12 17:55:36 +00:00
tsutsui 7f4c51639c Sync with src/sys/arch/hp300/stand/mkboot/volhdr.h rev 1.6.
https://mail-index.netbsd.org/source-changes/2024/05/07/msg151195.html
> Use proper signedness for the LIF file system data structures.

mkboot should use this MI <sys/bootblock.h> and volhdr.h should
be removed soon.
2024-05-11 22:10:27 +00:00
andvar 9faf246505 s/boostrap/bootstrap/ in comment, warning message and documentation. 2024-05-11 06:50:23 +00:00
christos 0fe82aa40b Add an option to warn and error out for mtree missing entries. 2024-05-08 15:57:56 +00:00
christos 71e954c71c Add ${TOOL_DATE} (Jan-Benedict Glaw) 2024-04-26 22:07:32 +00:00
christos f421508b22 PR/58202: Malte Dehling: Don't link libzfs 2024-04-26 18:21:25 +00:00
hannken 050294fac1 Increase length of set description to 40 characters so recent additions fit.
Ok: martin@

Fixes PR install/58188 "sysinst fails to display status of base32 set"
2024-04-25 11:25:08 +00:00
rillig 9e59e5f95f makefs: fix out-of-bounds fsnode count in fsnode_sort
Found by running './makefs img.dat cd9660'.

While here, apply more KNF.
2024-04-24 21:59:39 +00:00
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