Re: fix libz regress on gcc archs

2022-10-31 Thread Klemens Nanni
On Mon, Oct 31, 2022 at 07:45:29AM +, Miod Vallat wrote: > > +.if (${COMPILER_VERSION:L} != "clang" && ! exists(/usr/local/bin/eg++)) > > +regress: > > + @echo 'Run "pkg_add g++" to run unittests on GCC architectures' > > + @echo SKIPPED > > Or the C++ test could be downgraded to C++98 so

size: improve column alignment

2022-10-30 Thread Klemens Nanni
size(1) output is not padded and uses a single tab between each column which often looks ugly: $ size bsd /usr/lib/libc.so.96.4 `which echo cc` textdatabss dec hex 896234 31208 54664 982106 efc5a /usr/lib/libc.so.96.4 106152 11200 12640

fix libz regress on gcc archs

2022-10-30 Thread Klemens Nanni
Makefile bits adapted from regress/lib/libssl/interop/botan/Makefile. required for stderr required for exit(3) required for memcmp(3) g++-8.4.0p12 on sparc64 prints coloured warnings/errors, but that is enother issue. On sparc64, `make CXX=clang++' without patch works as well. A follow-up

Re: Towards unlocking mmap(2) & munmap(2)

2022-10-30 Thread Klemens Nanni
On Fri, Oct 28, 2022 at 11:08:55AM +0200, Martin Pieuchot wrote: > On 20/10/22(Thu) 16:17, Martin Pieuchot wrote: > > On 11/09/22(Sun) 12:26, Martin Pieuchot wrote: > > > Diff below adds a minimalist set of assertions to ensure proper locks > > > are held in uvm_mapanon() and uvm_unmap_remove()

Re: Towards unlocking mmap(2) & munmap(2)

2022-10-30 Thread Klemens Nanni
On Sun, Oct 30, 2022 at 01:58:40PM +0100, Martin Pieuchot wrote: > On 30/10/22(Sun) 12:45, Klemens Nanni wrote: > > On Sun, Oct 30, 2022 at 12:40:02PM +, Klemens Nanni wrote: > > > regress on i386/GENERIC.MP+WITNESS with this diff shows > > > > Another one; Th

Re: Towards unlocking mmap(2) & munmap(2)

2022-10-30 Thread Klemens Nanni
On Sun, Oct 30, 2022 at 12:40:02PM +, Klemens Nanni wrote: > regress on i386/GENERIC.MP+WITNESS with this diff shows Another one; This machine has three read-only NFS mounts, but none of them are used during builds or regress. This one is most certainly from the NFS regress tests themsel

Re: Towards unlocking mmap(2) & munmap(2)

2022-10-30 Thread Klemens Nanni
On Fri, Oct 28, 2022 at 11:08:55AM +0200, Martin Pieuchot wrote: > On 20/10/22(Thu) 16:17, Martin Pieuchot wrote: > > On 11/09/22(Sun) 12:26, Martin Pieuchot wrote: > > > Diff below adds a minimalist set of assertions to ensure proper locks > > > are held in uvm_mapanon() and uvm_unmap_remove()

Remove audio(9) speaker_ctl(), let open() handle speakers where needed

2022-10-30 Thread Klemens Nanni
Only five legacy half-duplex hardware drivers require this function to change between playing and recording: i386: ess(4), gus(4), pas(4), sb(4) luna88k: nec86(4) If defined, it is always called early in audio_open(), so just move the call from audio(4) to each hardware driver's

Re: netstart: create interfaces once, do not try physical ones

2022-10-29 Thread Klemens Nanni
On Sat, Oct 29, 2022 at 09:49:56PM +, Klemens Nanni wrote: > Physical interfaces may at/detach at runtime but ifconfig(8) cannot > create them like virtual ones, yet netstart(8) always tries to do so: > > # sh /etc/netstart -n em0 > { ifconfig em0 || ifco

netstart: create interfaces once, do not try physical ones

2022-10-29 Thread Klemens Nanni
Wrong diff, failed to juggle the netstart hunks, new one soon.

netstart: create interfaces once, do not try physical ones

2022-10-29 Thread Klemens Nanni
Physical interfaces may at/detach at runtime but ifconfig(8) cannot create them like virtual ones, yet netstart(8) always tries to do so: # sh /etc/netstart -n em0 { ifconfig em0 || ifconfig em0 create; } ifconfig em0 up vifscreate() is used to create all virtual

Remove unused audio(9) get_props()/AUDIO_PROP_*

2022-10-27 Thread Klemens Nanni
After converting all drivers to play/record/duplex checks in their open() handler, those bits are no longer used and can go. OK once the other diffs are in? --- share/man/man9/audio.9 | 5 - sys/dev/audio.c| 9 - sys/dev/audio_if.h | 7 --- 3 files changed, 21

[PATCH 3/4] Replace audio(9) get_props() with duplex check in open() for non-duplex drivers

2022-10-27 Thread Klemens Nanni
On Thu, Oct 27, 2022 at 03:51:45PM +0200, Alexandre Ratchov wrote: > IMO, for play-only drivers, the check should be: > > if (flags & FREAD) > return ENXIO; > > which will reject record-only and full-duplex. My mistake when typing things down: those are drivers not

Re: Replace audio(9) get_props() with duplex check in open() in partial-duplex drivers

2022-10-27 Thread Klemens Nanni
On Thu, Oct 27, 2022 at 03:51:05PM +0200, Alexandre Ratchov wrote: > On Thu, Oct 27, 2022 at 01:08:57PM +0000, Klemens Nanni wrote: > > @@ -1040,6 +1041,9 @@ ad1848_open(void *addr, int flags) > > > > DPRINTF(("ad1848_open: sc=%p\n", sc)); > > > &g

Re: Replace audio(9) get_props() with duplex check in open() for record-only drivers

2022-10-27 Thread Klemens Nanni
On Thu, Oct 27, 2022 at 03:49:55PM +0200, Alexandre Ratchov wrote: > On Thu, Oct 27, 2022 at 01:09:57PM +0000, Klemens Nanni wrote: > > @@ -1859,6 +1857,9 @@ utvfu_audio_open(void *v, int flags) > > if (usbd_is_dying(sc->sc_udev)) > > return (EIO);

Re: Replace audio(9) get_props() with duplex check in open() in partial-duplex drivers

2022-10-27 Thread Klemens Nanni
27 Oct 2022 17:31:45 Miod Vallat : > Wait, this is wrong. All your > >     (flags & (FWRITE | FREAD)) > > comparisons must be > >     ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD)) > > in order to truly catch full-duplex opens. Otherwise the condition will > always be satisfied since one

Replace audio(9) get_props() with duplex check in open() for play-only drivers

2022-10-27 Thread Klemens Nanni
Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO in their open() if full-duplex mode was requested. This way, sys/dev/audio.c:audio_open() will fail immediately rather than later through the to-be-removed get_props() check. These are all drivers which simply don't support

Replace audio(9) get_props() with duplex check in open() for record-only drivers

2022-10-27 Thread Klemens Nanni
Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO in their open() if full-duplex mode was requested. This way, sys/dev/audio.c:audio_open() will fail immediately rather than later through the to-be-removed get_props() check. utvfu(4) seems to be the only driver that

Replace audio(9) get_props() with duplex check in open() in partial-duplex drivers

2022-10-27 Thread Klemens Nanni
Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO in their open() if full-duplex mode was requested. This way, sys/dev/audio.c:audio_open() will fail immediately rather than later through the to-be-removed get_props() check. This is the first round for drivers with logic in

nd6_timer: remove kernel lock

2022-10-27 Thread Klemens Nanni
The kernel lock was added back when there was a single sofnet task queue: sys/net/nd6.c revision 1.213 date: 2017/08/06 12:53:30; author: mpi; state: Exp; lines: +15 -21; Reduce contention on the NET_LOCK() by moving the nd6 address expiration task to the

Re: don't save emtpy lines in ksh history

2022-10-26 Thread Klemens Nanni
On Wed, Oct 26, 2022 at 11:30:20AM +0200, Uwe Werler wrote: > Hi all, > > when running ksh in vi-mode an empty line could be stored in history: > > Steps to reproduce in command mode: > > 1. go history back e.g.: k > 2. start editor with: v > 3. delete the whole line and :wq > 4. check history

netstart: do not wait for DAD completion in dry-mode

2022-10-26 Thread Klemens Nanni
There is no point in waiting when only printing would-be commands. OK? I'll promptly update this diff or the "netstart: improve shell style" one in case either lands since they both touch the same line. Index: netstart === RCS

Re: netstart: SOII: fix comment, print step with -n

2022-10-26 Thread Klemens Nanni
On Mon, Oct 24, 2022 at 07:01:02PM +, Klemens Nanni wrote: > IPv6LL no longer uses SOII (ifconfig(8) `soii' description got fixed). Relevant commit: sys/netinet6/in6_ifattach.c revision 1.114 date: 2019/08/21 15:32:18; author: florian; state: Exp; lines: +2

Re: installboot: merge duplicate code into sr_open_chunk()

2022-10-26 Thread Klemens Nanni
On Wed, Oct 05, 2022 at 10:31:38AM +, Klemens Nanni wrote: > On Sat, Sep 10, 2022 at 02:10:22AM +0000, Klemens Nanni wrote: > > It does not have the prettiest signature, but nicely folds identical > > copies into MI softraid.c, which then allows us to > > - avoid furt

audio: make get_props() optional, remove it from duplex drivers

2022-10-25 Thread Klemens Nanni
The property bits of audio(9) are obsolete and ought to be removed completely. sys/dev/audio.c:audio_open() currently uses get_props() to bail out if read *and* write was requested on a driver non-duplex driver. Drivers that currently support playing but not recording need a little adjustment

Re: netstart: trim DESCRIPTION

2022-10-25 Thread Klemens Nanni
On Tue, Oct 25, 2022 at 11:07:33AM +0100, Jason McIntyre wrote: > i'm ok with this. however it is really *a* command script, rather than *the* > command script. Sure, i fixed my local diff.

netstart: improve shell style

2022-10-25 Thread Klemens Nanni
The mixed use of upper and lower case variables is neither obvious nor consistent. PRINT_ONLY is local to netstart. ip6kernel is local to netstart. multicast gets sources from rc.subr(8). 1. uppercase ip6kernel as is common for global variables in base scripts 2. use the simpler true/false idiom

netstart: trim DESCRIPTION

2022-10-25 Thread Klemens Nanni
- just call it (a sh(1)) script, in line with MAKEDEV(8) and rc.d(8) - use only .Nm thereafter instead of .Nm/the .Nm script/... - zap the additional rc.conf(8) bits for they can be found in there - zap unhelpful "(or can be)" Feedback? Objection? OK? Index: netstart.8

netstart: do not wait for autoconf in dry-run

2022-10-24 Thread Klemens Nanni
If there is no default route but some interface has AUTOCONF, printing what would be done still waits for... nothing to happen. OK? Index: netstart === RCS file: /cvs/src/etc/netstart,v retrieving revision 1.220 diff -u -p -r1.220

netstart: SOII: fix comment, print step with -n

2022-10-24 Thread Klemens Nanni
IPv6LL no longer uses SOII (ifconfig(8) `soii' description got fixed). Don't ignore this step in dry-runs. In analogy to how we print { ifconfig trunk0 || ifconfig trunk0 create; } the file check could be deferred and printed as well, i.e. [[ -f /etc/soii.key ]] && sysctl ...

netstart: improve DESCRIPTION

2022-10-24 Thread Klemens Nanni
On Fri, Oct 21, 2022 at 06:58:52PM +, Klemens Nanni wrote: > On Fri, Oct 21, 2022 at 06:39:59PM +0100, Jason McIntyre wrote: > > i was going to incliude this in my answer, but eventually thought it > > looks like a seperate diff: > > > > the text currently read

Re: sparc64: bootblk: let bsd.prog.mk do the work

2022-10-24 Thread Klemens Nanni
On Wed, Oct 12, 2022 at 05:55:10PM +, Klemens Nanni wrote: > sets up CLEANFILES, build/install targets and more, so no > need to roll them ourselves if we just set PROG and SRCS. > > STRIPFLAG is defined but not used and in INSTALL_STRIP is > the magic word, so fix that. >

Re: weird behavior with timeout(1) in a script

2022-10-23 Thread Klemens Nanni
On Fri, Oct 21, 2022 at 03:50:41PM +0200, Solene Rapenne wrote: > hi > > I found a weird behavior trying to use timeout(1) in a script with > interactive commands. My use case is to ask for unlocking /home > from /etc/rc.local but continue if I don't type it in time. > > this is working: > >

Re: compress: remove cat_opts and decomp_opts, add static

2022-10-23 Thread Klemens Nanni
On Sat, Oct 22, 2022 at 02:09:40PM -0600, Todd C. Miller wrote: > The cat_opts and decomp_opts fields in struct compressor are unused > so just remove them. Also mark functions unused outside of main.c > as static. OK kn

vmt: read ifnetlist/addresses with shared net lock

2022-10-23 Thread Klemens Nanni
vmt(4) reads MAC and IP addresses periodically through a task on the kernel locked system task queue `systq'. vmt_nicinfo_task() grabs the exclusive net lock which protects the interface list and addresses, but it only reads and thus may grab the shared net lock. Again, not a big difference due

installboot: skip keydisk silently

2022-10-22 Thread Klemens Nanni
Logging the presence of a keydisk the same way offline data chunks are reported seems unjustified. Noting offline chunks serves as warning, so the user can bring them online and update bootblocks. Keydisks, however, are not to be touched by installboot(8) in any case and whether they're

Re: netstart: fix synopsis

2022-10-22 Thread Klemens Nanni
On Sat, Oct 22, 2022 at 04:11:25PM +0200, Theo Buehler wrote: > > I don't think we have another script in base that is meant to be run > > manually, so netstart(8) stands out. > > MAKEDEV Right, what I meant was "to be run manually **as argument to sh(1)**". I keep doing `cd /dev; sh MAKEDEV

Re: netstart: fix synopsis

2022-10-22 Thread Klemens Nanni
On Sat, Oct 22, 2022 at 07:24:21AM +0100, Jason McIntyre wrote: > On Fri, Oct 21, 2022 at 06:58:52PM +0000, Klemens Nanni wrote: > > But now that I see your diff, I think we should actually include `sh' > > in the synopsis since /etc/netstart is not executable, so the documente

Re: sparc64: constify ddb instruction table

2022-10-22 Thread Klemens Nanni
On Fri, Oct 21, 2022 at 10:55:57PM +0200, Mark Kettenis wrote: > Be careful. By moving more stuff into .rodata, you may overflow the > .text/.rodata block. Make sure you build and test the kernels and > also test an actual bsd.rd. Yes, I keep testing bsd and bsd.rd/miniroot on amd64 and

Re: sparc64: constify ddb instruction table

2022-10-21 Thread Klemens Nanni
On Fri, Oct 21, 2022 at 11:29:32AM -0900, Philip Guenther wrote: > On Fri, Oct 21, 2022 at 11:04 AM Klemens Nanni wrote: > > > --- a/sys/arch/sparc64/sparc64/db_disasm.c > > +++ b/sys/arch/sparc64/sparc64/db_disasm.c > > > ... > > > @@ -877,7

sparc64: constify ddb instruction table

2022-10-21 Thread Klemens Nanni
This is the second biggest read-write global in a sparc64 bsd.mp: 01c091b8 g O .data 2cb8 sparc_i ddb(4) does not ever write to it and happily decodes instructions after moving it to .rodata: ddb{3}> x /i %pc db_inst_branch+0x10:be,pn

Re: netstart: fix synopsis

2022-10-21 Thread Klemens Nanni
On Fri, Oct 21, 2022 at 06:39:59PM +0100, Jason McIntyre wrote: > i was going to incliude this in my answer, but eventually thought it > looks like a seperate diff: > > the text currently reads as though only a singular interface is > specified, and -n is kind of hidden. so i reworked the text. i

ubcmtp: constify device table

2022-10-21 Thread Klemens Nanni
As usual, a global that's only ever read during match and attach. The device type pointer gets stored in the softc, so that member must be const as well. Builds on amd64 but I don't have Apple notebooks to run-test: 820dd550 l O .rodata0410 ubcmtp_devices Tests?

malloc: constify memname table

2022-10-21 Thread Klemens Nanni
These are the compile-time constant strings behind vmstat(1)'s "malloc", the kern.malloc.kmemnames sysctl(8) and panic strings. Boots and displays unchanged on amd64: 82068690 g O .rodata0490 memname OK? Index: kern/kern_malloc.c

uvideo: constify device table

2022-10-21 Thread Klemens Nanni
Not that big, but quirks are likely to grow in the feature and there is no reason to keep them writable: 822c0750 g O .data 0160 uvideo_devs Builds fine on amd64 but I don't have uvideo(4) attaching anywhere. OK? diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c

Re: loop_clone_destroy: read ifnetlist/rdomain with shared net lock

2022-10-21 Thread Klemens Nanni
On Fri, Oct 21, 2022 at 03:02:33PM +0300, Vitaliy Makkoveev wrote: > netlock could be completely dropped here. We could probably drop the net lock around ifnetlist wherever the kernel lock is currently held, but that would just make it harder to reason about ifnetlist locking, imho. Eventually,

loop_clone_destroy: read ifnetlist/rdomain with shared net lock

2022-10-21 Thread Klemens Nanni
All interface ioctls always run with the kernel lock anyway, so this doesn't make a difference, except that it reflects how ifnetlist is not modified. OK? diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index a15820420ef..16006c4c102 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@

netstart: fix synopsis

2022-10-21 Thread Klemens Nanni
Using -n does not require an interface: # sh /etc/netstart -n ; echo $? ifconfig lo0 inet 127.0.0.1/8 route -qn add -inet6 fe80:: -prefixlen 10 ::1 -reject ... 0 OK? Index: etc/netstart ===

acpisbs: constify battery check table

2022-10-20 Thread Klemens Nanni
Another global that can go to .rodata: 8227fec0 g O .data 0420 acpisbs_battery_checks Builds fine on amd64, but I don't have access to this hardware. Tests? OK? diff --git a/sys/dev/acpi/acpisbs.c b/sys/dev/acpi/acpisbs.c index 7fd85860f79..252588da591 100644 ---

Re: 7.2 miniroot pointed to /pub/OpenBSD/snapshots for sets

2022-10-20 Thread Klemens Nanni
On Thu, Oct 20, 2022 at 09:05:42AM -0700, Heppler, J. Scott wrote: > Using the miniroot img from https://cdn.openbsd.org/pub/OpenBSD/7.2, the > set retrival still points to snapshots. Can't confirm, default install points at 7.2/ for me: $ ftp

hyperv(4): ifnetlist read: replace kernel lock with shared net lock

2022-10-20 Thread Klemens Nanni
Looking at users of the global interface list `ifnetlist', drivers like this read out an IP or MAC address to report to the hypervisor. None of this modifies any of the fields in the global list, they iterate over and read from it. net/if_var.h documents the `if_list' member as kernel lock

audio(9): remove unused setfd member from struct audio_hw_if

2022-10-19 Thread Klemens Nanni
All consumers now use C99 struct init and none of them sets `.setfd'. My X230 still plays audio just fine: azalia0 at pci0 dev 27 function 0 "Intel 7 Series HD Audio" rev 0x04: msi azalia0: codecs: Realtek ALC269, Intel/0x2806, using Realtek ALC269 audio0 at azalia0 Feedback? OK? diff --git

ahc, ahd: constify global identity tables

2022-10-19 Thread Klemens Nanni
Those .data symbols are already treated as const, so move to .rodata: 82290610 g O .data 05d0 ahc_pci_ident_table 82290be0 g O .data 0198 ahd_pci_ident_table 650 const struct ahc_pci_identity * 651 ahc_find_pci_device(pcireg_t id, pcireg_t subid,

asmc: constify global product table

2022-10-19 Thread Klemens Nanni
Looking at symbols in /bsd .data again for .rodata candidates: 82281b70 l O .data 1688 asmc_prods amsc(4) never writes, but a const table requires a const softc member: 263 for (i = 0; asmc_prods[i].pr_name && !sc->sc_prod; i++) 264 if

Re: sparc64: miniroot: add mount_nfs(8) to fetch sets over NFS

2022-10-19 Thread Klemens Nanni
On Tue, Oct 11, 2022 at 05:43:21PM +, Klemens Nanni wrote: > sparc64 RAMDISK already has NFSCLIENT enabled and miniroot's FSSIZE > still fits after linking mount_nfs: > > /dev/vnd0a6312 5592 72089% 3 59 > 5% /mnt > > Th

Re: ksh in vi-mode and line editing

2022-10-19 Thread Klemens Nanni
On Wed, Aug 31, 2022 at 05:16:27PM +0200, Uwe Werler wrote: > Hi folks, > > I'm just wondering why there's a test for an empty line and args to start the > editor for line editing. In bash one can start vi immediately with an empty > line by ^v. Might be there's another reason I don't understand

maestro(4), uaudio(4): constify globals

2022-10-19 Thread Klemens Nanni
Used only for lookups; builds on i386. OK? Index: usb/uaudio.c === RCS file: /cvs/src/sys/dev/usb/uaudio.c,v retrieving revision 1.169 diff -u -p -r1.169 uaudio.c --- usb/uaudio.c21 Mar 2022 19:22:42 - 1.169 +++

necsb(4/luna88k): remove audio(9) setfd() stub

2022-10-19 Thread Klemens Nanni
This is the only "implementation" of setfd() throughout the tree. With this gone and the audio_hw_if C99 struct init for most drivers, we can safely remove setfd() code from audio(9). OK? diff --git a/sys/arch/luna88k/cbus/nec86.c b/sys/arch/luna88k/cbus/nec86.c index 2d2d965d1bc..ea1e8b8f6df

Re: sys: use C99 struct init for struct audio_hw_if

2022-10-18 Thread Klemens Nanni
On Tue, Oct 18, 2022 at 02:17:54PM +, Klemens Nanni wrote: > audio(9) cleanup demands removing a member from this struct, which is > cumbersome in our current tree as drivers initialise it inconsistently, > i.e. a simple removal of ".member_name = driver_func," is no

arm64: aplmca: constify _hw_if struct

2022-10-18 Thread Klemens Nanni
The only driver with a non-const struct. Seen while looking at it for audio(9). OK? diff --git a/sys/arch/arm64/dev/aplmca.c b/sys/arch/arm64/dev/aplmca.c index 07a53103be4..03ade86fee7 100644 --- a/sys/arch/arm64/dev/aplmca.c +++ b/sys/arch/arm64/dev/aplmca.c @@ -135,7 +135,7 @@ int

dev/isa: ess, pas: constify string table

2022-10-18 Thread Klemens Nanni
Each only used once for a printf() call in *_attach(). Seen while tweaking their *_hw_if struct. OK? Index: dev/isa/ess.c === RCS file: /cvs/src/sys/dev/isa/ess.c,v retrieving revision 1.28 diff -u -p -r1.28 ess.c --- dev/isa/ess.c

sys: use C99 struct init for struct audio_hw_if

2022-10-18 Thread Klemens Nanni
audio(9) cleanup demands removing a member from this struct, which is cumbersome in our current tree as drivers initialise it inconsistently, i.e. a simple removal of ".member_name = driver_func," is not always possible. Most drivers call their driver_*() functions like the member name, - some

Re: audio: remove unused AUDIO_PROP_{MMAP,INDEPENDENT}

2022-10-18 Thread Klemens Nanni
On Tue, Oct 18, 2022 at 09:32:27AM +0200, Alexandre Ratchov wrote: > On Mon, Oct 17, 2022 at 07:45:33PM +0000, Klemens Nanni wrote: > > I was looking at one particular driver and needed to know what those > > flags are, turns out AUDIO_PROP_FULLDUPLEX is the only au

Re: mpii(4): document/handle RAID 1E, bioctl(8): print it as such

2022-10-18 Thread Klemens Nanni
On Wed, Oct 05, 2022 at 12:10:26AM +, Klemens Nanni wrote: > On Sun, Sep 25, 2022 at 12:59:27AM +0000, Klemens Nanni wrote: > > On a sparc64 T4-2 I boot OpenBSD from hardware RAID 1E using the > > built-in controller: > > > > mpii0 at pci15 dev 0 function 0

Re: audio: remove unused AUDIO_PROP_{MMAP,INDEPENDENT}

2022-10-17 Thread Klemens Nanni
On Mon, Oct 17, 2022 at 09:53:26PM +0200, Mark Kettenis wrote: > > Date: Mon, 17 Oct 2022 19:45:33 + > > From: Klemens Nanni > > > > I was looking at one particular driver and needed to know what those > > flags are, turns out AUDIO_PROP_FULLDUPLEX

audio: remove unused AUDIO_PROP_{MMAP,INDEPENDENT}

2022-10-17 Thread Klemens Nanni
I was looking at one particular driver and needed to know what those flags are, turns out AUDIO_PROP_FULLDUPLEX is the only audio(9) property that is in use. The other two are only ever set in *_get_props(); their handling disappeared from sys/dev/audio.c in commit

Re: reorder_kernel: set up syslog traps before logfile

2022-10-15 Thread Klemens Nanni
On Sat, Oct 08, 2022 at 07:25:26PM +, Klemens Nanni wrote: > If /usr is mounted read-only, kernel relinking fails silently without > any log trace. > > # ksh /usr/libexec/reorder_kernel > /usr/libexec/reorder_kernel[35]: cannot create > /usr/share/relink

octeon: installer: use installboot -p

2022-10-15 Thread Klemens Nanni
The installboot regress tests use -p on octeon which works fine. I don't have serial console access to octen machines at the moment, but this should just fly as installboot already has -p support on octeon. It's also easy to test with snapshot media as one can easily apply this patch in the

Re: cwm: do not overlap menu entries

2022-10-14 Thread Klemens Nanni
On Fri, Oct 14, 2022 at 02:11:19PM -0400, Okan Demirmen wrote: > the below seems to work: Walter (thanks!) found the spot i missed on > replacing height with ascent+descent. > > please let me know. Works just fine for me, no more visual glitches, thanks!

Re: sysupgrade: apply bsd.re-config(5) to /bsd.upgrade

2022-10-14 Thread Klemens Nanni
On Thu, Oct 06, 2022 at 05:22:17PM +, Klemens Nanni wrote: > On Tue, Sep 06, 2022 at 03:11:45PM +0000, Klemens Nanni wrote: > > On rare occasions, I need 'disable xxx' in /etc/bsd.re-config to be able to > > boot a system, e.g. to ignore quirky devices crashing driver

rc.d: smtpd, unwind: add configtest

2022-10-14 Thread Klemens Nanni
Two more, then all daemons in my accumulated `rcctl ls on' output should be covered. OK? Index: smtpd === RCS file: /cvs/src/etc/rc.d/smtpd,v retrieving revision 1.7 diff -u -p -r1.7 smtpd --- smtpd 11 Jan 2018 19:52:12 -

rc.d: dhcpleased, rad: add configtest

2022-10-13 Thread Klemens Nanni
Two more easy cases. rad(8) requires a config file and there is no default /etc/rad.conf, so configtest will fail unless a valid config (behind -f in rad_flags) exists. dhcpleased(8) is happy without config at all, so configtest is always happy unless a bogus config exists. OK? Index:

Re: cwm: do not overlap menu entries

2022-10-13 Thread Klemens Nanni
On Thu, Oct 13, 2022 at 04:39:04PM +0200, Omar Polo wrote: > On 2022/10/13 13:00:34 +0000, Klemens Nanni wrote: > > On Thu, Oct 13, 2022 at 08:28:50AM -0400, Okan Demirmen wrote: > > > And I keep missing it! I can't reproduce this - can you share the font > &

Re: cwm: do not overlap menu entries

2022-10-13 Thread Klemens Nanni
On Thu, Oct 13, 2022 at 08:28:50AM -0400, Okan Demirmen wrote: > And I keep missing it! I can't reproduce this - can you share the font > you're using maybe? Whatever is the default, I never fiddled with fonts in X, no xorg.conf, `cwm -c/dev/null' shows the glitch for me on a ThinkPad X230.

Re: ypldap TLS by default

2022-10-13 Thread Klemens Nanni
On Thu, Oct 13, 2022 at 10:11:39PM +1000, Jonathan Matthew wrote: > While working on ypconnect(2), Theo suggested that ypldap(8) should > not default to plaintext LDAP connections, since the data it's dealing with > is pretty important to the security of the system. Here's a straightforward >

cwm: do not overlap menu entries

2022-10-12 Thread Klemens Nanni
This has annoyed me for a long time... 1. have at least two windows 2. open the window menu with M-slash (alt+/) 3. show all windows with C-A (ctrl+a) 4. move cursor over list from top to bottom, observe no glitch 5. move cursor over list from bottom to top, observe "[" and "]" chars in

Re: sparc64: bootblk: broken fake target still useful?

2022-10-12 Thread Klemens Nanni
Then there's also bootblk.text: not required by bootblk, not installed and only used with Sun's fakeboot in a target that cannot work: $ make -n fake ([ -h machine ] || ln -s /home/kn/src/sys/arch/sparc64/stand/bootblk/../../include machine) ../fakeboot/fakeboot -elf32

sparc64: bootblk: let bsd.prog.mk do the work

2022-10-12 Thread Klemens Nanni
sets up CLEANFILES, build/install targets and more, so no need to roll them ourselves if we just set PROG and SRCS. STRIPFLAG is defined but not used and in INSTALL_STRIP is the magic word, so fix that. Don't replace "bootblk" wth "${PROG}" to avoid churn. No object change, `make' does

Re: make.1: sync variable substitution bits with NetBSD

2022-10-12 Thread Klemens Nanni
On Sat, Nov 13, 2021 at 10:09:27AM +, Klemens Nanni wrote: > On Sat, Dec 26, 2020 at 05:19:55PM +0100, Klemens Nanni wrote: > > Our make(1) is behind NetBSD's and FreeBSD's make(1) on at least the > > rules of variable substitution. > > > > Our DESCRIPION says &g

macppc: stand: remove powerpc left-overs

2022-10-12 Thread Klemens Nanni
There since the powerpc -> macppc move/rename. KERN_AS usage disappeared in commit 5b7db11d478192c5908038bb1345e7d51cc35c8e Author: rahnds Date: Mon May 5 16:47:15 1997 + only build one version of the libraries. REAL_VIRT usage disappeared in

macppc: ofwboot: fix -Wreturn-type

2022-10-12 Thread Klemens Nanni
.../ofdev.c:130:1: warning: non-void function does not return a value [-Wreturn-type] OK? Index: sys/arch/macppc/stand/ofdev.c === RCS file: /cvs/src/sys/arch/macppc/stand/ofdev.c,v retrieving revision 1.27 diff -u -p -r1.27

Re: sparc64: ofwboot: no incremental builds due to broken libsa/libz dep

2022-10-11 Thread Klemens Nanni
12 Oct 2022 02:22:15 Todd C. Miller : > This problem is not confined to sparc64 is it?  At least macppc > seems to have the same issue. Looks like it, I have not yet tested other architectures. > Some, like amd64 and i386, cheat and > just pull in the 4 source files from the libz directory.

sparc64: ofwboot: no incremental builds due to broken libsa/libz dep

2022-10-11 Thread Klemens Nanni
Testing the libz size fix in ofwboot.net showed that rebuilding ofwboot after updating libz sources did not relink ofwboot as it should, imho: $ cd sys/arch/sparc64/stand $ make ... $ touch ../../../lib/libz/crc32.c $ make ===> bootblk ===>

sparc64: miniroot: add mount_nfs(8) to fetch sets over NFS

2022-10-11 Thread Klemens Nanni
sparc64 RAMDISK already has NFSCLIENT enabled and miniroot's FSSIZE still fits after linking mount_nfs: /dev/vnd0a6312 5592 72089% 3 59 5% /mnt This boots fine on T4-2 guest domains and I can upgrade via NFS: Location of sets? (disk http

ksh: errexit executes ERR trap twice

2022-10-10 Thread Klemens Nanni
The ERR trap is supposed to be run once, regardless of errexit: $ ksh -c 'trap "echo ERR" ERR; false' ERR $ ksh -c 'trap "echo ERR" ERR; false' -e ERR ERR This duplication is a regression of the following bin/ksh/main.c commit: revision 1.52

Re: ksh: trigger ERR trap on permanent I/O redirection failure

2022-10-10 Thread Klemens Nanni
On Sat, Oct 08, 2022 at 11:22:59AM -0600, Todd C. Miller wrote: > On Sat, 08 Oct 2022 16:01:18 -0000, Klemens Nanni wrote: > > > Account for this to make permanent redirection failure trigger the ERR > > trap: > > > > $ ./obj/ksh -c 'trap "echo ERR" E

install.sub: use newlines for readability inside single quotes

2022-10-09 Thread Klemens Nanni
No functional changes, just breaking the long line. OK? Index: install.sub === RCS file: /cvs/src/distrib/miniroot/install.sub,v retrieving revision 1.1210 diff -u -p -r1.1210 install.sub --- install.sub 5 Oct 2022 19:30:47 -

Re: install.sub: Get rid of another useless/confusing subshell

2022-10-09 Thread Klemens Nanni
On Tue, Oct 04, 2022 at 08:11:46PM +, Klemens Nanni wrote: > This function's style is a bit off: it wraps the body in a subshell to > discard all stdout/err at once, but a still uses return inside it. > > 1. A command list (using {}) would be enough here as it groups like a &

Re: install.sub: Get rid of useless/confusing subshell

2022-10-09 Thread Klemens Nanni
On Wed, Oct 05, 2022 at 04:56:57PM +0200, Alexander Hall wrote: > While I dislike the ">/dev/null 2>&1" sledgehammer, this is in the right > direction. Agreed. We should be fine silencing only the test condition which produces legit output and warnings. All else produces no output and should

Re: rc.d/dhcpd: enable configtest

2022-10-08 Thread Klemens Nanni
On Sun, Oct 02, 2022 at 12:29:34PM +, Klemens Nanni wrote: > dhcpd(8) has > -n Only test configuration, do not run dhcpd. > > rc_configtest() taken from other rc.d scripts. > > Feedback? OK? P

reorder_kernel: set up syslog traps before logfile

2022-10-08 Thread Klemens Nanni
If /usr is mounted read-only, kernel relinking fails silently without any log trace. # ksh /usr/libexec/reorder_kernel /usr/libexec/reorder_kernel[35]: cannot create /usr/share/relink/kernel/GENERIC.MP/relink.log: Read-only file system This stderr line does not show up during

ksh: trigger ERR trap on permanent I/O redirection failure

2022-10-08 Thread Klemens Nanni
Failure to permanently redirect I/O for the shell itself, i.e. when no command is executed, must trigger the ERR trap like any other failure, but that is currently not happening: (non-zero exit code is trigger, no redirection) $ ksh -c 'trap "echo ERR" ERR ; false' ERR (failed

Re: sysupgrade: exit 1 instead of exit 0 when ending early

2022-10-08 Thread Klemens Nanni
On Sat, Oct 08, 2022 at 07:33:38AM +0200, Florian Obser wrote: > Being up2date doesn't feel like an error to me, what am I missing? I concur.

install.sub: leave installurl handling to syspatch(8)

2022-10-06 Thread Klemens Nanni
When upgrading to releases, the installer fills rc.firsttime(8) with a syspatch(8) snippet possibly displaying available patches. That snippet itself checks for a release version as well as an existent installurl(5) file as a precondition for syspatch, see the diff below. syspatch, however, has

Re: sysupgrade: apply bsd.re-config(5) to /bsd.upgrade

2022-10-06 Thread Klemens Nanni
On Tue, Sep 06, 2022 at 03:11:45PM +, Klemens Nanni wrote: > On rare occasions, I need 'disable xxx' in /etc/bsd.re-config to be able to > boot a system, e.g. to ignore quirky devices crashing drivers during attach. > > bsd.re-config(5) currently applies to GENERIC(.MP

eeprom.8: document network-boot-arguments for sparc64 diskless(8)

2022-10-06 Thread Klemens Nanni
The Oracle OpenBoot 4.x Administration Guide[0] documents a few useful options for network boot. Basically do either {ok} setenv network-boot-arguments tftp-retries=0 {ok} boot net ... or {ok} boot net:tftp-retries=0 ... Newer machines like the T4-2 using OpenBoot 4.38.16

Re: installboot: merge duplicate code into sr_open_chunk()

2022-10-05 Thread Klemens Nanni
On Sat, Sep 10, 2022 at 02:10:22AM +, Klemens Nanni wrote: > It does not have the prettiest signature, but nicely folds identical > copies into MI softraid.c, which then allows us to > - avoid further diverging MD code > - implement the keydisk fix on tech@ once instead of thri

Re: mpii(4): document/handle RAID 1E, bioctl(8): print it as such

2022-10-04 Thread Klemens Nanni
On Sun, Sep 25, 2022 at 12:59:27AM +, Klemens Nanni wrote: > On a sparc64 T4-2 I boot OpenBSD from hardware RAID 1E using the > built-in controller: > > mpii0 at pci15 dev 0 function 0 "Symbios Logic SAS2008" rev 0x03: msi > mpii0: Solana On-Board, fir

Drop fattr promise unless file creation is allowed

2022-10-04 Thread Klemens Nanni
This is only required for the single fchmod(2) ensuring default permissions which only happens in the -c code path; "fattr" without "cpath" makes no sense here. OK? Index: tftpd.c === RCS file: /cvs/src/usr.sbin/tftpd/tftpd.c,v

rc: do not clear mfs /tmp

2022-10-04 Thread Klemens Nanni
There is no problem to fix, but every boot I read "/clearing /tmp" and know it is a useless step since my /tmp live on volatile RAM anyway. Other steps in rc(8) also check and print/log conditionally, so this can do as well, saving yet another line. There is also the unconditional echo

<    1   2   3   4   5   6   7   8   9   10   >