Re: [PATCH] um/configs: don't use devtmpfs in defconfig

From: Al Viro
Date: Tue Jul 16 2013 - 15:03:49 EST


On Tue, Jul 16, 2013 at 11:42:55PM +0530, Ramkumar Ramachandra wrote:
> Leave aside the fact that I could not find the uml-utils upstream [1],
> and didn't have a /uml/port-helper to connect the xterms for a second;
> I didn't even understand what was supposed to happen. Why do we spawn
> xterms, and attach to the host's /dev/tty*? So far, I just used
> /dev/console inside my existing tmux session in urxvt, and it seems to
> work fine.

There are several things that can be attached to them. Again, see the
HOWTO for details. FWIW, I prefer to have console in whatever I'm
launching the whole thing in (usually - ssh session to the box I'm
using to run all kinds of testing stuff on) with tty[1-6] attached to
pts and accessed via screen /dev/pts/<n> on the same box (again, from ssh
sessions, obviously).

> > One
> > practical issue is the lack of VT102 emulation;
>
> This detail is not at all clear from the Documentation. I spent a lot
> of time trying to figure out why systemd wasn't able to getty on
> /dev/tty1.

No fscking idea - sysvinit has no problem with launching getty instances
(on explicit lines in inittab, that is), so it's not a problem on getty
side of things. And as much as I dislike systemd, I think it's not to blame
in this case. It looks like it *does* lauch getty just fine, but your host
is misconfigured in a way that makes attempts to open the corresponding device
nodes fail. With the messages you've quoted. The same HOWTO has
2.3 Compiling and installing uml_utilities
right after
2.1 Compiling the kernel
2.2 Compiling and installing kernel modules
so it's not as if the needed setup had not been mentioned.

FWIW, it would be a good idea to package the damn thing for Fedora -
Debian has
$ apt-cache search 'User-Mode Linux'
rootstrap - A tool for building complete Linux filesystem images
uml-utilities - User-mode Linux (utility programs)
user-mode-linux-doc - User-mode Linux (Documentation)
user-mode-linux - User-mode Linux (kernel)
$

> > TERM=linux when logged
> > in on those is not right - you want either TERM=xterm (for xterms) or
> > TERM=screen (when accessing pts-associated ones with screen /dev/pts/n),
> > etc. In any case, it's a dumb serial line as far as the guest kernel
> > is concerned - all terminal emulation is going to happen elsewhere (xterms
> > running on host and interpreting escape sequences from guest userland,
> > etc.)
>
> Hm, what does $TERM have to do with all this?

Huh? That's what tells all curses-based stuff which escape sequences to
emit. And that's the *only* thing in which "it's not a VT" matters at
all. Again, your description of symptoms doesn't look like "systemd gets
confused by tty1 not being a VT and fails to launch getty"; it appears to
be "systemd does see tty1 and does launch getty, albeit with slightly wrong
terminal type argument. Which doesn't matter, since getty fails to open the
device nodes due to missing utilities on host". Install said utilities
or switch to explicit con=... in command line and getty will launch just
fine. That's where TERM= settings come into play - some curses-based stuff
will assume it has all linux VT escape sequences to play with and the
thing you are using to access it might not be happy. Other than that
(and this is the thing you pass to getty as terminal type - the last
argument for agetty(8)), everything seems to boil down to lack of uml utils
on host...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/