1 AUTHOR: John Gnew <john dot gnew at verizon dot net>
7 SYNOPSIS: How to install LFS on S/390 hardware
9 PRIMARY URL: http://www.linuxfromscratch.org/hints/
12 This hint should help to install Linux from scratch version 6.0 on a
13 IBM S/390 mainframe. I was able to take the 6.0 install guide, with some minor
14 modifications and three additional packages, and complete the install.
16 This LFS system was installed on a 3390-3, my starter LFS 5.0 system was on a 3390-3.
17 I also had a 3390-9 to use for general storage of files.
19 At the compleation, I was able to IPL my LFS system as a VM guest.
21 I have not included the CTC configuration as this will vary from system to system.
23 Prior to compiling the kernel, I verified various kernl patches from IBM. It seems that
24 all of the patches I came up with were already included in the kernel sources. I would
25 recommend checking for patches prior to compiling different versions of the kernel.
27 The IBM site for obtaining various patches is located at:
28 (http://www-128.ibm.com/developerworks/linux/linux390/index.html)
34 REQUIRED ADDITIONAL SOFTWARE:
35 mingetty-1.06 (version 1.07-1 in now available)
39 I followed the documentation for the LFS 6.0 install with the following exceptions:
41 The first addition was to upgrade the 2.4 kernel in LFS 5. GCC was already at
42 level 3.3. I needed to be at the 2.6 level. This upgrade caused changes in the
43 networking so it took a few attempts before I got everything back in place.
45 Install module-init-tools-3.0.tar.bz2
46 ./configure --prefix=/
50 ./generate-modprobe.conf /etc/modprobe.conf
51 copy the modprobe.devfs file into /etc.
53 Upgrade kernel to 2.6.8.1 (or any 2.6 kernel)
54 Create /sys dir and update fstab for sysfs entry
55 I had problems with CTC network without /sys dir
57 Set up CTC with the commands similar to the following:
59 # device must be offline and should be by default
60 echo 0.0.2000,0.0.2001 > /sys/bus/ccwgroup/drivers/ctc/group
61 # echo 0 > /sys/bus/ccwgroup/drivers/ctc/0.0.2000/online
62 echo 0 > /sys/bus/ccwgroup/drivers/ctc/0.0.2000/protocol
63 echo 1 > /sys/bus/ccwgroup/drivers/ctc/0.0.2000/online
65 The following is the command to freate your file system:
69 linux-libc-headers needs to change the copy asm-i386 to asm-s390
70 in chapter 5 and chapter 6
73 touch /tools/glibc-kernheaders/autoconf.h
74 And I initially received the following error:
75 In file included from sys/ustat.h:30,
76 from ../sysdeps/unix/sysv/linux/ustat.c:21:
77 ../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat'
78 make[2]: *** [/LFS60/sources/glibc-build/misc/ustat.o] Error 1
79 make[2]: Leaving directory `/LFS60/sources/glibc-2.3.4/misc'
81 To correct this problem I edited ./sysdeps/unix/sysv/linux/ustat.c by commenting
82 #include <sys/ustat.h> and then adding #include <sys/statfs.h>.
83 The following SED command will accomplish the same.
84 sed -i 's@sys/ustat.h@sys/statfs.h@' \
85 '../glibc-2.3.4/sysdeps/unix/sysv/linux/ustat.c'
86 The problem was related to a file including an obsolete header file.
89 Chapter 5 Locking in GLIBC
90 The next thing to do is to amend our GCC specs file so that it points to the new dynamic linker.
91 A simple sed will accomplish this:
93 SPECFILE=/tools/lib/gcc-lib/*/*/specs &&
94 sed -e 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
95 $SPECFILE > tempspecfile &&
96 mv -f tempspecfile $SPECFILE &&
100 sed -e 's@ /lib/ld.so.1@ /tools/lib/ld.so.1@g' \
102 There does not seem to be a ld-linux.so.2 in the /tools/lib.
104 In chapter 6 I had to remove the coreutils patch for uname. Had a problem with asm:
105 Besides, patch is for intel not 390.
106 Gettext 0.14.3 check failed on msgfmt-6. This also failed on 0.14.4.
107 I found a comment on problems with this test and AIX.
110 +#define cpuid(in,a,b,c,d)\
111 + asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
112 +int has_sse( void );
114 Besides, this patch is for intel type boxes not s390. Guess I’ll just have to
115 live with uname -1 and uname -p displaying unknown.
117 mingetty-1.06 (http://packages.qa.debian.org/m/mingetty.html)
118 mingetty is required for non serial consoles. This had to be installed with "make&&make install"
119 which puts mingetty in /sbin.
121 The /etc/inittab needed the following added:
123 # S/390 enable console login for all runlevels
124 1:012356:respawn:/sbin/mingetty /dev/ttyS0
126 I also commented the following lines:
128 #1:2345:respawn:/sbin/agetty tty1 9600
129 #2:2345:respawn:/sbin/agetty tty2 9600
130 #3:2345:respawn:/sbin/agetty tty3 9600
131 #4:2345:respawn:/sbin/agetty tty4 9600
132 #5:2345:respawn:/sbin/agetty tty5 9600
133 #6:2345:respawn:/sbin/agetty tty6 9600
136 root:/usr/src# ln -s /usr/share/kbd/keymaps/i386/qwerty/defkeymap.map.gz /usr/sh
137 are/kbd/keymaps/defkeymap.map.gz
140 For the install the kernel, the kernel is not under arch/i386/boot/BzImage but
141 rather arch/s390/boot/image
145 Tools that were built as follows:
158 During boot the console will display messages that have ascii control characters.
159 This make it hard to read. Especialy during a disk check.
160 To correct this make sure bashrc has something similar to the following:
161 # Provides a colored /bin/ls command. Used in conjunction with code in
164 if [ $TERM = "dumb" ]; then
165 alias ls='ls --color=never'
167 alias ls='ls --color=auto'
170 To prevent the console from displaying weird lines during a filesystem check,
171 change in /etc/rc.d/init.d/checkfs
173 # fsck $options -a -A -C -T
174 fsck $options -a -A -T
184 * Corrected install for GCC-2.95.3
186 * Changed install to represent LFS 6