Trouble with lpr and Brother wireless printer

2022-07-30 Thread Ben Hancock
Hi all,

I'm having trouble getting printing to work using lpr(1) and a
Brother wireless printer[1] that should support it. This seems to
be a perennial topic on the list, but despite trying what I've found
in the archives, I'm stumped.

Here's my /etc/printcap:

lp|brother:\
:rm=192.168.xxx.xxx:\
:rp=brother:\
:sd=/var/spool/output/lpd:\
:lf=/var/log/lpd-errs:

(The `xxx`s are, of course, actually digits).

But entering `$ lpr filename.ps` does nothing. The printer remains
quiet. Nothing shows up in the queue. `lpq` gives this output:

Printer Name: brother
Jobs: No Jobs in Queue

The output of `lpc status` is similarly unremarkable:

lp:
queuing is enabled
printing is enabled
no entries
printer idle

My permissions also seem fine:

$ ls -la /var/spool/output
total 12
drwxr-xr-x  3 root  wheel   512 Jul 30 14:24 .
drwxr-xr-x  6 root  wheel   512 Apr 11 16:45 ..
drwxrwx---  2 root  daemon  512 Jul 30 20:21 lpd

Oddly, if I attempt to print something from Firefox, using the
system dialog and setting lpr as the printer, the printer wakes up
and starts spewing out blank sheets until I manually cancel it using
the power button on the printer. So it seems that the issue is not
connecting to the printer, but how I am invoking lpr ... maybe?

What am I overlooking?

- Ben

[1] https://www.brother-usa.com/products/hll2350dw



Re: Makefile for a custom port

2022-07-30 Thread Stuart Henderson
On 2022-07-30, Mik J  wrote:
>  Hello Omar,
> Thank you for your answer.What am I supposed to do if the software has no 
> Makefile
> If I want it to be installed manually, I need to type something like rake30 
> build:agent
> Am I supposed to deconstruct the initial installer that is provided in the 
> sources and arrange it so it's Openbsd compatible ?

Whatever software you're trying to build, from the information about it
that you've given so far, I think it's likely to be a challenge even for
an experienced porter.

rake is not *normally* used for software written in Go, and something
written in Go and using rake is not likely to fit very well with
existing build scaffolding in ports.

If you say what the software is, we might be able to give some more clues.




Re: usbhidaction(1) is unvel(2)ed too strictly to run programs.

2022-07-30 Thread Theo de Raadt
I suspect it should unveil("/", "x")

It is better than not doing anything.



Re: Firefox and stuttering USB audio

2022-07-30 Thread Courtney

I hope it isn't in bad etiquette to resurrect an old piece of mail.

Since May I mitigated the stuttering audio issue with Firefox running
by using Firefox ESR 91. Clearly something beyond 91 added something
that doesn't jive well with OpenBSD. Now that 91 ESR is gone and it is 102
the issue has returned.

I have been playing around with a different issue, but in the process
of messing with that issue I came across something. I ran sndiod in
debug mode with these flags:

sndiod -dd -f rsnd/0 -F rsnd/1

I then went to try out opening tabs in firefox which then triggered
a whole bunch of this getting spat out

snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 1440/7680
snd1: play hw xrun, pused = 6240/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680
snd1: rec hw xrun, rused = 960/7680
snd1: play hw xrun, pused = 6720/7680
snd1: rec hw xrun, rused = 480/7680
snd1: play hw xrun, pused = 7200/7680

I'm wondering if someone has more of a clue as to what all
this means.

On 5/26/22 05:25, Peter Fröhlich wrote:

Just FYI, when I updated from a smooth 7.0 to 7.1 about a week ago, I
started experiencing audio/video stuttering that I did not before. I
am unclear on what exactly the problem is, whether it's the kernel, a
driver, Firefox, etc. I just know that I went from a "no audio/video
issues whatsoever" X230 to a "I get about 20 seconds before the next
stutter will happen" X230. :-/

On Fri, May 6, 2022 at 9:31 AM Courtney  wrote:

Hello all,

First time on the mailing list, please forgive me if I am missing any
"netiquette". I've been using OpenBSD on my desktop these last few
weeks. I have been trying to solve an issue with Only Firefox causing
stuttering issues with my audio output. Some things I have tried are:

* Setting dom.ipc.processCount to a lower number in about:config
* Muddled with sndiod -b and -z flags
* Set softdep,noatime for my different partitions in fstab (NVMe drive)
* Tried with/without SMT (Intel 10700k)
* Set some sysctl flags:

kern.shminfo.shmall=3145728
kern.shminfo.shmmax=2147483647
kern.shminfo.shmmni=2048
kern.shminfo.shmseg=2048
kern.seminfo.semmns=4096
kern.seminfo.semmni=2048
kern.maxproc=32768
kern.maxfiles=65535
kern.bufcachepercent=80
kern.maxvnodes=32
kern.somaxconn=4096

It would seem some things might work at first and pretty quickly I
would realize none of these things worked. The only solution has
been to not use Firefox. Tried chromium but it saddens me to see
that keepassxc-proxy & u2f doesn't work there.

Seems there's quite a few play errors:

# audioctl -f /dev/audioctl1 play.{bytes,errors}
play.bytes=242641680
play.errors=130560

play.errors does not go up when firefox is closed. According to the faq
it seems it could mean that the device has underrun samples. Whatever
that means, I'm unsure how to fix it. This has been a big headache for
me and I'm hoping someone could guide me to a solution here.

My DAC is a FiiO E10k
Running -current branch

$ uname -a
OpenBSD towerDefense 7.1 GENERIC.MP#492 amd64

I'm on the latest firefox (100.0)

Audio device is rsnd/1
Here is my system's dmesg below:

OpenBSD 7.1-current (GENERIC.MP) #492: Tue May  3 08:40:53 MDT 2022
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 34261110784 (32673MB)
avail mem = 33205428224 (31667MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.2 @ 0x7eb5a000 (94 entries)
bios0: vendor American Megatrends Inc. version "A.A0" date 10/22/2021
bios0: Micro-Star International Co., Ltd. MS-7C75
acpi0 at bios0: ACPI 6.2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP MCFG SSDT SSDT FIDT SSDT SSDT HPET APIC SSDT
SSDT NHLT LPIT SSDT SSDT DBGP DBG2 SSDT VFCT TPM2 WSMT FPDT BGRT
acpi0: wakeup devices PEG2(S4) PEGP(S4) PEG3(S4) PEGP(S4) PEGP(S4)
PEG1(S4) PEGP(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4)
RP04(S4) PXSX(S4) RP05(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0
acpimcfg0: addr 0xe000, bus 0-255
acpihpet0 at acpi0: 2399 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) 

usbhidaction(1) is unvel(2)ed too strictly to run programs.

2022-07-30 Thread Hector Velasco
Hello Misc.

TL;DR: usbhidaction(1) is unveil(2)ed too strictly to run programs.

I'm running:
kern.version=OpenBSD 7.1 (GENERIC.MP) #3: Sun May 15 10:27:01 MDT 2022
r...@syspatch-71-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Complete dmesg at the bottom.

I use usbhidaction to make some global mappings for mpd. My
usbhidaction.conf looks something like this:

/etc/usbhidaction.conf:
Consumer:Volume_Increment   1   sndioctl output.level=+0.05
Consumer:Volume_Decrement   1   sndioctl output.level=-0.05
Consumer:Mute   1   sndioctl output.mute=!
Consumer:Play/Pause 1   mpc -q toggle
Consumer:Scan_Previous_Track1   mpc -q prev
Consumer:Scan_Next_Track1   mpc -q next
Consumer:Random_Play1   mpc -q random
Consumer:Stop   1   mpc -q stop
Consumer:Fast_Forward   1   mpc -q seek +10
Consumer:Rewind 1   mpc -q seek -10


The reason for using usbhidaction (as opposed to regular X binds) is
that i'm not always running X. My GPU freezes every now and then
(amdgpu), so most of the time I'm running X-less. I like those binds to
be consistent whether I'm running X or not, basically.

On 7.0, ucc(4) was introduced. This driver works for my usb thinkpad kb
but not with a home-made with custom firmware. Both work with
usbhidaction.

7.0, if I remember correctly, added unveil to usbhidaction, which does
its job flawlessly, as in completely blocking access to anything other
than its config file, but it also blocks access to any programs
configured in it, I think, defeating the point of usbhidaction.

The question is then: what's the best approach to solve this?

Completely removing usbhidaction's unveil call will decrease
security, so I'm sure this is not an option.

Unveiling each of the programs named in the config file. This will
work for initial setup, but if usbhidaction gets a SIGHUP it won't
be able to unveil new programs named in the config file. This in
turn forces a restart of the service, defeating the point of
reloading. However, it's still an improvement over it not working.

Fix my custom kb so it works with ucc. This I will do, as there's
obviously something wrong in how I report the keys, but I don't know
if there's a way to tell ucc what to do on keypresses. If I have mpd
and mpv running, which one should react to it? Can I map this out of
X as well?

Or, I'm using usbhidaction wrong and I should fix my setup. In which
case I'd like some pointers on how to do so.

For the time being, I disable ucc on boot and I patched the unveil calls
out of usbhidaction. It's working fine and I don't mind a few patches,
but I suspect there's a better way to deal with this.

Regards.

HV

--
OpenBSD 7.1 (GENERIC.MP) #3: Sun May 15 10:27:01 MDT 2022

r...@syspatch-71-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8532971520 (8137MB)
avail mem = 8257073152 (7874MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xed530 (58 entries)
bios0: vendor American Megatrends Inc. version "F3" date 04/01/2015
bios0: Gigabyte Technology Co., Ltd. 990FXA-UD5 R5
acpi0 at bios0: ACPI 4.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT MCFG HPET SSDT
acpi0: wakeup devices SBAZ(S4) P0PC(S4) GEC_(S4) UHC1(S4) UHC2(S4) USB3(S4) 
UHC4(S4) USB5(S4) UHC6(S4) UHC7(S4) PE20(S4) GBE_(S4) PE21(S4) PE22(S4) 
PE23(S4) PC02(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 16 (boot processor)
cpu0: AMD FX(tm)-4170 Quad-Core Processor, 4219.97 MHz, 15-01-02
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,NODEID,TOPEXT,CPCTR,ITSC
cpu0: 64KB 64b/line 2-way I-cache, 16KB 64b/line 4-way D-cache, 2MB 64b/line 
16-way L2 cache
cpu0: ITLB 48 4KB entries fully associative, 24 4MB entries fully associative
cpu0: DTLB 32 4KB entries fully associative, 32 4MB entries fully associative
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 200MHz
cpu0: mwait min=64, max=64, IBE
cpu1 at mainbus0: apid 17 (application processor)
cpu1: AMD FX(tm)-4170 Quad-Core Processor, 421.85 MHz, 15-01-02
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,XOP,SKINIT,WDT,FMA4,NODEID,TOPEXT,CPCTR,ITSC
cpu1: 64KB 64b/line 2-way I-cache, 

Re: support new

2022-07-30 Thread Jiri Navratil
Hello,

could someone guide me please, what I have to improve in my request
and/or on my web page to be approved for
https://www.openbsd.org/support.html ?

Thank you a lot,
Jiří

On Wed, Jul 27, 2022 at 03:13:52PM +0200, Jiri Navratil wrote:
> 0
> C Czech Republic
> P
> T Prague
> Z 15800
> A Kacirkova 1016/19
> O JIRI NAVRATIL (R)
> I Jiri Navratil
> M j...@navratil.cz
> U https://nocloud.cz/
> B +420 777 224 245
> X
> N OpenBSD/Linux installation, maintenance and support. Providing on-premise 
> solutions with OpenBSD on physical HW. Teaching Unix operating systems at 
> University of Ostrava with OpenBSD as the Unix-like operating system.

-- 
Jiri Navratil, https://nocloud.cz, +420 777 224 245



smime.p7s
Description: S/MIME cryptographic signature


Trying to install openBSD on Raspberry Pi CM4+IO board ..keyboard hangs

2022-07-30 Thread Sandeep Gupta
Hello,
  I managed to get the OpenBSD installer up and running on CM4 mounted on
the Pi official I/O board.
I installed UEFI bootloader in emmc and had OpenBSD miniroot image burnt
on  SSD (connected to usb 3.0 over pcie).
When CM4 boots it invokes the UEFI loader, which drops me at UEFI prompt.
At the prompt I do "set tty fb0" and then "boot" which hands over the
booting to openBSD.
Which runs through fine.  However, the moment openBSD installer starts, the
keyboard hangs/doesn't get recognized.
So I stuck at the Install/Update/... option prompt of the bootloader.

Is there a simple workaround for this?

I am not sure if there are other roadblocks down the installation road but
it seems promising enough to try if the keyboard issue is a minor hassle.

Thanks for taking a look at this.
-Sandeep


Re: Switching from tcsh to ksh and Aliases exportation

2022-07-30 Thread Federico Giannici

I solved it!

Instead of using 'su -m' now I use 'su -m root -l'.

It seems that tcsh is launced by default as "interactive shell" while 
ksh must be explicitly instructed with the '-l' flag.


Now, as "interactive shell", it re-read the .profile configuration with 
aliases and all...


Thanks


On 7/30/22 11:46, Alexander Hall wrote:



On July 30, 2022 9:18:34 AM GMT+02:00, Federico Giannici  
wrote:

For historical reasons I always used the tcsh shell for my personal uses. Now 
I'd like to switch to the system sh (actually ksh), but I have a problem.

Usually, on the servers I manage, I switch to root with "su -m", so I can 
maintain my environment: path, prompt, aliases, etc.

With tcsh it works perfectly, but if I use sh (ksh) all the aliases are lost in 
the root environment.

Is it expected this different behavior between tcsh and ksh?

Is there a way to maintain the aliases when i do "su -m" with sh?

Is there some kind of "exportation" of aliases? In the ksh man page it says that the "-x" 
option of alias "sets the export attribute of an alias", but it doesn't seem to have any effect. 
How is it supposed to work?


I doubt you're really exporting the aliases per se. More likely tcsh is 
sourcing your alias definitions from some file(s). Files like .profile, .login, 
.kshrc etc are sourced in different ways in different shells. For details, 
consult the ksh man page.

/Alexander



Thanks.

P.S.
I'm talking about OpenBSD amd64 7.0 and 7.1.







Re: Makefile for a custom port

2022-07-30 Thread Omar Polo
Mik J  wrote:
> Hello,
> I'm trying to make a port
> This program has dependencies with Go to name one.
> How should I indicate this dependency in the Makefile ?

for some big stuff like go, python etc the right way is often just
include the correct module

MODULES = lang/go

see bsd.port.mk(5) and port-modules(5) for more info.

(by the way, for go portgen(1) often does a good work at scaffolding the
port for you.)

> Should I use BUILD_DEPENDS = or LIB_DEPENDS =Go is used to build my program 
> but also to use it thereafter.
> Should I use WANTLIB += ?

BUILD_DEPENDS are for stuff needed to build the thing, while LIB_DEPENDS
for packages that provides the libraries needed.  WANTLIB lists the
libraries that the program links to.

usually you can fix LIB_DEPENDS and WANTLIB using

$ make port-lib-depends-check

once you have something that works.  it will complain about missing
packages in LIB_DEPENDS (look for the NOT REACHABLE lines in the output)
and will suggest a sensible WANTLIB.  99% of the times this is enough.

(there are programs that dlopen(3) libraries at run time but luckly
these are not the majority.  For these you need to see which libraries
they want and register them in the port; make port-lib-depends-check
will complain but that's expected in this case.)

modules will often add stuff to BUILD_DEPENDS, when in doubt don't
forget to run `make show=BUILD_DEPENDS' (or any other variable really)
to see its content.

> Also what is the right way to make an Openbsd package ?I read that in a port 
> tutorial that the right way is to make the port and during that process the 
> make package will do that.
> Thank you

yep, `make package' will create a package under /usr/ports/packages/.
`make install' will install it thru pkg_add.  again, see bsd.port.mk(5)
for more information, it carefully describes how "package", "install",
"update", "deinstall" etc works.



Re: Switching from tcsh to ksh and Aliases exportation

2022-07-30 Thread Alexander Hall



On July 30, 2022 9:18:34 AM GMT+02:00, Federico Giannici  
wrote:
>For historical reasons I always used the tcsh shell for my personal uses. Now 
>I'd like to switch to the system sh (actually ksh), but I have a problem.
>
>Usually, on the servers I manage, I switch to root with "su -m", so I can 
>maintain my environment: path, prompt, aliases, etc.
>
>With tcsh it works perfectly, but if I use sh (ksh) all the aliases are lost 
>in the root environment.
>
>Is it expected this different behavior between tcsh and ksh?
>
>Is there a way to maintain the aliases when i do "su -m" with sh?
>
>Is there some kind of "exportation" of aliases? In the ksh man page it says 
>that the "-x" option of alias "sets the export attribute of an alias", but it 
>doesn't seem to have any effect. How is it supposed to work?

I doubt you're really exporting the aliases per se. More likely tcsh is 
sourcing your alias definitions from some file(s). Files like .profile, .login, 
.kshrc etc are sourced in different ways in different shells. For details, 
consult the ksh man page.

/Alexander

>
>Thanks.
>
>P.S.
>I'm talking about OpenBSD amd64 7.0 and 7.1.
>



Switching from tcsh to ksh and Aliases exportation

2022-07-30 Thread Federico Giannici
For historical reasons I always used the tcsh shell for my personal 
uses. Now I'd like to switch to the system sh (actually ksh), but I have 
a problem.


Usually, on the servers I manage, I switch to root with "su -m", so I 
can maintain my environment: path, prompt, aliases, etc.


With tcsh it works perfectly, but if I use sh (ksh) all the aliases are 
lost in the root environment.


Is it expected this different behavior between tcsh and ksh?

Is there a way to maintain the aliases when i do "su -m" with sh?

Is there some kind of "exportation" of aliases? In the ksh man page it 
says that the "-x" option of alias "sets the export attribute of an 
alias", but it doesn't seem to have any effect. How is it supposed to work?


Thanks.

P.S.
I'm talking about OpenBSD amd64 7.0 and 7.1.