zLinux on HERCULES: First installation
Home Rafael Pereira Tercero
   rptv2003@yahoo.com Español   

Stand-alone programs
IPL from CD
IBM 1401
zLinux on Hercules
PGP public key

zLinux ThinkBlue64 on Hercules:
Installation and Configuration


Hardware used:

    Machine "ubieta":   Workstation Intel Pentium III, 800MHz, 128MB memory.

Software used:

    Linux i386:         Debian GNU/Linux v3.0r1 / kernel 2.4.18
    Hercules:           v3.01
    HTTP server:	Apache/1.3.26
    zLinux:             ThinkBlue64-7.1a


First of all, I define user zlinux and group zlinux in my PC.


The installation of zLinux ThinkBlue requieres a TCP/IP communication line between the zSeries machine we will install zLinux in and the machine in which we have the rpm packages to install.

In my case, the rpm packages are accessible from the CD reader in the Intel machine ubieta. In this machine I have Debian GNU/Linux v3.0r1, with kernel 2.4.18-14, and Hercules 3.01 installed. This Hercules, which emulates a machine with ESAME architecture (z/Architecture), will be the "machine" I will install zLinux in. I will name the emulated zSeries machine dino.

VIRTUAL CONFIGURATION +-----+ +----| | | | | +----+ | | |51 1| | | | |------------------|____| | | | 192.168.50.* /______\ +----+-----+ ubieta dino IBM zSeries 2064 (emulated by Hercules) Intel Pentium III +------------------+ +------------------+ | | | | | +----+51 192.168.50.* 1+----+ | | |ctc0|-------------------------|tun0| | | +----+ +----+ | | | | | | | | | |zLinux (ThinkBlue)| |GNU/Linux (Debian)| +------------------+ +------------------+ dino ubieta
REAL CONFIGURATION +----+ | | |____| /______\ ubieta +-------------------------------------------------+ | | | +-------------------------------------------+ | | | +--------------------------------------+ | | | | | zLinux, ThinkBlue64-7.1a, | | | | | | kernel 2.4.7 | | | | | +--+------+----------------------------+ | | | | | ctc0 | | | | | +------+ | | | | | (zSeries 2064: dino) | | | | +------+ | | | | | 3088 | H E R C U L E S | | | +----+------+-------------------------------+ | | | | | | | | +--------------+ +------+ | | | /dev/net/tun |--------------------| tun0 | | | ++--------------+--------------------+------+-+ | | | GNU/Linux, Debian v3.0r1, kernel 2.4.18 | | | +---------------------------------------------+ | | | +-------------------------------------------------+ Pentium III: ubieta

The real machine ubieta and the virtual machine dino communicate with each other through the TUN/TAP driver of the Linux kernel.

Initially I did not have the TUN/TAP driver configured in the kernel, so the first thing to do was to recompile the kernel including the option:

    Universal TUN/TAP device driver support (CONFIG_TUN)

Next, to define the /dev/net/tun device:

    # mkdir /dev/net
    # mknod -m 660 /dev/net/tun c 10 200 && chgrp zlinux /dev/net/tun

And, finally, to modify the permission bits of program hercifc. Following the installation of HERCULES I had it defined with:

    owner:           installer
    group:           staff
    permission bits: 0755, without SETUID

I modify it, so that it is root-SETUID:

    chown root:zlinux /usr/local/bin/hercifc && chmod 4750 /usr/local/bin/hercifc 

The IP addresses used for the virtual net established through the TUN/TAP driver are the following:


In order to be able to access the virtual machine dino by name, I define an entry for it in [ubieta]/etc/hosts:    dino


I prepare the HERCULES configuration in the home directory of user zlinux:

    login zlinux
    mkdir dino && cd dino
    mkdir conf discos

The conf directory is to contain the zlinux.conf configuration file. Getting rid of the comments, the content of the zlinux.conf file is the following:

    CPUSERIAL 000069        # CPU serial number
    CPUMODEL  2064          # CPU model number
    MAINSIZE  64            # Main storage size in megabytes
    XPNDSIZE  0             # Expanded storage size in megabytes
    CNSLPORT  3270          # TCP port to which consoles connect
    NUMCPU    1             # Number of CPUs
    LOADPARM  0120....      # IPL parameter
    OSTAILOR  LINUX         # OS tailoring
    PANRATE   FAST          # Panel refresh rate
    ARCHMODE  ESAME         # z/Architecture

    0120    3390    discos/root.0120.z
    0121    3390    discos/swap.0121.z
    0E20    3088    CTCI

I define two 3390 dasds. One for the zLinux software, sized 1,200 cylinders, and the other to be used for swap, sized 20 cylinders:

    cd discos
    dasdinit -z root.0120.z 3390 ROOT 1200
    dasdinit -z swap.0121.z 3390 SWAP 20


I make the content of CD-1 of ThinkBlue64-7.1a accessible via http:

    I insert CD-1 of ThinkBlue64-7.1a into the CD reader.
    # mount -t iso9660 /dev/cdrom /cdrom
    # ln -s /cdrom /var/www/cdrom          (my Apache server serves pages from
                                            the /var/www directory)

I begin the installation. I will use two console sessions. To make clear which commands are issued from one session and which from the other, "0:" will be prefixed to the commands issued from the HERCULES console, and "1:" to those issued from the other console:

    0:login zlinux
    0:cd dino
    0:hercules -f conf/zlinux.conf
    0:ipl /cdrom/think0.ins
    0:Enter FQDN
        .dino        (the prefixed dot is important when issuing Linux
                      commands from the Hercules console).
    0:Enter network device
    0:Enter IP address of virtual machine
    0:Enter IP address of point-to-point partner
    0:CTC Device address:

    1:login zlinux
    1:telnet dino
    1:Enter DASD range
    1:Choose DASDs to format
        [*] force lowlevel-dasdformat
	[*] /dev/dasda
	[*] /dev/dasdb
      Note: this step takes about 7min.
    1:Mount points:
	dasda1 /
    1:Network setup:
	full hostname: dino
	domain name search list: dino
	IP of DNS server:
    1:Package source:

      Note: this step takes about 3.5 hours. It is the time needed to install
            a total of 344 rpm packages: dino-rpmlist.txt

    1:root password:

       You have sucessfully installed Think Blue 64 Linux for zSeries !
       Next, ipl your linux user in vm or your linux LPAR
       No controlled shutdown is needed at this point



After the installation the size of the root disk is about 200MB. I want to keep the root disk as it is now, so I make it read-only and I define shadow file for it in the conf/zlinux.conf configuration file.

    cd $HOME/dino/discos
    chmod 440 root.0120.z

I modify the definition for device 0120 in zlinux.conf:

    0120    3390    discos/root.0120.z sf=discos/root_1.0120.z

Now, I boot the zLinux system just generated at unit 0120:

    0:cd $HOME/dino

    0:hercules -f conf/zlinux.conf
    0:ipl 0120

	   The dino-boot.txt file contains some boot messages.

    1:login zlinux
    1:rlogin root@dino

I activate the swap partition:

    1:mkswap /dev/dasdb1
    1:swapon /dev/dasdb1
    1:cp -p /etc/fstab /etc/fstab.ORIG
    1:I append to /etc/fstab:
        /dev/dasdb1  none    swap    sw    0    0

I update /etc/hosts and activate the ftp server:

    1:cp -p /etc/hosts /etc/hosts.ORIG
    1:I append to /etc/hosts:    ubieta    ubieta

    1:cp -p /etc/xinetd.d/wu-ftpd /etc/xinetd.d/wu-ftpd.ORIG
    1:I update in /etc/xinetd.d/wu-ftpd:
        disable = no

    1:I get the pid of xinetd, using ps
    1:kill -s USR1 pid-of-xinetd

I define a group and a user with no special privileges: zlinux. The gid and uid are the same that I have used for group zlinux and user zlinux in the "ubieta" machine:

    1:groupadd -g 510 zlinux
    1:useradd -g zlinux -m -u 1001 zlinux
    1:passwd zlinux

From this point on, I have a working zLinux at "dino" and I can access to it both using rlogin and ftp.


HERCULES: http://www.hercules-390.org/
zLinux Info: http://linuxvm.org/
Linux/390 on Hercules: http://linuxvm.org/penguinvm/hercules/
zLinux ThinkBlue64: http://linux.zseries.org