Mercurial > docs > s390-linux
changeset 10:1d96f0b77f23
revamp of the build system + zvm-centos4 howto begining
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sun, 31 Aug 2008 18:56:26 -0400 |
parents | a590fc5fb55c |
children | 43f87a840ead |
files | .hgignore Makefile body-hercules-s390.html body-zvm-centos4.html body.html head-index.html head.html tail-index.html tail.html zvm-centos4/install1.png zvm-centos4/install2.png zvm-centos4/install3.png zvm-centos4/install5.png zvm-centos4/install7.png zvm-centos4/install8.png zvm-centos4/install9.png |
diffstat | 16 files changed, 721 insertions(+), 519 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Thu Jan 03 02:59:07 2008 -0500 +++ b/.hgignore Sun Aug 31 18:56:26 2008 -0400 @@ -1,1 +1,4 @@ -^s390\.html$ +^hercules-s390\.html$ +^zvm-centos4\.html$ +\.swp$ +^index\.html$
--- a/Makefile Thu Jan 03 02:59:07 2008 -0500 +++ b/Makefile Sun Aug 31 18:56:26 2008 -0400 @@ -1,11 +1,31 @@ SHORTLOG_LEN=1 -all: s390.html +HOWTOS=hercules-s390.html zvm-centos4.html + +COMMON=head.html tail.html + +all: $(HOWTOS) + +index.html: $(HOWTOS) head-index.html tail-index.html + cat head-index.html > $@ + echo "<h3><a href=\"zvm-centos4.html\">Installing CentOS 4.x under z/VM</a></h3>" >> $@ + echo "<h3><a href=\"hercules-s390.html\">Installing Debian under Hercules</a></h3>" >> $@ + sed -e 's/@@YEAR@@/2007-2008/g' < tail-index.html >> $@ -.PHONY: s390.html -s390.html: head.html body.html tail.html - cat head.html > $@ - hg log -l$(SHORTLOG_LEN) | sed -e 's/>/\>/g' -e 's/</\</g' >> $@ - cat body.html >> $@ - hg log | sed -e 's/>/\>/g' -e 's/</\</g' >> $@ - cat tail.html >> $@ +hercules-s390.html: body-hercules-s390.html $(COMMON) + sed -e 's/@@HEAD@@/Installing Debian under Hercules/g' < head.html > $@ + hg log -l$(SHORTLOG_LEN) body-hercules-s390.html | sed -e 's/>/\>/g' -e 's/</\</g' >> $@ + cat body-hercules-s390.html >> $@ + hg log body-hercules-s390.html | sed -e 's/>/\>/g' -e 's/</\</g' >> $@ + sed -e 's/@@YEAR@@/2007-2008/g' < tail.html >> $@ + +zvm-centos4.html: body-zvm-centos4.html $(COMMON) + sed -e 's/@@HEAD@@/Installing CentOS 4.x under z\/VM/g' < head.html > $@ + hg log -l$(SHORTLOG_LEN) body-zvm-centos4.html | sed -e 's/>/\>/g' -e 's/</\</g' >> $@ + cat body-zvm-centos4.html >> $@ + hg log body-zvm-centos4.html | sed -e 's/>/\>/g' -e 's/</\</g' >> $@ + sed -e 's/@@YEAR@@/2008/g' < tail.html >> $@ + +.PHONY: clean +clean: + rm -f $(HOWTOS)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/body-hercules-s390.html Sun Aug 31 18:56:26 2008 -0400 @@ -0,0 +1,507 @@ +</pre> +<hr> +<h2>Let's get started</h2> + +<p> +If you follow this HOWTO, at the end of it you'll have: +</p> + +<img src="hercules-s390/final-system.png" alt="Linux on S/390" /> + +<p> +Yes, that's debian running on an IBM System/390 box. Very emulated one, but +still wonderful enough to keep around :) +</p> + +<p> +The following howto assumes, that you know at least a little bit of: +<ul> + <li>Debian installer on say i386 or x86_64</li> + <li>General networking knowledge</li> + <li>General Linux knowledge</li> +</ul> +</p> + +<p> +The following software is required: +<ul> + <li>iptables - to NAT the emulated machine (or machines!)</li> + <li>ssh client</li> + <li>hercules - the emulator itself</li> +</ul> +</p> + +<p> +On my laptop (3.06GHz Pentium 4, 1GB RAM) the install take about 3 hours (2 +hours for minimal system, and about an hour extra for what Debian considers +some useful packages). The minimal install downloads about 66MB, and the +additional software is about 42MB on top of that. +</p> + +<!--more--> + +<p> +First, let's set up a place to do all the work: +</p> + +<pre> +$ mkdir zlinux +$ cd zlinux +$ mkdir dasd rdr prt +</pre> + +<p> +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). +</p> + +<p> +There are a number of distros that support S/390 hardware, but only one of +them is worth trying on any platform - +<a href="http://www.debian.org">Debian</a> :) +</p> + +<p> +So, point your browser to the mirror nearest you, navigate to this rather +long path: +<pre>/debian/dists/stable/main/installer-s390/current/images/generic/</pre> + +and grab these files: +<pre> +initrd.debian +kernel.debian +parmfile.debian +</pre> + +I used Debian 4.0r2 to write this howto, but a newer version should work +just as well. +</p> + +<p> +Save them into the <pre>rdr</pre> 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. +</p> + +<p> +Any serious emulator allows you to specify the exact system configuration +via a config file. Hercules is no exception. Save the following in +<pre>zlinux/s390.cnf</pre> or similar. +</p> + +<pre> +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 +</pre> + +<p> +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. +</p> + +<p> +One thing to note, if your real hardware has only one core, you may want to +change the NUMCPU to 1. +</p> + +<p> +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 <strong>two</strong> IP addresses. Go ahead, and +use any <strong>valid</strong> 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. +</p> + +<p> +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. +</p> + +<p> +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. +</p> + +<pre> +$ dasdinit -lfs -linux 3390.LINUX.0120 3390-3 LIN120 # / +$ dasdinit -lfs -linux 3390.LINUX.0121 3390-3 LIN121 # /home +</pre> + +<p> +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: + +<pre> +# hercules -f s390.cnf +</pre> +</p> + +<p> +You should see something that looks like this: +</p> + +<img src="hercules-s390/herc-console.png" alt="Hercules console" /> + +<p> +It is safe to ignore the "tun0: Operation not supported" message. +</p> + +<p> +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: + +<pre> +# 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 +</pre> +</p> + +<p> +If for more information about the networking, look at any number of the +networking guides on the internet. +</p> + +<p> +Ok, now it is time to load the program - time to IPL! In Hercules, type +<pre>ipl c</pre> and press enter. This tells the emulator to start executing +the program from device <pre>000C</pre> which happens to be the card reader! +</p> + +<p> +Now you should see the Linux kernel booting - the installer to be exact :) +</p> + +<p> +Wait until you see: +</p> + +<img src="hercules-s390/herc-installer-netdev.png" /> + +<p> +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: +<pre>.1</pre> 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. +</p> + +<p> +Now, you have to define the end-points for this virtual network interface: +Select read ctc device: <pre>.1</pre> +</p> + +<p> +Select write ctc device: <pre>.2</pre> +</p> + +<p> +Select protocol - s/390: <pre>.1</pre> +</p> + +<p> +Now, enter the IP addresses for the end-points (must match the IP +addresses in the .cnf file). +</p> + +<p> +Enter s390 box IP: <pre>.10.1.1.2</pre> +</p> + +<p> +Enter host box IP: <pre>.10.1.1.1</pre> +</p> + +<img src="hercules-s390/herc-installer-netdev-setup.png" /> + +<p> +Enter DNS server IP - choose the same your non-virtual system uses (see +/etc/resolv.conf): <pre>.x.x.x.x</pre> +</p> + +<p> +Enter hostname: <pre>.s390</pre> +</p> + +<p> +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): <pre>.home</pre> +</p> + +<p> +Alright! Now, just sit back, and wait until your system generates a SSH key. +This will take a few minutes. +</p> + +<img src="hercules-s390/herc-installer-ssh-keygen.png" /> + +<p> +Before long, the installer will ask you for a password for the remainder of +the install process, just enter anything: <pre>.foo</pre> +</p> + +<img src="hercules-s390/herc-installer-passwd.png" /> + +<p> +Re-enter it to make sure. Yes, you can see the password in plain-text, but +the installer wants it anyway :) +</p> + +<p> +When you see +</p> + +<img src="hercules-s390/herc-installer-phase1done.png" /> + +<p> +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. +</p> + +<img src="hercules-s390/ssh-passwd.png" /> + +<p> +Remember that you are using ssh which encrypts everything, and therefore +things will be slow. +</p> + +<p> +Once you enter the right password, a more familiar looking Debian installer +will start up: +</p> + +<img src="hercules-s390/ssh-menu1.png" /> + +<p> +Select: <strong>start menu</strong> +</p> + +<p> +Select your country and a suitable mirror. +</p> + +<p> +Leave the proxy information blank unless you have some special proxy setup. +</p> + +<p> +Now you should see: +</p> + +<img src="hercules-s390/ssh-download-release-file.png" />, + +<p> +and shortly after, several installation components will get downloaded +</p> + +<img src="hercules-s390/ssh-downloading-udebs.png" /> + +<p> +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. :) +</p> + +<p> +Once everything is downloaded, you'll be presented with a config screen for +DASD: +</p> + +<img src="hercules-s390/ssh-dasd1.png" /> + +<p> +DASD is "Direct Access Storage Device" - yes Debian calls it +"<strong>Disk</strong> access storage device" oh well, they are wrong. +</p> + +<p> +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. +</p> + +<p> +Select the first, on the next screen, you'll be asked if you want to format +it, say no. You'll get back to the DASD menu: +</p> + +<img src="hercules-s390/ssh-dasd2.png" />, + +<p> +Select the other device (121), and do not format it. (If you happen to say +yes to formating, all that'll do it waste a lot of your time doing IO. +However, nothing bad will happen.) +</p> + +<p> +Once both volumes are configured, select "Finish". +</p> + +<p> +The following screen +</p> + +<img src="hercules-s390/ssh-partition1.png" /> + +<p> +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. +</p> + +<img src="hercules-s390/ssh-partition2.png" /> + +<img src="hercules-s390/ssh-partition3.png" /> + +<img src="hercules-s390/ssh-partition4.png" /> + +<p> +Confirm the changes: +</p> + +<img src="hercules-s390/ssh-partition5.png" /> + +<p> +Now the ext2 filesystems will get created on the DASD packs. +</p> + +<p> +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 ;) +</p> + +<p> +The next few questions have to do with locale (country & timezone), so just +answer them to the best of your ability. +</p> + +<p> +The next question is the password for root - use something you'll remember +:) +</p> + +<p> +Following is a series of questions about creating a new user (non-root) +account; so create yourself an account. Once you finish, the installer will +spend quite some time installing all the packages. At the end, you will be +asked if you want to reboot your computer. Say that you do. When the system +stops, in the Hercules console, enter <pre>ipl 120</pre>. Now, wait a bit, +and after not too long, try to ssh into <strong>username@10.1.1.2</strong> +(where username is what you entered during the non-root user account +creation). You should get a shell. It is Linux. It is a mainframe. It is +<strong>yours</strong>. Have fun! :) +</p> + +<p> +When you've had enough fun for the day, just shutdown the Linux system +(halt, shutdown, whatever way you prefer), and then run <pre>quit</pre> in +the Hercules window. +</p> + +<p> +If you decide to play with a system you already installed, start Hercules: + +<pre># hercules -f s390.cnf</pre> + +Set up iptables: + +<pre> +# 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 +</pre> + +and IPL from device 120 (the system DASD): + +<pre>ipl 120</pre> + +When Linux starts up, you should be able to SSH in without any problems. +</p> + +<p> +The system you now have is running with a 31-bit kernel. If you want a +64-bit kernel, simply run: + +<pre> +# aptitude install kernel-image-2.6-s390x +</pre> + +This will install the right image, and set up zIPL (the bootloader) to do +the right thing. The original kernel image will remain installed, and you +can select it in the bootloader (right after you issue ipl on the Hercules +console). +</p> + +<h2>Final Note</h2> +<p> +I hope this HOWTO helped you get started with a mainframe of your own. I +tried to be as accurate and specific with the details where I thought it was +necessary - the S/390 specific parts. If you have any suggestions, or +comments (content, spelling, etc.) feel free to contact me via email: +<a href="mailto:jeffpc@josefsipek.net">jeffpc@josefsipek.net</a>. +</p> + +<hr> +<h2>Full history</h2> +<pre>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/body-zvm-centos4.html Sun Aug 31 18:56:26 2008 -0400 @@ -0,0 +1,165 @@ +</pre> +<hr> +<h2>Let's get started</h2> + +<p> +If you follow this HOWTO, at the end of it you'll have a 31-bit CENTOS 4.6 +running under z/VM. +</p> + +<p> +The following howto assumes, that you know at least a little bit of: +<ul> + <li>CentOS/RHEL familiarity</li> + <li>General networking knowledge</li> +</ul> +</p> + +<p> +The following software is required: +<ul> + <li>telnet client</li> + <li>3270 terminal emulator (e.g., c3270)</li> +</ul> +</p> + +<p> +The install can take anywhere from half hour to a couple of hours depending +on a couple of things, including your internet connection speed, as well as +how much CPU time your VM guest gets. +</p> + +<!--more--> + +<p> +First of all, you'll need to get the installation files to get things going. +</p> + +<p> +So, point your browser to the mirror nearest you, navigate to this rather +long path: +<pre>XXX</pre> + +and grab these files: +<pre> +redhat.exec +kernel.img +initrd.img +generic.prm +</pre> + +I used CentOS 4.6 to write this howto, but a newer version should work just +as well. +</p> + +<p> +Login to your VM id, and start CMS <pre>ipl cms</pre>. Then transfer the +files you got to your A minidisk. You can either use FTP, or IND$FILE +through your 3270 terminal emulator. I used the IND$FILE method via c3270.<br/> +<br/> +<b>Note:</b> The .img files should be transfered as binaries, and the other two +need to be converted to EBCDIC. Both, FTP and IND$FILE support converting +between ASCII and EBCDIC. + +<pre> +transfer host=vm ... mode=binary localfile=kernel.img "hostfile=kernel img a" +transfer host=vm ... mode=binary localfile=initrd.img "hostfile=initrd img a" +transfer host=vm ... mode=ascii localfile=redhat.exec "hostfile=redhat exec a" +transfer host=vm ... mode=ascii localfile=generic.prm "hostfile=generic prm a" +</pre> + +As one might easily guess, the first is the kernel image, and the second is +the initrd. The third file is a short REXX script that'll punch the files in +the proper order to your rdr, and then IPLs from device 000c - which by +convention is your rdr. The last file contains the kernel command line +options, which on systems like i386, you specify via a keyboard to the +bootloader. +</p> + +<p> +At this point, your CMS A minidisk should look like something like +this:<br/> +<img src="zvm-centos4/install1.png" alt="CMS listing the files on A" /><br/> +<br/> +The RHEL5.CONF file contains configuration options for the installer. +<pre> +FIXME: example conf file +</pre> +</p> + +<p> +Now, it is time to run the REXX script. Just type <pre>redhat</pre> and +press enter. You'll see the reader getting purged, and then three files +getting punched:<br/> +<img src="zvm-centos4/install2.png" alt="Files punched to RDR" /> +</p> + +<p> +FIXME: do I need to IPL by hand?<br/> +Shortly after, you'll see the kernel banner displayed. Since I installed +CentOS 4.x, the kernel version is 2.6.9. If you use 5.x, the version will be +obviously different.<br/> +<img src="zvm-centos4/install3.png" alt="Kernel banner" /> +</p> + +<p> +After a few screen-fulls of output, you should be prompted for ... FIXME. +FIXME: Include a screenshot. +</p> + +<p> +Some more scrolling later, you'll see a message prompting you to telnet or +ssh into the system, and continue with the installation process:<br/> +<img src="zvm-centos4/install5.png" alt="SSH/telnet prompt" /><br/> +SSH or telnet in as root. The password is the empty string, so when +prompted, simply press the enter key.<br/> +<br/> +At this point, the install process is much like network install on any other +architecture. +</p> + +<p> +The regular CentOS installer will kicks. It'll prompt you for the type of +install (http, ftp, nfs - FIXME: verify + image). I went with HTTP.<br/> +<br/> +The next screen prompts you for the hostname and path on the HTTP server +that contains the CentOS packages:<br/> +<img src="zvm-centos4/install7.png" alt="SSH/telnet prompt" /><br/> +Right after, the installer tries to grab stage 2 of itself: +<img src="zvm-centos4/install8.png" alt="Stage2 being downloaded" /><br/> +</p> + +<p> +FIXME: partitions +</p> + +<p> +Most of the questions the installer normally asks you get answered by the +options in the RHEL5.CONF file (FIXME: rename). And before long, you'll see +the install process doing its thing:<br/> +<img src="zvm-centos4/install9.png" alt="Install!" /> +</p> + +<p> +Although this howto was aimed at 31-bit CentOS...<br/> +<ul> + <li> installing a 64-bit version should be the same process...just + use the <i>s390x</i> directories on the mirror instead of + <i>s390</i>.</li> + <li> installing RHEL 4.x should be the same process; just point the + installer at a server with RHEL4 RPMS.</li> +</ul> +</p> + +<h2>Final Note</h2> +<p> +I hope this HOWTO helped you get started with CentOS under z/VM. I tried to +be as accurate and specific with the details where I thought it was +necessary - the S/390 specific parts. If you have any suggestions, or +comments (content, spelling, etc.) feel free to contact me via email: +<a href="mailto:jeffpc@josefsipek.net">jeffpc@josefsipek.net</a>. +</p> + +<hr> +<h2>Full history</h2> +<pre>
--- a/body.html Thu Jan 03 02:59:07 2008 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,507 +0,0 @@ -</pre> -<hr> -<h2>Let's get started</h2> - -<p> -If you follow this HOWTO, at the end of it you'll have: -</p> - -<img src="hercules-s390/final-system.png" alt="Linux on S/390" /> - -<p> -Yes, that's debian running on an IBM System/390 box. Very emulated one, but -still wonderful enough to keep around :) -</p> - -<p> -The following howto assumes, that you know at least a little bit of: -<ul> - <li>Debian installer on say i386 or x86_64</li> - <li>General networking knowledge</li> - <li>General Linux knowledge</li> -</ul> -</p> - -<p> -The following software is required: -<ul> - <li>iptables - to NAT the emulated machine (or machines!)</li> - <li>ssh client</li> - <li>hercules - the emulator itself</li> -</ul> -</p> - -<p> -On my laptop (3.06GHz Pentium 4, 1GB RAM) the install take about 3 hours (2 -hours for minimal system, and about an hour extra for what Debian considers -some useful packages). The minimal install downloads about 66MB, and the -additional software is about 42MB on top of that. -</p> - -<!--more--> - -<p> -First, let's set up a place to do all the work: -</p> - -<pre> -$ mkdir zlinux -$ cd zlinux -$ mkdir dasd rdr prt -</pre> - -<p> -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). -</p> - -<p> -There are a number of distros that support S/390 hardware, but only one of -them is worth trying on any platform - -<a href="http://www.debian.org">Debian</a> :) -</p> - -<p> -So, point your browser to the mirror nearest you, navigate to this rather -long path: -<pre>/debian/dists/stable/main/installer-s390/current/images/generic/</pre> - -and grab these files: -<pre> -initrd.debian -kernel.debian -parmfile.debian -</pre> - -I used Debian 4.0r2 to write this howto, but a newer version should work -just as well. -</p> - -<p> -Save them into the <pre>rdr</pre> 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. -</p> - -<p> -Any serious emulator allows you to specify the exact system configuration -via a config file. Hercules is no exception. Save the following in -<pre>zlinux/s390.cnf</pre> or similar. -</p> - -<pre> -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 -</pre> - -<p> -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. -</p> - -<p> -One thing to note, if your real hardware has only one core, you may want to -change the NUMCPU to 1. -</p> - -<p> -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 <strong>two</strong> IP addresses. Go ahead, and -use any <strong>valid</strong> 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. -</p> - -<p> -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. -</p> - -<p> -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. -</p> - -<pre> -$ dasdinit -lfs -linux 3390.LINUX.0120 3390-3 LIN120 # / -$ dasdinit -lfs -linux 3390.LINUX.0121 3390-3 LIN121 # /home -</pre> - -<p> -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: - -<pre> -# hercules -f s390.cnf -</pre> -</p> - -<p> -You should see something that looks like this: -</p> - -<img src="hercules-s390/herc-console.png" alt="Hercules console" /> - -<p> -It is safe to ignore the "tun0: Operation not supported" message. -</p> - -<p> -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: - -<pre> -# 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 -</pre> -</p> - -<p> -If for more information about the networking, look at any number of the -networking guides on the internet. -</p> - -<p> -Ok, now it is time to load the program - time to IPL! In Hercules, type -<pre>ipl c</pre> and press enter. This tells the emulator to start executing -the program from device <pre>000C</pre> which happens to be the card reader! -</p> - -<p> -Now you should see the Linux kernel booting - the installer to be exact :) -</p> - -<p> -Wait until you see: -</p> - -<img src="hercules-s390/herc-installer-netdev.png" /> - -<p> -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: -<pre>.1</pre> 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. -</p> - -<p> -Now, you have to define the end-points for this virtual network interface: -Select read ctc device: <pre>.1</pre> -</p> - -<p> -Select write ctc device: <pre>.2</pre> -</p> - -<p> -Select protocol - s/390: <pre>.1</pre> -</p> - -<p> -Now, enter the IP addresses for the end-points (must match the IP -addresses in the .cnf file). -</p> - -<p> -Enter s390 box IP: <pre>.10.1.1.2</pre> -</p> - -<p> -Enter host box IP: <pre>.10.1.1.1</pre> -</p> - -<img src="hercules-s390/herc-installer-netdev-setup.png" /> - -<p> -Enter DNS server IP - choose the same your non-virtual system uses (see -/etc/resolv.conf): <pre>.x.x.x.x</pre> -</p> - -<p> -Enter hostname: <pre>.s390</pre> -</p> - -<p> -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): <pre>.home</pre> -</p> - -<p> -Alright! Now, just sit back, and wait until your system generates a SSH key. -This will take a few minutes. -</p> - -<img src="hercules-s390/herc-installer-ssh-keygen.png" /> - -<p> -Before long, the installer will ask you for a password for the remainder of -the install process, just enter anything: <pre>.foo</pre> -</p> - -<img src="hercules-s390/herc-installer-passwd.png" /> - -<p> -Re-enter it to make sure. Yes, you can see the password in plain-text, but -the installer wants it anyway :) -</p> - -<p> -When you see -</p> - -<img src="hercules-s390/herc-installer-phase1done.png" /> - -<p> -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. -</p> - -<img src="hercules-s390/ssh-passwd.png" /> - -<p> -Remember that you are using ssh which encrypts everything, and therefore -things will be slow. -</p> - -<p> -Once you enter the right password, a more familiar looking Debian installer -will start up: -</p> - -<img src="hercules-s390/ssh-menu1.png" /> - -<p> -Select: <strong>start menu</strong> -</p> - -<p> -Select your country and a suitable mirror. -</p> - -<p> -Leave the proxy information blank unless you have some special proxy setup. -</p> - -<p> -Now you should see: -</p> - -<img src="hercules-s390/ssh-download-release-file.png" />, - -<p> -and shortly after, several installation components will get downloaded -</p> - -<img src="hercules-s390/ssh-downloading-udebs.png" /> - -<p> -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. :) -</p> - -<p> -Once everything is downloaded, you'll be presented with a config screen for -DASD: -</p> - -<img src="hercules-s390/ssh-dasd1.png" /> - -<p> -DASD is "Direct Access Storage Device" - yes Debian calls it -"<strong>Disk</strong> access storage device" oh well, they are wrong. -</p> - -<p> -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. -</p> - -<p> -Select the first, on the next screen, you'll be asked if you want to format -it, say no. You'll get back to the DASD menu: -</p> - -<img src="hercules-s390/ssh-dasd2.png" />, - -<p> -Select the other device (121), and do not format it. (If you happen to say -yes to formating, all that'll do it waste a lot of your time doing IO. -However, nothing bad will happen.) -</p> - -<p> -Once both volumes are configured, select "Finish". -</p> - -<p> -The following screen -</p> - -<img src="hercules-s390/ssh-partition1.png" /> - -<p> -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. -</p> - -<img src="hercules-s390/ssh-partition2.png" /> - -<img src="hercules-s390/ssh-partition3.png" /> - -<img src="hercules-s390/ssh-partition4.png" /> - -<p> -Confirm the changes: -</p> - -<img src="hercules-s390/ssh-partition5.png" /> - -<p> -Now the ext2 filesystems will get created on the DASD packs. -</p> - -<p> -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 ;) -</p> - -<p> -The next few questions have to do with locale (country & timezone), so just -answer them to the best of your ability. -</p> - -<p> -The next question is the password for root - use something you'll remember -:) -</p> - -<p> -Following is a series of questions about creating a new user (non-root) -account; so create yourself an account. Once you finish, the installer will -spend quite some time installing all the packages. At the end, you will be -asked if you want to reboot your computer. Say that you do. When the system -stops, in the Hercules console, enter <pre>ipl 120</pre>. Now, wait a bit, -and after not too long, try to ssh into <strong>username@10.1.1.2</strong> -(where username is what you entered during the non-root user account -creation). You should get a shell. It is Linux. It is a mainframe. It is -<strong>yours</strong>. Have fun! :) -</p> - -<p> -When you've had enough fun for the day, just shutdown the Linux system -(halt, shutdown, whatever way you prefer), and then run <pre>quit</pre> in -the Hercules window. -</p> - -<p> -If you decide to play with a system you already installed, start Hercules: - -<pre># hercules -f s390.cnf</pre> - -Set up iptables: - -<pre> -# 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 -</pre> - -and IPL from device 120 (the system DASD): - -<pre>ipl 120</pre> - -When Linux starts up, you should be able to SSH in without any problems. -</p> - -<p> -The system you now have is running with a 31-bit kernel. If you want a -64-bit kernel, simply run: - -<pre> -# aptitude install kernel-image-2.6-s390x -</pre> - -This will install the right image, and set up zIPL (the bootloader) to do -the right thing. The original kernel image will remain installed, and you -can select it in the bootloader (right after you issue ipl on the Hercules -console). -</p> - -<h2>Final Note</h2> -<p> -I hope this HOWTO helped you get started with a mainframe of your own. I -tried to be as accurate and specific with the details where I thought it was -necessary - the S/390 specific parts. If you have any suggestions, or -comments (content, spelling, etc.) feel free to contact me via email: -<a href="mailto:jeffpc@josefsipek.net">jeffpc@josefsipek.net</a>. -</p> - -<hr> -<h2>Full history</h2> -<pre>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/head-index.html Sun Aug 31 18:56:26 2008 -0400 @@ -0,0 +1,6 @@ +<html> +<head> + <title>Linux on s/390 HOWTOs</title> +</head> +<body> +<h1>Linux on s/390 HOWTOs</h1>
--- a/head.html Thu Jan 03 02:59:07 2008 -0500 +++ b/head.html Sun Aug 31 18:56:26 2008 -0400 @@ -1,9 +1,9 @@ <html> <head> - <title>Installing Debian under Hercules</title> + <title>@@HEAD@@</title> </head> <body> -<h1>Installing Debian under Hercules</h1> +<h1>@@HEAD@@</h1> <h2>Changes since last version</h2> <pre>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tail-index.html Sun Aug 31 18:56:26 2008 -0400 @@ -0,0 +1,8 @@ +<p> +If you have any suggestions, or comments (content, spelling, etc.) feel free +to contact me via email: <a href="mailto:jeffpc@josefsipek.net">jeffpc@josefsipek.net</a>. +</p> +<hr> +Copyright ©@@YEAR@@ Josef "Jeff" Sipek <jeffpc@josefsipek.net> +</body> +</html>
--- a/tail.html Thu Jan 03 02:59:07 2008 -0500 +++ b/tail.html Sun Aug 31 18:56:26 2008 -0400 @@ -1,6 +1,6 @@ </pre> <hr> -Copyright ©2007 Josef "Jeff" Sipek <jeffpc@josefsipek.net> +Copyright ©@@YEAR@@ Josef "Jeff" Sipek <jeffpc@josefsipek.net> </body> </html>