ttyname(bug)

jsdy at hadron.UUCP jsdy at hadron.UUCP
Tue Jan 28 08:48:31 AEST 1986


The problem, as stated, was that shutdown's
	ln /dev/________ /dev/syscon
put syscon earlier in /dev than the tty that was being linked.

To fix this permanently, you must make sure that there are no
empty slots in /dev before all the tty names.  Here are two ways
to do this.

To do either, you must first have an idea how many empty slots
there are and where they are.  If you say 'od -c /dev', you will
get output that looks something like:

0000000  \9 \0  . \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000020  \2 \0  .  . \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000040  \0 \0  r  p  2  0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000060   d \2  c  o  n  s  o  l  e \0 \0 \0 \0 \0 \0 \0
0000100   c \2  t  t  y  0  0 \0 \0 \0 \0 \0 \0 \0 \0 \0
	...

The slots that have "\0 \0" in the first two columns are your empty
slots.  One example is "rp20" above.  This gives you how many and
where.

One thing you could do is to create new device or regular files to
fill these empty slots.  You could (if you trust yourself) remove
device files that are at the end of /dev and re-mknod them, so that
they will re-appear at the beginning.  Or you could just 'tee x y z
<RET><CTL-D>'.  This creates empty regular files.

Or, if you don't want to create useless files in /dev, but are not
sure you want to remove device files (after all, even _I_ make
mistakes!  [;-)]), you can change the links.  Since (presumably)
they already have the names you want them to have, you'll have to
make an extra link or two as intermediates:
	ln ttyz8 x	# right slot, wrong name
	ln x y		# wrong slot, wrong name
	rm ttyz8 x
	ln y ttyz8	# right slot, right name
	rm y

Of course, you will want to do both of these techniques single-user
so that you can remove /dev/syscon  b e f o r e  you do any of this.
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Net.bugs.usg mailing list