[617118d] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | # cross-lfs native util-linux build
|
---|
| 4 | # ---------------------------------
|
---|
| 5 | # $LastChangedBy$
|
---|
| 6 | # $LastChangedDate$
|
---|
| 7 | # $LastChangedRevision$
|
---|
| 8 | # $HeadURL$
|
---|
| 9 | #
|
---|
| 10 |
|
---|
| 11 | cd ${SRC}
|
---|
| 12 | LOG=util-linux-native.log
|
---|
| 13 |
|
---|
| 14 | set_libdirname
|
---|
| 15 | setup_multiarch
|
---|
| 16 |
|
---|
| 17 | unpack_tarball util-linux-${UTILLINUX_VER} &&
|
---|
| 18 | cd ${PKGDIR}
|
---|
| 19 |
|
---|
| 20 | case ${UTILLINUX_VER} in
|
---|
| 21 | 2.12 | 2.12a )
|
---|
| 22 | case ${KERNEL_VER} in
|
---|
| 23 | 2.[56].* )
|
---|
| 24 | # Fixes for utillinux 2.12 + 2.12a for building against 2.6
|
---|
| 25 | # kernel headers
|
---|
| 26 | apply_patch util-linux-2.12a-kernel_headers-1
|
---|
| 27 | ;;
|
---|
| 28 | esac
|
---|
| 29 | ;;
|
---|
| 30 | 2.12[k-q] )
|
---|
| 31 | # fix cramfs
|
---|
| 32 | apply_patch util-linux-2.12q-cramfs-1
|
---|
| 33 | ;;
|
---|
| 34 | esac
|
---|
| 35 |
|
---|
| 36 | case ${UTILLINUX_VER} in
|
---|
| 37 | 2.12[a-m] )
|
---|
| 38 | # Patch to fix fdiskbsdlabel.h for m68k, also adds unistd.h to list
|
---|
| 39 | # of includes for swapon.c
|
---|
| 40 | apply_patch util-linux-2.12a-cross-lfs-fixes
|
---|
| 41 | ;;
|
---|
| 42 | 2.12* )
|
---|
| 43 | # Patch to fix fdiskbsdlabel.h for m68k
|
---|
| 44 | apply_patch util-linux-2.12n-cross-lfs-fixes
|
---|
| 45 | ;;
|
---|
| 46 | esac
|
---|
| 47 |
|
---|
| 48 | # Make FHS compliant
|
---|
| 49 | # Get list of files which reference etc/adjtime
|
---|
| 50 | filelist=`grep -l -d recurse etc/adjtime *`
|
---|
| 51 |
|
---|
| 52 | # Edit each file in turn
|
---|
| 53 | for file in ${filelist} ; do
|
---|
| 54 | test -f ${file}-ORIG ||
|
---|
| 55 | cp ${file} ${file}-ORIG
|
---|
| 56 | # Change instance of etc/adjtime to var/lib/hwclock/adjtime
|
---|
| 57 | sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \
|
---|
| 58 | ${file}-ORIG > ${file}
|
---|
| 59 | done
|
---|
| 60 | mkdir -p /var/lib/hwclock &&
|
---|
| 61 |
|
---|
| 62 | # Optimization defaults to -O2
|
---|
| 63 | max_log_init Util-linux ${UTILLINUX_VER} "native (shared)" ${CONFLOGS} ${LOG}
|
---|
| 64 | export CC="${CC-gcc} ${ARCH_CFLAGS}"
|
---|
| 65 |
|
---|
| 66 | # Here it is just plain ugly. We set CPU and ARCH to something that wont trigger
|
---|
| 67 | # anything in MCONFIG
|
---|
| 68 | export CPU=m68k
|
---|
| 69 | export ARCH=m68k
|
---|
| 70 | export DESTDIR=${LFS}
|
---|
| 71 |
|
---|
| 72 | ./configure \
|
---|
| 73 | >> ${LOGFILE} 2>&1 &&
|
---|
| 74 | echo " o Configure OK" &&
|
---|
| 75 |
|
---|
| 76 | # Don't build kill or sln
|
---|
| 77 | # (procps supplies kill and glibc supplies sln)
|
---|
| 78 | # No need to supply LDFLAGS="-s", taken care of during configure
|
---|
| 79 | #
|
---|
| 80 | # Optionally, for x86, unset CPUOPT (defaults to i486 if cpu not i386)
|
---|
| 81 | # or set specifically for your cpu type.
|
---|
| 82 | # See MCONFIG...
|
---|
| 83 |
|
---|
| 84 | min_log_init ${BUILDLOGS} &&
|
---|
| 85 | make HAVE_KILL=yes HAVE_SLN=yes CPUOPT="" \
|
---|
| 86 | >> ${LOGFILE} 2>&1 &&
|
---|
| 87 | echo " o Build OK" &&
|
---|
| 88 |
|
---|
| 89 | min_log_init ${INSTLOGS} &&
|
---|
| 90 | make HAVE_KILL=yes HAVE_SLN=yes install \
|
---|
| 91 | >> ${LOGFILE} 2>&1 &&
|
---|
| 92 | echo " o ALL OK" || barf
|
---|
| 93 |
|
---|