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.
`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.
(Initial patch from Christos Zoulas.) Don't create an archive based on local
permission bits and owner/group. Instead, feed a small manifest into `pax`
and let it to its work.
NB: Don't also feed in an entry for the current directory ".", as `pax` will
then archive all files in the current directory, in `readdir()` order.
Release artifacts may contain symbol lists. Binutils's `nm` sorts them by
symbol name, locale based. Inserting a plain `sort` (with `LC_ALL=C`) here
sorts them by address, and (with several symbols pointing to the same address)
sorting by name is also stable (think of embedded '_'.)
Fixes the build without MPBIOS or ACPI. Modified patch from Paolo Pisati in
current-users@.
While here:
Remove obsolete <arch/x86/pci/msipic.h> include with its guard.
Add comments for multiple endifs for better readability.
(Path from Paolo Pisati in current_users@)
While here:
Simplify mp_cpu_start() ifdefs. MULTIPROCESSOR and HYPERV code falls under
NLAPIC > 0, thus just combine all blocks under this guard.
Rearrange opt_acpi.h include alphabetically.
The :gmtime and :localtime modifiers are not used often and thus are not
time-critical. Exchange the custom code that parses an integer from a
substring for an additional memory allocation.
Thanks sjg@ for suggesting to avoid the custom parsing code.
Let's just see how this works out in practice. Might need to reduce
the overhead of each GHES on machines with thousands of them, but
we'll see.
PR kern/58046
The function TryParseTime takes a pointer to a string, but the LazyBuf
returns a Substring, which is not guaranteed to be null-terminated or
delimited. In TryParseTime, calling strtoul on the Substring read past
the end of the substring.
Noticed in the NetBSD build in libntp, where the :gmtime modifier is
used in two places with the same timestamp value, of which the first was
evaluated correctly and the second wasn't.
The bug was introduced in var.c 1.1050 from 2023-05-09, when the
argument of the :gmtime and :localtime modifiers was allowed to be an
expression instead of an integer constant.
On NetBSD, libdrm uses this to discover what kind of bus the device
is on, without which it refuses to expose the render node at all,
rendering it useless. With this change, libdrm is able to use render
nodes on NetBSD.
Since this is just reading out information about the bus type and
bus/dev/func numbers, I don't think it's problematic to expose to
render nodes.
This requires tweaking the access path to the master.
PR kern/58180