r58 - in trunk/text: chapter01 chapter03 chapter05/03-libc-headers chapter05/06-libc chapter06 chapter06/10-libc

robert at linuxfromscratch.org robert at linuxfromscratch.org
Fri Jan 7 14:56:00 PST 2005


Author: robert
Date: 2005-01-07 15:55:57 -0700 (Fri, 07 Jan 2005)
New Revision: 58

Modified:
   trunk/text/chapter01/changelog.txt
   trunk/text/chapter03/patches.txt
   trunk/text/chapter05/03-libc-headers/03-uclibc-headers.txt
   trunk/text/chapter05/06-libc/06-uclibc.txt
   trunk/text/chapter06/05-createfiles.txt
   trunk/text/chapter06/10-libc/10-uclibc.txt
   trunk/text/chapter06/11-adjusting.txt
   trunk/text/chapter06/13-gcc.txt
Log:
uclibc updates

Modified: trunk/text/chapter01/changelog.txt
===================================================================
--- trunk/text/chapter01/changelog.txt	2005-01-07 19:07:34 UTC (rev 57)
+++ trunk/text/chapter01/changelog.txt	2005-01-07 22:55:57 UTC (rev 58)
@@ -83,5 +83,5 @@
 
 January 7th, 2005 [robert]
 Bump to Texinfo 4.8, removed segfault patch. Bump to Findutils 4.2.11.
-Put a Gettext page in chapter 6.
+Put a Gettext page in chapter 6. Added new Grsec patch for kernel 2.6.10.
 

Modified: trunk/text/chapter03/patches.txt
===================================================================
--- trunk/text/chapter03/patches.txt	2005-01-07 19:07:34 UTC (rev 57)
+++ trunk/text/chapter03/patches.txt	2005-01-07 22:55:57 UTC (rev 58)
@@ -14,6 +14,7 @@
 http://www.linuxfromscratch.org/patches/downloads/hlfs/glibc-2.3.4-fstack_protector-1.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/glibc-2.3.4-pt_pax-1.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/glibc-2.3.4-ssp_frandom-6.patch
+http://grsecurity.net/grsecurity-2.1.0-2.4.28-200501051112.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/inetutils-1.4.2-kernel_headers-1.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/inetutils-1.4.2-no_server_man_pages-1.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/iproute2-2.6.9_ss040831-find_update-1.patch
@@ -29,7 +30,7 @@
 http://www.linuxfromscratch.org/patches/downloads/hlfs/shadow-4.0.6-uclibc-1.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/sysvinit-2.85-proclen-1.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/sysvinit-2.85-proclen-1.patch
-http://www.linuxfromscratch.org/patches/downloads/hlfs/uClibc-20041227-config-1.patch
+http://www.linuxfromscratch.org/patches/downloads/hlfs/uClibc-20041227-config-2.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/uClibc-20041227-ssp-1.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/util-linux-2.12p-fPIC-1.patch
 http://www.linuxfromscratch.org/patches/downloads/hlfs/util-linux-2.12p-cramfs-1.patch

Modified: trunk/text/chapter05/03-libc-headers/03-uclibc-headers.txt
===================================================================
--- trunk/text/chapter05/03-libc-headers/03-uclibc-headers.txt	2005-01-07 19:07:34 UTC (rev 57)
+++ trunk/text/chapter05/03-libc-headers/03-uclibc-headers.txt	2005-01-07 22:55:57 UTC (rev 58)
@@ -2,7 +2,7 @@
 
 # This patch adds a generic configuration.
 
-patch -Np1 -i ../uClibc-20041227-config-1.patch
+patch -Np1 -i ../uClibc-20041227-config-2.patch
 
 # Now we prepare the headers.
 

Modified: trunk/text/chapter05/06-libc/06-uclibc.txt
===================================================================
--- trunk/text/chapter05/06-libc/06-uclibc.txt	2005-01-07 19:07:34 UTC (rev 57)
+++ trunk/text/chapter05/06-libc/06-uclibc.txt	2005-01-07 22:55:57 UTC (rev 58)
@@ -11,36 +11,30 @@
 # and SSP. This will build with standard features. In chapter 6 you will be
 # able to configure uClibc to your more specific needs.
 
-patch -Np1 -i ../uClibc-20041227-config-1.patch
+patch -Np1 -i ../uClibc-20041227-config-2.patch
 
 # UClibc uses the -Os optimization to reduce size. The following command
 # will remove this so uClibc uses -O2 instead to optimize for speed.
 
 sed -e 's/-Os,//' -i Rules.mak
 
+# Reset the installation paths.
+
+sed -e 's at .*SHARED_LIB_LOADER_P.*@SHARED_LIB_LOADER_PREFIX="/tools/lib"@g' \
+	-i .config &&
+sed -e 's at .*RUNTIME_PREFIX.*@RUNTIME_PREFIX="/tools"@g' -i .config &&
+sed -e 's at .*DEVEL_PREFIX.*@DEVEL_PREFIX="/tools/"@g' -i .config &&
+sed -e 's at .*KERNEL_SOURCE.*@KERNEL_SOURCE="/tools"@g' -i .config
+
 # Then build and install uClibc.
 
-make KERNEL_SOURCE=/tools CROSS=${target}- all &&
-make RUNTIME_PREFIX=/tools/ install_runtime
+make CROSS=${target}- all
 
 # UClibc will clobber the previously installed libc headers. There is no
-# practical way to prevent this, but no harm is done. The 'install_dev'
-# make target will install startfiles (lib/*crt*.o) and static libraries,
-# in addition to headers. We remove the kernel header symlinks to stop
-# 'install_dev' from clobbering the kernel headers.
+# practical way to prevent this, but no harm is done. Remove the kernel
+# header symlinks to stop 'make install' from clobbering the kernel headers,
+# because this causes many warning messages.
 
 rm include/{asm,asm-generic,linux} &&
-make DEVEL_PREFIX=/tools/ install_dev
+make install
 
-# The previous command created several incorrect symlinks. The following
-# commands will repair them.
-
-ln -sf libc.so.0 /tools/lib/libc.so &&
-ln -sf libcrypt.so.0 /tools/lib/libcrypt.so &&
-ln -sf libdl.so.0 /tools/lib/libdl.so &&
-ln -sf libm.so.0 /tools/lib/libm.so &&
-ln -sf libnsl.so.0 /tools/lib/libnsl.so &&
-ln -sf libpthread.so.0 /tools/lib/libpthread.so &&
-ln -sf libresolv.so.0 /tools/lib/libresolv.so &&
-ln -sf libutil.so.0 /tools/lib/libutil.so
-

Modified: trunk/text/chapter06/05-createfiles.txt
===================================================================
--- trunk/text/chapter06/05-createfiles.txt	2005-01-07 19:07:34 UTC (rev 57)
+++ trunk/text/chapter06/05-createfiles.txt	2005-01-07 22:55:57 UTC (rev 58)
@@ -10,16 +10,20 @@
 # will be overwritten in chapter 7, and/or you can remove it when chapter 6
 # is complete. If you are using Glibc use these commands:
 
+cat > /etc/profile << "EOF"
 export target=$(uname -m)-pc-linux-gnu &&
 export ldso=/lib/ld-linux.so.2 &&
 export clocale=--enable-clocale=gnu
+EOF
 
 # If you are using uClibc use these commands:
 
+cat > /etc/profile << "EOF"
 export target=$(uname -m)-pc-linux-uclibc &&
 export ldso=/lib/ld-uClibc.so.0 &&
 export clocale="--disable-clocale --enable-sjlj-exceptions" &&
 export disable_nls=--disable-nls
+EOF
 
 # Then source it.
 

Modified: trunk/text/chapter06/10-libc/10-uclibc.txt
===================================================================
--- trunk/text/chapter06/10-libc/10-uclibc.txt	2005-01-07 19:07:34 UTC (rev 57)
+++ trunk/text/chapter06/10-libc/10-uclibc.txt	2005-01-07 22:55:57 UTC (rev 58)
@@ -1,2 +1,82 @@
 - Chapter 5 - Installing uClibc 20041227
 
+# First patch the ssp.c file.
+
+patch -Np1 -i ../uClibc-20041227-ssp-1.patch
+
+# Change the default optimization option so it uses -O2.
+
+sed -e 's/-Os,//' -i Rules.mak
+
+# Next run menuconfig. This is very similiar to the kernel's menuconfig.
+# If you want to install locales you will need to fetch the
+# uClibc-locale-030818.tgz package from the uClibc.org website, and do:
+# install -m444 ../uClibc-locale-030818.tgz extra/locale/
+# 
+# UCLIBC_HAS_WCHAR is needed to build g++. UCLIBC_HAS_RPC is needed to build
+# util-linux (nfsmount). Use your own judgement for the rest. The
+# 'make defconfig' and 'make allyesconfig' targets are not reccomended.
+#
+# You can use the uClibc-config patch from chapter 5 if you do not want to
+# answer any questions here.
+
+make menuconfig
+
+# The runtime path gets hardcoded into ldd, and so on. So we reset these
+# installations paths now before compiling anything. While we're at it
+# we can tell uClibc where to find the new kernel headers.
+
+sed -e 's at .*SHARED_LIB_LOADER_PREFIX.*@SHARED_LIB_LOADER_PREFIX="/lib"@g' \
+	-i .config &&
+sed -e 's at .*RUNTIME_PREFIX.*@RUNTIME_PREFIX="/"@g' -i .config &&
+sed -e 's at .*DEVEL_PREFIX.*@DEVEL_PREFIX="/usr/"@g' -i .config &&
+sed -e 's at .*KERNEL_SOURCE.*@KERNEL_SOURCE="/usr"@g' -i .config
+
+# Then build uClibc, and the utilities.
+
+make &&
+make -C utils
+
+# Run the testsuite if you like. Some tests may fail.
+
+make -k -C test | tee make-test.log
+
+# Then install uClibc libraries, and headers (but not the kernel headers).
+
+rm include/{asm,asm-generic,linux} &&
+make install
+
+# Then install the utilities by hand. There is a readelf(1) program too,
+# but that is already provided by the Binutils package. If you built compiled
+# uClibc with locales you should also install the iconv(3) program.
+
+install utils/ldd /usr/bin/ldd &&
+install utils/ldconfig /sbin/ldconfig
+
+# Then install /etc/ld.so.conf.
+
+cat > ld.so.conf.new << "EOF"
+# Begin /etc/ld.so.conf
+
+/usr/local/lib
+/opt/lib
+
+# End /etc/ld.so.conf
+EOF
+
+install -m644 ld.so.conf.new /etc/ld.so.conf
+
+# The system timezone is set with the /etc/TZ file. Users can use the TZ
+# enviroment variable for their local time. See:
+# http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html
+# and/or
+# http://leaf.sourceforge.net/doc/guide/buci-tz.html#id2599108
+# for a more complete description. This example is for eastern standard time,
+# and it will adjust by 1 hour automaticly for daylight savings time.
+
+echo "EST5EDT" > TZ.new &&
+install -m644 TZ.new /etc/TZ
+
+# If your hardware clock is on localtime use something like "EST0EDT".
+# Remote users can use 'export TZ=JST-9:' (Japan standard time).
+

Modified: trunk/text/chapter06/11-adjusting.txt
===================================================================
--- trunk/text/chapter06/11-adjusting.txt	2005-01-07 19:07:34 UTC (rev 57)
+++ trunk/text/chapter06/11-adjusting.txt	2005-01-07 22:55:57 UTC (rev 58)
@@ -15,5 +15,7 @@
 echo 'main(){}' | cc -x c - &&
 readelf -l a.out | grep ': /lib'
 
-# You should see "[Requesting program interpreter: /lib/ld-uClibc.so.0]"
+# You should see "[Requesting program interpreter: /lib/something.so.]"
 
+# Remove the binutils build and source directories now.
+

Modified: trunk/text/chapter06/13-gcc.txt
===================================================================
--- trunk/text/chapter06/13-gcc.txt	2005-01-07 19:07:34 UTC (rev 57)
+++ trunk/text/chapter06/13-gcc.txt	2005-01-07 22:55:57 UTC (rev 58)
@@ -1,5 +1,7 @@
 - Chapter 6 - Installing GCC 3.4.3
 
+# Unpack gcc-core, gcc-g++, and gcc-testsuite.
+
 # Apply these patches if you are using uClibc.
 
 patch -Np1 -i ../gcc-3.4.3-uclibc_conf-1.patch &&
@@ -35,7 +37,7 @@
 	LIBCFLAGS="-fstack-protector-all -O2"
 
 # Run the testsuite if you like. The results should be identical to results
-# you would typically get from an LFS build. There is an SSP tests in
+# you would typically get from an LFS build. There is an SSP test in
 # gcc.misc-tests/ which should pass.
 
 make -k check




More information about the hlfs-dev mailing list