Re: Openbsd 6.9 TCL ISSUE

2021-08-29 Thread Richard Toohey
On Wed, 25 Aug 2021 at 9:28 PM, Stuart Henderson 
wrote:

> On 2021-08-24, Error@Oddprotocol  wrote:
> > hi all
> > i have been trying to use some tcl script for an eggdrop on openbsd 6.9
> > and im getting the following error
> >
> > Error: error reading "sock7": Unknown error: 50327587
> >
> >
> > i have tested the same script on other linux distro and they/it works
> fine.
> >
> > i think there is a some dependency or lib missing, as a learner its
> really
> > tough for me to figure it out. can any one help?
>
> That isn't how a missing dependency or library would normally show itself.
> There aren't mamy Tcl people here, you could try
> asking the Tcl port maintainer but you're probably better off
> asking on Tcl mailing lists.
>
>
> I saw you asked this question in a few places and someone suggested a
newer version of tcltls.

I’ve had a quick go at using the newer version (1.7.22) on OpenBSD 6.9 and
it seems to improve things. It certainly went from throwing an error to
being able to retrieve an https page.

I didn’t use the sample code just a simple http request so not saying the
egg drop code is guaranteed to work but might get you further along.

Download and extract the source code, configure, make and use. It seems to
just work.

Do you want to give that a go - I can give more details if you need.

Thanks,
Richard


Re: Does anyone have experience with OpenBSD on SiFive Unmatched?

2021-08-29 Thread Mike Larkin
On Mon, Aug 30, 2021 at 03:25:42AM +, Joseph wrote:
> > > In this moment on -current, how well does the SiFive Unmatched RISCV64
> > > board work?
> > >
> > > E.g. multiple core support, PCIe.
> >
> > Works fine.
> >
> > > E.g. multiple core support, PCIe.
> >
> > Works, and works.
>
>
> > The "serial cable" can in fact be just a USB-A to Micro-USB cable
> > with the A end plugged into a USB port on a laptop or PC.
> >
> > The micro-SD card must be present to boot OpenBSD (so maybe make
> > a backup copy of it?). IDK exactly what files it needs. Maybe
> > somebody will figure out how the boot stuff can be flashed into
> > flash mem on the motherboard without bricking their board.
> >
> > And bear in mind the Unmatched is meant to be a developr machine not > 
> > powerhouse; it lopes along nicely at 1.2GHz with 4 cores. If the RISC-V
> > people are right, there will be faster, bigger machines "real soon
> > now", in case you need breath-holding practice.
>
> Hi Mike and Ian,
>
> Wow. Thank you for letting me know.
>
>
> If the ISA even has it, two questions on the topic of virtualization:
>
> Is the riscv64 architecture designed in such a way that riscv64
> OpenBSD should work out of the box as guest under a virtualizer,
> if-when one exists?
>

I know of no hardware capable of this.

> And off-topic here, does any VM host exist for riscv64? Without or
> with passthrough of PCI/cad/etc.
>

For OpenBSD, no.

> I see this KVM fork but not sure exactly in what environment/
> distribution/setup it works e.g. does it support Unmatched, not even
> clear if virtualization is really in the riscv64 ISA spec:
>
> https://github.com/kvm-riscv/howto/wiki/KVM-RISCV64-on-QEMU
> https://lwn.net/Articles/856685/
> https://lists.riscv.org/g/tech-privileged/topic/risc_v_h_extension_freeze/80346318?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,80346318
> https://lwn.net/ml/linux-kernel/CAAhSdy0F7gisk=fzxn7jmqflvb3456wunwvxhkrnvnuwtrh...@mail.gmail.com/
>
> Perhaps this q is too early for riscv64 and to be revisited later.
>

Yes

> Best regards,
> Joseph
>
> (Related: https://news.ycombinator.com/item?id=27592187
> 38bit vmem upped to 48 https://www.sifive.com/cores/performance-p550
> https://www.anandtech.com/show/16780/intel-to-create-riscv-development-platform-with-sifive-p550-cores-on-7nm-in-2022)



Re: Applying scan_ffs output to disklabel?

2021-08-29 Thread gwes

On 8/29/21 10:51 PM, Kenneth Gober wrote:

On Sun, Aug 29, 2021 at 5:35 PM Jason Morris  wrote:


I'm in the process of recovering my drive (fat fingered dd and blew away
the partitions). I've obtained the following output from scan_ffs but not
sure how to apply this to recreate the disklabel. Running disklabel -R with
this output doesn't seem to work.

fuguita# scan_ffs -lv sd2c
block 128673234 id a86900, 1d53400 size 30225408
block 150903347 id 8,0 size 76481934
block 475612813 id 502b55c2,800e9b02 size 1130083924
block 587802509 id 502b55c2,800e9b02 size 1130083924
block 867995213 id 502b55c2,800e9b02 size 1130083924
block 1338443597 id 502b55c2,800e9b02 size 1130083924
block 1638543507 id abbbeaf9, b4ab0641 size 472173501
scan_ffs:_read: Invalid argument


According to the man page, scan_ffs will work only on FFS file systems, not
FFS2.  Since FFS2
is now the default, presumably scan_ffs wasn't able to find any file
systems.  If it had found
something, it would have output one or more lines looking something like
these:

X: 524224 64 4.2BSD 2048 16384 1 # /
X: 4194304 524288 4.2BSD 2048 16384 1 # /usr
X: 1048576 4718592 4.2BSD 2048 16384 1 # /usr/local

There should be a backup of your disklabel in
/var/backups/disklabel.sd2.current (or sd0, or sd1,
etc. as appropriate depending on how things were configured previously).
If you have backups,
the easiest thing to do is look through those backups to find this file.
If you don't have backups,
here is an example of what one of these disklabel files might look like;
you might be able to find
it on your disk just by reading blocks until you find it (assuming it's not
encrypted):

# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: DELL PERC H700
duid: 26daa7a4492ed6e9
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 36404
total sectors: 584843264
boundstart: 100759680
boundend: 584830260
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize   cpg]
   a:  1028160100759680  4.2BSD   2048 16384  8000 # /
   b:131604480101787840swap# none
   c:5848432640  unused
   d:  4112640233392320  4.2BSD   2048 16384 12958 # /usr
   e:  2056320237504960  4.2BSD   2048 16384 12958 #
/usr/local
   f:  1028160239561280  4.2BSD   2048 16384  8000 # /var
   g: 16450560240589440  4.2BSD   2048 16384 12958 # /tmp
   h:  411264025704  4.2BSD   2048 16384 12958 # /home
   i:64197   63 unknown
   j: 5121522064260NTFS
   k:197406720261152640  4.2BSD   2048 16384 12958 #
/var/postgresql

Note that a 'normal' installation of OpenBSD will typically have a much
smaller boundstart
value, like 64.  The system I took this sample from has both Windows and
OpenBSD on
it so the layout is a bit unusual.

-ken
If there aren't sufficient backups I have a version of scan_ffs which 
works on FFS2.

  geoff steckel



Re: Sunday presentaion on OpenBSD

2021-08-29 Thread Chris Narkiewicz
On Sat, Aug 21, 2021 at 07:12:41PM -0600, Jonathan Drews wrote:
> This Sunday Peter Hansteen will give a presentaion on OpenBSD:
> 
> "Recent and not so recent changes in OpenBSD that make
> life better"

Any recording available?



signature.asc
Description: PGP signature


Re: Sunday presentaion on OpenBSD

2021-08-29 Thread Jonathan Drews
On Sun, Aug 29, 2021 at 11:52:57PM +0100, Chris Narkiewicz wrote:
> On Sat, Aug 21, 2021 at 07:12:41PM -0600, Jonathan Drews wrote:
> > This Sunday Peter Hansteen will give a presentaion on OpenBSD:
> > 
> > "Recent and not so recent changes in OpenBSD that make
> > life better"
> 
> Any recording available?
> 

I am afraid not. However peter has posted a writeup:

The Slides
https://home.nuug.no/~peter/openbsd_moments/#1

The Writeup 
https://bsdly.blogspot.com/2021/08/recent-and-not-so-recent-changes-in.html




Re: Applying scan_ffs output to disklabel?

2021-08-29 Thread Kenneth Gober
On Sun, Aug 29, 2021 at 5:35 PM Jason Morris  wrote:

> I'm in the process of recovering my drive (fat fingered dd and blew away
> the partitions). I've obtained the following output from scan_ffs but not
> sure how to apply this to recreate the disklabel. Running disklabel -R with
> this output doesn't seem to work.
>
> fuguita# scan_ffs -lv sd2c
> block 128673234 id a86900, 1d53400 size 30225408
> block 150903347 id 8,0 size 76481934
> block 475612813 id 502b55c2,800e9b02 size 1130083924
> block 587802509 id 502b55c2,800e9b02 size 1130083924
> block 867995213 id 502b55c2,800e9b02 size 1130083924
> block 1338443597 id 502b55c2,800e9b02 size 1130083924
> block 1638543507 id abbbeaf9, b4ab0641 size 472173501
> scan_ffs:_read: Invalid argument
>

According to the man page, scan_ffs will work only on FFS file systems, not
FFS2.  Since FFS2
is now the default, presumably scan_ffs wasn't able to find any file
systems.  If it had found
something, it would have output one or more lines looking something like
these:

X: 524224 64 4.2BSD 2048 16384 1 # /
X: 4194304 524288 4.2BSD 2048 16384 1 # /usr
X: 1048576 4718592 4.2BSD 2048 16384 1 # /usr/local

There should be a backup of your disklabel in
/var/backups/disklabel.sd2.current (or sd0, or sd1,
etc. as appropriate depending on how things were configured previously).
If you have backups,
the easiest thing to do is look through those backups to find this file.
If you don't have backups,
here is an example of what one of these disklabel files might look like;
you might be able to find
it on your disk just by reading blocks until you find it (assuming it's not
encrypted):

# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: DELL PERC H700
duid: 26daa7a4492ed6e9
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 36404
total sectors: 584843264
boundstart: 100759680
boundend: 584830260
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize   cpg]
  a:  1028160100759680  4.2BSD   2048 16384  8000 # /
  b:131604480101787840swap# none
  c:5848432640  unused
  d:  4112640233392320  4.2BSD   2048 16384 12958 # /usr
  e:  2056320237504960  4.2BSD   2048 16384 12958 #
/usr/local
  f:  1028160239561280  4.2BSD   2048 16384  8000 # /var
  g: 16450560240589440  4.2BSD   2048 16384 12958 # /tmp
  h:  411264025704  4.2BSD   2048 16384 12958 # /home
  i:64197   63 unknown
  j: 5121522064260NTFS
  k:197406720261152640  4.2BSD   2048 16384 12958 #
/var/postgresql

Note that a 'normal' installation of OpenBSD will typically have a much
smaller boundstart
value, like 64.  The system I took this sample from has both Windows and
OpenBSD on
it so the layout is a bit unusual.

-ken


(Feedback needed) openbsd and ulimits.

2021-08-29 Thread Vladimir Nikishkin
Hello, everyone.

I found this problem when trying to write some go on OpenBSD:

https://github.com/google/starlark-go/issues/382

OpenBSD enforces ulimits on virtual space, whereas many operating
systems do not. `starlark`, as, in fact, many other pieces of software,
casually allocate "all virtual space in 32 bits", because presumably
that does not hurt on other operating systems. Hence, software using
starlark compiles, but does not run.

What would be the best approach to make it work on OpenBSD?

I am not an expert on POSIX memory management in any sense of the word,
so please, those who are, comment on that issue.


-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)



Applying scan_ffs output to disklabel?

2021-08-29 Thread Jason Morris
Hi,

I'm in the process of recovering my drive (fat fingered dd and blew away the 
partitions). I've obtained the following output from scan_ffs but not sure how 
to apply this to recreate the disklabel. Running disklabel -R with this output 
doesn't seem to work.

fuguita# scan_ffs -lv sd2c
block 128673234 id a86900, 1d53400 size 30225408 
block 150903347 id 8,0 size 76481934
block 475612813 id 502b55c2,800e9b02 size 1130083924
block 587802509 id 502b55c2,800e9b02 size 1130083924 
block 867995213 id 502b55c2,800e9b02 size 1130083924
block 1338443597 id 502b55c2,800e9b02 size 1130083924
block 1638543507 id abbbeaf9, b4ab0641 size 472173501
scan_ffs:_read: Invalid argument


Any recommendations on how I can at least rebuild the partition map and mount 
my partitions? 

Thanks in advance!


Re: Determining real-time CPU usage of a process

2021-08-29 Thread Baptiste Jonglez
On 14-08-21, Jeremie Courreges-Anglas wrote:
> On Sat, Aug 14 2021, Baptiste Jonglez  wrote:
> > Hello,
> 
> Hi Baptiste, long time no see. :)

Hi jca, indeed, good to talk to you :)  Sorry for the late reply.

> > I would like to determine the CPU usage of a process on a "real-time"
> > basis.  That is, every few seconds (sampling period), I would like to
> > compute its average CPU usage in the previous period.
> 
> Looks like a job for getrusage(2) or the CLOCK_PROCESS_CPUTIME_ID clock
> supported by clock_gettime(2).

Thanks for the pointer.

It seems getrusage() and clock_gettime() apply only to the current
process, while I'm more interested in other processes, like top.  That is,
I think the right interface to use is kvm_getprocs().

Besides, getrusage() seems to also use p_{u,s,i}ticks, so it would
probably also suffer from the delayed updates of these fields; that being
said, I haven't tested.

Regards,
Baptiste


signature.asc
Description: PGP signature


Re: Accessing LAN behind gateway from Road Warrior on wg(4) based tunnel

2021-08-29 Thread Erling Westenvik
On Fri, Aug 27, 2021 at 07:36:21PM -, Stuart Henderson wrote:
> On 2021-08-27, Erling Westenvik  wrote:
> > On Fri, Aug 27, 2021 at 02:20:29PM +0100, Zé Loff wrote:
> >> 
> >> On Fri, Aug 27, 2021 at 03:03:36PM +0200, Erling Westenvik wrote:
> >> > Hello all,
> >> > I have successfully set up a wg(4) based VPN tunnel from my laptop
> >> > (current) to my home/office gateway (6.9) but have problems
> >> > understanding how to access the LAN behind the gateway.
> >> > 
> >> > [Laptop]
> >> > - wg0 (10.0.0.42)
> >> > - egress (trunk0 {em0 iwn0} dhcp)
> >> > [Internet]
> >> > [Gateway]
> >> > - egress (em0 dhcp)
> >> > - wg0 (10.0.0.1)
> >> > - bridge0 {em1, (vether0 192.168.3.1 dhcpd)}
> >> > [LAN]
> >> > - various 192.168.3.0/24
> >> > 
> >> > I can ping/ssh between wg(4) endpoints (10.0.0.1 to 10.0.0.42 and vica
> >> > versa) and also from LAN clients (192.168.3.0/24) to gateway wg(4)
> >> > endpoint (10.0.0.1), but the laptop (10.0.0.42) can only reach the
> >> > gateway (10.0.0.1).
> >> > 
> >> > Is it as easy as defining some routes? If so, where? There's a ton of
> >> > more or less relevant and/or updated howto's out there but I have not
> >> > found anyone dealing with a similar scenario. Any hints are appreciated.
> >> 
> >> I added something like
> >> 
> >> !route add 192.168.3.0/24 10.0.0.1
> >> 
> >> to /etc/hostname.wg0.
> >
> > Thanks. I did too, I just forgot to mention it.
> > It doesn't work in my case though.
> > At least your answer tells me that what I try to achieve, to access the
> > LAN behind a wg(4) endpoint, is possible, right?
> >
> >> Of course this _might_ be messy if by any chance your laptop's local
> >> network is also 192.168.3.0/24 or a subset of this range.
> >
> > When connected to the LAN it of course is, but there should not be any
> > traces of that range after a reboot or two.
> >
> > Guess I'm up for debugging, testing of pf rules, and tcpdumping..
> > Any ideas where to begin is appreciated.
> >
> > Erling
> >
> >
> >> > 
> >> > (My wg(4) setup is based on:
> >> > https://www.tumfatig.net/20201202/a-mesh-vpn-using-openbsd-and-wireguard/)
> >> > 
> >> > Best regards,
> >> > 
> >> > Erling
> >> > 
> >> 
> >> -- 
> >>  
> >
> >
> 
> Make sure you have set wgaip to allow traffic from the machines on the
> subnet on the other side of the tunnel.

That was it. Thank you so much. Not directly intuitive to me that
"access" to a remote subnet must be specified on the connecting client,
but I think I understand the mechanisms a little better now.

I can now access my home/office LAN which was my primary goal but I just
found out that traffic to everything else leaves egress untunneled.
However - trying something like:

route change default 10.0.0.1

leaves the laptop dead in the water. Again a routing problem of some
kind I guess. Any hints on where to start digging?

Erling

> If that's not it, please show some config, ifconfig wg0 output
> from both sides (run as root so it includes more info; make sure
> any masking is done consistently i.e. search-and-replace),
> netstat -rn output.
> 
> When you get connectivity working you may find you get TCP stalls
> when connecting to/from machines on the subnet behind the gateway
> (initial connect is ok but stalling after larger data transfer) -
> if so then you might need some "match ... scrub (max-mss 1380)"
> or maybe a bit smaller depending on your internet connection.
> 
> 
> -- 
> Please keep replies on the mailing list.
> 



Re: Does anyone have experience with OpenBSD on SiFive Unmatched?

2021-08-29 Thread Mike Larkin
On Sun, Aug 29, 2021 at 05:28:45AM +, Joseph wrote:
> (In absence of an openbsd-riscv emailing list sending this to misc:)
>
> Hi all,
>
> In this moment on -current, how well does the SiFive Unmatched RISCV64
> board work?
>

Works fine.

> E.g. multiple core support, PCIe.
>

Works, and works.

> The current installation instructions are the oneliner at
> http://www.openbsd.org/riscv64.html .
>
> Should one boot with serial cable or would PCIe graphics activate
> early. With the Xenocara support, should X supposedly work out of the
> box e.g. AMDGPU or commodity PCIe or USB graphics adapter?
>

People have reported amdgpu on unmatched works.

Boot with serial cable and use the microsd card that came with the machine.
Install from USB stick to nvme.

The cad(4) onboard adapter should work fine as well.

-ml

> Best regards,
> Joseph
>
> Commits:
>
> Arch 23 April
> https://marc.info/?l=openbsd-cvs&m=161914575319702&w=2
>
> Xenocara 15 June
> https://undeadly.org/cgi?action=article;sid=20210619161607
>
> SMP 29 June
> https://marc.info/?l=openbsd-cvs&m=162500209229957&w=2
>



openbsd-riscv mailing list?

2021-08-29 Thread Joseph
Hi openbsd-misc ML,

Is there any riscv emailing list yet to discuss riscv64?

I see no emailing list discussion at all, however riscv64 arch support
is there. I guess riscv will become more and more popular over time.

Joseph

References:
http://www.openbsd.org/riscv64.html
https://undeadly.org/cgi?action=article;sid=20210423090342 23 April
https://undeadly.org/cgi?action=article;sid=20210619161607 6 June



Thanks for RISCV64!

2021-08-29 Thread Joseph
So happy to see RISCV64 supported.

Greatest thanks to you who implemented it!

http://www.openbsd.org/riscv64.html



Does anyone have experience with OpenBSD on SiFive Unmatched?

2021-08-29 Thread Joseph
(In absence of an openbsd-riscv emailing list sending this to misc:)

Hi all,

In this moment on -current, how well does the SiFive Unmatched RISCV64
board work?

E.g. multiple core support, PCIe.

The current installation instructions are the oneliner at
http://www.openbsd.org/riscv64.html .

Should one boot with serial cable or would PCIe graphics activate
early. With the Xenocara support, should X supposedly work out of the
box e.g. AMDGPU or commodity PCIe or USB graphics adapter?

Best regards,
Joseph

Commits:

Arch 23 April
https://marc.info/?l=openbsd-cvs&m=161914575319702&w=2

Xenocara 15 June
https://undeadly.org/cgi?action=article;sid=20210619161607

SMP 29 June
https://marc.info/?l=openbsd-cvs&m=162500209229957&w=2