Hi all,
Dave Aubin solved this problem (that i posted long ago) for his system and
got it working. Many have found my question in the archives and asked about
a solution since i posted it (i have had none), so now I'm passing on the
solution on Dave's behalf.
Dave solved it by modifying inittab so that the tty prefix precedes the rest.
::respawn:tinylogin getty -L 115200 ttyS1 vt100
does not work (the TIOCSPGRP error), but when he modified it to
ttyS1::respawn:tinylogin getty -L 115200 ttyS1 vt100
he said it worked. He further mentioned that "You must have the ttyS1 in
front of the tinylogin or else you'll get ctrl-c on ttyS0 effecting ttyS1"
I have tried to verify/get it working on my system, but i must have some
options messed up somewhere, as in my setup it seems that any id field (in
this case 'ttyS1') at the beginning of an inittab line prevents it from being
spawned. When i spawn it on ttyS1 manually from the console, it segfaults
when i try and login.
I hope i have passed on Dave's solution accurately. Please correct me if i
mis-transcribed, Dave.
So, hopefully this helps some of you out there now, and those looking through
the archives at some future date. (hi future people! ;-)
cheers,
cam
> -----Original Message-----
> From: Cam Mayor [EMAIL PROTECTED]
> Sent: Monday, August 20, 2001 3:19 PM
> Subject: getty (tinylogin) problem: errno 25: Not a typewriter
>
>
> Hi,
>
> I am having a getty problem with tinylogin. The short story
> is that after the kernel (2.4.6-rmk1-rayl1) boots on my
> device (Cirrus CDB89712 board), i attempt to login at the
> login prompt on the second serial port (hermit is on the
> first serial port and is unresponsive at this point), but
> it dumps out with the error "getty: ioctl() TIOCSPGRP call
> failed". Actually, the length of the error message is
> variant (it gets truncated), but that is what the full
> error is supposed to read.
>
> I am looking for the possible cause of this so i may rectify it.
>
> Now the long story...
> The piece of code which is causing the error is in getty.c,
> in the int getty_main(int argc, char **argv) function.
> specifically, the problem (appears to) lie in the ioctl function
> called in the code:
>
> #ifdef __linux__
> {
> int iv;
> iv = getpid();
> if (ioctl(0, TIOCSPGRP, &iv) <0)
> perror_msg("ioctl() TIOCSPGRP call failed");
> }
> #endif
>
> When i try to login, ioctl() dumps with a return code of -1.
> Based on debug code, TIOCSPGRP appears to be 21520 (but i don't
> really know what this means), and iv is the pid of the new
> getty process. (it increments as a new one is spawned every
> time i attempt to login - increments by 2 if i try to login as
> anybody other than root) <IThink> the perror_msg is getting
> truncated because the getty process is killed by the system
> before it completes dumping the message to the console.</IThink>.
>
> The errno set by ioctl is 25, which is defined as "Not a typewriter".
> I believe that "Not a typewriter" is an error message that is set
> when something attempts to use a non-tty type device as an input
> device. I do not know what the "0" represents in the ioctl() call.
>
> I suspect there are some file permissions/existences/contents that
> i am missing that is causing this error. Has anybody encountered
> this problem before? Can anybody shed a clue on this for me?
>
> cheers,
> cam
>
> tinylogin Build information:
>
> I don't think this is related to the problem, but i'll list
> this just in case.
>
> I am cross compiling using arm-linux-gcc 2.95.3. The gcc
> from uclibc is also version 2.95.3. uclibc, tinylogin (0.80),
> and busybox (0.60.0) were all downloaded within this past week
> from current tarballs found on the lineo web page.
>
> When originally compiling tinylogin, the compiler was barfing
> on what looked like a failure in the definition of updwtmp
> when there is no __GLIBC__ defined.
> I have attached a small edited section of the make output where
> it failed.
> -------cam's tinylogin failing make---------
> make -eC pwd_grp
> make[1]: Entering directory
> `/usr/local/server/arm/cvs/tinylogin-0.80/pwd_grp'
> [...]
> /usr/local/server/arm/arm-linux-uclibc/bin/gcc -Wall -Os
> -fomit-frame-pointe
> r -D_GNU_SOURCE -DTLG_VER='"0.80"'
> -DTLG_BT='"2001.08.17-20:52+0000"' -c -
> o utmp.o utmp.c
> utmp.c: In function `setutmp':
> utmp.c:109: warning: implicit declaration of function `updwtmp'
> [...]
> /usr/local/server/arm/arm-linux-uclibc/bin/gcc -Wall -Os
> -fomit-frame-pointe
> r -D_GNU_SOURCE -DTLG_VER='"0.80"'
> -DTLG_BT='"2001.08.17-20:52+0000"' -c -
> o getty.o getty.c
> getty.c: In function `update_utmp':
> getty.c:568: warning: implicit declaration of function `updwtmp'
> [...]
> /usr/local/server/arm/arm-linux-uclibc/bin/gcc -s -Wl,-warn-common -o
> tinylogin tinylogin.o env.o obscure.o pwd2spwd.o setupenv.o shell.o utmp.o
> utility.o usage.o addgroup.o adduser.o deluser.o getty.o login.o passwd.o
> shadow.o -lcrypt pwd_grp/libpwd.a
> utmp.o: In function `setutmp':
> utmp.o(.text+0x1a0): undefined reference to `updwtmp'
> getty.o: In function `update_utmp':
> getty.o(.text+0x730): undefined reference to `updwtmp'
> collect2: ld returned 1 exit status
> make: *** [tinylogin] Error 1
> -------end of cam's tinylogin failing make---------
>
> Specifically, the problem was in the code for utmp and getty.
> I forced a dumber compile by patching the if __GLIBC__
> statements which allows everything to compile ok by forcing
> it to define its own updwtmp function(here is an example diff
> between the official lineo getty.c and my version - similar
> code patched with utmp.c):
>
> -------cam's tinylogin getty.c changes---------
> 525c525,526
> < #if ! (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
> ---
>
> > #if 1 //cmayor
> > //#if ! (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
>
> 567c568,569
> < #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
> ---
>
> > #if 0 //cmayor
> > //#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
>
> -------end cam's tinylogin getty.c changes---------
>
>
>
>
> _______________________________________________
> http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
> Please visit the above address for information on this list.
-------------------------------------------------------
_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.