Commit Graph

16664 Commits

Author SHA1 Message Date
christos
362817299c bump bind libraries 2021-02-19 17:06:26 +00:00
rillig
746e9c89cf lint: warn about mismatch in getopt handling 2021-02-19 12:28:56 +00:00
dbj
e5062177fe Revert "distrib/amd64/cdroms: honor CDBOOTOPTIONS when installing EFI bootloader"
https://mail-index.netbsd.org/current-users/2021/02/17/msg040358.html
I think this change had unexpected side effects and needs further review
2021-02-17 08:49:54 +00:00
kre
6974a2b259 PR bin/55979
Add a sh ATF test to demonstrate a bug in the way that \0 characters
are dropped from scripts.   This test will eventually be extended to
test other potential sh script input related issues.

When initially committed, this test should fail.  It should succeed
when the fix for the PR is committed (soon).

Nb: this tests only the \0 related issues from the PR, the MSAN
detected uninitialised variable (struct field) can only be detected
by MSAN, as it has no visible impact on the operation of the shell
when running on any real (or even emulated) hardware.
(It will, however, also be fixed).
2021-02-16 09:46:24 +00:00
rillig
324a77845a distrib/sets/fmt-list: document how to sort by directory first
In lists/base/mi, the directory ./libdata/firmware contains several
subdirectories for which the entries do not look aligned right now, even
after normalizing the alignment.

This is because the indentation for a directory is not determined
globally for all directory entries from the complete file, but instead
for each group of items, after sorting, that have the same directory.
This results in several entries having only a single item per group,
such as ./libdata/firmware/nouveau, and this single item is obviously
consistently indented since all of its 1 lines are already indented to
the same depth.

One possible solution for this is to sort the entries in another order,
keeping all entries from a directory together.  This allows to quickly
see all entries from a certain directory, but on the other hand, when
adding a new directory plus some entries, the directory has to be listed
far away from its entries.  (This would be done automatically by
fmt-list though, which weakens this argument a bit.)

Another possible solution for this is to first determine the indentation
for all entries from each directory, no matter how far these entries are
apart, and then indent these entries to the common indentation.  This
may or may not help since there will still be single entries between
groups of differently indented entries.

Writing down the intuitive rules for how to align the entries properly
is a nontrivial task.  See pkglint/varalignblock, which is around 650
lines of code, plus around 4000 lines of test code.

No functional change.
2021-02-15 23:46:46 +00:00
rillig
8b7ecb733b distrib/sets/list-fmt: sort commented entries like regular entries
Seen in lists/modules/ad.aarch64, among others.  These lines are not
intended as comments but as regular entries that just happen to be
commented out.

This is the same as how pkglint treats commented variable assignments,
which take part in aligning blocks of variable assignments even though
they are syntactically comments.
2021-02-15 23:00:03 +00:00
christos
e1d8873a1b new locale pages, sort 2021-02-15 14:38:06 +00:00
rillig
fe211a10c7 make: add test for the variable modifier ':sh' 2021-02-14 20:16:17 +00:00
rillig
ff6217c297 tests/libcurses: add test for addbytes 2021-02-13 06:29:45 +00:00
yamt
3bc7a17908 Make Raspberry PI 3 Model A+ use bwfm config for Model B+
* It works for me.

* It's what linux-firmware does.
  https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=923bfa68a1c97929652f029da699495f4ce43f14
2021-02-09 11:57:20 +00:00
martin
f44c8ec769 Use the same naming scheme for install images as we use for the ISO images. 2021-02-08 19:11:41 +00:00
rillig
25d40489d1 libcurses: demonstrate bug in addch that doubles tab indentation
When adding "\t" via addch, win.curx advances by twice the spaces as
intended.  This bug was introduced somewhere between NetBSD 8.0 and 9.0.

Adding "\t" via addstr does not have this bug.

This bug causes the installation menu of sysinst to be have its menu
items indented by 16 characters instead of only 8.  This in turn
produces an ugly line break in the German translation.

The test framework for libcurses is not well integrated into ATF.
Whenever the expected output is longer than the actual output, or vice
versa, the test passes nevertheless.  This makes it necessary to
constantly look into atf-run.log to see whether the actual output is
indeed equal to the expected output, which is crucial, especially for
telling the difference between addstr and addnstr.

Reusing the .chk files for several tests is not a good idea either.  For
example, addstr and waddstr are supposed to produce the same result for
ASCII-only text, so it was tempting to use the same file.  But waddstr
seems to have a bug (maybe undefined behavior), at least waddstr returns
ERR in one case where it shouldn't.  This means that currently the
expected output (acknowledging the bug) must be different.

The "expected" test output in waddstr.chk looks completely broken, but
that's exactly what the test produces right now.
2021-02-07 01:53:54 +00:00
dbj
751da7ebca distrib/amd64/cdroms: honor CDBOOTOPTIONS when installing EFI bootloader 2021-02-06 16:02:43 +00:00
rillig
6a794143e8 make: add test for reading from make's stdin
Just out of curiosity whether that really works.  It does.
2021-02-01 20:31:41 +00:00
rillig
7773efc249 make(1): add test for combining the options -j, -n, -t
This is a preparation for refactoring the complicated condition in
JobStart.
2021-01-30 12:46:38 +00:00
rillig
e15c45c68c make(1): demonstrate unnecessary creation of empty files in jobs mode 2021-01-29 22:38:17 +00:00
martin
9869002d85 Rename etc/rc.d/llvmlockdir to lvmlockdir - it has nothing to do with LLVM,
the name probably was a freudian slip of my fingers when I split that
fragment out of another rc.d script.
2021-01-26 13:31:19 +00:00
thorpej
62be88ee26 Add kmem_tmpbuf_alloc(), a utility function for allocating memory for
temporary use where allocation on the stack is desirable, but only up to
a certain size.  If the requested size fits within the specified stack
buffer, the stack buffer is returned.  Otherwise, memory is allocated with
kmem_alloc().  Add a corresponding kmem_tmpbuf_free() function that frees
the memory using kmem_free() if it is not the tempory stack buffer location.
2021-01-24 17:29:11 +00:00
thorpej
fed9ff05fd Add a manual page for strlist(9). 2021-01-21 15:53:15 +00:00
pgoyette
97deb5ac32 Oooppss we need another size bump 2021-01-18 03:35:11 +00:00
rillig
fb08819de8 lint: add more tests for system headers in strict bool mode 2021-01-17 23:00:41 +00:00
rillig
a5778d2e53 lint: install custom stdbool.h, used for strict bool mode 2021-01-17 19:32:52 +00:00
rillig
93104a9b2f lint: remove custom stdbool.h for strict bool mode again
Adding it broke the official builds.
2021-01-16 22:18:14 +00:00
rillig
9f199e7ddf lint: in strict bool mode, integer constants do not have type bool
Previously, lint1 allowed integer constants such as 0 and 1 to be used
as bool constants.  This was only half-baked since after fixing all
error messages from that strict mode, there may still be integer
literals in the code that should be replaced with true or false.  This
would stop a migration from int to bool in the middle, leaving
inconsistent code around.

To find the remaining type inconsistencies, treat integers and bool as
completely incompatible, even for compile time constants.
2021-01-16 16:03:46 +00:00
pgoyette
beede25931 Install image built with all of MKDEBUG, MKKDEBUG, and MKDEBUGLIB all
set to "yes" is a bit larger, so bump the image size accordingly.
2021-01-15 21:14:53 +00:00
rillig
a738d648f3 lint: add tests for newly added messages for strict bool mode 2021-01-14 22:18:13 +00:00
pgoyette
22f3130d8a Update sets lists to accomodate KERNEL_DIR. When both KERNEL_DIR and
MKDEBUG are defined, we create an empty $DESTDIR/usr/libdata/debug/netbsd/
directory.

Should fix ``build.sh release'' issue reported in kern/55923

XXX Since nothing ever seems to populate this directory, perhaps we should
XXX simply prevent its creation?  If we do create it, should its creation
XXX perhaps be conditioned on MKKDEBUG rather than MKDEBUG?

XXX There is still another problem with ``build.sh install-image'' but I
XXX open a new PR for that.
2021-01-14 19:11:48 +00:00
pgoyette
a62411020b /home/paul/XXX.txt 2021-01-14 19:07:03 +00:00
riastradh
cba96d16f7 Various entropy integration improvements.
- New /etc/security check for entropy in daily security report.

- New /etc/rc.d/entropy script runs (after random_seed and rndctl) to
  check for entropy at boot -- in rc.conf, you can:

  . set `entropy=check' to halt multiuser boot and enter single-user
    mode if not enough entropy

  . set `entropy=wait' to make multiuser boot wait until enough entropy

  Default is to always boot without waiting -- and rely on other
  channels like security report to alert the operator if there's a
  problem.

- New man page entropy(7) discussing the higher-level concepts and
  system integration with cross-references.

- New paragraph in afterboot(8) about entropy citing entropy(7) for
  more details.

This change addresses many of the issues discussed in security/55659.
This is a first draft; happy to take improvements to the man pages and
scripted messages to improve clarity.

I considered changing motd to include an entropy warning with a
reference to the entropy(7) man page, but it's a little trickier:
- Not sure it's appropriate for all users to see at login rather than
  users who have power to affect the entropy estimate (maybe it is,
  just haven't decided).
- We only have a mechanism for changing once at boot; the message would
  remain until next boot even if an operator adds enough entropy.
- The mechanism isn't really conducive to making a message appear
  conditionally from boot to boot.
2021-01-10 23:24:25 +00:00
rillig
0ec7a3ab6a lint: add test for triggering assertion failures in lint1 2021-01-10 18:06:38 +00:00
rillig
76d2ead3e0 lint: add test for treating _Bool as non-scalar type
This strict mode is not yet implemented.  The plan is to use it for
usr.bin/make, to get rid of the many possible variants of defining the
Boolean type in make.h.  These variants did find some bugs, but not
reliably so.  Using static analysis seems more promising for this.

In an early stage of developing this test, lint1 crashed in the enum
definition in line 213, where the node for the '?:' had been NULL.  This
can happen in other situations as well, such as with syntax errors, but
these should be rare, as lint is usually only run if the compiler has
accepted the source code.  Still, there should not be any assertion
failures while running lint1.
2021-01-10 17:43:46 +00:00
rillig
e107438c00 lint: demonstrate wrong handling of conversion to _Bool 2021-01-10 11:24:42 +00:00
uki
1c2777d6b9 Fix "build.sh syspkgs" build error 2021-01-09 02:40:44 +00:00
uki
4670c4d50e Rename man-util-* to comp-c-* 2021-01-08 09:41:24 +00:00
ryo
7c39e4802c add dts for odroid-N2 plus 2021-01-02 11:36:36 +00:00
rillig
a0a15c1464 lint: add a test for each message produced by lint1
Having a test for each message ensures that upcoming refactorings don't
break the basic functionality.  Adding the tests will also discover
previously unknown bugs in lint.

The tests ensure that every lint message can actually be triggered, and
they demonstrate how to do so.  Having a separate file for each test
leaves enough space for documenting historical anecdotes, rationale or
edge cases, keeping them away from the source code.

The interesting details of this commit are in Makefile and
t_integration.sh.  All other files are just auto-generated.

When running the tests as part of ATF, they are packed together as a
single test case.  Conceptually, it would have been better to have each
test as a separate test case, but ATF quickly becomes very slow as soon
as a test program defines too many test cases, and 50 is already too
many.  The time complexity is O(n^2), not O(n) as one would expect.
It's the same problem as in tests/usr.bin/make, which has over 300 test
cases as well.
2021-01-02 10:22:42 +00:00
ryo
891e9034bd revert http://mail-index.netbsd.org/source-changes/2021/01/01/msg125648.html
FYI: http://mail-index.netbsd.org/source-changes-d/2021/01/01/msg013085.html
2021-01-02 08:38:55 +00:00
nat
bfa1e92456 Update the debug set for testpat(6). 2021-01-02 03:41:06 +00:00
nat
268f30338f Add testpat(6) to the games set. 2021-01-02 03:24:01 +00:00
rillig
59e2f0df9e lint: demonstrate bug in handling of nested C9X struct initializers 2021-01-01 16:50:47 +00:00
ryo
34121d2a3c add dts for odroid-N2 plus.
meson-g12b-odroid-n2-plus.dts of linux is not optimized for the odroid-N2plus CPU clock.
and the dts for odroid-n2-plus in the hardkernel repository is  significantly changed,
so cannot be imported without modification. Therefore, a simple meson-g12b-odroid-n2-plus.dts
has been added based on "meson-g12b-odroid-n2.dts" with only the cpu_opp_table and
regulator table changed.
2021-01-01 07:41:46 +00:00
rillig
e93292def1 lint: fix segmentation fault when checking returned enum types (211) 2021-01-01 01:07:07 +00:00
rillig
ee607e0b85 lint: check that in "if (cond)", cond is scalar 2020-12-31 18:51:28 +00:00
rillig
d81f96abfb make(1): add test for error handling and expansion in .for loops 2020-12-31 03:05:12 +00:00
rillig
4c09bc6956 make(1): add test for .endfor without corresponding .for 2020-12-30 14:50:08 +00:00
rillig
f4b4e8b893 lint: add test for old style function arguments 2020-12-30 13:15:07 +00:00
martin
5662516c24 Add /var/db/obsolete/xdebug 2020-12-29 17:53:08 +00:00
martin
213b42bc0d Mark resize debug info as obsolete 2020-12-29 12:43:36 +00:00
rillig
c182aecfbc make(1): add test that explains how variables are exported
Exporting the variables at the right time and with the correct values is
a subtle issue.  The current implementation carefully marks variables as
ready to be exported, then exports them and at the same time tries to
export as few variables as possible, to avoid memory leaks.  This test
describes and explains how all this works in detail.

This test also justifies that the call to Var_ReexportVars happens in
the make process itself, not in the child processes, no matter whether
these are created with vfork or (only theoretically) with plain fork.
This has changed in compat.c 1.217, job.c 1.390 and main.c 1.504 from
2020-12-27.
2020-12-29 01:45:06 +00:00
martin
6f4eaa13f9 Add resize 2020-12-28 14:28:54 +00:00