Menu contextuel

Aller au menu principal - Aller au contenu

Contenu de la page

Aller au menu contextuel - Aller au menu principal

Debian GNU/Linux Woody (3.0) on an IBM iSeries

This document was originally written in french, the translation could be bad. Menus labels were in french, and translated; you could see menu labels different from what is in this document.

Glossary

Partition
Virtual machine hosting an operating system
Primary partition
Partition working with OS400, allowing to manage the AS400
Network server
Partition boot system

Linux on iSeries partition creation procedure

A partition creation is made via the primary partition. About the described manipulations, please refer to the next chapters

  1. Partition definition : STRSST command; to be precised :
    • partition name,
    • allocated CPU :
      • CPU number,
      • CPU percentage (0.0 to 1.0),
    • allocated RAM size ;
  2. Storage space, to be created :
    • define a name,
    • allocated size (MB),
    • origin storage space: *NONE,
    • format: *OPEN ;
  3. Join the storage to the server, option 10 in the storage menu ;
  4. Network server description :
    • name,
    • reference to the partition,
    • reference to the storage,
    • booting instructions,
      • file stored in the OS400 partition,
      • booting on the first partition of the space, of type prepboot ;
  5. You can also attribute hardware. Not explained here.

Services access

Primary partition usage

To connect to the primary partition, use a 5250 terminal emulator 1 or the local console. The admin user is QSECOFR.

[1]by example TN5250

Partitions access

To access partitions (virtual console), you need to access in telnet on port 2301 of the primary partition.

Use preferabley a special (specific)user to connect to the Linux virtual console.

Procedure mainline

Partition creation

service tools can be accessed with the STRSST command. Next, the "Work with system partitions" menu allows to manage partitions

  • in the service tools, choose option 5: "Create a new partition" ;
  • Select environment 2, "Guest" ;
    • Partition identifier and name : number and name of partition ;
    • Number of partition processors : processors allocated to the partition ;
    • Use shared processor pool : answer "1", Yes ;
    • Shared processor pool units : Option between "0.00" and "1.00" ;
    • Size of partition main storage : allocated RAM.

Define a network server

A network server is the logic representation of a partition in the iSeries. The WRKNWSD command allows to enter in the network servers description management screen. This menu allows to create the network server in order to use the created partition.

Informations to provide are :

  • network server name ;
  • ressource name : *NONE ;
  • associated partition ;
  • network server type (*GUEST)

Next, configuration of the new network server is possible.

  • "On line @ IPL" : start the partition at machine power on ;
  • "Codepage" : use "437" ;
  • "IPL source" : from which "device" to boot :
    • *NWSSTG : start the storage space on the storage space (prepboot partition),
    • *STMF : stream file from IPL = file stored on the AS400 disk ; the file is to be specified in "IPL STREAM File".
  • "IPL parameters" : command line (root=/dev/... for example)

In this menu, option 8 allows to manage partitions start/stop.

Storage space definition

Menu dedicated to storage spaces is shown with the WRKNWSSTG command. Next, to create a storage, use command "1".

Informations to be provided are :

  • storage space name ;
  • size to provide to this space (MB) ;
  • origin space (*NONE) ;
  • format (*OPEN).

You need next to associate the space to the created partition, with command 10 : "Add link".

Debian installation

Debian installer doesn't exist on the PowerPC 64 architecture.

First step is to create an installation system : prepare a Linux kernel for this installation.

Compile a kernel

Cross-compilation chain

On the Linux on PPC64 website, "Toolchain" menu, download "crosstool". Untar it and do the following

wget http://kegel.com/crosstool/crosstool-0.28-rc25.tar.gz
tar zxf crosstool-0.28-rc25.tar.gz
cd crosstool-0.28-rc25
su root -c mkdir /opt/crosstool
su root -c chown xxx /opt/crosstool
(export ftp_proxy="http://x.x.x.x:3128")
sh demo-ppc970.sh 

Or

wget http://kegel.com/crosstool/crosstool-0.28-rc25.tar.gz
tar zxf crosstool-0.28-rc25.tar.gz
cd crosstool-0.28-rc25
# Edit demo-ppc970.sh, modify ``RESULT_TOP``, and maybe ``TARBALLS_DIR``
(export ftp_proxy="http://x.x.x.x:3128")
sh demo-ppc970.sh 

These commands create the needed tools to compile the kernel for the target architecture.

Linux 2.6

The following steps are needod for kernel compilation in version 2.6

cd ~/downloads
tar jxf linux-2.6.6.tar.bz2
cd linux-2.6.6
vi Makefile
## Modify the following lines :
# ARCH=ppc64
# CROSS_COMPILE=powerpc64-unknown-linux-gnu-
make menuconfig
# Sélect the right options, mainly in the iSeries-specific menu
# Everything "hard-compiled", no module
PATH=$PATH:/opt/crosstool/powerpc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/bin/
make vmlinux

Linux 2.4

A Linux 2.4 kernel is also usable. You need to download a vanilla version, and then

tar jxf linux-2.4.xx.tar.bz2
cd linux-2.4.xx
vi Makefile
## Modify the following lines :
# ARCH=ppc64
# CROSS_COMPILE=powerpc64-unknown-linux-gnu-
make menuconfig
# Sélect the right options, mainly in the iSeries-specific menu
PATH=$PATH:/opt/crosstool/powerpc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/bin/
make vmlinux modules

Prépare an installation system

The documentation was made to create an installation image from a x86 machine, cross-compiling. The image creation doesn't work on this machine, that's why it's redone, at the end, on a, iSeries Linux already installed.

Kernel

A kernel boot image is creating, by adding its System.map

#cd arch/ppc64/boot
#gcc -o addRamDisk addRamdisk.c
#gcc -o addSystemMap addSystemMap.c

mkdir /tmp/boottarget
#cp addRamDisk addSystemMap /tmp/boottarget
#cd ../../..
cp System.map /tmp/boottarget
cp vmlinux /tmp/boottarget

Modules

This kernel modules are installed in a temporary space

mkdir /tmp/boottarget/modules
make INSTALL_MOD_PATH=/tmp/boottarget/modules/ modules_install

cd /tmp/boottarget
#./addSystemMap System.map vmlinux vmlinux.sysmap

Boot file

A file is created, boot image, like a floppy disk...

First, the necessary files are downloaded

wget http://ftp.fr.debian.org/debian/dists/woody/main/disks-powerpc/base-images-current/basedebs.tar
wget http://ftp.fr.debian.org/debian/dists/woody/main/disks-powerpc/3.0.23-2002-05-21/prep/images-1.44/root.bin
mv root.bin root.bin.gz
gunzip root.bin.gz

Next, a new (40 MB) boot image is created

su

# Temp directory
mkdir /tmp/rootbin
mkdir /tmp/ppc64tmp


# Base system
mount -o loop root.bin /tmp/rootbin
cp -a /tmp/rootbin/* /tmp/ppc64tmp/
umount /tmp/rootbin

# /dev entries
mkdir /tmp/ppc64tmp/dev/iseries
cd /tmp/ppc64tmp/dev/iseries
mknod vda b 112 0
mknod vda1 b 112 1
mknod vda2 b 112 2
mknod vda3 b 112 3
mknod vda4 b 112 4
mknod vda5 b 112 5
mknod vda6 b 112 6
mknod vda7 b 112 7
mknod vdb b 112 8
mknod vdb1 b 112 9
mknod vdb2 b 112 10
mknod vdb3 b 112 11
mknod vdb4 b 112 12
mknod vdb5 b 112 13
mknod vdb6 b 112 14
mknod vdb7 b 112 15
mknod vdc b 112 16
mknod vdc1 b 112 17
mknod vdc2 b 112 18
mknod vdc3 b 112 19
mknod vdc4 b 112 20
mknod vdc5 b 112 21
mknod vdc6 b 112 22
mknod vdc7 b 112 23
mknod vdd b 112 24
mknod vdd1 b 112 25
mknod vdd2 b 112 26
mknod vdd3 b 112 27
mknod vdd4 b 112 28
mknod vdd5 b 112 29
mknod vdd6 b 112 30
mknod vdd7 b 112 31
mknod vcda b 113 0
mknod vcdb b 113 1
mknod vtty0 c 229 0
mknod vtty1 c 229 1
mknod vt0 c 230 0
mknod vt1 c 230 1
cd -

# I prefer Bash
wget http://ftp.fr.debian.org/debian/pool/main/b/base-files/base-files_3.0.2_powerpc.deb
wget http://ftp.fr.debian.org/debian/pool/main/b/bash/bash_2.05a-11_powerpc.deb
wget http://ftp.fr.debian.org/debian/pool/main/b/base-passwd/base-passwd_3.4.1_powerpc.deb
wget http://ftp.fr.debian.org/debian/pool/main/d/debianutils/debianutils_1.16.2woody1_powerpc.deb
wget http://ftp.fr.debian.org/debian/pool/main/g/gawk/gawk_3.1.0-3_powerpc.deb
wget http://security.debian.org/debian-security/pool/updates/main/g/glibc/libc6_2.2.5-11.5_powerpc.deb
(LIBNCURSES5 ?)
wget http://ftp.fr.debian.org/debian/pool/main/n/nvi/nvi_1.79-20_powerpc.deb
alien -t *.deb

cd /tmp/ppc64tmp
for i in /tmp/boottarget/*.tgz
do
 tar zxf $i
done

# Unnecessary files are removed (or the image will be too large)
rm release_notes.*
rm -fr usr/share/doc/
rm unifont-reduced.bgf
rm etc/messages.*
rm -fr usr/share/zoneinfo/

# Correct link for "vi"
cd usr/bin
rm vi
ln -s nvi vi
cd ../..

# Boot script
cd sbin
mv init init.old
vi init
#### Shellscript containing:
#
# #!/bin/ash
# echo "Welcome to the Adelux iSeries Debian installer"
# mount -t proc proc /proc
# /bin/bash
####
chmod a+x init
cd ..

# Kernel modules copy
cp -a /tmp/boottarget/modules/lib/* lib/


# Boot image creation
cd /tmp/boottarget
dd if=/dev/zero of=ppc64.bin bs=10M count=2
mkfs.ext2 ppc64.bin
  y
mkdir /tmp/ppc64
mount -o loop ppc64.bin /tmp/ppc64
cp -a /tmp/ppc64tmp/* /tmp/ppc64/
umount /tmp/ppc64

gzip ppc64.bin
#./addRamDisk ppc64.bin.gz System.map vmlinux.sysmap iseries_debian_installer.img

Image creation on an iSeries

Because image creation on the compilation machine (x86) doesn't work, it's done on an alreeady installed Linux on an iSeries.

  1. vmlinux, System.map and ppc64.bin.gz files are copied on a Linux iSeries
  2. addSystemMap64 System.map vmlinux vmlinux.sysmap
  3. addRamDisk64 ppc64.bin.gz System.map vmlinux.sysmap iseries_deb_install.img

Installation preparation

The installation file is uploaded on the OS400 via FTP, and the Linux partition to install is configured to boot on a stream file, the downloaded file.

The network server is then booted, option 8 in the network servers definition menu.

Debian installation

Installation system is made by hand, because the Debian installer doesn't support the PowerPC 64 architecture.

Network

First, the network has to work. On a DHCP network, use dhclient-2.2.x .

Hard drive(s)

Partitionning

cfdisk is used to partition the disk

cfdisk /dev/iseries/vda

The existing FAT16 partition is to be removed.

A first partition, 15 MB large, is created, of type 41 (PPC PReP boot). Other partitions are defined as needed by the installed system.

Partitions formatting and mounting

the ext3 filesystem is created with mke2fs -j`, on /dev/iseries/vd*. swap space is also created with the standard procedure.

Target partitions are to be mounted in /instmnt, starting with /.

For example

mount /dev/iseries/vda3 /instmnt
mkdir -p /instmnt/var/log
mount /dev/iseries/vda4 /instmnt/var/log

Base system installation

basedebs.tar (http://ftp.fr.debian.org/debian/dists/woody/main/disks-powerpc/base-images-current/basedebs.tar) is to be downloaded, and uncompressed in /instmnt, for exmample

cd /instmnt
wget ftp://xxxxxxx@172.16.3.178/home/yeiazel/basedebs.tar
tar xf basedebs.tar

for i in var/cache/apt/archives/*.deb
do
 ar -x $i
 tar zxf data.tar.gz
 rm data.tar.gz debian-binary control.tar.gz
done

rm basedebs.tar
cd /

Base system files

Some files are to be created before using the installed system :

  • /instmnt/etc/apt/sources.list : include packages sources
  • /instmnt/etc/network/interfaces : network configuration (do ot forget "lo")
  • /instmnt/etc/resolv.conf : DNS configuration file
  • /instmnt/etc/fstab : partitions configuration file
  • /instmnt/etc/hotname : system hostname
chroot /instmnt
hostname --file /etc/hostname

Here, the system is installed, but the dpkg packages base is not correctly configured. That's why all packages are to be reinstalled with dpkg

export PATH
dpkg --force-all -i /var/cache/apt/archives/dpkg*.deb
dpkg --force-all -i /var/cache/apt/archives/libc6*.deb

for i in /var/cache/apt/archives/*.deb > do
 dpkg --force-all -i $i
done

There could be some errors, there are not blocking.

System update

apt-get update
apt-get upgrade

Some packets are also installed or removed

apt-get install --purge postfix less pcmcia-cs- yaboot- quik- vim nvi- ssh

Passwords

/usr/sbin/shadowconfig on
passwd root

exit

Kernel, boot

The iSeries cannot boot by loading a kernel on the machine disk (like a bootloader). You need to put the kernel in the PReP partition

dd if=/boot/vmlinux of=/dev/iseries/vda1

iSeries reconfiguration

In the network server configuration menu, configure to boot on the PReP partition, with command line root=/dev/iseries/vda3.

Aller au menu contextuel - Aller au menu principal - Aller au contenu