Re: Add /dev/video0 to fbtab

2021-04-04 Thread Marcus Glocker
Thanks for your feedback Matthias.

Unfortunately there wasn't too much acceptance for this diff from the
community, so it's unlikely that it will make it in to the tree.

Cheers,
Marcus

On Sat, 3 Apr 2021 10:25:58 +0200
Matthias Schmidt  wrote:

> Hi,
> 
> * Marcus Glocker wrote:
> > On Thu, Feb 25, 2021 at 09:34:45PM +0100, Mark Kettenis wrote:
> >   
> > > 
> > > The xenodm tty should really be ttyC4 on all our architectures.  I
> > > would suggest that anywhere where you're not sure (or have
> > > something different) we shouldn't add /dev/video0.  People won't
> > > be using a webcam on those platforms anyway.  And if they do they
> > > can file a bug report and we fix things.  
> > 
> > Agree.
> > 
> > I've tested on amd64, i386 is obvious, tb@ tested on macppc.  
> 
> I am using this on amd64 for quite some while now and it is quite
> handy when joining video calls.  Any chance to get this committed?
> 
> Cheers
> 
>   Matthias
> 



Re: Add /dev/video0 to fbtab

2021-04-03 Thread Matthias Schmidt
Hi,

* Marcus Glocker wrote:
> On Thu, Feb 25, 2021 at 09:34:45PM +0100, Mark Kettenis wrote:
> 
> > 
> > The xenodm tty should really be ttyC4 on all our architectures.  I
> > would suggest that anywhere where you're not sure (or have something
> > different) we shouldn't add /dev/video0.  People won't be using a
> > webcam on those platforms anyway.  And if they do they can file a bug
> > report and we fix things.
> 
> Agree.
> 
> I've tested on amd64, i386 is obvious, tb@ tested on macppc.

I am using this on amd64 for quite some while now and it is quite handy
when joining video calls.  Any chance to get this committed?

Cheers

Matthias



Re: Add /dev/video0 to fbtab

2021-02-26 Thread Marcus Glocker
On Thu, Feb 25, 2021 at 10:36:02PM +0100, Marcus Glocker wrote:

> On Thu, Feb 25, 2021 at 09:14:06PM +, Stuart Henderson wrote:
> 
> > On 2021/02/25 22:02, Marcus Glocker wrote:
> > > On Thu, Feb 25, 2021 at 08:00:32PM +, Stuart Henderson wrote:
> > > 
> > > > On 2021/02/25 20:10, Marcus Glocker wrote:
> > > > > We had this discussion recently when fbtab(5) for xenodm(1) was fixed
> > > > > 6 weeks ago, but we didn't come to an agreement yet.  tb@ asked me the
> > > > > same question yesterday whether we can add video(1) to fbtab to avoid
> > > > > manual chown of /dev/video0, which I think a lot of people do today.
> > > > > Therefore here another try to bring this up.
> > > > 
> > > > I'm not sure this is something I would expect to be chmod'ed
> > > > automatically.. It's a very different class of device than things
> > > > currently in fbtab or Give/TakeConsole.
> > > > 
> > > > At least if this is done we'll have to document it somewhere for people
> > > > using ports like multimedia/motion.
> > > 
> > > Um - I don't know this port, but glancing over it, it's a daemon running
> > > under the _motion user which is accessing /dev/video*?  So people
> > > using that today are chowning /dev/video* to _motion?
> > 
> > chown or chgrp - yes.
> 
> I see.  I wouldn't know what is the right place to document that the
> video device would be owned by the console or xenodm login user.  What
> would you suggest, in the impacted port itself or centrally, like in the
> video(4) man page?

I guess I would document it in video(4).


Index: etc/etc.amd64/fbtab
===
RCS file: /cvs/src/etc/etc.amd64/fbtab,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 fbtab
--- etc/etc.amd64/fbtab 12 Feb 2021 10:26:33 -  1.8
+++ etc/etc.amd64/fbtab 26 Feb 2021 20:16:55 -
@@ -1 +1,2 @@
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: etc/etc.i386/fbtab
===
RCS file: /cvs/src/etc/etc.i386/fbtab,v
retrieving revision 1.15
diff -u -p -u -p -r1.15 fbtab
--- etc/etc.i386/fbtab  12 Feb 2021 10:26:34 -  1.15
+++ etc/etc.i386/fbtab  26 Feb 2021 20:16:55 -
@@ -1 +1,2 @@
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: etc/etc.macppc/fbtab
===
RCS file: /cvs/src/etc/etc.macppc/fbtab,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 fbtab
--- etc/etc.macppc/fbtab12 Feb 2021 10:26:34 -  1.13
+++ etc/etc.macppc/fbtab26 Feb 2021 20:16:55 -
@@ -1,3 +1,4 @@
 /dev/ttya  0600/dev/console
 /dev/tty00 0600/dev/console
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: share/man/man4/video.4
===
RCS file: /cvs/src/share/man/man4/video.4,v
retrieving revision 1.19
diff -u -p -u -p -r1.19 video.4
--- share/man/man4/video.4  29 Dec 2020 12:28:23 -  1.19
+++ share/man/man4/video.4  26 Feb 2021 20:16:56 -
@@ -53,6 +53,15 @@ variable:
 kern.video.record=0# Recording is blanked (default)
 kern.video.record=1# Recording is enabled
 .Ed
+.Pp
+Primary console login or
+.Xr xenodm 4
+login will change the
+.Pa /dev/video0
+permissions to be owned by the login user by using
+.Xr login_fbtab 3 .
+This allows the usage of the primary video device without any need to change
+the video device permissions manually.
 .Sh IOCTLS
 The following
 .Xr ioctl 2
@@ -455,11 +464,13 @@ ioctl command without blocking.
 .Sh FILES
 .Bl -tag -width /dev/video -compact
 .It Pa /dev/video
+.It Pa /etc/fbtab
 .El
 .Sh SEE ALSO
 .Xr video 1 ,
 .Xr ioctl 2 ,
-.Xr uvideo 4
+.Xr uvideo 4 ,
+.Xr fbtab 5
 .Sh HISTORY
 The
 .Nm



Re: Add /dev/video0 to fbtab

2021-02-25 Thread Marcus Glocker
On Thu, Feb 25, 2021 at 09:14:06PM +, Stuart Henderson wrote:

> On 2021/02/25 22:02, Marcus Glocker wrote:
> > On Thu, Feb 25, 2021 at 08:00:32PM +, Stuart Henderson wrote:
> > 
> > > On 2021/02/25 20:10, Marcus Glocker wrote:
> > > > We had this discussion recently when fbtab(5) for xenodm(1) was fixed
> > > > 6 weeks ago, but we didn't come to an agreement yet.  tb@ asked me the
> > > > same question yesterday whether we can add video(1) to fbtab to avoid
> > > > manual chown of /dev/video0, which I think a lot of people do today.
> > > > Therefore here another try to bring this up.
> > > 
> > > I'm not sure this is something I would expect to be chmod'ed
> > > automatically.. It's a very different class of device than things
> > > currently in fbtab or Give/TakeConsole.
> > > 
> > > At least if this is done we'll have to document it somewhere for people
> > > using ports like multimedia/motion.
> > 
> > Um - I don't know this port, but glancing over it, it's a daemon running
> > under the _motion user which is accessing /dev/video*?  So people
> > using that today are chowning /dev/video* to _motion?
> 
> chown or chgrp - yes.

I see.  I wouldn't know what is the right place to document that the
video device would be owned by the console or xenodm login user.  What
would you suggest, in the impacted port itself or centrally, like in the
video(4) man page?
 
> > > > This diff adds /dev/video0 to fbtab on all archs where video is
> > > > available.  It's added for the existing console login entry, in case
> > > > people start X through startx/xinit, and on a new entry when X is
> > > > started through xenodm.
> > > 
> > > Hmm - last time I suggested fbtab for something jcs pointed out
> > > that it doesn't work with xenodm..
> > 
> > Did you read my first sentence? :-)
> 
> Oh... :)



Re: Add /dev/video0 to fbtab

2021-02-25 Thread Stuart Henderson
On 2021/02/25 22:02, Marcus Glocker wrote:
> On Thu, Feb 25, 2021 at 08:00:32PM +, Stuart Henderson wrote:
> 
> > On 2021/02/25 20:10, Marcus Glocker wrote:
> > > We had this discussion recently when fbtab(5) for xenodm(1) was fixed
> > > 6 weeks ago, but we didn't come to an agreement yet.  tb@ asked me the
> > > same question yesterday whether we can add video(1) to fbtab to avoid
> > > manual chown of /dev/video0, which I think a lot of people do today.
> > > Therefore here another try to bring this up.
> > 
> > I'm not sure this is something I would expect to be chmod'ed
> > automatically.. It's a very different class of device than things
> > currently in fbtab or Give/TakeConsole.
> > 
> > At least if this is done we'll have to document it somewhere for people
> > using ports like multimedia/motion.
> 
> Um - I don't know this port, but glancing over it, it's a daemon running
> under the _motion user which is accessing /dev/video*?  So people
> using that today are chowning /dev/video* to _motion?

chown or chgrp - yes.

> > > This diff adds /dev/video0 to fbtab on all archs where video is
> > > available.  It's added for the existing console login entry, in case
> > > people start X through startx/xinit, and on a new entry when X is
> > > started through xenodm.
> > 
> > Hmm - last time I suggested fbtab for something jcs pointed out
> > that it doesn't work with xenodm..
> 
> Did you read my first sentence? :-)

Oh... :)



Re: Add /dev/video0 to fbtab

2021-02-25 Thread Marcus Glocker
On Thu, Feb 25, 2021 at 08:00:32PM +, Stuart Henderson wrote:

> On 2021/02/25 20:10, Marcus Glocker wrote:
> > We had this discussion recently when fbtab(5) for xenodm(1) was fixed
> > 6 weeks ago, but we didn't come to an agreement yet.  tb@ asked me the
> > same question yesterday whether we can add video(1) to fbtab to avoid
> > manual chown of /dev/video0, which I think a lot of people do today.
> > Therefore here another try to bring this up.
> 
> I'm not sure this is something I would expect to be chmod'ed
> automatically.. It's a very different class of device than things
> currently in fbtab or Give/TakeConsole.
> 
> At least if this is done we'll have to document it somewhere for people
> using ports like multimedia/motion.

Um - I don't know this port, but glancing over it, it's a daemon running
under the _motion user which is accessing /dev/video*?  So people
using that today are chowning /dev/video* to _motion?

> > This diff adds /dev/video0 to fbtab on all archs where video is
> > available.  It's added for the existing console login entry, in case
> > people start X through startx/xinit, and on a new entry when X is
> > started through xenodm.
> 
> Hmm - last time I suggested fbtab for something jcs pointed out
> that it doesn't work with xenodm..

Did you read my first sentence? :-)



Re: Add /dev/video0 to fbtab

2021-02-25 Thread Marcus Glocker
On Thu, Feb 25, 2021 at 09:34:45PM +0100, Mark Kettenis wrote:

> > Date: Thu, 25 Feb 2021 20:10:00 +0100
> > From: Marcus Glocker 
> > 
> > We had this discussion recently when fbtab(5) for xenodm(1) was fixed
> > 6 weeks ago, but we didn't come to an agreement yet.  tb@ asked me the
> > same question yesterday whether we can add video(1) to fbtab to avoid
> > manual chown of /dev/video0, which I think a lot of people do today.
> > Therefore here another try to bring this up.
> > 
> > This diff adds /dev/video0 to fbtab on all archs where video is
> > available.  It's added for the existing console login entry, in case
> > people start X through startx/xinit, and on a new entry when X is
> > started through xenodm.
> > 
> > On all other archs than amd64, i386, arm64, and macppc I'm not sure
> > whether I have picked the right xenodm tty.  Therefore I would be glad
> > if people can verify that, and let me know.  If you run X on that arch
> > an easy way to identify this is:
> > 
> > grep consolePath /var/log/xenodm.log  
> > xenodm info (pid 13760): consolePath: ttyC4
> > 
> > This additional entry could be also used later on to move the xenodm
> > GiveConsole/TakeConsole chown entries over, I guess.
> > 
> > Any thoughts?
> 
> The xenodm tty should really be ttyC4 on all our architectures.  I
> would suggest that anywhere where you're not sure (or have something
> different) we shouldn't add /dev/video0.  People won't be using a
> webcam on those platforms anyway.  And if they do they can file a bug
> report and we fix things.

Agree.

I've tested on amd64, i386 is obvious, tb@ tested on macppc.


Index: etc/etc.amd64/fbtab
===
RCS file: /cvs/src/etc/etc.amd64/fbtab,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 fbtab
--- etc/etc.amd64/fbtab 12 Feb 2021 10:26:33 -  1.8
+++ etc/etc.amd64/fbtab 25 Feb 2021 20:42:24 -
@@ -1 +1,2 @@
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: etc/etc.i386/fbtab
===
RCS file: /cvs/src/etc/etc.i386/fbtab,v
retrieving revision 1.15
diff -u -p -u -p -r1.15 fbtab
--- etc/etc.i386/fbtab  12 Feb 2021 10:26:34 -  1.15
+++ etc/etc.i386/fbtab  25 Feb 2021 20:42:24 -
@@ -1 +1,2 @@
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: etc/etc.macppc/fbtab
===
RCS file: /cvs/src/etc/etc.macppc/fbtab,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 fbtab
--- etc/etc.macppc/fbtab12 Feb 2021 10:26:34 -  1.13
+++ etc/etc.macppc/fbtab25 Feb 2021 20:42:24 -
@@ -1,3 +1,4 @@
 /dev/ttya  0600/dev/console
 /dev/tty00 0600/dev/console
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0



Re: Add /dev/video0 to fbtab

2021-02-25 Thread Mark Kettenis
> Date: Thu, 25 Feb 2021 20:10:00 +0100
> From: Marcus Glocker 
> 
> We had this discussion recently when fbtab(5) for xenodm(1) was fixed
> 6 weeks ago, but we didn't come to an agreement yet.  tb@ asked me the
> same question yesterday whether we can add video(1) to fbtab to avoid
> manual chown of /dev/video0, which I think a lot of people do today.
> Therefore here another try to bring this up.
> 
> This diff adds /dev/video0 to fbtab on all archs where video is
> available.  It's added for the existing console login entry, in case
> people start X through startx/xinit, and on a new entry when X is
> started through xenodm.
> 
> On all other archs than amd64, i386, arm64, and macppc I'm not sure
> whether I have picked the right xenodm tty.  Therefore I would be glad
> if people can verify that, and let me know.  If you run X on that arch
> an easy way to identify this is:
> 
>   grep consolePath /var/log/xenodm.log  
>   xenodm info (pid 13760): consolePath: ttyC4
> 
> This additional entry could be also used later on to move the xenodm
> GiveConsole/TakeConsole chown entries over, I guess.
> 
> Any thoughts?

The xenodm tty should really be ttyC4 on all our architectures.  I
would suggest that anywhere where you're not sure (or have something
different) we shouldn't add /dev/video0.  People won't be using a
webcam on those platforms anyway.  And if they do they can file a bug
report and we fix things.

> Index: etc/etc.alpha/fbtab
> ===
> RCS file: /cvs/src/etc/etc.alpha/fbtab,v
> retrieving revision 1.12
> diff -u -p -u -p -r1.12 fbtab
> --- etc/etc.alpha/fbtab   17 Nov 2013 08:51:23 -  1.12
> +++ etc/etc.alpha/fbtab   25 Feb 2021 11:27:29 -
> @@ -1 +1,2 @@
> -/dev/ttyC0  0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/video0
> +/dev/ttyC5   0600/dev/video0
> Index: etc/etc.amd64/fbtab
> ===
> RCS file: /cvs/src/etc/etc.amd64/fbtab,v
> retrieving revision 1.8
> diff -u -p -u -p -r1.8 fbtab
> --- etc/etc.amd64/fbtab   12 Feb 2021 10:26:33 -  1.8
> +++ etc/etc.amd64/fbtab   25 Feb 2021 11:27:29 -
> @@ -1 +1,2 @@
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
> +/dev/ttyC4   0600/dev/video0
> Index: etc/etc.arm64/fbtab
> ===
> RCS file: /cvs/src/etc/etc.arm64/fbtab,v
> retrieving revision 1.4
> diff -u -p -u -p -r1.4 fbtab
> --- etc/etc.arm64/fbtab   12 Feb 2021 10:26:34 -  1.4
> +++ etc/etc.arm64/fbtab   25 Feb 2021 11:27:29 -
> @@ -1,2 +1,3 @@
>  /dev/tty00   0600/dev/console
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
> +/dev/ttyC4   0600/dev/video0
> Index: etc/etc.armv7/fbtab
> ===
> RCS file: /cvs/src/etc/etc.armv7/fbtab,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 fbtab
> --- etc/etc.armv7/fbtab   23 Jun 2020 13:54:40 -  1.2
> +++ etc/etc.armv7/fbtab   25 Feb 2021 11:27:29 -
> @@ -1,2 +1,3 @@
>  /dev/tty00   0600/dev/console
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/video0
> +/dev/ttyC4   0600/dev/video0
> Index: etc/etc.i386/fbtab
> ===
> RCS file: /cvs/src/etc/etc.i386/fbtab,v
> retrieving revision 1.15
> diff -u -p -u -p -r1.15 fbtab
> --- etc/etc.i386/fbtab12 Feb 2021 10:26:34 -  1.15
> +++ etc/etc.i386/fbtab25 Feb 2021 11:27:29 -
> @@ -1 +1,2 @@
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
> +/dev/ttyC4   0600/dev/video0
> Index: etc/etc.loongson/fbtab
> 

Re: Add /dev/video0 to fbtab

2021-02-25 Thread Stuart Henderson
On 2021/02/25 20:10, Marcus Glocker wrote:
> We had this discussion recently when fbtab(5) for xenodm(1) was fixed
> 6 weeks ago, but we didn't come to an agreement yet.  tb@ asked me the
> same question yesterday whether we can add video(1) to fbtab to avoid
> manual chown of /dev/video0, which I think a lot of people do today.
> Therefore here another try to bring this up.

I'm not sure this is something I would expect to be chmod'ed
automatically.. It's a very different class of device than things
currently in fbtab or Give/TakeConsole.

At least if this is done we'll have to document it somewhere for people
using ports like multimedia/motion.

> This diff adds /dev/video0 to fbtab on all archs where video is
> available.  It's added for the existing console login entry, in case
> people start X through startx/xinit, and on a new entry when X is
> started through xenodm.

Hmm - last time I suggested fbtab for something jcs pointed out
that it doesn't work with xenodm..

>   grep consolePath /var/log/xenodm.log  
>   xenodm info (pid 13760): consolePath: ttyC4
> 
> This additional entry could be also used later on to move the xenodm
> GiveConsole/TakeConsole chown entries over, I guess.
> 
> Any thoughts?
> 
> 
> Index: etc/etc.alpha/fbtab
> ===
> RCS file: /cvs/src/etc/etc.alpha/fbtab,v
> retrieving revision 1.12
> diff -u -p -u -p -r1.12 fbtab
> --- etc/etc.alpha/fbtab   17 Nov 2013 08:51:23 -  1.12
> +++ etc/etc.alpha/fbtab   25 Feb 2021 11:27:29 -
> @@ -1 +1,2 @@
> -/dev/ttyC0  0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/video0
> +/dev/ttyC5   0600/dev/video0
> Index: etc/etc.amd64/fbtab
> ===
> RCS file: /cvs/src/etc/etc.amd64/fbtab,v
> retrieving revision 1.8
> diff -u -p -u -p -r1.8 fbtab
> --- etc/etc.amd64/fbtab   12 Feb 2021 10:26:33 -  1.8
> +++ etc/etc.amd64/fbtab   25 Feb 2021 11:27:29 -
> @@ -1 +1,2 @@
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
> +/dev/ttyC4   0600/dev/video0
> Index: etc/etc.arm64/fbtab
> ===
> RCS file: /cvs/src/etc/etc.arm64/fbtab,v
> retrieving revision 1.4
> diff -u -p -u -p -r1.4 fbtab
> --- etc/etc.arm64/fbtab   12 Feb 2021 10:26:34 -  1.4
> +++ etc/etc.arm64/fbtab   25 Feb 2021 11:27:29 -
> @@ -1,2 +1,3 @@
>  /dev/tty00   0600/dev/console
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
> +/dev/ttyC4   0600/dev/video0
> Index: etc/etc.armv7/fbtab
> ===
> RCS file: /cvs/src/etc/etc.armv7/fbtab,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 fbtab
> --- etc/etc.armv7/fbtab   23 Jun 2020 13:54:40 -  1.2
> +++ etc/etc.armv7/fbtab   25 Feb 2021 11:27:29 -
> @@ -1,2 +1,3 @@
>  /dev/tty00   0600/dev/console
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/video0
> +/dev/ttyC4   0600/dev/video0
> Index: etc/etc.i386/fbtab
> ===
> RCS file: /cvs/src/etc/etc.i386/fbtab,v
> retrieving revision 1.15
> diff -u -p -u -p -r1.15 fbtab
> --- etc/etc.i386/fbtab12 Feb 2021 10:26:34 -  1.15
> +++ etc/etc.i386/fbtab25 Feb 2021 11:27:29 -
> @@ -1 +1,2 @@
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
> +/dev/ttyC4   0600/dev/video0
> Index: etc/etc.loongson/fbtab
> ===
> RCS file: /cvs/src/etc/etc.loongson/fbtab,v
> retrieving revision 1.6
> diff -u -p -u -p -r1.6 fbtab
> --- etc/etc.loongson/fbtab12 Feb 2021 10:26:34 -  1.6
> +++ 

Add /dev/video0 to fbtab

2021-02-25 Thread Marcus Glocker
We had this discussion recently when fbtab(5) for xenodm(1) was fixed
6 weeks ago, but we didn't come to an agreement yet.  tb@ asked me the
same question yesterday whether we can add video(1) to fbtab to avoid
manual chown of /dev/video0, which I think a lot of people do today.
Therefore here another try to bring this up.

This diff adds /dev/video0 to fbtab on all archs where video is
available.  It's added for the existing console login entry, in case
people start X through startx/xinit, and on a new entry when X is
started through xenodm.

On all other archs than amd64, i386, arm64, and macppc I'm not sure
whether I have picked the right xenodm tty.  Therefore I would be glad
if people can verify that, and let me know.  If you run X on that arch
an easy way to identify this is:

grep consolePath /var/log/xenodm.log  
xenodm info (pid 13760): consolePath: ttyC4

This additional entry could be also used later on to move the xenodm
GiveConsole/TakeConsole chown entries over, I guess.

Any thoughts?


Index: etc/etc.alpha/fbtab
===
RCS file: /cvs/src/etc/etc.alpha/fbtab,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 fbtab
--- etc/etc.alpha/fbtab 17 Nov 2013 08:51:23 -  1.12
+++ etc/etc.alpha/fbtab 25 Feb 2021 11:27:29 -
@@ -1 +1,2 @@
-/dev/ttyC0  0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/video0
+/dev/ttyC5 0600/dev/video0
Index: etc/etc.amd64/fbtab
===
RCS file: /cvs/src/etc/etc.amd64/fbtab,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 fbtab
--- etc/etc.amd64/fbtab 12 Feb 2021 10:26:33 -  1.8
+++ etc/etc.amd64/fbtab 25 Feb 2021 11:27:29 -
@@ -1 +1,2 @@
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: etc/etc.arm64/fbtab
===
RCS file: /cvs/src/etc/etc.arm64/fbtab,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 fbtab
--- etc/etc.arm64/fbtab 12 Feb 2021 10:26:34 -  1.4
+++ etc/etc.arm64/fbtab 25 Feb 2021 11:27:29 -
@@ -1,2 +1,3 @@
 /dev/tty00 0600/dev/console
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: etc/etc.armv7/fbtab
===
RCS file: /cvs/src/etc/etc.armv7/fbtab,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 fbtab
--- etc/etc.armv7/fbtab 23 Jun 2020 13:54:40 -  1.2
+++ etc/etc.armv7/fbtab 25 Feb 2021 11:27:29 -
@@ -1,2 +1,3 @@
 /dev/tty00 0600/dev/console
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: etc/etc.i386/fbtab
===
RCS file: /cvs/src/etc/etc.i386/fbtab,v
retrieving revision 1.15
diff -u -p -u -p -r1.15 fbtab
--- etc/etc.i386/fbtab  12 Feb 2021 10:26:34 -  1.15
+++ etc/etc.i386/fbtab  25 Feb 2021 11:27:29 -
@@ -1 +1,2 @@
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128:/dev/video0
+/dev/ttyC4 0600/dev/video0
Index: etc/etc.loongson/fbtab
===
RCS file: /cvs/src/etc/etc.loongson/fbtab,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 fbtab
--- etc/etc.loongson/fbtab  12 Feb 2021 10:26:34 -  1.6
+++ etc/etc.loongson/fbtab  25 Feb 2021 11:27:29 -
@@ -1,2 +1,3 @@
+/dev/console   0600/dev/video0
 /dev/tty00 0600/dev/console
-/dev/ttyC0 0600
/dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/ttyC4:/dev/drm0:/dev/drmR128:/dev/dri/card0:/dev/dri/renderD128
+/dev/ttyC0 0600