1 AUTHOR: Robert Connolly <robert at linuxfromscratch.org> (ashes)
7 SYNOPSIS: Building LFS-6.0+ with Linux-2.4.
10 This hint gives the info needed to build recent LFS with the 2.4 series Linux kernel.
15 I built my workstation with the 2.4 series kernel because I became tired of following
16 changes in the 2.6 series. It went fairly smoothly, and this hint contains the
17 modifications to the LFS and BLFS books that were needed. There may be some things that
18 I have overlooked, but my system with Xorg-7.1, and everything else, seems to be working
19 perfectly fine. If you discover something I overlooked then please email me the
20 difference. This hint is based on LFS-SVN-20070209, but should work with any LFS book
23 The host system can be running any of the Linux 2.6 kernels. If the host system is
24 running a Linux 2.4 kernel, then I suggest running a kernel newer than 2.4.22 because
25 Glibc uses additional kernel features until 2.4.22. Be sure to enable
26 CONFIG_UNIX98_PTYS and CONFIG_DEVPTS_FS in the host kernel so /dev/pts can be mounted.
28 # Get the latest kernel from:
29 # http://www.kernel.org/pub/linux/kernel/v2.4/
31 # Chapter 5 - Linux Headers
32 # Unpack the Linux-2.4 kernel package, and install the headers with the following
36 make include/linux/version.h
38 mkdir /tools/include/asm
39 cp -v include/asm/* /tools/include/asm
40 cp -vR include/asm-generic /tools/include
41 cp -vR include/linux /tools/include
44 # Glibc's Native Posix Threading Library (NPTL) depends on Linux 2.6 series kernels.
45 # Since Glibc-2.4 NPTL has been the default, and Linux Threads has been depreciated.
46 # Linux Threads in the latest Glibc releases still works, but is no longer supported.
48 # Be sure to download and unpack the Glibc-linuxthreads addon package, from the same
49 # place you downloaded the Glibc package.
51 # We need to disable sanity checks in order to disable NPTL. Use these options when
53 # '--enable-kernel=2.4.22 --enable-addons=linuxthreads --disable-sanity-checks'
55 # Chapter 6 - Linux Headers
58 make include/linux/version.h
60 cp -HR include/asm /usr/include
61 cp -R include/asm-generic /usr/include
62 cp -R include/linux /usr/include
63 touch /usr/include/linux/autoconf.h
65 # Chapter 6 - Mounting kernfs and making devices
66 # Dont mount /sys. Do mount /dev/pts, after doing 'mkdir /dev/pts'.
67 # Get: http://downloads.linuxfromscratch.org/MAKEDEV-1.7.bz2
71 bzcat MAKEDEV-1.7.bz2 > /dev/MAKEDEV
72 chmod 754 /dev/MAKEDEV
74 ./MAKEDEV -v generic-nopty
77 # Again, unpack the 'linuxthreads' addon.
79 # When installing Linux Threads, Glibc installs
80 # 'linuxthreads/sysdeps/pthread/semaphore.h' to '/usr/include/semaphore.h'. The
81 # 'linuxthreads/sysdeps/pthread/semaphore.h' header only contains one line,
82 # '#include <linuxthreads/semaphore.h>', but 'linuxthreads/semaphore.h' will not exist
83 # in '/usr/include'. As a result packages which need 'semaphore.h' will not be able to
84 # build because this header is broken. We can correct this by renaming
85 # 'linuxthreads/sysdeps/pthread/semaphore.h' so that the 'linuxthreads/semaphore.h'
86 # header will be used and installed instead:
88 mv -v linuxthreads/sysdeps/pthread/semaphore.h{,.bak}
90 # Do not use "-fomit-frame-pointers" in your CFLAGS, this will break linuxthreads.
91 # Use '--enable-omitfp' instead.
93 # Configure Glibc with the same additional options as in chapter 5, but add libidn if
95 # '--enable-kernel=2.4.22 --enable-addons=linuxthreads,libidn --disable-sanity-checks'
97 # Don't expect all the testsuite to pass. Linuxthreads is not maintained, and neither
98 # is the testsuite against it. I investigated the test failures and found they were
99 # mainly caused by too many included headers, or the wrong included headers. The test
100 # failures were caused by bugs in the testsuite, not Glibc or linuxthreads themselves.
102 # Chapter 6 - Modutils
103 # Replace the Module-init-utils package with Modutils from:
104 # http://www.kernel.org/pub/linux/utils/kernel/modutils/v2.4/
105 # And get this patch to compile it with gcc4:
106 # http://mirror.linux.org.mt/mirror/gentoo-portage/sys-apps/modutils/files/
107 # modutils-2.4.27-gcc.patch
108 # Install Modutils with:
115 # Don't install this package.
117 # Chapter 7 - LFS-bootscripts
118 # You can use lfs-bootscripts-2.0.5:
119 # http://downloads.linuxfromscratch.org/lfs-bootscripts-2.0.5.tar.bz2
120 # or the latest boot scripts at:
121 # http://www.linuxfromscratch.org/lfs/downloads/development/
123 # The latest boot scripts are designed for the 2.6 kernel, and will need to be
124 # modified to work with Linux-2.4. First disable the Udev boot scripts:
126 chmod -x /etc/rc.d/init.d/udev*
128 # Then in '/etc/rc.d/init.d/mountfs' comment out or remove the line:
129 # 'mount -f /sys || failed=1'
130 # In '/etc/rc.d/init.d/mountkernfs' comment out or remove the lines:
131 # if ! mountpoint /sys &> /dev/null; then
132 # boot_mesg -n " /sys" ${NORMAL}
133 # mount -n /sys || failed=1
136 # Chapter 8 - Linux kernel
137 # Starting with version 2.4.34 the 2.4 series kernel can compile with GCC-4.
138 # Clean the Linux source with either 'make mrproper' or 'make clean'.
144 # Enable CONFIG_UNIX98_PTYS and CONFIG_DEVPTS_FS for '/dev/pts', and CONFIG_TMPFS if
145 # you want to be able to mount '/dev/shm'.
147 # And then build the kernel and modules with:
153 # And install the modules with:
158 # The 2.4 kernel doesn't come with Alsa sound drivers, and the BLFS book doesn't have
159 # the Alsa-driver package. If you want to use Alsa then get the driver package at:
160 # ftp://ftp.alsa-project.org/pub/driver/
161 # Using the same version as your other Alsa packages. This Alsa-driver package will
162 # install the actual kernel modules. Look at './configure --help' if you want to use
163 # the '--with-cards=' option so you only install the driver(s) you need. You will also
164 # need to point '--with-kernel=' at your kernel source directory, unless you symlinked
165 # it to /usr/src/linux. Use the '--with-build=' switch too. This package will build
166 # the sound modules with the same CFLAGS that were used to build the kernel, so don't
167 # modify them. Build and install alsa-driver with:
169 ./configure --with-kernel=/usr/src/linux-2.4.34.1 \
170 --with-build=/usr/src/linux-2.4.34.1 &&