# HG changeset patch # User Josef "Jeff" Sipek # Date 1189653684 14400 # Node ID e9b53c1db049c7a2ce1d5eca93ddee10a8d1b1bb # Parent 341e24a1a316cea29aac3add17365e43eb14afb8 Automate howto build process diff -r 341e24a1a316 -r e9b53c1db049 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Wed Sep 12 23:21:24 2007 -0400 @@ -0,0 +1,1 @@ +^s390\.html$ diff -r 341e24a1a316 -r e9b53c1db049 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Wed Sep 12 23:21:24 2007 -0400 @@ -0,0 +1,10 @@ +SHORTLOG_LEN=1 + +all: s390.html + +s390.html: head.html body.html tail.html + cat head.html > $@ + hg log -l$(SHORTLOG_LEN) | sed -e 's/>/\>/g' -e 's/> $@ + cat body.html >> $@ + hg log | sed -e 's/>/\>/g' -e 's/> $@ + cat tail.html >> $@ diff -r 341e24a1a316 -r e9b53c1db049 body.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/body.html Wed Sep 12 23:21:24 2007 -0400 @@ -0,0 +1,442 @@ + +
+

Let's get started

+ +

+If you follow this HOWTO, at the end of it you'll have: +

+ +Linux on S/390 + +

+Yes, that's debian running on an IBM System/390 box. Very emulated one, but +still wonderful enough to keep around :) +

+ +

+The following howto assumes, that you know at least a little bit of: +

+

+ +

+The following software is required: +

+

+ + + +

+First, let's set up a place to do all the work: +

+ +
+$ mkdir zlinux
+$ cd zlinux
+$ mkdir dasd rdr prt
+
+ +

+Wonderful. Now, let's get the images from which we will IPL (IPL stands for +Initial Program Load, and it is effectively the "boot" process). +

+ +

+There are a number of distros that support S/390 hardware, but only one of +them is worth trying on any platform - +Debian :) +

+ +

+So, point your browser to the mirror nearest you, navigate to this rather +long path: +

/debian/dists/Debian4.0r0/main/installer-s390/currentgeneric/
+ +and grab these files: +
+initrd.debian
+kernel.debian
+parmfile.debian
+
+

+ +

+Save them into the

rdr
directory. The first two files' names +gives away their contents - the first is an initrd, and the second is the +kernel image itself. The last file contains the kernel command line options, +which on systems like i386, you specify via a keyboard to the bootloader. +

+ +

+Any serious emulator allows you to specify the exact system configuration +via a config file. Hercules is no exception. Save the following in +

zlinux/s390.cnf
or similar. +

+ +
+CPUSERIAL 000069        # CPU serial number
+CPUMODEL  9672          # CPU model number
+MAINSIZE  256           # Main storage size in megabytes
+XPNDSIZE  0             # Expanded storage size in megabytes
+CNSLPORT  3270          # TCP port number to which consoles connect
+NUMCPU    2             # Number of CPUs
+LOADPARM  0120....      # IPL parameter
+OSTAILOR  LINUX         # OS tailoring
+PANRATE   SLOW          # Panel refresh rate (SLOW, FAST)
+ARCHMODE  ESAME         # Architecture mode ESA/390 or ESAME
+
+# .-----------------------Device number
+# |     .-----------------Device type
+# |     |       .---------File name and parameters
+# |     |       |
+# V     V       V
+#---    ----    --------------------
+
+# console
+001F    3270
+
+# terminal
+0009    3215
+
+# reader
+000C    3505    ./rdr/kernel.debian ./rdr/parmfile.debian ./rdr/initrd.debian autopad eof
+
+# printer
+000E    1403    ./prt/print00e.txt crlf
+
+# dasd
+0120    3390    ./dasd/3390.LINUX.0120
+0121    3390    ./dasd/3390.LINUX.0121
+
+# tape
+0581    3420
+
+# network                               s390     realbox
+0A00,0A01  CTCI -n /dev/net/tun -t 1500 10.1.1.2 10.1.1.1
+
+ +

+The top part of the config file specifies the processor features, and the +bottom part specifies devices attached. Each device has a device number +(left more column), a device type (middle column), and optionally arguments +(right column). I'd suggest you read a bit of information from the Hercules +website or many other websites dedicated to the IBM System/390 and zSeries +architectures. It is just far too much to explain here. +

+ +

+One thing to note, if your real hardware has only one core, you may want to +change the NUMCPU to 1. +

+ +

+Another thing you may want to change is the last line, which defines a +Channel To Channel (CTC, see internet for description of what Channels are) +device which will be used as a network bridge to allow the virtual machine +access to the LAN and therefore the internet :) The first IP address is the +address that the virtual machine running s/390 linux will use, and the +second address is one which will be used by the real hardware. This means, +that the real box will have two IP addresses. Go ahead, and +use any valid addresses in the non-routable range +10.0.0.0/8 or 192.168.0.0/16 (this is not a networking guide, so go to the +net if you need help with it). Once we start the emulator, it will set up a +tun/tap device on the real box which will be connected to the ctc device +within S/390. +

+ +

+Next step is to generate the DASD devices. DASD stands for Direct Access +Storage Device, and it is the S/390 name for very beefed up versions of +"disks". For details on how DASD works, see the internet. +

+ +

+We defined two so called packs. The first, device number 120, will contain +the root file system, and the second, device 121, will contain your home +directory. Execute the following two commands in the dasd directory. Each +will create a file about 2.7GB in size. +

+ +
+$ dasdinit -lfs 3390.LINUX.0120 3390-3 LIN120  # /
+$ dasdinit -lfs 3390.LINUX.0121 3390-3 LIN121  # /home
+
+ +

+Congratulations! You are ready to start the emulator now. Since, the default +configuration on any reasonable Linux box will require you to be root to set +up tun/tap connections, let's start hercules as root with the config file: + +

+# hercules -f s390.cnf
+
+

+ +

+You should see something that looks like this: +

+ +Hercules console + +

+It is safe to ignore the "tun0: Operation not supported" message. +

+ +

+Now, by default, the emulated network interface is not routed through, the +following commands will take care of things if you use 10.1.1.x IP addresses +as I do: + +

+# iptables -t nat -A POSTROUTING -o eth0 -s 10.1.1.0/24 -j MASQUERADE  
+# iptables -A FORWARD -s 10.1.1.0/24 -j ACCEPT
+# iptables -A FORWARD -d 10.1.1.0/24 -j ACCEPT
+# echo 1 > /proc/sys/net/ipv4/ip_forward
+# echo 1 > /proc/sys/net/ipv4/conf/all/proxy_arp
+
+

+ +

+If for more information about the networking, look at any number of the +networking guides on the internet. +

+ +

+Ok, now it is time to load the program - time to IPL! In Hercules, type +

ipl c
and press enter. This tells the emulator to start executing +the program from device
000C
which happens to be the card reader! +

+ +

+Now you should see the Linux kernel booting - the installer to be exact :) +

+ +

+Wait until you see: +

+ + + +

+Wonderful! The installer is asking us to select the type of the network +interface. Select ctc (Channel to Channel - for description of what exactly +channels are, see plenty of other documentation on the subject) by typing: +

.1
Note, that the dot is important. Without the dot, anything you +type will be interpreted by Hercules (the emulator). The dot tells Hercules +to send the remainder of the string to the emulated system. +

+ +

+Now, you have to define the end-points for this virtual network interface: +Select read ctc device:

.1
+

+ +

+Select write ctc device:

.2
+

+ +

+Select protocol - s/390:

.1
+

+ +

+Now, enter the IP addresses for the end-points (must match the IP +addresses in the .cnf file). +

+ +

+Enter s390 box IP:

.10.1.1.2
+

+ +

+Enter host box IP:

.10.1.1.1
+

+ + + +

+Enter DNS server IP - choose the same your non-virtual system uses (see +/etc/resolv.conf):

.x.x.x.x
+

+ +

+Enter hostname:

.s390
+

+ +

+Enter your domain name; to specify no domain name, you need to enter the empty +string, but due to the way Hercules handles input, you will need to enter a +dot followed by a space):

.home
+

+ +

+Alright! Now, just sit back, and wait until your system generates a SSH key. +This will take a few minutes. +

+ + + +

+Before long, the installer will ask you for a password for the remainder of +the install process, just enter anything:

.foo
+

+ + + +

+Re-enter it to make sure. Yes, you can see the password in plain-text, but +the installer wants it anyway :) +

+ +

+When you see +

+ + + +

+you'll know you are on the right track! Now, open a new terminal, and ssh +into installer@10.1.1.2, if everything you did was right, ssh will ask you +for a password. +

+ + + +

+Remember that you are using ssh which encrypts everything, and therefore +things will be slow. +

+ +

+Once you enter the right password, a more familiar looking Debian installer +will start up: +

+ + + +

+Select: start menu +

+ +

+Select your country and a suitable mirror. +

+ +

+Leave the proxy information blank unless you have some special proxy setup. +

+ +

+Now you should see: +

+ +, + +

+and shortly after, several installation components will get downloaded +

+ + + +

+Just be patient and wait...or maybe go get some non-caffeinated beverage, +because chances are you've been sipping on that coffee/tea since the +beginning of the installation. :) +

+ +

+Once everything is downloaded, you'll be presented with a config screen for +DASD: +

+ + + +

+DASD is "Direct Access Storage Device" - yes Debian calls it +"Disk access storage device" oh well, they are wrong. +

+ +

+You'll see two DASD packs, 0.0.0120 and 0.0.0121. The first will be used for +the system root and the second for your /home. +

+ +

+Select the first, on the next screen, you'll be asked if you want to format +it, say yes. And wait :) this will generate a large amount of disk I/O, so +you may want to go get a cup of coffee, oh wait, I told you not to...damn :) +

+ +

+When the formating completes, you'll get back to the DASD menu: +

+ +, + +

+Select the other device (121), and format it as well. +

+ +

+Once both volumes are formated, select "Finish". +

+ +

+The following screen +

+ + + +

+should seem familiar to anyone who installed Debian before and chose manual +partitioning. You want to create one partition on each DASD, both ext2 to +avoid "double-journaling", and save some clock cycles. +

+ + + + + + + +

+Confirm the changes: +

+ + + +

+Now the ext2 filesystems will get created on the DASD packs. +

+ +

+Since we didn't define any swap space, the installer will ask us if we want +to go back to the partitioner, we don't want to go back because we know what +we are doing ;) +

+ +

+The next few questions have to do with locale (country & timezone), so just +answer them to the best of your ability. +

+ +

+The next question is the password for root - use something you'll remember +:) +

+ +

+Following is a series of questions about creating a new user (non-root) +account, create yourself an account. +

+ +
+

Full history

+
diff -r 341e24a1a316 -r e9b53c1db049 head.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head.html	Wed Sep 12 23:21:24 2007 -0400
@@ -0,0 +1,9 @@
+
+
+	Installing Debian under Hercules
+
+
+

Installing Debian under Hercules

+ +

Changes since last version

+
diff -r 341e24a1a316 -r e9b53c1db049 s390.html
--- a/s390.html	Wed Sep 12 23:13:25 2007 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,444 +0,0 @@
-
-
-	Installing Debian under Hercules
-
-
-

Installing Debian under Hercules

- -

-If you follow this HOWTO, at the end of it you'll have: -

- -Linux on S/390 - -

-Yes, that's debian running on an IBM System/390 box. Very emulated one, but -still wonderful enough to keep around :) -

- -

-The following howto assumes, that you know at least a little bit of: -

    -
  • Debian installer on say i386 or x86_64
  • -
  • General networking knowledge
  • -
  • General Linux knowledge
  • -
-

- -

-The following software is required: -

    -
  • iptables - to NAT the emulated machine (or machines!)
  • -
  • ssh client
  • -
  • hercules - the emulator itself
  • -
-

- - - -

-First, let's set up a place to do all the work: -

- -
-$ mkdir zlinux
-$ cd zlinux
-$ mkdir dasd rdr prt
-
- -

-Wonderful. Now, let's get the images from which we will IPL (IPL stands for -Initial Program Load, and it is effectively the "boot" process). -

- -

-There are a number of distros that support S/390 hardware, but only one of -them is worth trying on any platform - -Debian :) -

- -

-So, point your browser to the mirror nearest you, navigate to this rather -long path: -

/debian/dists/Debian4.0r0/main/installer-s390/currentgeneric/
- -and grab these files: -
-initrd.debian
-kernel.debian
-parmfile.debian
-
-

- -

-Save them into the

rdr
directory. The first two files' names -gives away their contents - the first is an initrd, and the second is the -kernel image itself. The last file contains the kernel command line options, -which on systems like i386, you specify via a keyboard to the bootloader. -

- -

-Any serious emulator allows you to specify the exact system configuration -via a config file. Hercules is no exception. Save the following in -

zlinux/s390.cnf
or similar. -

- -
-CPUSERIAL 000069        # CPU serial number
-CPUMODEL  9672          # CPU model number
-MAINSIZE  256           # Main storage size in megabytes
-XPNDSIZE  0             # Expanded storage size in megabytes
-CNSLPORT  3270          # TCP port number to which consoles connect
-NUMCPU    2             # Number of CPUs
-LOADPARM  0120....      # IPL parameter
-OSTAILOR  LINUX         # OS tailoring
-PANRATE   SLOW          # Panel refresh rate (SLOW, FAST)
-ARCHMODE  ESAME         # Architecture mode ESA/390 or ESAME
-
-# .-----------------------Device number
-# |     .-----------------Device type
-# |     |       .---------File name and parameters
-# |     |       |
-# V     V       V
-#---    ----    --------------------
-
-# console
-001F    3270
-
-# terminal
-0009    3215
-
-# reader
-000C    3505    ./rdr/kernel.debian ./rdr/parmfile.debian ./rdr/initrd.debian autopad eof
-
-# printer
-000E    1403    ./prt/print00e.txt crlf
-
-# dasd
-0120    3390    ./dasd/3390.LINUX.0120
-0121    3390    ./dasd/3390.LINUX.0121
-
-# tape
-0581    3420
-
-# network                               s390     realbox
-0A00,0A01  CTCI -n /dev/net/tun -t 1500 10.1.1.2 10.1.1.1
-
- -

-The top part of the config file specifies the processor features, and the -bottom part specifies devices attached. Each device has a device number -(left more column), a device type (middle column), and optionally arguments -(right column). I'd suggest you read a bit of information from the Hercules -website or many other websites dedicated to the IBM System/390 and zSeries -architectures. It is just far too much to explain here. -

- -

-One thing to note, if your real hardware has only one core, you may want to -change the NUMCPU to 1. -

- -

-Another thing you may want to change is the last line, which defines a -Channel To Channel (CTC, see internet for description of what Channels are) -device which will be used as a network bridge to allow the virtual machine -access to the LAN and therefore the internet :) The first IP address is the -address that the virtual machine running s/390 linux will use, and the -second address is one which will be used by the real hardware. This means, -that the real box will have two IP addresses. Go ahead, and -use any valid addresses in the non-routable range -10.0.0.0/8 or 192.168.0.0/16 (this is not a networking guide, so go to the -net if you need help with it). Once we start the emulator, it will set up a -tun/tap device on the real box which will be connected to the ctc device -within S/390. -

- -

-Next step is to generate the DASD devices. DASD stands for Direct Access -Storage Device, and it is the S/390 name for very beefed up versions of -"disks". For details on how DASD works, see the internet. -

- -

-We defined two so called packs. The first, device number 120, will contain -the root file system, and the second, device 121, will contain your home -directory. Execute the following two commands in the dasd directory. Each -will create a file about 2.7GB in size. -

- -
-$ dasdinit -lfs 3390.LINUX.0120 3390-3 LIN120  # /
-$ dasdinit -lfs 3390.LINUX.0121 3390-3 LIN121  # /home
-
- -

-Congratulations! You are ready to start the emulator now. Since, the default -configuration on any reasonable Linux box will require you to be root to set -up tun/tap connections, let's start hercules as root with the config file: - -

-# hercules -f s390.cnf
-
-

- -

-You should see something that looks like this: -

- -Hercules console - -

-It is safe to ignore the "tun0: Operation not supported" message. -

- -

-Now, by default, the emulated network interface is not routed through, the -following commands will take care of things if you use 10.1.1.x IP addresses -as I do: - -

-# iptables -t nat -A POSTROUTING -o eth0 -s 10.1.1.0/24 -j MASQUERADE  
-# iptables -A FORWARD -s 10.1.1.0/24 -j ACCEPT
-# iptables -A FORWARD -d 10.1.1.0/24 -j ACCEPT
-# echo 1 > /proc/sys/net/ipv4/ip_forward
-# echo 1 > /proc/sys/net/ipv4/conf/all/proxy_arp
-
-

- -

-If for more information about the networking, look at any number of the -networking guides on the internet. -

- -

-Ok, now it is time to load the program - time to IPL! In Hercules, type -

ipl c
and press enter. This tells the emulator to start executing -the program from device
000C
which happens to be the card reader! -

- -

-Now you should see the Linux kernel booting - the installer to be exact :) -

- -

-Wait until you see: -

- - - -

-Wonderful! The installer is asking us to select the type of the network -interface. Select ctc (Channel to Channel - for description of what exactly -channels are, see plenty of other documentation on the subject) by typing: -

.1
Note, that the dot is important. Without the dot, anything you -type will be interpreted by Hercules (the emulator). The dot tells Hercules -to send the remainder of the string to the emulated system. -

- -

-Now, you have to define the end-points for this virtual network interface: -Select read ctc device:

.1
-

- -

-Select write ctc device:

.2
-

- -

-Select protocol - s/390:

.1
-

- -

-Now, enter the IP addresses for the end-points (must match the IP -addresses in the .cnf file). -

- -

-Enter s390 box IP:

.10.1.1.2
-

- -

-Enter host box IP:

.10.1.1.1
-

- - - -

-Enter DNS server IP - choose the same your non-virtual system uses (see -/etc/resolv.conf):

.x.x.x.x
-

- -

-Enter hostname:

.s390
-

- -

-Enter your domain name; to specify no domain name, you need to enter the empty -string, but due to the way Hercules handles input, you will need to enter a -dot followed by a space):

.home
-

- -

-Alright! Now, just sit back, and wait until your system generates a SSH key. -This will take a few minutes. -

- - - -

-Before long, the installer will ask you for a password for the remainder of -the install process, just enter anything:

.foo
-

- - - -

-Re-enter it to make sure. Yes, you can see the password in plain-text, but -the installer wants it anyway :) -

- -

-When you see -

- - - -

-you'll know you are on the right track! Now, open a new terminal, and ssh -into installer@10.1.1.2, if everything you did was right, ssh will ask you -for a password. -

- - - -

-Remember that you are using ssh which encrypts everything, and therefore -things will be slow. -

- -

-Once you enter the right password, a more familiar looking Debian installer -will start up: -

- - - -

-Select: start menu -

- -

-Select your country and a suitable mirror. -

- -

-Leave the proxy information blank unless you have some special proxy setup. -

- -

-Now you should see: -

- -, - -

-and shortly after, several installation components will get downloaded -

- - - -

-Just be patient and wait...or maybe go get some non-caffeinated beverage, -because chances are you've been sipping on that coffee/tea since the -beginning of the installation. :) -

- -

-Once everything is downloaded, you'll be presented with a config screen for -DASD: -

- - - -

-DASD is "Direct Access Storage Device" - yes Debian calls it -"Disk access storage device" oh well, they are wrong. -

- -

-You'll see two DASD packs, 0.0.0120 and 0.0.0121. The first will be used for -the system root and the second for your /home. -

- -

-Select the first, on the next screen, you'll be asked if you want to format -it, say yes. And wait :) this will generate a large amount of disk I/O, so -you may want to go get a cup of coffee, oh wait, I told you not to...damn :) -

- -

-When the formating completes, you'll get back to the DASD menu: -

- -, - -

-Select the other device (121), and format it as well. -

- -

-Once both volumes are formated, select "Finish". -

- -

-The following screen -

- - - -

-should seem familiar to anyone who installed Debian before and chose manual -partitioning. You want to create one partition on each DASD, both ext2 to -avoid "double-journaling", and save some clock cycles. -

- - - - - - - -

-Confirm the changes: -

- - - -

-Now the ext2 filesystems will get created on the DASD packs. -

- -

-Since we didn't define any swap space, the installer will ask us if we want -to go back to the partitioner, we don't want to go back because we know what -we are doing ;) -

- -

-The next few questions have to do with locale (country & timezone), so just -answer them to the best of your ability. -

- -

-The next question is the password for root - use something you'll remember -:) -

- -

-Following is a series of questions about creating a new user (non-root) -account, create yourself an account. -

- - - diff -r 341e24a1a316 -r e9b53c1db049 tail.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tail.html Wed Sep 12 23:21:24 2007 -0400 @@ -0,0 +1,4 @@ + +
+ +