devfs
[Top] [All Lists]

Re: serial console under devfs

To: dagum@xxxxxxxxxxxxxxxxxxx, tduffy@xxxxxxxxxxxxxxxxxx
Subject: Re: serial console under devfs
From: "Khimenko Victor" <devfs@xxxxxxxxxxxxxxxxx>
Date: Mon, 7 Aug 2000 10:36:48 +0400 (MSD)
Cc: devfs@xxxxxxxxxxx
Organization: MCCME
References: <200008070513.WAA11693@barrel.engr.sgi.com>
Sender: owner-devfs@xxxxxxxxxxx
6-Aug-00 22:13 you wrote:
>> From: Thomas Duffy <tduffy@dbear>
>>
>> I have read this document before and I went over it just a minute ago as a
>> refresher.  Still, I cannot find an answer to my problem.
>>
>> I can get lilo and the kernel to print to the serial port.

With console=ttyXX,YYYY ? And STILL can not redirect initscripts messages there.
Hmm.

>> And I can get "getty" to start on the serial lin.

On serial line or on /dev/console, redirected to serial line ?

>> But, I cannot get stuff written out to console (like the initscritps
>> messages or the logon in single user mode) to come out.

I worked for me last time I checked (I do not have proper hardware here to
recheck now). What version of kernel you are using ?

>> That is my problem.  I want /everything/ to come out on the serial line.

And that's EXACTLY what will happen if you'll redirect console with kernel
option.

> Is the problem here that the console goes away when devfs gets mounted?

No, no, no. Devfs is mount VERY early on boot process (guess why? to make
/dev/console available for kernel early on boot process, of course :-)

>>
>> The only way I have found to fix this problem is to remove /dev/console
>> and re-mknod it as the serial line.  I agree this is an ugly hack and if
>> you know of a better way, then I would love to hear it.  But this hack
>> which I normally do does not work under devfs.

> You cannot mknod on a devfs filesystem.

LIE.

> It's a VFS like /proc with fairly limited capabilities (that's by design,
> the goal is for any device node found under /dev to correspond to a real
> physical device).

LIE. Yes, it's limited filesystem - you can not create regular files there.
But you CAN create symlinks, directories, sockets and pipes there just fine.
You can play with permissions and such info will be even keept across reboots
with properly tuned devfsd. THAT'S by design. Thing like /proc where you can
not create file or alter it's permission can not replace old-fashioned /dev
for sure.

> Have you tried using devfsd to create a symlink from /dev/console to
> /dev/ttyS0?

You are joking, right ? RIGHT ? How the hell devfsd can do anything with
/dev/console before it's even loaded ? Console is created in main.c before
PCI and other kernel subsystems are initialized or /sbin/init started.

>>
>> -tduffy
>>
>> On Mon, 7 Aug 2000, Khimenko Victor wrote:
>>
>> > 4-Aug-00 12:59 you wrote:
>> > > So, I have been having a problem getting devfs to allow me to make
>> > > /dev/console redirected to the serial port.
>> >
>> > Really ? How so ?
>> >
>> > > On an non devfs system, I simply removed /dev/console and then re-mknod 
>> > > it
>> > > to be c 4 64 which corresponds to ttyS0.
>> >
>> > Aah. Yeah, if you usually come to the house through the window it looks 
>> > like
>> > reasonable solution. Still most peoples prefer door. Why not RTFM at last
>> > (/usr/src/linux/Documentation/serial-console.txt) ?
>> >

> There's no place for this kind of arrogance here.  Save it for people
> who will be suitably impressed.

At least I was not duped his as I know what I'm talking about. It's devfs
feature (sometimes unfortunate but still feature): you can not change type
of OPENED device - you can remove that device and you can try to create
something in place of that device but you'll get the same device with the
same minor and major numbers as before. Since /dev/console is created early
on boot and used by kernel for the whole system lifetime you can not change
/dev/console. You can redirect /dev/console to serial port without /dev/console
recreation though so it's not a big problem usually.




<Prev in Thread] Current Thread [Next in Thread>