source: scripts/scripts/target-scripts/target-util-linux.sh @ a11a2d51

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since a11a2d51 was a11a2d51, checked in by Jim Gifford <clfs@…>, 18 years ago

r1047@server (orig r1045): ryan | 2006-01-12 00:57:23 -0800

r1081@rei: lfs | 2006-01-12 19:16:25 +1100
Update for util-linux-2.12r


  • Property mode set to 100755
File size: 3.3 KB
Line 
1#!/bin/bash
2
3# cross-lfs target util-linux build
4# ---------------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11# NOTE: this script defaults to installing into the new root ( ${LFS} ).
12#       work has to be done on configure to make it install to
13#       ${TGT_TOOLS}
14
15# NOTE: *** For gods sake ryan, fix the setting of CPU and ARCH ***
16
17cd ${SRC}
18LOG=util-linux-target.log
19
20set_libdirname
21setup_multiarch
22
23unpack_tarball util-linux-${UTILLINUX_VER} &&
24cd ${PKGDIR}
25
26case ${UTILLINUX_VER} in
27   2.12 | 2.12a )
28      case ${KERNEL_VER} in
29         2.[56].* )
30            # Fixes for utillinux 2.12 + 2.12a for building against 2.6
31            # kernel headers
32            apply_patch util-linux-2.12a-kernel_headers-1
33         ;;
34      esac
35   ;;
36   2.12[k-r] )
37      # fix cramfs, this fix will need to be tracked for later versions...
38      apply_patch util-linux-2.12q-cramfs-1
39      # fix sfdisk for mips n32/64 as n32/64 uses lseek, not llseek
40      apply_patch util-linux-2.12q-sfdisk_use_lseek_for_mips64-1
41      case ${GCC_VER} in
42         4.* ) apply_patch util-linux-2.12r-gcc4_fixes-1 ;;
43      esac
44   ;;
45esac
46
47case ${UTILLINUX_VER} in
48   2.12 | 2.12[a-m] )
49      # Patch to fix fdiskbsdlabel.h for m68k, also adds unistd.h to list
50      # of includes for swapon.c
51      apply_patch util-linux-2.12a-cross-lfs-fixes
52   ;;
53   2.12* )
54      # Patch to fix fdiskbsdlabel.h for m68k
55      apply_patch util-linux-2.12n-cross-lfs-fixes
56   ;;
57esac
58
59# Make FHS compliant
60# Get list of files which reference etc/adjtime
61filelist=`grep -l -d recurse etc/adjtime *`
62
63# Edit each file in turn
64for file in ${filelist} ; do
65   test -f ${file}-ORIG ||
66      cp ${file} ${file}-ORIG
67   # Change instance of etc/adjtime to var/lib/hwclock/adjtime
68   sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \
69      ${file}-ORIG > ${file}
70done
71mkdir -p ${LFS}/var/lib/hwclock
72
73if [ ! "${USE_SYSROOT}" = "Y" ]; then
74   echo " o Changing hard coded references to /usr/include to point at ${TGT_TOOLS}"
75   flist=`grep -d recurse -l /usr/include *`
76   for file in ${flist}; do
77      (
78      echo " - editing ${file}"
79      test -f ${file}-ORIG || cp ${file} ${file}-ORIG
80      sed 's@/usr/include@${TGT_TOOLS}/include@g' ${file}-ORIG > ${file}
81      )
82   done
83fi
84
85# Optimization defaults to -O2
86max_log_init Util-linux ${UTILLINUX_VER} "Final (shared)" ${CONFLOGS} ${LOG}
87export CC="${TARGET}-gcc ${ARCH_CFLAGS}"
88
89# Here it is just plain ugly. We set CPU and ARCH to something that wont trigger
90# anything in MCONFIG
91export CPU=m68k
92export ARCH=m68k
93export DESTDIR=${LFS}
94
95./configure \
96   >> ${LOGFILE} 2>&1 &&
97echo " o Configure OK" &&
98
99# Don't build kill or sln
100# (procps supplies kill and glibc supplies sln)
101# No need to supply LDFLAGS="-s", taken care of during configure
102#
103# Optionally, for x86, unset CPUOPT (defaults to i486 if cpu not i386)
104# or set specifically for your cpu type.
105# See MCONFIG...
106#
107# also, build login by setting HAVE_SHADOW to no, this can be revisited
108# if/when we cross-compile the shadow package
109
110min_log_init ${BUILDLOGS} &&
111make HAVE_KILL=yes HAVE_SLN=yes HAVE_SHADOW=no CPUOPT="" \
112      >> ${LOGFILE} 2>&1 &&
113echo " o Build OK" || barf
114
115min_log_init ${INSTLOGS} &&
116echo Password:
117su -c "export PATH=${PATH} ; make HAVE_KILL=yes HAVE_SLN=yes HAVE_SHADOW=no install" \
118   >> ${LOGFILE} 2>&1 &&
119echo " o ALL OK" || barf
120
Note: See TracBrowser for help on using the repository browser.