source: scripts/target-scripts/target-util-linux.sh@ 60454e2

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 60454e2 was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100755
File size: 3.2 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-q] )
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 ;;
42esac
43
44case ${UTILLINUX_VER} in
45 2.12 | 2.12[a-m] )
46 # Patch to fix fdiskbsdlabel.h for m68k, also adds unistd.h to list
47 # of includes for swapon.c
48 apply_patch util-linux-2.12a-cross-lfs-fixes
49 ;;
50 2.12* )
51 # Patch to fix fdiskbsdlabel.h for m68k
52 apply_patch util-linux-2.12n-cross-lfs-fixes
53 ;;
54esac
55
56# Make FHS compliant
57# Get list of files which reference etc/adjtime
58filelist=`grep -l -d recurse etc/adjtime *`
59
60# Edit each file in turn
61for file in ${filelist} ; do
62 test -f ${file}-ORIG ||
63 cp ${file} ${file}-ORIG
64 # Change instance of etc/adjtime to var/lib/hwclock/adjtime
65 sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \
66 ${file}-ORIG > ${file}
67done
68mkdir -p ${LFS}/var/lib/hwclock
69
70if [ ! "${USE_SYSROOT}" = "Y" ]; then
71 echo " o Changing hard coded references to /usr/include to point at ${TGT_TOOLS}"
72 flist=`grep -d recurse -l /usr/include *`
73 for file in ${flist}; do
74 (
75 echo " - editing ${file}"
76 test -f ${file}-ORIG || cp ${file} ${file}-ORIG
77 sed 's@/usr/include@${TGT_TOOLS}/include@g' ${file}-ORIG > ${file}
78 )
79 done
80fi
81
82# Optimization defaults to -O2
83max_log_init Util-linux ${UTILLINUX_VER} "Final (shared)" ${CONFLOGS} ${LOG}
84export CC="${TARGET}-gcc ${ARCH_CFLAGS}"
85
86# Here it is just plain ugly. We set CPU and ARCH to something that wont trigger
87# anything in MCONFIG
88export CPU=m68k
89export ARCH=m68k
90export DESTDIR=${LFS}
91
92./configure \
93 >> ${LOGFILE} 2>&1 &&
94echo " o Configure OK" &&
95
96# Don't build kill or sln
97# (procps supplies kill and glibc supplies sln)
98# No need to supply LDFLAGS="-s", taken care of during configure
99#
100# Optionally, for x86, unset CPUOPT (defaults to i486 if cpu not i386)
101# or set specifically for your cpu type.
102# See MCONFIG...
103#
104# also, build login by setting HAVE_SHADOW to no, this can be revisited
105# if/when we cross-compile the shadow package
106
107min_log_init ${BUILDLOGS} &&
108make HAVE_KILL=yes HAVE_SLN=yes HAVE_SHADOW=no CPUOPT="" \
109 >> ${LOGFILE} 2>&1 &&
110echo " o Build OK" || barf
111
112min_log_init ${INSTLOGS} &&
113echo Password:
114su -c "export PATH=${PATH} ; make HAVE_KILL=yes HAVE_SLN=yes HAVE_SHADOW=no install" \
115 >> ${LOGFILE} 2>&1 &&
116echo " o ALL OK" || barf
117
Note: See TracBrowser for help on using the repository browser.