Running GNU/Linux Debian s390 under a i386

Posted by enerv on Tue 2 Jan 2007 at 06:07

Using the hercules emulator it is possible to have your system emulate an IBM mainframe! Here we'll give a brief overview of using the emulator to install a pre-made image of Woody, giving you a Debian GNU/Linux S390 system.

Installing the emulator with a fresh installation of Sarge is as simple as:

aptitude install hercules
mkdir /etc/hercules
cd /etc/hercules

wget http://people.debian.org/~mdz/hercules/Debian-3.0r1.3390 wget http://people.debian.org/~mdz/hercules/hercules.cnf

Now edit the file /etc/hercules/hercules.cnf and comment out the following line :

000C    3505    bf/vmrdr/kernel.debian bf/vmrdr/parmfile.debian bf/vmrdr/initrd.debian autopad eof

Uncomment these two lines:

0A00    3088 CTCI       /dev/net/tun 2000 192.168.10.2 192.168.10.1 255.255.255.252
0A01    3088 CTCI       /dev/net/tun 2000 192.168.10.2 192.168.10.1 255.255.255.252

Now change the line:

0300    3390    debian.3390

to read:

0300 3390  /etc/hercules/Debian-3.0r1.3390

Now that the configuration file has been updated we can execute hercules:

slut:/etc/hercules# hercules

Once the system has started started enter into the console:

iodelay 800
ipl 0300

This should now start to run the system. When HERCULES asks you for login and password just type (using a dot):

.root

You are logged into the a Debian GNU/Linux s390 machine! All commands that you will use in this system console needs a dot before the syntax (eg.: .cat /proc/cpuinfo). It's because the emulator needs to "translate" the syntax this way. On the other hand Hercules will run the commands without the dot.

If you want to use the internet connection of your host system you will need to use the nat table in your iptables firewall. For example run these commands:

iptables -t nat -A POSTROUTING -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward

Once the system is booted you can carry out the rest of your work using the installed telnet server, via the IP address we added to /etc/hercules/hercules.cnf file we edited.

In our case:

telnet 192.168.10.2

Now you will finish the Debian installation. Remember that you need to edit the /etc/resolv.conf file typing your nameservers.

Note: when you run through the installer second-stage over telnet you will need to edit the source.list file, since it will refer to "stable" and not "woody".

You also need to remember to save the configurations before you close Hercules:

stop
savecore debian-current
start

Now you can test your packages in this arch (s390)! ;)

Let's HACK! ;)

www.enerv.net


This article can be found online at the Debian Administration website at the following bookmarkable URL (along with associated comments):

This article is copyright 2007 enerv - please ask for permission to republish or translate.