Upgrade SuSE 7.0 GA to 2.4.7
Many have asked how to upgrade an existing SuSE 7.0 installation
to a Linux 2.4.7 kernel. A real upgrade of your system would not
just be the kernel, but also all the packages at proper levels.
If you just replace the kernel (and the bare minimum of other
items) your files will not match the rpm database anymore, you
may end up with all kind of trouble. However, if you really want
to try the Linux 2.4.7 kernel now on some test system, then you
should be able to get it done.
If you are currently using LVM, then do not follow this recipe
since the LVM code for 2.2.16 does not run with this kernel. You
would probably need to get the new LVM utilities for it.
So the moral of this is: Don't, but this is how...
Notes
- The URLs in this document point to
ftp.kernel.org. This may not be the fastest site for you to
find the files. A local mirror of kernel.org (like ftp.de.kernel.org)
may give you better results.
- Instead of downloading the files to a PC first and then upload
to the mainframe, you could save yourself a lot of trouble by
downloading to your Linux for S/390 system directly.
If your S/390 is separated from the Internet through a firewall
with socks servers, you may consider to install a socks client
(like Dante, available on the SuSE CDs).
If you have proxy servers you can use
wget to download
the tar files by setting the http_proxy environment variable.
- The commands to rebuild the components tend to produce a lot of output.
This can be intimidating when you are not used to it. In the sections below
the last part of that output is shown to give you the warm feeling of
recognition.
Upgrade modutils
Download
modutils-2.4.7.tar.gz and get the patch for the ELF magic number
modutils-2.4.7-s390magic.diff. This patch will make binutils accept both the old
and the new ELF magic code, even when you have not upgraded your glibc yet.
tar xzf modutils-2.4.7.tar.gz
cd modutils-2.4.7
patch -p1 -i ../modutils-2.4.7-s390magic.diff
./configure --enable-insmod-static --prefix=/usr \
--exec-prefix=/ --mandir=/usr/share/man \
--disable-compat-2-0 --disable-kerneld s390-suse-linux
make
make install
make clean
cd ..
Verify with depmod -V that you have the correct modutils (and get
rid of the old /etc/conf.modules link as suggested).
Upgrade binutils
Download
binutils-2.11.90.0.27.tar.gz and the two patches from the DeveloperWorks
web site.
Also get the patch to modify the ELF magic number
binutils-2.11.90.0.27-s390magic.diff.
tar xzf binutils-2.11.90.0.27.tar.gz
tar xzf binutils-2.11.90.0.27-s390.tar.gz
tar xzf binutils-2.11.90.0.27-brxlg.tar.gz
cd binutils-2.11.90.0.27
patch -p1 -i ../binutils-2.11.90.0.27-s390.diff
patch -p1 -i ../binutils-2.11.90.0.27-brxlg.diff
patch -p1 -i ../binutils-2.11.90.0.27-s390magic.diff
./configure --prefix=/usr s390-suse-linux
make
...
rm -f ld.pod
make[3]: Leaving directory `/root/binutils-2.11.90.0.27/ld'
make[2]: Leaving directory `/root/binutils-2.11.90.0.27/ld'
make[1]: Leaving directory `/root/binutils-2.11.90.0.27/ld'
make install
...
mv -f /usr/lib/libiberty.an /usr/lib/libiberty.a
make[2]: Entering directory `/root/binutils-2.11.90.0.27/libiberty/testsuite'
make[2]: Nothing to be done for install'.
make[2]: Leaving directory `/root/binutils-2.11.90.0.27/libiberty/testsuite'
make[1]: Leaving directory `/root/binutils-2.11.90.0.27/libiberty'
make clean
...
rm -f configdev.txt configbuild.txt configdev.eps configbuild.eps
rm -f configdev.jpg configbuild.jpg
make[1]: Leaving directory `/root/binutils-2.11.90.0.27/etc'
rm -f *.a TEMP errs core *.o *~\#* TAGS *.E *.log
cd ..
You have now an upgraded assembler and linker.
as -version
GNU assembler 2.11.90.0.27
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
This assembler was configured for a target of `s390-suse-linux'.
Upgrade gcc
Download
gcc-2.95.3.tar.gz and the patches from DeveloperWorks.
tar xzf gcc-2.95.3.tar.gz
tar xzf gcc-2.95.3-s390.tar.gz
tar xzf gcc-2.95.3-s390-1.tar.gz
cd gcc-2.95.3
patch -p1 -i ../gcc-2.95.3-s390.diff
patch -p1 -i ../gcc-2.95.3-s390-1.diff
./configure --prefix=/usr --enable-languages="C,C++" s390-suse-linux
...
Configuring etc...
loading cache ../config.cache
checking for a BSD compatible install... (cached) /usr/bin/ginstall -c
creating ./config.status
creating Makefile
make
...
thr-vxworks.c ..linked
thr-win32.c ..linked
thr.c ..linked
creating cache ./config.cache
checking if compiler cc1obj has been built... no
rmdir: libobjc: Directory not empty
make install
...
make[2]: Nothing to be done for `install'.
make[2]: Leaving directory `/root/gcc-2.95.3/s390-ibm-linux-gnu/libiberty/testsuite'
make[1]: Leaving directory `/root/gcc-2.95.3/s390-ibm-linux-gnu/libiberty'
make clean
...
make[2]: Leaving directory `/root/gcc-2.95.3/s390-ibm-linux-gnu/libiberty'
make[1]: Leaving directory `/root/gcc-2.95.3/s390-ibm-linux-gnu/libiberty'
rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
The new gcc compiler is now installed, verify this with gcc -v
Upgrade the kernel
Download the two linux-2.4.7 patches from DeveloperWorks and the
linux-2.4.7.tar.gz
cd
tar xzf linux-2.4.7-s390.tar.gz
tar xzf linux-2.4.7-s390-1.tar.gz
cd /usr/src
rm linux
tar xzf /root/linux-2.4.7.tar.gz
mv linux linux-2.4.7
ln -s linux-2.4.7 linux
cd linux
patch -p1 -i /root/linux-2.4.7-s390.diff
patch -p1 -i /root/linux-2.4.7-s390-1.diff
cp /boot/image.config .config
make menuconfig
Some of the new features in the linux-2.4.7 kernel for
S/390 are not compatible with what you have in 2.2.16, in that
they require additional configuration changes.
- devfs
- The Device Filesystem is a replacement for the static entries
in the /dev directory. While this is goodness to have, it does
require some extra work, including the installation and setup of
the devfsd deamon. If you do not need this new function, you can
just disable it in your kernel configuration (in FileSystems,
"Dev file system support")
- chandev
- The Channel Device Configuration is the new infrastructure for the
ctc, lcs and qeth drivers. If you currently use the ctc driver
you can disable this new feature (in "Network Device Drivers")
and continue to use the ctc driver as you did before.
The IBM supplied lcs and qeth drivers require the new Channel
Device Configuration to be active, so in that case you will have to
review the documentation and do the necessary updates.
# exit and save your configuration
make dep
...
make[2]: Leaving directory `/usr/src/linux/arch/s390/math-emu'
make[1]: Leaving directory `/usr/src/linux'
make image
objcopy -O binary ipldump.lnk ipldump.boot
objcopy -O binary /usr/src/linux/vmlinux image
nm /usr/src/linux/vmlinux | grep -v '\(compiled\)\|\( [aUw] \)\|\(\.\)\|\(LASH[RL]DI\)' | sort > /usr/src/linux/System.map
rm iplfba.lnk ipleckd.o ipldump.o ipleckd.lnk ipldump.lnk iplfba.o
make[1]: Leaving directory `/usr/src/linux/arch/s390/boot'
make modules
...
make[1]: Entering directory `/usr/src/linux/arch/s390/math-emu'
make[1]: Nothing to be done for `modules'.
make[1]: Leaving directory `/usr/src/linux/arch/s390/math-emu'
make modules_install
mkdir -p pcmcia; \
find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.4.7; fi
Install s390-tools
The s390-tools package contains the new dasdfmt and fdasd utilities and
zipl, which replaces silo. Since your 2.2.16 silo does not work on the
new kernel, and zipl does not work on the old one, you have to be a bit
careful here. You need to download the base package and the patch from
the DeveloperWorks web site.
Note: Before you overwrite your current dasdfmt program you may
want to rename that to dasdfmt-2.2.16 so that you could still get it
when you backout the new kernel.
You may also want to get the
s390-tools-sbin.diff patch to install the tools in /sbin (where the
current dasdfmt also is).
cd
tar xzf s390-tools.tar.gz
tar xzf s390-tools.tgz
tar xzf s390-tools-1.tar.gz
cd s390-tools
patch -p1 -i ../s390-tools-1.diff
patch -p1 -i ../s390-tools-sbin.diff
make
make[1]: Leaving directory `/root/s390-tools/fdasd'
make[1]: Entering directory `/root/s390-tools/dasdfmt'
gcc -O2 -I/usr/src/linux/include -L../fdasd -lvtoc -o dasdfmt dasdfmt.c
make[1]: Leaving directory `/root/s390-tools/dasdfmt'
make install
strip dasdfmt
install -d -m 755 /sbin /usr/man/man8
install -g root -o root -m 700 dasdfmt /sbin
install -g root -o root -m 644 dasdfmt.8 /usr/man/man8
make[1]: Leaving directory `/root/s390-tools/dasdfmt'
make clean
Download network drivers
Download any network drivers you need and install them in
/lib/modules/2.4.7/misc/. After you copied them, run a
depmod -a -F /usr/src/linux/System.map
Activate the new kernel
You are now about to write the new kernel on disk. I very strongly
recommend to create an "Alternate boot disk" as outlined in the
latest Linux for S/390 Redpiece. Another option would be to configure
the kernel for booting from your virtual reader and use that approach.
Now you can copy the kernel to the boot directory and run silo. Following
assumes your /boot directory is on /dev/dasdb (verify with 'df /boot')
cd /boot
cp /usr/src/linux/System.map System.map-2.4.7
cp /usr/src/linux/arch/s390/boot/image image-2.4.7
silo -d /dev/dasdb -f image-2.4.7
Now shutdown your Linux image and IPL from the device that holds the
new kernel.
Further experiments
One thing you may want to do is undo the patches for the ELF magic
number. Your new kernel now runs both types, so you could undo that
patch as follows.
cd binutils-2.11.90.0.27
patch -p1 -R -i ../binutils-2.11.90.0.27-s390magic.diff
The first time you then rebuild binutils you get an assembler and a
loader that produce binaries with the new ELF architecture
number, but the assembler and loader itself is still the old one.
So using these new tools you rebuild binutils again, and now you
have new binaries that produce new binaries. Next would be to
rebuild gcc, etc. But if you are doing this just for your own system
and do not share things with others, I don't see a pressing reason
to do so.
If you need to rebuild your kernel again you would need to use zipl
to activate that kernel. After you copy the new kernel and System.map
to the /boot directory, it goes like this.
zipl -i image-2.4.7 -t .
building bootmap : ./bootmap
adding Kernel Image : image-2.4.7 located at 0x00010000
adding Parmline : parmfile located at 0x00001000
Bootloader for ECKD type devices with classic layout installed.
Syncing disks....
...done