r902 - trunk

tushar at linuxfromscratch.org tushar at linuxfromscratch.org
Sat Oct 23 09:11:29 PDT 2004


Author: tushar
Date: 2004-10-23 10:11:26 -0600 (Sat, 23 Oct 2004)
New Revision: 902

Added:
   trunk/lfss390.txt
Log:
Added Hint: lfss390

Added: trunk/lfss390.txt
===================================================================
--- trunk/lfss390.txt	2004-10-10 22:54:45 UTC (rev 901)
+++ trunk/lfss390.txt	2004-10-23 16:11:26 UTC (rev 902)
@@ -0,0 +1,344 @@
+AUTHOR:		John Gnew <john dot gnew at verizon dot net>
+
+DATE:		2004-10-21
+
+LICENSE:	Public Domain
+
+SYNOPSIS:	How to install LFS on S/390 hardware
+
+PRIMARY URL:	http://www.linuxfromscratch.org/hints/
+
+DESCRIPTION:
+For some unknown reason, I had the urge to install Linux from scratch version 5.0 on a 
+IBM S/390 mainframe. I was able to take the 5.0 install guide, with some minor 
+modifications and three additional packages, and complete the install.
+
+At the compleation, I was able to IPL my LFS system as a VM guest.
+
+I have not included the CTC configuration as this will vary from system to system.
+
+Prior to compiling the kernel, I verified various patches from IBM. It seems that 
+all of the patches I came up with were already included in the kernel sources. I would 
+recommend checking for patches prior to compiling different versions of the kernel.
+
+
+PREREQUISITES: 
+None
+
+REQUIRED SOFTWARE:
+mingetty-1.06
+net-snmp-5.1.1
+s390-tools-1.2.4-june2003.tar.gz
+
+HINT: 
+I followed the documentation for the LFS 5.0 install with the following exceptions:
+
+glibc 2.3.2
+I initially received the following error:
+In file included from sys/ustat.h:30,
+                 from ../sysdeps/unix/sysv/linux/ustat.c:21:
+../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat'
+make[2]: *** [/LFS50/sources/glibc-build/misc/ustat.o] Error 1
+make[2]: Leaving directory `/LFS50/sources/glibc-2.3.2/misc'
+
+To correct the problem I edited ./sysdeps/unix/sysv/linux/ustat.c by commenting 
+#include <sys/ustat.h> and then adding #include <sys/statfs.h>.
+
+The problem was related to a file including an obsolete header file. 
+
+
+GLIBC CHECK
+Timed out: killed the child process but it exited 0
+make[2]: *** [/LFS50/sources/glibc-build/rt/tst-aio7.out] Error 1
+make[2]: Leaving directory `/LFS50/sources/glibc-2.3.2/rt'
+make[1]: *** [rt/tests] Error 2
+make[1]: Leaving directory `/LFS50/sources/glibc-2.3.2'
+make: *** [check] Error 2
+
+
+Chapter 5 Locking in GLIBC
+The next thing to do is to amend our GCC specs file so that it points to the new dynamic linker. 
+A simple sed will accomplish this:
+
+
+SPECFILE=/tools/lib/gcc-lib/*/*/specs &&
+sed -e 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2 at g' \
+    $SPECFILE > tempspecfile &&
+mv -f tempspecfile $SPECFILE &&
+unset SPECFILE
+
+Change to
+sed -e 's@ /lib/ld.so.1@ /tools/lib/ld.so.1 at g' \
+
+There does not seem to be a ld-linux.so.2 in the /tools/lib.
+
+BINUTILS
+
+FAIL: bootstrap
+FAIL: bootstrap with strip
+FAIL: bootstrap with --static
+FAIL: bootstrap with --traditional-format
+FAIL: bootstrap with --no-keep-memory
+FAIL: bootstrap with -relax
+
+                === ld Summary ===
+
+# of expected passes            152
+# of unexpected failures        6
+# of expected failures          1
+/source/src/binutils-build/ld/ld-new 20030612
+
+make[4]: *** [check-DEJAGNU] Error 1
+make[4]: Leaving directory `/source/src/binutils-build/ld'
+make[3]: *** [check-am] Error 2
+make[3]: Leaving directory `/source/src/binutils-build/ld'
+make[2]: *** [check-recursive] Error 1
+make[2]: Leaving directory `/source/src/binutils-build/ld'
+make[1]: *** [check-ld] Error 2
+make[1]: Leaving directory `/source/src/binutils-build'
+make: *** [check] Error 2
+
+Looks like these tests failed because the tests are linked against crt1 or 2 and 
+should have been linked against crt0.
+
+
+MODUTILS
+Had to go to modutils-2.4.27. Version 25 would not compile correctly.
+make[1]: Entering directory `/usr/src/modutils-2.4.25/obj'
+gcc -O2 -Wall -I./../include -D_GNU_SOURCE  -DCONFIG_ROOT_CHECK_OFF=0   -DCOMMON
+_3264 -DELF_MACHINE_H='"elf_s390.h"' -DARCH_s390 -DONLY_32 -c -o obj_s390.o obj_
+s390.c
+In file included from obj_s390.c:31:
+../include/util.h:42: warning: built-in function `log' declared as non-function
+obj_s390.c: In function `obj32_arch_apply_relocation':
+obj_s390.c:207: error: `R_390_GOTOFF' undeclared (first use in this function)
+obj_s390.c:207: error: (Each undeclared identifier is reported only once
+obj_s390.c:207: error: for each function it appears in.)
+obj_s390.c: In function `obj32_arch_create_got':
+obj_s390.c:267: error: `R_390_GOTOFF' undeclared (first use in this function)
+make[1]: *** [obj_s390.o] Error 1
+make[1]: Leaving directory `/usr/src/modutils-2.4.25/obj'
+make: *** [all] Error 2
+
+gcc-2.95.3 - I could not get this to compile
+root:/# cd /usr/src/gcc-2-build/
+root:/usr/src/gcc-2-build# ../gcc-2.95.3/configure --prefix=/opt/gcc-2.95.3 \
+>     --enable-shared --enable-languages=c \
+>     --enable-threads=posix
+Configuring for a s390-unknown-linux-gnu host.
+Invalid configuration `s390-unknown-linux-gnu': machine `s390-unknown' not recognized
+Invalid configuration `s390-unknown-linux-gnu': machine `s390-unknown' not recognized
+Unrecognized host system name s390-unknown-linux-gnu.
+
+
+mingetty-1.06 (http://packages.qa.debian.org/m/mingetty.html)
+mingetty is required for non serial consoles. This had to be installed with "make&&make install" 
+which puts mingetty in /sbin.
+
+The /etc/inittab needed the following added:
+
+# S/390 enable console login for all runlevels
+1:012356:respawn:/sbin/mingetty /dev/ttyS0
+
+I also commented the following lines:
+
+#1:2345:respawn:/sbin/agetty tty1 9600
+#2:2345:respawn:/sbin/agetty tty2 9600
+#3:2345:respawn:/sbin/agetty tty3 9600
+#4:2345:respawn:/sbin/agetty tty4 9600
+#5:2345:respawn:/sbin/agetty tty5 9600
+#6:2345:respawn:/sbin/agetty tty6 9600
+
+Customization
+root:/usr/src# ln -s /usr/share/kbd/keymaps/i386/qwerty/defkeymap.map.gz /usr/sh
+are/kbd/keymaps/defkeymap.map.gz
+
+KERNEL GEN
+make mrproper (first time to clean source tree)
+make menuconfig - configure what you want
+make dep
+make image 
+make modules
+make modules_install
+cp arch/s390/boot/image /boot/newname
+cp System.map /boot/System.map
+
+("make vmlinux" only creates the image, make image creates a binary file. 
+If you do a make vmlinux you will get the following error when you boot)
+HCPGIR453W CP entered; program interrupt loop 
+
+
+MAKEDEV - There is a different MAKEDEV script in 5.1 and this might not be an issue.
+MAKEDEV needs to be modified to allocate the mdx and dasdx devices. 
+There should be 32 mdx devices and dasd should have a-z with 3 partition each. 
+The MAKEDEV script in /dev should have the two following lines added:
+
+major_md=9
+
+The md) section should be changed
+        md)
+                major=`Major md` || continue
+                for part in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 \
+                    16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
+                do
+                        makedev md$part b $major $part $disk
+                done
+Add the section:
+        s390)
+                $0 $opts dasda dasdb dasdc dasdd dasde dasdf dasdg dasdh
+                $0 $opts dasdi dasdj dasdk dasdl dasdm dasdn dasdo dasdp
+                $0 $opts dasdq dasdr dasds dasdt dasdu dasdv dasdw dasdx
+                $0 $opts dasdy dasdz
+                ;;
+Add the section:
+        dasd[a-z])
+                major=`Major dasd 64`
+                unit=`suffix $arg dasd`
+                base=`index ab $unit`
+                base=`index abcdefghijklmnopqrstuvwxyz $unit`
+                base=`math $base \* 4`
+                makedev dasd$unit b $major $base $disk
+                for part in 1 2 3
+                do
+            makedev dasd$unit$part b $major `math $base + $part` $disk
+                done
+                ;;
+Then run MAKEDEV -v md
+and      MAKEDEV -v s390
+
+MKINITRD
+root:/# cat mkinitrc
+#! /bin/sh
+dd if=/dev/zero of=/boot/initrd-2.4.22 bs=1M count=16
+/sbin/mke2fs -F -m 0 -b 1024 /boot/initrd-2.4.22
+mkdir /mnt/initrd-2.4.22
+mount -t ext2 -o loop /boot/initrd-2.4.22 /mnt/initrd-2.4.22
+cd /mnt/initrd-2.4.22
+mkdir bin dev lib
+cd /bin
+cp -a sh /mnt/initrd-2.4.22/bin
+cd /sbin
+cp -a insmod /mnt/initrd-2.4.22/bin
+mkdir /mnt/initrd-2.4.22/lib/modules
+(cd /lib/modules; tar -c 2.4.22/) | (cd /mnt/initrd-2.4.22/lib/modules; tar -x)
+cd /dev
+cp -a console /mnt/initrd-2.4.22/dev
+cp -a null /mnt/initrd-2.4.22/dev
+cp -a md* /mnt/initrd-2.4.22/dev
+cp -a ram* /mnt/initrd-2.4.22/dev
+cp -a zero /mnt/initrd-2.4.22/dev
+cd /
+cat > /mnt/initrd-2.4.22/linuxrc << "EOF"
+#! /bin/sh
+
+export PATH=/bin
+
+echo 'Loading module dasd_mod dasd=$dasd ...'
+insmod dasd_mod dasd=$dasd
+
+echo 'Loading module dasd_eckd_mod ...'
+insmod dasd_eckd_mod
+EOF
+umount /mnt/initrd-2.4.22
+rm -rf /mnt/initrd-2.4.22
+gzip /boot/initrd-2.4.22
+
+net-snmp-5.1.1
+Turns out that net-snmp-5.1.1 is required for the s390 tools.
+./configure -prefix=/usr
+make
+make install
+
+
+s390-tools-1.2.4-june2003.tar.gz
+
+In order to get zipl to make I modified the zipl/src/Makefile by adding -DCONFIG_SMP
+
+In file included from /usr/include/linux/fs.h:26,
+                 from disk.c:26:
+/usr/include/asm/bitops.h:42:2: #error "bitops won't work without CONFIG_SMP"
+make[2]: *** [disk.o] Error 1
+
+
+CFLAGS := -I../include -I../boot -O2 -Wall -DZFCPDUMP_DIR=$(ZFCPDUMP_DIR) \
+          -DZFCPDUMP_IMAGE=$(ZFCPDUMP_IMAGE) -DZFCPDUMP_RD=$(ZFCPDUMP_RD) \
+          -DCONFIG_SMP \
+          -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE)
+
+Tools were built as follows
+cd zipl
+make
+make install
+cd ../fdasd
+make
+make install
+cd ../dasdfmt
+make
+make install
+cd ../dasdview
+make
+make install
+cd ../zdump
+make
+make install
+cd ../tape390
+make
+make install
+cd ../qetharp
+make
+make install
+cd ../qethconf
+make
+make install
+cd ../ip_watcher
+make
+make install
+I still need to look at osasnmpd and zfcpdump need to be looked at. Bad compiles.
+
+
+PROBLEMS TODO
+
+./loadkeys
+Loading keymap...Loading /usr/share/kbd/keymaps/defkeymap.map.gz
+Couldnt get a file descriptor referring to the console
+
+./setclock
+Setting clock...DISABLED
+Cannot access the Hardware Clock via any known method.
+Use the --debug option to see the details of our search for an access method.
+
+hwclock --hctosys --localtime --debug
+hwclock from util-linux-2.12
+hwclock: Open of /dev/rtc failed, errno=19: No such device.
+No usable clock interface found.
+Cannot access the Hardware Clock via any known method.
+
+/usr/src/s390-tools-1.2.4/zfcpdump
+zfcpdump would not compile. Dependancies were not found.
+* ERROR: 'extern/linux-2.4.19.tar.bz2' missing
+* ERROR: 'extern/busybox-0.60.5.tar.bz2' missing
+* ERROR: 'extern/e2fsprogs-1.32.tar.gz' missing
+* Call 'get_files.sh' to get the required tarballs from the internet!
+
+/usr/src/s390-tools-1.2.4/osasnmpd
+osasnmpd did not compile
+
+gcc-2.95.3
+root:/# cd /usr/src/gcc-2-build/
+root:/usr/src/gcc-2-build# ../gcc-2.95.3/configure --prefix=/opt/gcc-2.95.3 \
+>     --enable-shared --enable-languages=c \
+>     --enable-threads=posix
+Configuring for a s390-unknown-linux-gnu host.
+Invalid configuration `s390-unknown-linux-gnu': machine `s390-unknown' not recognized
+Invalid configuration `s390-unknown-linux-gnu': machine `s390-unknown' not recognized
+Unrecognized host system name s390-unknown-linux-gnu.
+
+ACKNOWLEDGMENTS:
+
+
+CHANGELOG:
+[2004-10-21]
+* Initial post
+
+
+




More information about the hints mailing list