Re: How to mount a PCMCIA hard drive

2024-06-09 Thread Martin Husemann
On Sun, Jun 09, 2024 at 01:47:45PM +0300, Erkki Ruohtula wrote:
> I have a "Centennial MicroDrive", 340 Mb that does into a PCMCIA card
> slot. Inserting it into the T23, I get these dmesg messages
> 
> [ 6743.118863] wdc2 at pcmcia1 function 0:  CARD> [ 6743.118863] wdc2: i/o mapped mode
> [ 6743.618871] atabus2 at wdc2 channel 0
> [ 8339.023384] atabus2: detached
> [ 8339.023384] wdc2: detached 

There should be a drive on that "atabus2", without the drive you can not
access the card.

Not sure why no drive is detected in your case.

Martin


Re: conditional nat using ! negation

2024-06-01 Thread Martin Husemann
On Wed, May 29, 2024 at 11:33:28AM +0200, fddi wrote:
> So for example, nat any clients from 172.16.10.0/23, 172.16.1.0/24 to any
> desination NOT matching 131.241.0.0/16, thus traffic to 131.241.0.0/16 is
> supposed to be routed and not natted.
> 
> $pub_if = "vioif0"
> map $pub_if dynamic any -> inet4($pub_if) pass family inet4 from {
> 172.16.10.0/23, 172.16.1.0/24 } to ! 131.241.0.0/16
> 
> but this is what "npfctl validate" or "npfctl show" is showing:
> 
> map vioif0 dynamic any -> 131.154.4.29 pass family inet4 from {
> 172.16.10.0/23, 172.16.1.0/24 } to 131.241.0.0/16
> 
> The negation mark (!) is ignored

At quick glance it seems the generated bpf byte code is correct, but the
pretty printer used in "validate" and "show" misses the destination inversion
option (there is code that should show it, but it seems to be buggy).

You can see the difference between the version with and without the ! by
doing something like:

npfctl debug -c npf.conf > out.neg

then removing the ! and try again:

npfctl debug -c npf.conf > out.positive

and then diff -u the two out.* files.


Have you tried if your NAT works?

Please file a PR with the details, there defintively is a bug if
"show" or "validate" don't show a rule that could be used for input.

Martin


Re: NetBSD 10.0 installation cd boot hangs

2024-05-25 Thread Martin Husemann
On Sat, May 25, 2024 at 03:00:24PM +0200, Benny Siegert wrote:
> This is technically not a hang. The kernel did not find the device to boot
> from, so it is waiting for you to enter one. Are you expecting the device on
> the SATA bus? -- Benny
> 

I guess it should show up in the viaide controller, but:

> viaide0 channel 1: reset failed for drive 0

says it did not work well.

You could try to list the available devices by entering

?

at the boot prompt (but I guess your CD will be missing).

Martin


Re: Clean Microsoft FROM NETBSD

2024-05-17 Thread Martin Husemann
On Fri, May 17, 2024 at 02:18:59PM +, Todd Gruhn wrote:
> I want to  to clean out  crap that Microsoft forces on
> that drive.
> 
> MS Windows   want to stop me from "Uninstall" stuff that they
> installed...
> 
> Can this be done with NetBSD?

"yes" - in several variants.

You can wipe the whole disk content, e.g. by overwriting it with zeroes
or random data (something like: dd bs=1m if=/dev/urandom of=/dev/rsd0d)

Or you can kill single partitions - usually the Windows stuff shows up
as extra GPT partitions, use something like "gpt show -a sd0", identify
the partition you want to kill and then remove it with "gpt remove -i $index".

After removing the GPT partition you can reboot into windows and tell it to
resize the neighbour partition and fill the new space again.

If you mean inside a NTFS partition and w/o destroying everything else on that
partition: that is tricky and requires tools from pkgsrc, but should be 
doable. But I guess you are talking about the extra partition stuff, which
is simple to remove - see above.

Martin


Re: Clean Microsoft FROM NETBSD

2024-05-17 Thread Martin Husemann
On Fri, May 17, 2024 at 02:05:23PM +, Todd Gruhn wrote:
> S -- not do-able?

What is the exact question? I can't parse the request.

Martin


Re: sysint crash

2024-05-10 Thread Martin Husemann
On Thu, May 09, 2024 at 03:14:54PM -0700, Stephen Medina wrote:
> Hello,
> 
> I was in the middle of my first install, about to partition my 
> drive, when sysint terminated with the error "screen too 
> narrow for menu". I am using one of those old square LCD 
> monitors. Is there a way around this?

Tell us more about the machine this happened on. Sysinst requires at least
80 columns and 24 rows (which seems reasonable). If your architecture's
kernel does not come with fonts to allow for that, we need to add them.

What is the resolution of your display and what kernel are you booting?

You can boot the installer, exit installation and use e.g.

dmesg | more

to find more details. An example for on of my machines would be:

[ 1.00] NetBSD 10.0_STABLE (EMMAS) #7: Sun Apr 28 16:05:18 CEST 2024
[ 1.00] 
mar...@seven-days-to-the-wolves.aprisoft.de:/work/src-10/sys/arch/amd64/compile/EMMAS

this lines tell us architecture and kernel used.

[ 1.014923] genfb0: framebuffer at 0xf100, size 1024x768, depth 32, 
stride 4096

and this tells us the resolution of the display.

You can check the text resolution by

stty -a

which for me outputs:

speed 9600 baud; 48 rows; 128 columns; queue = 2048; line = termios;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -mdmbuf
-cdtrcts
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ;
eol2 = ; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
stop = ^S; susp = ^Z; time = 0; werase = ^W;


So I have 48 rows and 128 columns, despite the quite low res monitor
used on that console.

Martin


Re: Intel Wireless fatal error

2024-05-07 Thread Martin Husemann
On Tue, May 07, 2024 at 08:16:18AM +, Riccardo Mottola wrote:
> [  3574.054462] iwi0: autoconfiguration error: fatal error

The message is bogus, it has nothing to do with autoconfiguration.

"Fatal error" is a bit in the interrupt cause register of the intel
chipset. The driver can not do anything about it and resets the device
(simmilar to a "ifconfig iwi0 down). This is not a good error handling
strategy, as you have noticed - and it is also done very wrong in the
iwi_softintr handler.

The driver should clear the interrupt, schedule a reset and ignore all
other activity untill the reset has happened. Of course the reset should
include bringing up the device to full working state again.

However, this is obviously not easy to test and debug, as you will have to
be in a setup where this happens often enough (like your's).
If you have patience and would be able to help with this: compile your
kernel with "options IWI_DEBUG" and see if that enables enough login to
give us a hint about the cause. If that is not enough you would need to
raise iwi_debug to more than the default level of 4, but that would
spam your log with every received packet.

Please file a PR and lets collect data there.

Martin


Re: NetBSD 10 and unreliable git

2024-05-06 Thread Martin Husemann
On Mon, May 06, 2024 at 12:51:19PM +, Riccardo Mottola wrote:
> I'just doing a git clone or a git pull... so don't blame "me".
> At most git.. or its NetBSD compilation.

I have never seen that (neither on 10.0 nor on -current). It is very
hard to tell what causes the errors for you. Two potential reasons
would be network issues (e.g. a bug in the driver for the network device
you are using) or the limit of simultaneous open files.

If you are using /bin/sh (or bash) please tell us the output of "ulimit -a"
[or for {t}csh: "limit").

What network device are you using? Can you show the relevant part of
/var/run/dmesg.boot? Also the output of ifconfig for the device (sometimes
checksum offload breaks things).

Martin


Re: virtio-9p filesharing issue

2024-05-05 Thread Martin Husemann
On Sun, May 05, 2024 at 09:10:36PM +0200, Taryel Hlontsi wrote:
> Then I had to make a device node:
> 
> mknod /dev/vio9p0 c 356 0
> 
> where 356 is a major number of the device I found in
> /usr/src/sys/conf/majors

The official way is something like:

cd /dev && sh MAKEDEV vio9p0

(so you don't have to go digging for the number, and sometimes devices
come in groups like tty* and dty*, MAKEDEV will handle that).

Martin


Re: netbsd crashes when using fat filesys

2024-05-03 Thread Martin Husemann
On Fri, May 03, 2024 at 12:20:45PM +0200, Riccardo Mottola wrote:
> still it would be nice to understand what changes Solaris was doing which
> disturb NetBSD.

Yes (but it sounds like it is a bug Solaris).

> I don't think NetBSD should crash...

Only if the file system passes a fsck_msdos(8). Which we don't know.
For random USB sticks we recommend the "-o rump" mount option.

Martin


Re: netbsd crashes when using fat filesys

2024-05-02 Thread Martin Husemann
On Thu, May 02, 2024 at 08:12:06PM +0200, Martin Husemann wrote:
> On Thu, May 02, 2024 at 08:04:28PM +0200, Rhialto wrote:
> > I filed http://gnats.netbsd.org/58146 for it.
> 
> Why do you think those issue are related? Sounds very unlikely to me.

To ellaborate on this:

 - the original issue reported here is *something else* mangling/breaking
   a FAT file system and NetBSD not dealing with the result. This can
   either be a bug in Solaris or in NetBSD's interpration of the FAT
   file system format - we just don't know (yet).

   An image of a file system in broken state is absolutely required here
   to debug the issue.

   If the OP can't provide such an image, we need a *working recipe* how
   to reproduce the issue, plus someone with a Solaris 10 installation
   to create the broken image, plus someone to debug the result.
   Currently we have neither the recipe nor someone with Solaris 10 installed
   willing to help.

 - PR 58146 looks like a NetBSD local locking issue/race condition. The
   file system image you offered probably will not be helpfull, we need
   to do carefull reading of the relevant locking paths in the code.


Martin


Re: netbsd crashes when using fat filesys

2024-05-02 Thread Martin Husemann
On Thu, May 02, 2024 at 08:04:28PM +0200, Rhialto wrote:
> I filed http://gnats.netbsd.org/58146 for it.

Why do you think those issue are related? Sounds very unlikely to me.

Martin


Re: netbsd crashes when using fat filesys

2024-05-02 Thread Martin Husemann
On Wed, May 01, 2024 at 05:08:04PM +, xuser wrote:
> This is as much as a I can give you
> It say some thing about invalid fats
> i cant see much because the screen go blank
> As for the core dump i don't have enough swap space

Can you provdie an image of a filesystem that shows this bug?
Maybe create a new empty one (on a usb stick?) and make it bad (however
that is done), then dump the stick's content and only after that try if
it triggers your crash. If it does, upload the image somewhere and send
the URL.

Thanks,

Martin


Re: netbsd crashes when using fat filesys

2024-04-30 Thread Martin Husemann
On Tue, Apr 30, 2024 at 10:25:09PM +, xuser wrote:
> Netbsd crashes when using fat that solaris 10 has modified.

Can you give any details (e.g. the exact kernel output from the crash),
provide a copy of the "modified" filesystem, or the kernel crash dump?

Martin


Re: NetBSD 10 RFE (ramdisk-cgdroot.fs in boot.cfg)

2024-04-30 Thread Martin Husemann
On Mon, Apr 29, 2024 at 07:12:16PM +, Arvind wrote:
> Sure, was just using the linux remote unlock as an example of what
> we're trying to get configured (after encrypting the root partition
> with passphrase unlock). Any help from the group would be much
> appreciated.

It should be relatively simple to add that to the root partition setup
with a few rc.d scripts and a bit of sshd setup (but there seems to be
no plug+play pkg for it nor a quick howto documentation).

We also should support the auto-booting clevis + tang alternative (but
both lack a pkg and again there should be a short howto documentation).

Has anyone done one or the other and would like to share details?

Martin


Re: ipv4_prefer

2024-04-30 Thread Martin Husemann
On Mon, Apr 29, 2024 at 05:04:06PM -0400, MLH wrote:
> Same :
> inet6 fe80:: (redacted but looks good)

Link local address.

> inet6 ::1000/128 flags 0

Bogus.

> dhcpcd issued a bunch of ipv6 stuff on startup that indicated all
> was fine but it didn't go into dmesg or a logfile that I can find
> and it appeared to wait a bit until an ipv6 addr was satisfied.

You need to show more of the dhcp conversation and router discovery
output (and/or debug logs), or capture a tcpdump.

Your router doesn't seem to advertize itself and not provide a prefix for
your public IPv6 address.

Martin


Re: OAUTH TOTP

2024-04-29 Thread Martin Husemann
On Mon, Apr 29, 2024 at 06:04:23PM +0100, Patrick Welche wrote:
> Apparently I need to "purchase an inexpensive OATH TOTP compatible
> token device."
> 
> $ wtf oath
> wtf: I don't know what `oath' means!
> $ wtf totp
> TOTP: time-based one time password
> 
> Any suggestions on something that works on NetBSD/amd64?

There is simple python code available that does it, if you only have one
site that needs it and can guarantee security for your local scripts
you can do something very simple like:

--8<--
#!/usr/bin/env python3.10

import base64, datetime, hashlib, os, sys, unittest
from warnings import warn

from urllib.parse import urlparse, parse_qsl

sys.path.insert(0, os.path.join(os.path.dirname(__file__), 
'../TOTP/pyotp-2.6.0/src'))
import pyotp  # noqa


print(pyotp.TOTP('YOUR_SECRET_CODE_HERE').now())
-->8--

(importing the local pyotp lib is a historic artifact, I should clean it up)

When "registereing" the device with your web site you will be shown a QR
code typically, or often can get one after selecting "something else, not
Google or MS authenticator", sometimes with the cleartext code shown
that you add in above script instead of YOUR_SECRET_CODE_HERE.

If only a QR code is shown, point your mobile camera at it and copy the
URL, it contains the code and you can manually extract it.

All of TOTP is a mangling of the current time + the pre shared secret.

I think there are several more "password manager" like python
applications in pkgsrc, but for me the simple single-target python
script was most convenient for now (I avoid TOTP where possible, prefering
WebAuthN with a yubikey whenever supported).

Martin


Re: cryptic pkgin SSL cert error

2024-04-23 Thread Martin Husemann
On Tue, Apr 23, 2024 at 03:17:14PM +0100, David Brownlee wrote:
> However, while better checking of trust anchors is a better end state
> - assuming I am understanding the situation correctly: in an
> effectively unannounced change, pkgin on a -9 system without either
> security/mozilla-rootcerts-openssl installed or /etc/openssl will now
> just fail, including any attempt to install mozilla-rootcerts-openssl
> to resolve.

Only if the binary pkgs repository URL was using https.
Default setup used to be http:

> This requires manual intervention to set an environment variable to
> allow mozilla-rootcerts-openssl to be installed, or otherwise setup
> /etc/openssl. That would appear to be an unhelpful change, to the
> extent that I would propose pkgin on netbsd < 10 might be better to
> default to disabling checking trust anchors (with a warning).

Edit the URL, install mozilla-rootcerts-openssl, change the URL back.

Martin


Re: NetBSD 9.3 to 10.0 upgrade failure - check for DOS fs

2024-04-23 Thread Martin Husemann
On Tue, Apr 23, 2024 at 01:20:12PM +, Riccardo Mottola wrote:
> /dev/sd0e   /media/usb  msdos   rw  0 0

What is that partition?
Is that "usb" device available (as sd0) during your upgrade experiment?

If you boot the installer from a USB disk, that might become sd0 and
things will go awfully wrong. This still is a bug - sysinst should recognize
the device clash, but I'm pretty sure there currently is no such code.

Maybe you could try commenting that partition out in /etc/fstab, do the upgrade
and later manually enable it again?

Martin


Re: Broken Link

2024-04-19 Thread Martin Husemann
On Thu, Apr 18, 2024 at 09:46:30AM -0700, Thomas D. Dean wrote:
> On https://wiki.netbsd.org/ports/evbarm/
> Select NetBSD/evbarm 10.0 INSTALL notes
> Produces Error 404.

Fixed, thanks!

Martin


Re: NetBSD 9.3 to 10.0 upgrade failure - check for DOS fs

2024-04-10 Thread Martin Husemann
On Wed, Apr 10, 2024 at 11:52:04PM +0200, Riccardo Mottola wrote:
> 0: NetBSD (sysid 169)
>   bootmenu: NetBSD
>   start 2048, size 625140400, Active
> 1: 
> 2: 
> 3: 
> Bootselector disabled.
> First active partition: 0

Can you show us the /etc/fstab file from the NetBSD partition?

Martin


Re: NetBSD 9.3 to 10.0 upgrade failure - check for DOS fs

2024-04-10 Thread Martin Husemann
On Wed, Apr 10, 2024 at 11:42:22PM +0200, Riccardo Mottola wrote:
> Your explanation sounds plausible.
> However, "UEFI Boot Mode" is disabled in BIOS, I don't know if it is still
> used by the CD or "detected" somehow anyway.
> 
> How can I tell further?

Can you boot the original install CD you used, exit the installer and
check the output of:

sysctl machdep.bootmethod

This should either tell you BIOS or UEFI, and this is how the installer
decides what kind of setup the booted system later will need.

Martin


Re: NetBSD 9.3 to 10.0 upgrade failure - check for DOS fs

2024-04-09 Thread Martin Husemann
On Tue, Apr 09, 2024 at 10:28:46PM +0200, Riccardo Mottola wrote:
> So I have a perfect working 9.3 installation on on an HP ProBook laptop.
> I boot the CD which works fine

Try the BIOS-only install image instead - I bet your system boots the
CD via UEFI, but the original installation was BIOS only.

Yes, this is a bug, the installer should find out and deal with it.

Martin


Re: compile kernel

2024-04-08 Thread Martin Husemann
On Mon, Apr 08, 2024 at 02:15:30PM +0100, Chris Pinnock wrote:
> 
> 
> > On 8 Apr 2024, at 10:11, Todd Gruhn  wrote:
> > 
> > Is there a better way to config a netbsd kernel.
> > 
> > GENERIC is getting so big.
> 
> In arch/*/conf you can copy the GENERIC kernel config file and edit the new 
> file to remove drivers and features. (e.g. if you don?t use NFS, you can 
> remove it.)
> Then run config with the new file.

Another option (for many architectures) is to have a GENERIC.local file
(next to GENERIC in your arch's conf/ directory) and use that to remove
unwanted options from GENERIC. This avoids stale copies of GENERIC when
other changes happen to GENERIC.

You use "no ..." statements in GENERIC.local, like:

no file-system NFS
no file-system LFS
no options INET6
no i915drmkms*
no radeon*
no nouveau*


Martin


Re: EXT MAIL : Re: USB install is slow

2024-03-28 Thread Martin Husemann
On Thu, Mar 28, 2024 at 12:56:29PM +, Derrick Lobo wrote:
> When I choose system drive during upgrade the upgrade takes long i.e 25 to 45 
> minutes
> 
> However if I choose the actual drive then its done in less than 5 minutes.. 
> so I will use the actual drive going further 

Sorry, I fail to parse that - can you tell more about the two drives you used?

Martin


Re: changed major shlib versions in netbsd-9

2024-03-27 Thread Martin Husemann
On Tue, Mar 26, 2024 at 06:06:42PM -0400, Greg Troxel wrote:
> So:
> 
>   - this was thought about and believed within the rules
>   - I should just delete the destdir and continue
>   - we believe that I will then have no problems

Yes!

(If this would cause problems, you had them before but subtely hidden 
and at runtime)

Martin


Re: changed major shlib versions in netbsd-9

2024-03-26 Thread Martin Husemann
On Tue, Mar 26, 2024 at 03:46:21PM -0400, Greg Troxel wrote:
> Or, do we claim that these libs are private to bind, and thus this is
> not an ABI change?

We do, but it is phishy. There was a recent discussion to move it to
some more private directory like /usr/lib/bind/lib*.so (especially to
avoid collisions with bind from pkgsrc).

Martin


Re: can't get the install USB to boot

2024-03-23 Thread Martin Husemann
On Sat, Mar 23, 2024 at 10:32:53PM +0900, Henry wrote:
> In order to test NetBSD-10.0, I copied the latest kernel to the root
> directory of a [partially] working NetBSD-9.3 system.  Absolutely
> fantastic: super fast boot-up, AND the '/sbin/shutdown -p' glitch with
> the 9.x series is fixed!  THANK YOU developers for your hard work.
> 
> Now, is there a way to update all the binary sets other than using the
> install image sysinst?  Or can you remind me how to get the install
> disk to complete its boot?  I REALLY want to get NetBSD 10 on this
> machine.

Since booting the new kernel works, you could download:

https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0_RC6/amd64/binary/kernel/netbsd-INSTALL.gz

and put it in your (9.3) / dir, reboot, interrupt the boot countdown and drop
to the boot prompt, then do: boot netbsd-INSTALL.gz

This should load a 10.0_RC6 kernel with embedded ramdisk and installer.
In sysinst select upgrade and fetch sets via network.

Martin


Re: PKGSRC-Changes

2024-03-22 Thread Martin Husemann
On Fri, Mar 22, 2024 at 10:05:42AM -0400, Justin Parrott wrote:
> pkgsrc-changes@ is driving me nuts.  How do you feel about it?

Why are you subscribed to that list if you are not interested in 
the details there?

Martin


Re: EXT MAIL : Re: USB install is slow

2024-03-14 Thread Martin Husemann
On Thu, Mar 14, 2024 at 02:02:44AM +, Derrick Lobo wrote:
> Here are the details.  Has anyone else experience this issue
> netbsd 9.0
> time cat /mnt/amd64/binary/sets/base.tarxz > /dev/null
> 5.65s real 0.00s user 0.06s system
> 
> netbsd 10rc5
> time cat /mnt/amd64/binary/sets/base.tarxz > /dev/null
> 1.59s real 0.00s user 0.11s system

Are those times swapped? Otherwise I would read them as 10.0_RC5 being
about 3 times faster...

Martin


Re: EXT MAIL : Re: USB install is slow

2024-03-11 Thread Martin Husemann
On Mon, Mar 11, 2024 at 01:31:26PM +, Derrick Lobo wrote:
> I have reproduced this issue on multiple servers with the following
> cpus using the amd64 USB image on all of them takes 20 to 45 minutes
> which normally on netbsd9 took 3 minutes max to complete the USB
> install. None of our servers have CD/DVD

It would be really suprising if any of that CPUs would make a difference.

Have you tried a different USB stick?

It is still totally unclear where your machines spends all the time. Instead
of installation you could benchmark reading the sets first, something
like:

time cat /mnt/.../base.tar.xz > /dev/null

and compare that with 9.x numbers.

Martin


Re: dmesg error "source can't be determined: dst=x.x.x.x" for aliased address

2024-03-08 Thread Martin Husemann
On Fri, Mar 08, 2024 at 03:59:10PM +, Derrick Lobo wrote:
> wm0: flags=0x8843 mtu 1500
[..]
> inet6 fe80::ec4:7aff:fe33:2c6c%wm0/64 flags 0 scopeid 0x1
> inet 192.168.60.238/24 broadcast 192.168.60.255 flags 0
> inet 192.168.60.189/24 broadcast 192.168.60.255 flags 0
> inet 192.168.60.194/24 broadcast 192.168.60.255 flags 0


I have a very similar network setup running RC5 and working just fine.

In my case the first address is added via "ifconfig $if $addr"
and the additional ones via "ifconfig $if inet alias $addr"

Martin


Re: EXT MAIL : Re: USB install is slow

2024-03-08 Thread Martin Husemann
On Fri, Mar 08, 2024 at 08:18:14PM +, Derrick Lobo wrote:
> Hi Thierry
> 
> Manual untar seems fine no issues at all. This seems more like
> copying the file between usb to the local drive as I see stalls when
> the file is copied over

But you said the time was spent in the download mostly - and I am totally
confused what times you are comparing against which. The sets should be
on the install usb medium, so no download is necessary.

The download speed itself may vary widely and is totaly outside of our
controll.

When you say untarring the sets is fast, is that after copying them
from the USB stick to hard disk or untarring from the USB source directly?

Martin


Re: EXT MAIL : Re: USB install is slow

2024-03-08 Thread Martin Husemann
On Fri, Mar 08, 2024 at 03:52:15PM +, Derrick Lobo wrote:
> I ended just untaring the sets and running etcupdate as that was much
> quicker

Huh? If that was much quicker (you were running the same kernel, from the
install image?) - where did the upgrade spend all the additional time?
Extracting sets should be the major part, plus a bit of "postinstall" where
it hashes all the (new with -10) SSL certificates (and the script doing so
is suboptimal). Neither should take even close to 10 minutes on amd64 hardware
from the last 10 years or so.

Martin


Re: USB install is slow

2024-03-07 Thread Martin Husemann
On Thu, Mar 07, 2024 at 03:40:15PM +, Derrick Lobo wrote:
> I have noticed the USB install taking way too long anyone else noticed it

On what hardware?

This may depend on (a) the target disk [e.g. new driver bugs making writes
slow] or (b) the USB stick and what controller it is pluged in [i.e. slow
reads] - or something else going wrong in the new kernel during the
update [e.g. an interrupt storm due to some unrelated device/driver bug].

Please file a PR and include full dmesg output of the installer kernel.

Martin


Re: NetBSD 9.x-STABLE amd64 build sets problem?

2024-03-02 Thread Martin Husemann
On Sat, Mar 02, 2024 at 07:04:39PM +, Mike Pumford wrote:
> Something slightly off in a set definition?

Yes (for builds without MKDEBUG=yes). Should be fixed now.

Martin


Re: x86_64 assembly Hello World

2024-02-11 Thread Martin Husemann
On Sun, Feb 11, 2024 at 10:39:36AM +0100, Fekete Zoltán wrote:
> Hi There!
> 
> I have played with GNU as and ld, and subsequently created a "Hello World!"
> program, which I could not find anywhere else so far.

There are examples (including  x86_64 and i386) installed in
/usr/share/examples/asm/hello

It is a bit controversial if this examples are good, the prefered way for
most assembly programs is to link against libc and get the NetBSD marker
note from the libc startup code (src/lib/csu/common/sysident.S).

Martin


Re: Raspberry Pi Zero W almost useless

2024-02-08 Thread Martin Husemann
On Thu, Feb 08, 2024 at 12:06:51PM +0100, Ramiro Aceves wrote:
> Hello,
> 
> 
> I started playing  tweaking usbdevs file in the Intel Nuc 8i7BEH
> NetBSD-10_RC3 amd64- I added the line:
> 
> product REALTEK RTL8188FTV  0xf179  RTL8188FTV

You need to regnerate a few files after changes in sys/dev/usbdevs.
Try something like:

cd src/sys/dev/usb
make -f Makefile.usbdevs USETOOLS=never

or use nbmake-$arch from $TOOLDIR instead and remove the USETOOLS=... part.

Martin


Re: NetBSD 10.0 RC_3 GENERIC amd64 home built kernel doesn't boot

2024-02-04 Thread Martin Husemann
On Sun, Feb 04, 2024 at 07:18:57PM +0100, Fekete Zoltán wrote:
> ... boot device: wd0
> ... root on wd0c dumps on wd0b
> ... vfs_mountroot: can't open root device
> ... cannot mount root, error = 6
> ... root device (default wd0c):

wd0c sounds unlikely for / - can you try answering wd0a at the prompt?
When that works, show dmesg output and fdisk / disklabel output for wd0
and we can try to find out where something goes wrong.

Martin


Re: WireGuard setup in NetBSD 10 [SOLVED]

2024-01-18 Thread Martin Husemann
On Thu, Jan 18, 2024 at 11:16:16AM +0100, Kirill Miazine wrote:
> Step 3 has to be a different one: load if_wg module, to make sure wg is
> listed as a clonable interface.

Yes, indeed, and it is slightly subtle (auto-hiding by module auto-loading).

I have all my router kernels running securelevl >= 1 and module
auto-loading disabled, so I do have to make sure the if_wg module is
present before we go multi-user. Also in this setup the failure is
more obvious.

Martin


Re: WireGuard setup in NetBSD 10

2024-01-18 Thread Martin Husemann
On Thu, Jan 18, 2024 at 10:23:11AM +0100, Kirill Miazine wrote:
> Does your custom kernel provide some wg devices initially?

No, but "ifconfig -C" lists wg as a clonable device, so /etc/ifconfig.wg0
is loaded.

Martin


Re: WireGuard setup in NetBSD 10

2024-01-18 Thread Martin Husemann
On Thu, Jan 18, 2024 at 09:27:59AM +0100, Kirill Miazine wrote:
> 
> Yet for some reason mine isn't being picked up -- even if I use wg0 instead 
> of wg1.

Oh, sorry - I forgot the obvious part: you need to make sure your kernel
has wg(4) support - it is not part of GENERIC on most architectures currently.

You can either add it (I have it in GENERIC.local in my config dir) or make
sure the module is loaded (by adding if_wg.kmod to /etc/modules.conf).

You can check it is in-kernel by something like:

  modstat | fgrep wg

Martin


Re: WireGuard setup in NetBSD 10

2024-01-18 Thread Martin Husemann
On Thu, Jan 18, 2024 at 08:46:11AM +0100, Kirill Miazine wrote:
> Hi, NetBSD users
> 
> I've been setting up a NetBSD box, which has to be connected to the wider
> WireGuard network. There's a while since I managed NetBSD, so I'd like to
> ask for feedback as to whether current setup is considered a "proper" way of
> setting up WireGuard on NetBSD:
> 
> 1. Create files with WireGuard private key and pre-shared key

Yes.

> 2. Create ifconfig.wgN with lines to configure network address, and a bunch
> of calls to wgconfig using !. Now while writing this email I discovered that
> I can use $int variable in ifconfig.wgN file, and that made wgconfig calls a
> lot cleaner.

I use something like this as /etc/ifconfig.wg0:

-8<-
192.168.2.42/24
!wgconfig ${int} set private-key /etc/wg/${int}
!wgconfig ${int} set listen-port 62345
!wgconfig ${int} add peer  .  --allowed-ips=192.168.2.32/32
# more similar "add peer" lines...
up
->8-

> 3. Add wgN to net_interfaces in rc.conf.

No need to do that.

Martin


Re: Link to Release Candidates

2024-01-05 Thread Martin Husemann
On Fri, Jan 05, 2024 at 10:30:51AM -0600, Robert Nestor wrote:
> Maybe it?s just me, but putting an announcement of the availability
> of a Release Candidate at the top of the NetBSD Home Page without
> having a link to where it can be found seems highly inconvenient.

Not "without", but slightly hidden behind the way too long changes list ...
Searching for "download" in the page gets you to "Getting NetBSD 10.0"
and there are the links.

However, to simplify things and on popular demand:
the page now has a TL;DR banner with a link to the release binaries and
the hashes.

Martin


Re: Is it possible to install NetBSD from Ventoy?

2023-12-14 Thread Martin Husemann
On Thu, Dec 14, 2023 at 12:43:56PM +, Liam Proven wrote:
> You don't write an image to anything. You copy a file. It's a normal
> FAT32 filesystem with as many ISO files as will fit and it generates a
> boot menu on the fly every boot. It works on x86-32, x86-64, BIOS and
> UEFI.

The web page does not give any technical details, so it is hard to tell
how it is supposed to work.

Since you tested it with FreeBSD: what devices shows up as root device
there?

Extracting the bootloader and dynamically generating the boot menu is the
easy part, but how is the main part of the ISO filesystem provided to
the kernel?

On some architectures (and amd64 is one of them) the kernel booted from
the ISO is not ramdisk based, but instead mounts the CD's ISO9660 file
system as / (and sets up tmpfs for all writable parts).

I don't see how that could work outside of an emulator.

(and if the kernel would use a memory disk as / all of the ISO is a waste
and it would be better to just use the NetBSD-install kernel instead)

Martin


Re: How big should wd0e (/var) be

2023-12-11 Thread Martin Husemann
On Mon, Dec 11, 2023 at 11:22:31AM -0500, Todd Gruhn wrote:
> > The correct size is "not on its own partition". Why not have /var
> > along with / on the same filesystem?
> 
> Thanks  -- /var on wd0e was given to me  --  by  install.sh

What is install.sh?

> On Mon, Dec 11, 2023 at 9:54?AM xuser  wrote:
> >
> > If you have room 1GB at least.

I see varying usage between ~100M and 1.5G on several machines around here.

Some applications use /var/tmp for bigger temporary files.

If you use /var/mail for mail spool you should not limit the size too low
or mail might bounce.

Martin


Re: buildworld failure due to md5 not supported by openssl3

2023-11-23 Thread Martin Husemann
On Thu, Nov 23, 2023 at 11:58:08AM +0100, Ede Wolf wrote:
> Btw, this does not seem to be alpha-port specific. I've just tried to
> compile on amd64 for amd64, exactly the same mk.conf (with the obvious
> exception of CPUFLAGS) and of course changing -a and -m for build.sh:

As Robert noted, it is MKKERBEROS=no that breaks it. The CWARNFLAGS
setting in the makefile needs to be rearragend.

Martin


Re: X on 10.0 RC1 is unusable on my laptop

2023-11-23 Thread Martin Husemann
On Thu, Nov 23, 2023 at 09:47:21AM +0100, tlaro...@kergis.com wrote:
> Smart move and great initiative! Please do send patches to
> tech-k...@netbsd.org in order for the developers working with drmkms
> to see them and, hopefully, apply them to the cvs sources.

Adding them to the PR is good enough.

Martin


Re: buildworld failure due to md5 not supported by openssl3

2023-11-22 Thread Martin Husemann
On Wed, Nov 22, 2023 at 04:21:01PM +0100, Ede Wolf wrote:
> My build says somethig different about warnings and errors (Marking by me,
> of course):
> 
> /data/src/crypto/external/bsd/libsaslc/lib/../dist/src/crypto.c: In function
> 'saslc__crypto_md5_hex':
> /data/src/crypto/external/bsd/libsaslc/lib/../dist/src/crypto.c:233:2:
> error: 'MD5' is deprecated: Since OpenSSL 3.0
> [-Werror=deprecated-declarations]
>   233 |  (void)MD5((const unsigned char *)buf, buflen, digest);
>   |  ^

My build says:

#   compile  lib/crypto.o
/work/tools/bin/alpha--netbsd-gcc -O2   -std=gnu99-Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wno-sign-compare  -Wsystem-headers   
-Wno-traditional   -Wa,--fatal-warnings  -Wreturn-type -Wswitch -Wshadow 
-Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare 
-Wsign-compare -Wformat=2  -Wno-format-zero-length  -Werror  -mieee 
--sysroot=/work/hosts/alpha 
-I/work/src/crypto/external/bsd/libsaslc/lib/../dist/include  -c 
-Wno-error=deprecated-declarations   
/work/src/crypto/external/bsd/libsaslc/lib/../dist/src/crypto.c -o crypto.o



Note that it has:  -Wno-error=deprecated-declarations

(which comes from COPTS.crypto.c in the Makefile there).

So something in your setup must override that, but it is not obvious to me
right now.

If you go into src/crypto/external/bsd/libsaslc/lib and invoke your
$TOOLDIR/bin/nbmake-alpha with "-v COPTS.crypto.c" - what does it say?
Or it may override the construction of the final flags from that variable,
maybe due to your CPUFLAGS settings?

Martin


Re: buildworld failure due to md5 not supported by openssl3

2023-11-22 Thread Martin Husemann
On Wed, Nov 22, 2023 at 12:00:10PM +0100, Ede Wolf wrote:
> Hello,
> 
> just trying to crosscompile world, which fails with crypto not being able to
> be build, as MD5 is claimed to not be supported by openssl3.
> Is it just me or is anything known? cvs updated just an hour or so ago:
> 
> 
> /data/src/crypto/external/bsd/libsaslc/lib/../dist/src/crypto.c: In function
> 'saslc__crypto_md5_hash':
> /data/src/crypto/external/bsd/libsaslc/lib/../dist/src/crypto.c:218:3:
> error: 'MD5' is deprecated: Since OpenSSL 3.0
> [-Werror=deprecated-declarations]
>   218 |   (void)MD5((const unsigned char *)buf, buflen, digest);
>   |   ^

This warnings are not treated as errors in the build usually, how are you
doing this build? Anything special in /etc/mk.conf?

Martin


Re: Trouble with re driver

2023-11-19 Thread Martin Husemann
On Sun, Nov 19, 2023 at 12:48:47PM +0100, BERTRAND Joël wrote:
>   I have done a mistake this morning. I have replaced /netbsd kernel and
> copied /netbsd into /netbsd.old (thus, I have deleted my -10-beta
> kernel) but I'm pretty sure my -10-beta was built less that three months
> ago.

I reviewed the CHANGES-10 entries from that period again and still nothing
plausible. All pcidevs changes were only cosmetic (name changes) or
additions and no PCI resource mapping relevant files have been changed.

Martin


Re: Trouble with re driver

2023-11-19 Thread Martin Husemann
On Sat, Nov 18, 2023 at 10:59:14PM +0100, Tobias Nygren wrote:
> I suspect the regression originates with an acpica update and some
> firmware bug might be a prerequisite to trigger it.

There have been no acpica updates on the -10 branch.

Martin


Re: Trouble with re driver

2023-11-19 Thread Martin Husemann
On Sat, Nov 18, 2023 at 08:14:32PM +0100, BERTRAND Joël wrote:
>   If I restart this server with a -10.0-Beta kernel, faulty ethernet
> adapter is autoconfigured without trouble.

Can you give more details of that kernel? Ideally source update time,
or kernel build time? That way we can narrow down the range of pullups
in between the broken and the non-broken kernel.

There are no obvious changes at first glance, so this is a bit of a riddle.
It would be best if you could bisect the breakage to an individual pullup
(as we have no other reports of broken re(4) so far and as you noticed it
seems to be pretty hardware dependend).

Martin


Re: NetBSD as an NTP stratum 1 server

2023-11-16 Thread Martin Husemann
On Thu, Nov 16, 2023 at 06:03:56PM +0100, Manuel Bouyer wrote:
> To do better I think I'd go with an implementation of ntpd on a 
> microcontroller
> (maybe an ESP32, which has native ethernet) and use the PPS signal with a
> capture channel. Doing true real time on more complex CPUs is really hard.
> 
> I know there is an implementation on arduino, but I think a 32 bit MCU
> would be a better choice.

That sounded like such a good idea somebody must have done it before, and
it seems so (even with cool display):

https://github.com/liebman/ESPNTPServer

Martin


Re: [cross]compiling world and mk.conf

2023-11-08 Thread Martin Husemann
On Wed, Nov 08, 2023 at 01:02:12PM +0100, Ede Wolf wrote:
> Hello,
> 
> I am heading for my first cross compile, but reading chapter 33 or man
> make/release, I am having one principal problem of understanding:
> 
> Of course, if I have a central machine to cross compile for different hosts,
> I am having a different mk.conf for each remote host or host
> group/architecture. From CFLAGS to different build options, like .f.e.
> MKINFO
> 
> But I have not been able to find a means to tell make build or build.sh the
> location of mk.conf they shall use for that particular build.

That is simple (but not obvious):

-V MAKECONF=/mk.conf

Probably not very usefull side remark here: I never had the need for
different mk.conf files per build or architecture (but don't let that stop
you!)

Alternatively you can use conditionals in mk.conf, like:

.if ${MACHINE} == "sparc"
CFLAGS+= -mcpu=v8 -mtune=supersparc
.endif

or

.if ${MACHINE_ARCH} != shark
MKKDEBUG=yes
.endif


Martin


Re: Latest NetBSD-10

2023-11-04 Thread Martin Husemann
On Fri, Nov 03, 2023 at 09:24:59PM +, Todd Gruhn wrote:
> Iread that NetBSD-10.0.?RC was coming out at end of October.
> It is now November.

It was delayed a tiny bit by another openssl+openssh update, but will
happen over this weekend.

Martin


Re: How to get some needed binaries for an old installation (to do a system update to NetBSD 9.3)

2023-10-10 Thread Martin Husemann
On Mon, Oct 09, 2023 at 07:09:25PM +0200, Dennis Dingeldein wrote:
> My problem now is, on that 1.5.3 installation, there is no fdisk and no
> mkfs. I checked the installations tgz files located here
> https://archive.netbsd.org/pub/NetBSD-archive/NetBSD-1.5.3/vax/binary/sets/,
> but these also do not contain mkfs and fdisk.

You need disklabel, newfs and tar for a manual installation.

But probably easier would be to get into the installer somehow. Can you
try an ISO image from a newer netbsd-9 build (or even 10.0 BETA)?

You can download them from

https://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-9/latest/
or
https://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-10/latest/

Martin


Re: ssh is linked to libsqlite.so

2023-10-07 Thread Martin Husemann
On Sat, Oct 07, 2023 at 01:20:19AM +0500, Vitaly Shevtsov wrote:
> Why is ssh linked with libsqlite.so?

I think this comes from heimdal, the Kerberos implementation we use, to
support authentication via GSSAPI.

Martin


Re: Console video resolution

2023-09-22 Thread Martin Husemann
On Thu, Sep 21, 2023 at 05:00:07PM -0600, Brook Milligan wrote:
> Is there a way to control the video resolution on the console of a NetBSD 
> machine?  Is that controlled by the kernel somehow?

This depends on the architecture you are using, the boot method and the
framebuffer device.

If you have some drm*fb attaching, it is controlled by the fonts
available in the kernel. If you use amd64, vesafb and boot via UEFI you
can controll it via the bootloader's "gop" command.

Martin


Re: sysupgrade issues - missing netbsd-ARU_MBOX_OWNER

2023-09-11 Thread Martin Husemann
On Mon, Sep 11, 2023 at 06:54:36PM +0200, Ede Wolf wrote:
> Hello,
> 
> not sure, wether this is the proper list, but I am having a cubietruck, that
> hasn't seen much love lately, and while trying to fix this with an upgrade,
> I am running into problems.
> sysupgrade fails, because an image it requests does not ecist. And checking
> the site, it really is not there. What am I missing?

The netbsd-* set is for the kernel. Since you have a cubietruck, you probably
want netbsd-GENERIC.gz instead. Why does sysupgrade think it needs
that strange name as a kernel set?
What is your uname -a output?

Martin


Re: /dev/tty01 will not open on Beaglebone Black

2023-09-02 Thread Martin Husemann
On Fri, Sep 01, 2023 at 10:31:45PM -0600, Brook Milligan wrote:
> I'll submit a PR; what category?

Definitively hardware specific, so port-arm. 

> - When the kernel boots into multiuser, run cu as
> 
>   # cu -l /dev/tty01

You mean /dev/dty01 here? Is 01 the correct number (you should check in dmesg).

Martin


Re: 10_beta and bridged network with NPF

2023-08-25 Thread Martin Husemann
On Fri, Aug 25, 2023 at 09:50:59AM +0200, BERTRAND Joël wrote:
>   I suspect a mistake in npf kernel support introduced by last patches.

The change is explained in PR 56990. If you think it broke previously
correct and working configurations, please reply to the PR.

Thanks,

Martin


Re: UEFI installation

2023-08-14 Thread Martin Husemann
On Mon, Aug 14, 2023 at 11:15:48PM +0700, Robert Elz wrote:
> A better solution would probably be to simply set up all
> possible boot methods (for the way the system is being
> configured) without caring which method happened to be
> used to boot the install image.

Yes, ideally.

But that will get pretty complicated soon, when we introduce setting
proper boot options within UEFI now that we have the runtime services
available - but only if booted via UEFI. This is required to support
multi-boot setups (with different OSes on the same disk; it already
works fine if you dedicate a disk to each OS).

We could still do the default UEFI setup w/o boot option if booted via
BIOS, but then we'll have 3 code paths, all non-trivial to test.

Not objecting, just noting that it might get slightly complex.

Martin


Re: Regression in 10.x installer

2023-08-14 Thread Martin Husemann
On Mon, Aug 14, 2023 at 02:14:26PM -0400, salqu...@duck.com wrote:
> Previously I did not select this option ?preconfigured ?wedges?? because it
> says - preconfigured ?wedges? dk(4) in my case, and dk4 is not the NetBSD
> partition, it is a Linux swap partition. However, you are right that it
> lists the wedges, and I can select dk1 which is the NetBSD FFSv2 wedge. Now
> that I look closely, it does say dk(4), and not dk4. Maybe 4 is the count
> then? However, my disk wd0 has 5 partitions (unless we don?t want to count
> the EFI partition).

4 is the section number in the manuals, "man dk" will show:

DK(4)Device Drivers Manual   DK(4)

NAME
 dk - disk partition (wedge) driver


... so the menu entry is meant to say: everyhting that has a "dk" device
attached.

Clearly not well-phrased, I am open to sugestions for improvent.

> I still could not install NetBSD 10 current on the NetBSD wedge though,
> because after selecting the wedge, it again goes back to the menu asking
> which disk I want to install NetBSD on.

That clearly is a bug. At least it should error verbosly if anything
does not work - I'll see if I can reproduce it locally.

Martin


Re: Regression in 10.x installer

2023-08-14 Thread Martin Husemann
On Mon, Aug 14, 2023 at 12:34:26PM -0400, salqu...@duck.com wrote:
> $ dkctl wd0 listwedges
> 
> /dev/rwd0: 6 wedges:
> dk0: EFI System Partition, 409600 blocks at 40, type: msdos
> dk1: 82b9223d-b27d-504a-8ea9-693104c2edb5, 209715200 blocks at 411648, type:
> ffs
> dk2: 7d7df035-0929-de4b-a5f2-da3a405ad98c, 8597504 blocks at 210126848,
> type: swap
> dk3: 68ec576e-a611-fa4f-815e-426a5d4aa7c7, 419430400 blocks at 218724352,
> type: ext2fs
> dk4: 939184a1-522d-3b49-94d0-e2aacb30ecbb, 8429568 blocks at 638154752,
> type:

OK, so far everything looks fine. But you do *not* get dk0 ... dk4 offered
in the "Preconfigured "wedges" dk(4)" item in the "Available disks" menu?

You should get a list of all wedges there that are not mounted as /
(so in your case: everything besides dk7)

Martin


Re: Regression in 10.x installer

2023-08-14 Thread Martin Husemann
On Mon, Aug 14, 2023 at 04:33:49PM +0200, bsdprg wrote:
> NetBSD 9.x sysinst correctly identifies the NetBSD wedge and allows me to
> install 9.x on it.
> NetBSD 10.x sysinst does not show me the option to install on this wedge.
> Instead it shows only the full disk options and one EFI partition as the
> wedge option.

I am not sure I parse that correctly. In -9 the wedges were mixed into the
list of plain disks, and people found that confusing.
So in -10 the list of wedges moved into a separate menu item - which I assume
you found, since you see the EFI partition there.

I am not sure what you otherwise see or don't see but expect to be there,
so it would be best if you could show the output of:

gpt show -a wd0
dkctl wd0 listwedges
dmesg

(if wd0 is the hard disk you want to install to).

Martin


Re: UEFI installation

2023-08-14 Thread Martin Husemann
On Mon, Aug 14, 2023 at 08:39:11AM -0400, Greg Troxel wrote:
> So it seems the installer detected that it booted from mbr instead of
> UEFI and set up MBR probably gptboot and skipped the EFI gpt partition.
> Maybe I'm over-assuming.

Yes, the installer (on x86) uses machdep.bootmethod to decide if the
system is new enough for UEFI, which works quite well, but not in your
case since you revert the required settings in the UEFI setup after
the installation.

It would be possible to add a manual override in the installer, but
currently there is no such thing.

But the part that I don't understand: why can't you get your machine to
boot the USB install image in UEFI mode? With stupid x86 firmware everything
is possible but I would guess it is more likely that some setting should
allow booting from USB in UEFI mode. Maybe the boot order settings
priorize CSM/legacy mode for USB over native (UEFI) boot and you can move
the UEFI USB boot up in the list?

Martin


Re: top(1) behavior

2023-08-12 Thread Martin Husemann
On Fri, Aug 11, 2023 at 07:04:01PM -0700, Kevin Bowling wrote:
> A real example is doing a -j 8 kernel build.  Up in the top of top(1),
> I see global CPU usage in the high 90%.  Down in the process list, I
> see a few processes in the 1-10% range that do not add up to 800%.  I
> see some of the cc1 processes with 0% WCPU%/CPU%.

I am not sure I see what you mean, for me typically there are a few gcc
processes that take all the cpu, or later (close to the end) a few
xz or gzip processes. At a few spots ld wins and hogs at least one cpu
completely.

At least it looks not completely off, the top area displays statistics for
aggregated intervals, while many processes (besides the ones mentioned)
are very short lived - so the display is mostly what I'd expect it to be.

If you do "top -b" (so the list is not truncated) and save it to a file,
do you get a snapshot that is still unreasonable from your POV? Can you
share a concrete example?

For FreeBSD showing the values more like you expect I'd blame that on clang/
llvm being slow, but I'll be shot for this remark :-)

But still specualting without data: one thing that could make a serious
difference is the device you are running your build.sh on having a
suboptimal driver spending a lot of cpu in the kernel for the IO the
build produces.

Martin


Re: top(1) behavior

2023-08-11 Thread Martin Husemann
On Thu, Aug 10, 2023 at 02:13:12PM -0700, Kevin Bowling wrote:
> When running something heavy yet ephemeral like a parallel make, I can
> see expected CPU usage in the summary or per-cpu view.  However, I
> rarely see the process(es) consuming the CPU momentarily during the
> update intervals reflected accordingly in the per process view below.
> I find the behavior somewhat surprising compared to FreeBSD top(1) and
> am wondering what the difference is.

You mean you often don't see the process with STATE CPU/0 (or some other
cpu)?

Maybe FreeBSD uses a different default sort - you could try experimenting
if you get similar display with something like "top -o ..." and various
sort fields.

Martin


Re: Failed on boot kde4

2023-07-23 Thread Martin Husemann
On Sun, Jul 23, 2023 at 09:05:22PM +0800, ykla wrote:
> I encountered a problem when installing netbsd+kde4. I can enter the kdm
> interface, but after entering the password and pressing enter, the screen
> goes black and I can only see the mouse cursor.

This means your session did not run and there are no X clients connected
to the (apparently working) X server.

I don't know about kdm, but usually there is a log file in your home
directory capturing the errors from the session startup script - you need
to find out how that is called and check its content.

E.g. for me (using xdm and xfce4) it is 

~/.xsession

that is executed to start the session and

~/.xsession-errors

has the stderr output of it.

Martin


Re: modern desktop update recommendations?

2023-07-18 Thread Martin Husemann
On Mon, Jul 17, 2023 at 05:18:04PM -0400, MLH wrote:
>  port-amd64/56987 - non-critical medium priority sw-bug
> Certain usb devices can no longer be mounted on -current
> 
> I posted it over a year ago but no action yet.

"No action" is not quite correct. No solution certainly.

This is nearly impossible to debug w/o the hardware at hands or you
narrowing it down to a concrete change in the USB code.

Is the GPS device easily available (e.g. via ebay)? What is it exactly?
I think the PR does not tell. Regular storage devices are hopeless,
you get different things with the same name every time you order one.

If you can not narrow it down (I failed to parse your reasoning in the
PR) you need to build kernels with usb/umass debug enabled and start
looking for where things go wrong (or differences to the working one
when both have huge debug levels enabled).

Martin


Re: What is the current Wireguard situation?

2023-07-05 Thread Martin Husemann
On Wed, Jul 05, 2023 at 04:51:48PM +0100, Chavdar Ivanov wrote:
> So you can't modload if_wg on aarch64 at any time? It has to be in
> /etc/modules.conf ?

That depends on whether you run with kern.securelevel > 0, which I do,
and probably many evbarm kernels will do too by default.

Martin


Re: What is the current Wireguard situation?

2023-07-05 Thread Martin Husemann
On Wed, Jul 05, 2023 at 04:36:14PM +0100, Chavdar Ivanov wrote:
> But you have to add 'pseudo-device wg' to you kernel configuration -
> it is not on by default:

Yeah, that is what my garbled "you might, or load the module..." part
was trying to say.

You have the choice: build a custom kernel with the pseudo-device wg
line added (I do that in GENERIC64.local for an aarch64 evbarm machine),
or add the module to /etc/modules.conf.

Martin


Re: What is the current Wireguard situation?

2023-07-05 Thread Martin Husemann
On Wed, Jul 05, 2023 at 05:10:42PM +0200, logothesia wrote:
> Hi folks,
> 
> What does the landscape look like regarding WireGuard? Is it supported at
> all?

In -10 and -current it is. I am using it on several machines (mostly with
windows peers).

> ifconfig. It is my understanding that wireguard-tools only provides the
> userland stuff (i.e., config file reading and so on).

You do not even need that, base comes with wgconfig, and "man wg" tells
you all about the setup tricks.

> Do I have to compile a custom kernel, or enable something somewhere?

Did you try "ifconfig -C"? That should list all clonable interfaces
and includes "wg" if the kernel knows about it.

> Not sure if it matters, but I am running NetBSD/evbarm-earmv6hf 9.3.

You might, or load the if_wg kernel module (by adding it to /etc/modules.conf,
see "man modules.conf").

Martin


Re: installing onto nvme/m2 ssd

2023-06-25 Thread Martin Husemann
On Sat, Jun 24, 2023 at 10:30:26PM -0400, cyrus torros wrote:
> Hi, I am trying to install Netbsd 10 on a eufi machine. a ryzen b450
> motherboard with a ryzen 5 2600 in it.
> 
> It has currently a m2/nvme drive in it that has windows installed on it,
> complete with all the crap that comes with a eufi windows 10 install.
> 
> I am having trouble using the netbsd installer to properly wipe and
> repartition this sssd.

It should be pretty easy:

 - choose: Install NetBSD to hard disk
 - Select ld0 (or whatever your nvme drive ends up being called)
 - choose: Delete everything, use different partitions (not GPT)
   [and ignore the "not GPT" part here]

and then you can select everything you like and start with an empty disk.

However, once you have started mangling your disk it might get more trickky.
The easiest way out is to escape the installer and use dd(1) to write
like 1MB of zeroes to you disk, once right at the start and again right
at the end of the disk (exact numbers don't matter, the idea is to nuke
the first and the last few sectors on disk so no traces of the old GPT can
be found).

Martin


Re: installer crashes/segfaults when trying to partition disk

2023-06-20 Thread Martin Husemann
On Tue, Jun 20, 2023 at 01:14:23AM -0400, cyrus torros wrote:
> i am using an amd ryzen b450 tomahawk and m2 nvme ssd if that at all
> matters, i have no clue how to get the core dump off this without crashing.

We need more details, for a start: which version are you trying to install
and what is on the disks before the installation.

Martin


Re: ctwm focus on new window?

2023-06-06 Thread Martin Husemann
On Tue, Jun 06, 2023 at 04:27:49PM +, adr wrote:
> Why is ctwm duplicated in src and xsrc?

It is not. There are only makefiles for it in src, while the source
is in xsrc ;-)

Martin


Re: ctwm focus on new window?

2023-06-05 Thread Martin Husemann
On Mon, Jun 05, 2023 at 06:36:05PM +, adr wrote:
> There is no makefile there, but I tried in case bsdmake
> imports the necessary files:

The official way to compile only this (but it assumes everything in xsrc
has been build before!) is something like:

cd src/external/mit/ctwm
${TOOLDIR}/bin/nbmake-${arch} -j 16 obj dependall install

This is usefull when changing things in ctwm itself and testing, but not
so much for individual builds of it.

Martin


Re: Experience with NetBSD on 13-gen Framework 13 laptop

2023-06-05 Thread Martin Husemann
On Mon, Jun 05, 2023 at 01:24:52PM +0200, Sijmen J. Mulder wrote:
>  - No EFI boot entry is created by systinst and the BOOTIA32.EFI and 
>BOOTX64.EFI files are placed in \EFI\BOOT, which can conflict with
>other OSes. I think they would be better placed in \EFI\NetBSD or  
>such.

We simply do not have the tools (yet) to do that, only a week or so ago
the necessary setup tool hit pkgsrc, but of course that is useless
for sysinst.

When not using the default path, we need to set up a boot option in efi
vars, and that involves some tricky path calculations in efi device
notation. If anyone would like to help with that, I'll be happy to
deal with the sysinst specific part.

Martin


Re: NetBSD-10.0.x

2023-05-30 Thread Martin Husemann
On Tue, May 30, 2023 at 08:04:40PM +, Todd Gruhn wrote:
> So I read about NetBSD-10.0 BETA -- will there be a 10.0.1 version
> comming?

10.0_BETA will become 10.0_RC1 (once the blockers listed at
https://wiki.netbsd.org/releng/netbsd-10/ are mostly resolved)
and then 10.0.

After that release, there will likely be a 10.1 sometime in the future.

Martin


Re: Advice for new travelling server: Intel Z690 chipset?

2023-05-10 Thread Martin Husemann
On Wed, May 10, 2023 at 05:04:03PM +0200, Johan Stenstam wrote:
> Yes, I saw that when reading docs. But that prompts the obvious
> followup question, especially given Matthias question to me about
> trying BIOS-booting my system. Is there any way to change from UEFI
> boot to BIOS boot without having to jeopardise my boot disk? And,
> preferably, also a way to change back.

You need to persuade your firmware to use legacy/BIOS boot (sometimes
called CSM there).

As long as you are able to (temporarily) boot from an USB stick, the
single disk should not be a problem.

It boils down to:

 - manually copy /usr/mdec/boot to your / directory

 - run something like gpt biosboot -c /usr/mdec/gptmbr.bin -i $N
   where $N is the index shown by "gpt show wd0" (or similar) for the
   partition where your "/" fs lives

After that both boot methods should work with the same disk.

Martin


Re: Advice for new travelling server: Intel Z690 chipset?

2023-05-10 Thread Martin Husemann
On Wed, May 10, 2023 at 12:56:57PM +0200, Johan Stenstam wrote:

> I'm a dinosaur from the pre-UEFI era, all I know is 'BIOS boot'. How
> do I find that out?

sysctl machdep.bootmethod

will tell you. It is completely unrelated to GPT vs. MBR, NetBSD can work with
GPT both on BIOS and UEFI booting machines.

The installer (w/o asking the user) always picks the method it was booted
itself. If UEFI, you will have an additional partiton (the "ESP" aka Efi
System Partition) with msdos file system. This is where the UEFI bootloader
binaries live.

Martin


Re: Linux emulation: Compiling with binary distributed libraries

2023-04-01 Thread Martin Husemann
On Sat, Apr 01, 2023 at 11:28:39PM +0530, Mayuresh wrote:
> Is it possible to use NetBSD's native compiler for this scenario (C
> sources and .so files that come with Vivado, meant for Linux)? (It doesn't
> work. I'll post errors if this is supposed to work.)

No (or at least it is probably the mostly complex possible solution).

> Alternatively, shall I be using even gcc's Linux version through Linux
> emulation? If yes, how?

Yes, and I'm not quite sure I understand the "how". It depends how you
run the Vivado stuff, one easy way would be to use a chroot to a
full Linux userland, and there it just would use the C compiler from that
userland.

The other option is to have enough libs installed in the emul dir and use
Vivado w/o chroot, then you could place the linux gcc wherever you like
and just point at it (via $PATH or whatever mechanisms Vivado offers
for configuration).

Martin



Re: TOTP apps, and WebAuthn recommended devices?

2023-03-25 Thread Martin Husemann
On Sat, Mar 25, 2023 at 02:45:46AM +, Taylor R Campbell wrote:
> [3] If you use FIDO-with-PIN instead of password+FIDO for anything,
> then the FIDO key does become a single point of failure -- and the
> compatibility and user experience is worse.  So I advise you avoid
> that.

Taylor put ther far too nicely - the user experiences with brain dead
setups like Office 365 is a disaster and apparently only designed to
push users away from the safe keys to the revenue generating use of the
providers "authenticator" app (for those not understanding it is plain
TOTP and there are free alternatives) or revealing their mobile phone numbers.

Martin


Re: TOTP apps, and WebAuthn recommended devices?

2023-03-23 Thread Martin Husemann
On Thu, Mar 23, 2023 at 09:51:17AM -0400, Greg Troxel wrote:
> It looks like the Yubikey 5 might fit the bill.

I am totally happy with my Yubikey and its usage in NetBSD and Firefox
(but I use 10_BETA and -current, though that probably only makes a difference
for the ssh usage).

I am regularily using WebAuthN with firefox for various sites and it
works perfectly.

I am also using it for Github (to log into the webpage) but also for
ecdsa-sk ssh keys (ssh agent pops up and asks me to insert and tap the
key whenever that ssh key is used for the first time).

For TOTP there are various python and ruby based solutions
in pkgsrc/security (and its trivial).
I use a few homgrown scripts (few lines) around pyotp, like:

print(pyotp.TOTP('MYSECRET').now())

where MYSECRET was the code the web page gave me when registering.

Martin


Re: Seting time

2023-03-13 Thread Martin Husemann
On Mon, Mar 13, 2023 at 08:04:53AM -0400, Todd Gruhn wrote:
> Because our time (in spring) changed from 6:00am ---> 7:00am.

No need to do anything, if you have set the correct timezone it
should adjust for DST automatically.

> I was hoping NetBSD would just take to a server to get latest time, then set
> NetBSD time with this. (from Washington D.C.  Naval  server)

You can enable ntpd to do that (well, close, not guaranteed to be exactly
that server), add

ntpd=YES

to /etc/rc.conf (or select "Enable ntpd" in the sysinst configuration screen)

Martin


Re: Which ARM SBC would work well with NetBSD?

2023-03-09 Thread Martin Husemann
On Thu, Mar 09, 2023 at 09:34:05AM +0900, Henry wrote:
> o can I create a NetBSD bootable micro SD card, or does one have to
> use Debian or Android on these A-20 Olimex SBCs?

We create SD card images for you: armbsd.org.
Just copy the proper image to the sd card and you should be ready to boot.

Martin


Re: Which ARM SBC would work well with NetBSD?

2023-03-05 Thread Martin Husemann
On Sun, Mar 05, 2023 at 12:40:57PM +0100, Benny Siegert wrote:
> All of these are well-supported by NetBSD. I don't know how well
> supported the newest generation is, notably the Quartz64.

I run a Quartz64 Model B in production (using netbsd-10). It is great,
only downside is that the hardware forces you to choose between xhci
(USB 3) and the on board SATA connector - and unfortunately the firmware
used to boot NetBSD only supports xhci currently.

Martin


Re: firefox resource hog

2023-01-09 Thread Martin Husemann
On Mon, Jan 09, 2023 at 09:20:07AM +0100, Benny Siegert wrote:
> All this to say: if you want faster Firefox, ultimately you need to
> look into making Rust run faster on NetBSD.

I don't buy that. Most of firefox performance is totally unrelated
to compiler efficiency of neither Rust nor the C++ compiler used.

Someone (tm) should really look into the firefox debugging options
and memory statistics that are only partly implemented on NetBSD, and
then get real numbers for real performance tests.

We should make that a GSoC project - but it might be too big for
3 month.

> The difference is obvious if you compile lang/rust on NetBSD vs. Linux
> on the same machine.

Because they compile with vastly different settings and probably also
different LLVM versions?

Pkgsrc forces strang rust build options (unthreaded build or something
like that) for NetBSD IIRC.

My bet would be the same "single threaded build" on Linux would take
roughly the same time overall.

Martin


Re: Is this normal floppy behavior?

2023-01-07 Thread Martin Husemann
On Sat, Jan 07, 2023 at 12:52:13PM +0100, Havard Eidnes wrote:
> > Now, of course, wouldn't be nice if 'umount' said something like "hey
> > dude!  you're in the directory you're trying to umount."
> 
> That's what e.g. "fstat /a" can tell you.

Indeed, and that gives you full information - a process with current working
directory inside the relevant file system is just one way to run into this
issue, so umount pointing at that would be wrong.

Martin


Re: NetBSD_10.0_BETA boot issues

2023-01-05 Thread Martin Husemann
On Thu, Jan 05, 2023 at 06:43:32AM -0600, Robert Nestor wrote:
> Yes it is, but getting a dmesg during the failure seems to be
> difficult since I haven?t seen a failure when booting with serial
> console and most of the details of the failure scroll off the screen
> before the boot crashes.

We don't need the dmesg from the failure case, the working one is fine.

Martin


Re: NetBSD_10.0_BETA boot issues

2023-01-04 Thread Martin Husemann
On Wed, Jan 04, 2023 at 02:07:04PM -0600, Robert Nestor wrote:
> Be happy to try and provide more info if someone has suggestions.

Is this the same machine as in https://gnats.netbsd.org/56737 ?
As Rin asked there: we need the full dmesg output of the machine.

Martin


Re: NetBSD-10.0_BETA: clock: unknown CMOS layout

2022-12-23 Thread Martin Husemann
On Fri, Dec 23, 2022 at 02:48:25PM +0500, Dmitrii Postolov wrote:
> Hi to All! Sorry for my bad English...
> 
> $ uname -a
> NetBSD aspire9.localnet 10.0_BETA NetBSD-10.0_BETA (GENERIC) #0: Fri Dec 23
> 12:41:20 +05 2022 
> root@aspire9.localnet:/root/sysbuild/amd64/obj/usr/src/sys/arch/amd64/compile/GENERIC
> amd64
> 
> On boot of NetBSD-10.0_BETA the message "clock: unknown CMOS layout" is
> printed. There is no this message at boot on NetBSD-9.x.
> 
> Photo of screen: https://disk.yandex.ru/i/ashqmg563zGemQ
> 
> The hardware: PC Acer Aspire XC-895 Intel Core i5-10400

Modern machines not always have the "pc compatible" parts like the cmos/clock
or keyboard/mouse connector, but replace them with (typically) i2c connected
devices. Windows stopped requiring that level of hardware compatibility some
time ago and manufactures (naturally) use the new options.

Parts of the "fallout" is hidden by ACPI glue.

We are lacking a few drivers in that area, I see the same when booting
NetBSD on my wife's notebook. Older NetBSD versions just did not print the
message (but the CMOS/clock did not work any better with them).

Martin


Re: ffs2ea effects on rescue sw?

2022-12-22 Thread Martin Husemann
On Thu, Dec 22, 2022 at 06:05:18PM +, r0ller wrote:

> exactly) I deleted occassionally. By the way, it's not only good for
> image files and although the current version needs a small patch (can't
> recall, just a one liner) but it can be built from source.Nevertheless,
> the question is: will it work for ffs2ea?Best regards,r0ller

Depending how it works it might need another one line patch to learn
about the new super block magic.

Martin


Re: New ver -- NetBSD

2022-12-16 Thread Martin Husemann
On Fri, Dec 16, 2022 at 04:26:19PM +, Todd Gruhn wrote:
> When will NetBSD-10.* come out. I was told Jan 2023.

That would be slightly optimistic, first 10.0 BETA builds are just arriving.

>  Any specific dateset?

Not yet.

Martin


Re: Running NetBSD installer on VM to install on real disk [Was: NetBSD 9.3 UEFI...]

2022-12-05 Thread Martin Husemann
On Sun, Dec 04, 2022 at 08:17:46PM +0530, Mayuresh wrote:
> Thanks. If I got it right from one of your replies, -current installer is
> not recommended to install 9.2/9.3 sets. Right?

Yes, that will not work very well. I didn't test the netbsd-9 installer
because I didn't have it handy, but will do that too later.

Martin


Re: Running NetBSD installer on VM to install on real disk [Was: NetBSD 9.3 UEFI...]

2022-12-04 Thread Martin Husemann
On Sun, Dec 04, 2022 at 09:32:56AM +0100, Martin Husemann wrote:
> That sounds like a bug.

I just tested with the installer from -current and a fake setup trying
to mimic parts of your environment. I used labels for the NetBSD partitions
to make their identification easier later.

Before:

# gpt show -a vnd0
  start   size  index  contents
  0  1 PMBR
  1  1 Pri GPT header
  2 32 Pri GPT table
 34   4062 Unused
   4096 262144  1  GPT part - EFI System
 Type: efi
 TypeID: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
 GUID: 2df53c72-b805-4fef-8029-c13bd1a0c897
 Size: 128 M
 Label: 
 Attributes: None
 2662403072000  2  GPT part - Linux data
 Type: linux-data
 TypeID: 0fc63daf-8483-4772-8e79-3d69d8477de4
 GUID: ede3d951-58f6-4d3b-9075-f83dd2ccb979
 Size: 1500 M
 Label: 
 Attributes: None
3338240   61444096  3  GPT part - NetBSD FFSv1/FFSv2
 Type: ffs
 TypeID: 49f48d5a-b10e-11dc-b99b-0019d1879648
 GUID: 3bbc2e24-6609-44ca-bfce-4db31b371bb8
 Size: 30002 M
 Label: NetBSD root
 Attributes: None
   64782336   91447296  4  GPT part - NetBSD swap
 Type: swap
 TypeID: 49f48d32-b10e-11dc-b99b-0019d1879648
 GUID: 8cec37a5-e43f-4174-a3b4-33a4eb17d8e2
 Size: 44652 M
 Label: NetBSD swap
 Attributes: None
  156229632   1695 Unused
  156231327 32 Sec GPT table
  156231359  1 Sec GPT header


Then I select:

>a: Install NetBSD to hard disk 

and in the "Available disks" menu select

>f: Preconfigured "wedges" dk(4)

Now it offers me a selection of GPT partitions, most only liste by GUID,
but among them:

>j: NetBSD root (dk9@vnd0)

and then I end up in a mostly regular install process:


 Ok, we are now ready to install NetBSD on your hard disk (dk9).  Nothing has   
 been written yet.  This is your last chance to quit this process before
 anything gets changed. 

 Shall we continue? 




   +---+
   x Yes or no?x
   x   x
   x>a: No x
   x b: Yesx
   +---+

 
Since I did not newfs the NetBSD root partition upfront:

 The selected partition does not seem to have a valid file system.
 Do you want to newfs (format) it?

>b: Yes 

and then it recognizes the swap partition "near by":

 A swap partition (named NetBSD swap)
 seems to exist on vnd0.
 Do you want to use that?

>a: Yes

and then I get asked for the sets I want to install, selected

>a: Full installation

and network download via http/https

>b: HTTP

I had preconfigured my network, it recognized this and skipped dhcp/network
setup:

 Your network seems to work fine.
 Should we skip the configuration
 and just use the network as-is?

>a: Yes

and then I just acked the defaults for download from nycdn.NetBSD.org/
latest and everything installed just fine.

After that I would have had to fixup booting "somehow", but since this was
a fake test setup, I skipped that part ;-)

Martin


Re: Running NetBSD installer on VM to install on real disk [Was: NetBSD 9.3 UEFI...]

2022-12-04 Thread Martin Husemann
On Sun, Dec 04, 2022 at 12:10:02PM +0530, Mayuresh wrote:
> >  2) install (e.g. from the USB install image) by selecting "preconfigured
> > wedges (dk(4))" in the target disk selection and picking the root
> > partition you added in (1)

I forgot - this is slightly different in -current, all the preexisting
partitions are combined into a submenu (because this is a rarely used
"expert mode - I know what I am doing" kind of option).

> There are multiple ways to select the disk. In this[1] post I have written
> what happens with each. If I am not wrong, I think the option 3 in that
> post where I choose disk by uuid which is followed by (@dk(5)), is what
> this means. If yes, it just brings me back to the main menu of the
> installer.

That sounds like a bug.

Martin


Re: Running NetBSD installer on VM to install on real disk [Was: NetBSD 9.3 UEFI...]

2022-12-03 Thread Martin Husemann
On Sat, Dec 03, 2022 at 08:37:33AM +0530, Mayuresh wrote:
> On the same disk I have Void Linux and Windows installations.

The installer is not very smart when you create multi-boot installations
(unless you have a disk per OS).

I would not go via the VM detour, but instead:

 1) add partition(s) for NetBSD (root mandatory, swap optional)
- you can do this manually from any other OS if it allows you to
  force a specific GPT type for the partition
- you can do this from the install medium and abort the installation
  after partitions have been created

 2) install (e.g. from the USB install image) by selecting "preconfigured
wedges (dk(4))" in the target disk selection and picking the root
partition you added in (1)

 3) manually fix booting - this is higly dependend on whatever boot selection
scheme you use (I myself only ever use the UEFI boot menu and pick
the dedicated disk for whatever OS).
If you use UEFI to boot NetBSD, you have to copy /usr/mdec/bootx64.efi
(e.g. from the installer) to the EFI partition (typical dir: efi/boot)
and somehow configure your firmware to boot it

Martin


Re: NetBSD 9.3 UEFI installation help

2022-12-01 Thread Martin Husemann
On Thu, Dec 01, 2022 at 11:13:07PM +0530, Mayuresh wrote:
> But it says
> 
> error: no suitable video mode found
> Booting in blind mode

That is a message from grub, not from any part of NetBSD.

Martin


  1   2   3   4   5   6   7   >