Kernel relink and disable ulpt in kernel - cups printing

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Kernel relink and disable ulpt in kernel - cups printing

Mikolaj Kucharski-3
Hi all,

What is your approach for a need of official GENERIC(.MP) kernel however
customized to your need via `config -e -o /bsd /bsd` for example needed
when you have USB based printer.

Package readme from cups warns that ulpt(4) needing to be disabled in
the kernel and that is actually the case for me. When I use unmodified
GENERIC.MP my `Canon MG3200 series` printer:

$ dmesg | grep ulpt0
ulpt0 at uhub0 port 1 configuration 1 interface 1 "Canon MG3200 series" rev 2.00/1.04 addr 2
ulpt0: using bi-directional mode

is not detected by CUPS, or I don't know how to make it detect.
However when I disable ulpt(4) via config(8) then cups can detect the
printer and I configured via CUPS' web UI (additionally installing
gutenprint-5.3.3 package) and all works. I can print.

ugen0 at uhub0 port 1 "Canon MG3200 series" rev 2.00/1.04 addr 3

However I run current and I upgrade my system once in a while, so I was
wondering what would be the common practice to handle this in a smooth,
semi-automated way, without a need to go by hand and re-disable ulpt,
regenerate `kernel.SHA256` to make `reorder_kernel` happy each reboot or
each system upgrade.

I don't know how popular are printers leveraging ulpt(4). So my
questions for this post would be:

- Does any of you have a working printer using ulpt(4) driver under
  OpenBSD?

- How do you handle kernel modifications via config(8) with kernel
  relinking in a more automated way?

Please carbon-copy me in any replies. Thank you.

For the record, I'm currently using:

OpenBSD 6.6-current (GENERIC.MP) #60: Mon Mar 16 22:03:03 MDT 2020
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

# pkg_info -qI cups gutenprint
cups-2.3.1p1
gutenprint-5.3.3

--
Regards,
 Mikolaj

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Mikolaj Kucharski-3
On Tue, Mar 17, 2020 at 08:13:14AM +0000, Mikolaj Kucharski wrote:
> Please carbon-copy me in any replies. Thank you.

So it was ment for misc and not ports, but I'll leave it on ports for
now.

--
Regards,
 Mikolaj

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Anthony J. Bentley-4
In reply to this post by Mikolaj Kucharski-3
Mikolaj Kucharski writes:
> - Does any of you have a working printer using ulpt(4) driver under
>   OpenBSD?

Yes, I just bought my first printer, a Brother DCP-L2550DW, and it works
fine with ulpt(4) and lpd(8). It needed one customization: my printcap
calls an output filter that (for non-PDF/PostScript) inserts a blank
line in front and adds carriage returns to all lines. I can print plain
text, PostScript, or PDF simply by passing the file to lpr(1).

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Antoine Jacoutot-7
In reply to this post by Mikolaj Kucharski-3
> - How do you handle kernel modifications via config(8) with kernel
>   relinking in a more automated way?

$ cat /etc/rc.shutdown                                    
printf 'disable ulpt\nq\n' | config -ef /bsd
sha256 /bsd >/var/db/kernel.SHA256

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Mikolaj Kucharski-3
Hi,

On Thu, Mar 19, 2020 at 08:08:10AM +0100, Antoine Jacoutot wrote:
> > - How do you handle kernel modifications via config(8) with kernel
> >   relinking in a more automated way?
>
> $ cat /etc/rc.shutdown                                    
> printf 'disable ulpt\nq\n' | config -ef /bsd
> sha256 /bsd >/var/db/kernel.SHA256

Neat, simple and straightforward. I like it, thanks Antoine.

--
Regards,
 Mikolaj

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

François Chambaud
Mikolaj Kucharski <[hidden email]> writes:

> Hi,
>
> On Thu, Mar 19, 2020 at 08:08:10AM +0100, Antoine Jacoutot wrote:
>> > - How do you handle kernel modifications via config(8) with kernel
>> >   relinking in a more automated way?
>>
>> $ cat /etc/rc.shutdown                                    
>> printf 'disable ulpt\nq\n' | config -ef /bsd
>> sha256 /bsd >/var/db/kernel.SHA256
>
> Neat, simple and straightforward. I like it, thanks Antoine.

Or with -h option:

     -h hashfile
             Place the checksum into hashfile instead of stdout.

sha256 -h /var/db/kernel.SHA256 /bsd

--
François Chambaud
www.chambaud.org

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Mikolaj Kucharski-3
In reply to this post by Mikolaj Kucharski-3
On Sat, Mar 21, 2020 at 08:04:35PM +0000, Mikolaj Kucharski wrote:
> On Thu, Mar 19, 2020 at 08:08:10AM +0100, Antoine Jacoutot wrote:
> > > - How do you handle kernel modifications via config(8) with kernel
> > >   relinking in a more automated way?
> >
> > $ cat /etc/rc.shutdown                                    
> > printf 'disable ulpt\nq\n' | config -ef /bsd
> > sha256 /bsd >/var/db/kernel.SHA256
>
> Neat, simple and straightforward. I like it, thanks Antoine.

It has one disadvantage. It doesn't integrate well with sysupgrade(8)
and need one additional reboot, to get desired kernel configuration. For
me it's easy to forget this one additional reboot.

--
Regards,
 Mikolaj

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Chris Bennett-3
On Wed, Mar 25, 2020 at 02:23:48PM +0000, Mikolaj Kucharski wrote:

> On Sat, Mar 21, 2020 at 08:04:35PM +0000, Mikolaj Kucharski wrote:
> > On Thu, Mar 19, 2020 at 08:08:10AM +0100, Antoine Jacoutot wrote:
> > > > - How do you handle kernel modifications via config(8) with kernel
> > > >   relinking in a more automated way?
> > >
> > > $ cat /etc/rc.shutdown                                    
> > > printf 'disable ulpt\nq\n' | config -ef /bsd
> > > sha256 /bsd >/var/db/kernel.SHA256
> >
> > Neat, simple and straightforward. I like it, thanks Antoine.
>
> It has one disadvantage. It doesn't integrate well with sysupgrade(8)
> and need one additional reboot, to get desired kernel configuration. For
> me it's easy to forget this one additional reboot.
>

Actually, not.
When rebooting the first time, use boot -c
Then disable ulpt
quit

Which is what the above does for later reboots.
Which I am now thrilled to use for disable amdgpu.
I can now skip using boot -c

Boot -c is often used to enable or disable things to allow successful
booting at all.

--
Chris Bennett


Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Mikolaj Kucharski-3
In reply to this post by Mikolaj Kucharski-3
On Wed, Mar 25, 2020 at 02:23:48PM +0000, Mikolaj Kucharski wrote:
> It has one disadvantage. It doesn't integrate well with sysupgrade(8)
> and need one additional reboot, to get desired kernel configuration. For
> me it's easy to forget this one additional reboot.

I went for adding:

        printf 'disable ulpt\nq\n' | config -ef /bsd && \
        sha256 -h /var/db/kernel.SHA256 /bsd

to /etc/rc.shutdown and /upgrade.site and that makes it work the way I
would like to.

Would that be worth adding to ports/print/cups/pkg/README-main?

--
Regards,
 Mikolaj

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Antoine Jacoutot-7
On Sat, Mar 28, 2020 at 10:39:56AM +0000, Mikolaj Kucharski wrote:

> On Wed, Mar 25, 2020 at 02:23:48PM +0000, Mikolaj Kucharski wrote:
> > It has one disadvantage. It doesn't integrate well with sysupgrade(8)
> > and need one additional reboot, to get desired kernel configuration. For
> > me it's easy to forget this one additional reboot.
>
> I went for adding:
>
> printf 'disable ulpt\nq\n' | config -ef /bsd && \
> sha256 -h /var/db/kernel.SHA256 /bsd
>
> to /etc/rc.shutdown and /upgrade.site and that makes it work the way I
> would like to.
>
> Would that be worth adding to ports/print/cups/pkg/README-main?

No.
That's very bad practice.

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: Kernel relink and disable ulpt in kernel - cups printing

Mikolaj Kucharski-3
On Sat, Mar 28, 2020 at 12:05:26PM +0100, Antoine Jacoutot wrote:

> > I went for adding:
> >
> > printf 'disable ulpt\nq\n' | config -ef /bsd && \
> > sha256 -h /var/db/kernel.SHA256 /bsd
> >
> > to /etc/rc.shutdown and /upgrade.site and that makes it work the way I
> > would like to.
> >
> > Would that be worth adding to ports/print/cups/pkg/README-main?
>
> No.
> That's very bad practice.

Oh. Which part is exactly bad practice?

Do you mean adding commands to /upgrade.site or to /etc/rc.shutdown or
both, or in general using config -ef /bsd to disable drivers?

Is there any info which can be added to cups/pkg/README-main to make the
process more automated for disabling ulpt in kernel which plays nice
with sysupgrade or syspatch?

--
Regards,
 Mikolaj