Me: About Me
Things I Have Done: Linux Toys, Junk
Pictures and Stuff: Planet Horms, Photo Gallery
Sites I Maintain: Verge, Slarken, Ultra Monkey, Super Sparrow

Recent News

(That is news written by me, for other's news, please see Planet Horms)

Compiling Xenclient on Debian Lenny

[Fence]

Xenclient is one of those projects where you do a fairly small check out, perform some configuration, press the go button, and it builds a small universe worth of software, downloading things as needed. In my experience build-breakage usually ensues in such situations.

Here is the winning combination I came up with to compile the system on Lenny. Installing and testing I will leave for another day.


Fri, 22 May 2009 13:46:03 +1000| Permalink


PCI pass-through changes included in Xen 3.4.0

[Koi]

Xen 3.4.0 has been released and includes two improvements to PCI pass-through that I was involved in:

Unfortunately there have also been a number of bugs in pass-through. Many of these have been fixed. But and as of the release a known problem is that domains can't be started if they have previously had PCI devices hot-plugged. At this time I recommend using xm_pci_list_v3.patch and xm_pci_attach_v2.patch which have been provided by Masaki Kanno in his post [PATCH] Fix xm pci-attach/detach for inactivemanaged as a fix for this problem.

Update: Kanno-san's changes have been combined into a single patch and applied to xen-unstable as changset: 19618:780041c4a96d "xend: Fix xm pci commands for inactive managed domains".

Tue, 19 May 2009 12:03:50 +1000| Permalink


Asymmetric Drivers

[Rocks in Coogee]

Of late I've been working on and off towards adding support for the Intel 82566DM-2 and 82576 to gPXE. My current technique involves a combination of studying data-sheets and programming manuals available on Intel's web site, scrounging around the internet for existing patches and examining the working Linux drivers, which have a common ancestor to the driver in gPXE. Over the past week this work has been more on than off.

So far I have a driver for the 82566DM-2 that can receive packets and send one packet. As an amusing work-around I tried reseting after each transmit and that does allow it to send more packets. For the 82576 so far the driver can only send packets. Perhaps for another amusing hack I should try sending with one card and receiving with the other.

Update: I now have the 82576 working and have posted a patch which the mailing list archive mangled. I haven't had any more luck with the 82566DM-2 and have shelved that project for now.

Fri, 08 May 2009 11:10:54 +1000| Permalink


screenshell

[Chiz]

I recently wanted a way to set up a machine as a serial console server. That is to connect two of its serial ports to serial ports on two other machines using a null-modem. The idea being that these other machines would put their console on their serial port which would be accessable remotely. Good for debugging, good for handling crashes.

Reading Matt Palmer's recent post SheevaPlug-based serial console concentrators, I decided to write up how I achieved this goal.

Rather than users logging into the console server and then executing a command to access the relevant serial port, I wanted access to be I wanted access to the consoles by telneting to a designated port, one port per serial console that is available.

To achieve this I wrote a small script, screenshell and put it in /usr/local/bin. It is pretty simple, it creates a new screen session for the requested TTY if one doesn't already exist, else it connects to the existing session. I couldn't find an argument to screen that would do this in one hit, so the script looks at what screen sessions are running and acts accordingly - some room for improvement here (see update).

In order to accept connections via telnet, I just added the following lines to /etc/inetd.conf:

8000		stream	tcp	nowait	scs.scs	/usr/sbin/tcpd /usr/sbin/in.telnetd -h -L/usr/local/bin/screenshell-ttyS0
8001		stream	tcp	nowait	scs.scs	/usr/sbin/tcpd /usr/sbin/in.telnetd -h -L/usr/local/bin/screenshell-ttyS1

This basically says, listen for connections on port 8000, if you get a connection, invoke /usr/sbin/in.telnetd and use /usr/local/bin/screenshell-ttyS0 to handle their session. Similarly for port 80001. scs.scs denotes that /usr/sbin/in.telnetd should be invoked as user scs, group scs. The scs (Serial Console Server) user and group were created for this sole purpose, though that is really just a matter of taste.

I couldn't work out how to determine which port the user was connecting to from within screenshell when it is invoked in this way, nor could I work out how to pass extra arguments to screenshell. So instead I just symlinked screenshell to screenshell-ttyS0 and screenshell-ttyS1, which allowed the command name to be used to determine which TTY was being used. Again, room for improvement.

For the problem at hand telnet was sufficient so I didn't investigate how well ssh would work with the solution that I cam up with. For the task at hand, the solution above seems to work quite well.

Download: screenshell
Home: ~horms/junk/

Update: 4th May 2009
Kfish pointed out that screen -xRR -S NAME will attach to an existing session or start a new one as necessary. I have slimmed down the script accordingly.

Fri, 01 May 2009 11:10:34 +1000| Permalink


Xen on empty /var/lib/xend/state/sr.xml

[Chiz in Aoyama]

I'm not sure how/why/when /var/lib/xend/state/sr.xml became zero length, but I am sure that Xen's reaction was fairly difficult to read: xend wouldn't start.

# /etc/init.d/xend restart
.........

The log, at 61 lines, was much more verbose, though equally useless unless you are prepared to delve into the code. It can be found here. It turns out the interesting portion for debugging the problem is:

  File "usr/lib/python2.5/site-packages/xen/xend/XendNode.py", line 240, in _init_SRs
      saved_srs = self.state_store.load_state('sr')

Diving into the code, I put a few debugging statements into XendStateStore.py, which seemed to indicate that the breakage was occurring around the time that /var/lib/xend/state/sr.xml was read. On inspection I found this file to be empty, while similar files in the same directory were not.

A solution: # rm /var/lib/xend/state/sr.xml

A Lesson Learnt: If you follow xen-unstable, from time to time things will break in bizarre ways.

A Mystery: How did the file end up empty in the first place?

Thu, 30 Apr 2009 11:56:25 +1000| Permalink