Search:  
Gentoo Wiki

HOWTO_Configure_Gentoo_as_a_BlackDog_host

This describes how to get Gentoo to properly host a BlackDog mobile personal server.

After your Gentoo host is configured according to this HOWTO, plugging a BlackDog into the host's USB port should result in autodetection of the BlackDog first as a USB CD-ROM device, then after a few moments, as a USB ethernet device through which an X session is established between the BlackDog's X client and the host's X server. Once this connection is established BlackDog's authentication dialog should appear and you will be able to use the BlackDog normally.

Contents

Gentoo prerequisites


BlackDog prerequisites


Host system configuration

GNOME

Enable TCP connections to the X server.

File: /etc/X11/gdm/gdm.conf
DisallowTCP=false

Find the section corresponding to the following:

File: /etc/X11/gdm/gdm.conf
[server-Standard]
command=/usr/bin/X -audit 0 -br -dpi 96

and ensure the command line does not contain -nolisten tcp.

KDE or plain X

Find a line similar to the following:

File: /etc/X11/xdm/Xservers
:0 local /usr/bin/X

and ensure it does not contain -nolisten tcp.

If you launch X with startx put the following into ~/.xserverrc:

File: ~/.xserverrc
X :0

Make sure the option -nolisten tcp is not present here either.


Host-side scripts

Become root and create a directory for the BlackDog's host-side scripts:

su -
mkdir /opt/realm

The scripts you need are located on BlackDog's emulated CD-ROM, so if you're already able to access the image from your Gentoo host or if you have a Windows host handy, copy the following files from the image to /opt/realm on your Gentoo host:

  • /linux/mps300.hotplug
  • /linux-i386/Realm-networking

Create the udev action script.

File: /opt/realm/blackdog.sh
#!/bin/bash
BD_PATH=/opt/realm
sleep 5
$BD_PATH/mps300.hotplug
sleep 15
/sbin/ifconfig eth2 169.254.0.2
sleep 1
/sbin/route add -net 169.254.0.0/16 eth2
sleep 10
$BD_PATH/Realm-networking -a 169.254.1.3 169.254.0.1&
umount /dev/sr0  # For setups which fail to automatically unmount the fake USB CDROM device

Make the scripts and networking binary executable by root:

chmod 744 /opt/realm/mps300.hotplug /opt/realm/blackdog.sh /opt/realm/Realm-networking

Create a udev rule to launch blackdog.sh when udev detects the BlackDog.

File: /etc/udev/rules.d/40-blackdog.rules
SUBSYSTEM=="scsi_device", ACTION=="add", RUN+="/opt/realm/blackdog.sh"


Host kernel configuration

The kernel must support USB CD-ROM devices and Pegasus type USB ethernet devices.

If the host is using kernel 2.6.12 or 2.6.13, copy /linux-i386/pegasus-linux-2.6.12+.diff from the BlackDog's emulated CD-ROM to /opt/realm, then patch the kernel:

patch /usr/src/linux/drivers/usb/net/pegasus.c /opt/realm/pegasus-linux-2.6.12+.diff

To configure the kernel:

cd /usr/src/linux
make menuconfig

Select the following options:

Linux Kernel Configuration: Enable options for BlackDog
Device Drivers -->
  SCSI device support -->
    <*>   SCSI disk support
    <*>   SCSI CDROM support
  USB support -->
    <*> Support for Host-side USB
    [*]   USB device filesystem
    <*>   EHCI HCD (USB 2.0) support
    <*> USB Mass Storage support
    USB Network Adapters -->
      <*> USB Pegasus/Pegasus-II based ethernet device support


Tip: You may optionally configure the above built-in <*> options as modules <M> instead. If you experience instability with the modules reconfigure the kernel to use built-ins.


Make sure your /boot partition is mounted, then build and install the kernel (and modules if applicable):

make && make modules_install && make install && module-rebuild rebuild


Finalizing the configuration

Enable BlackDog's X client to connect to your Gentoo host's X server via TCP.

File: /etc/X0.hosts
inet:169.254.0.1

Finally, reboot with your updated kernel, plug in a BlackDog, and "have a lot of fun"!


Tip: echo "169.254.0.1 blackdog" >> /etc/hosts

Last modified: Fri, 05 Sep 2008 23:39:00 +0000 Hits: 8,698