2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2016 IPFire Team <info@ipfire.org> #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
21 ###############################################################################
23 # Beautifying variables & presentation & input output interface
25 ###############################################################################
28 # Find current screen size
29 if [ -z "${COLUMNS}" ]; then
31 COLUMNS
=${COLUMNS##* }
34 # When using remote connections, such as a serial port, stty size returns 0
35 if [ "${COLUMNS}" = "0" ]; then
39 ## Measurements for positioning result messages
44 RESULT_COL
=$
((${COLUMNS} - $RESULT_WIDTH - 4))
45 TIME_COL
=$
((${RESULT_COL} - $TIME_WIDTH - 5))
46 OPT_COL
=$
((${TIME_COL} - $OPT_WIDTH - 5))
47 VER_COL
=$
((${OPT_COL} - $VER_WIDTH - 5))
49 ## Set Cursur Position Commands, used via echo -e
50 SET_RESULT_COL
="\\033[${RESULT_COL}G"
51 SET_TIME_COL
="\\033[${TIME_COL}G"
52 SET_OPT_COL
="\\033[${OPT_COL}G"
53 SET_VER_COL
="\\033[${VER_COL}G"
55 # Define color for messages
64 local target_arch
="${1}"
66 if [ "${target_arch}" = "default" ]; then
67 target_arch
="$(configure_target_guess)"
70 case "${target_arch}" in
72 BUILDTARGET
="${target_arch}-unknown-linux-gnu"
73 CROSSTARGET
="${target_arch}-cross-linux-gnu"
74 CFLAGS_ARCH
="-m64 -mtune=generic"
78 BUILDTARGET
="${target_arch}-pc-linux-gnu"
79 CROSSTARGET
="${target_arch}-cross-linux-gnu"
80 CFLAGS_ARCH
="-march=i586 -mtune=generic -fomit-frame-pointer"
84 BUILDTARGET
="${target_arch}-unknown-linux-gnueabi"
85 CROSSTARGET
="${target_arch}-cross-linux-gnueabi"
86 CFLAGS_ARCH
="-march=armv5te -mfloat-abi=soft -fomit-frame-pointer"
91 exiterror
"Cannot build for architure ${target_arch}"
95 # Check if the QEMU helper is available if needed.
96 if qemu_is_required
"${target_arch}"; then
97 local qemu_target_helper
="$(qemu_find_target_helper_name "${target_arch}")"
99 if [ -n "${qemu_target_helper}" ]; then
100 QEMU_TARGET_HELPER
="${qemu_target_helper}"
102 exiterror
"Could not find a binfmt_misc helper entry for ${target_arch}"
106 TARGET_ARCH
="${target_arch}"
109 MACHINE
="${TARGET_ARCH}"
111 CFLAGS
="-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC"
112 CFLAGS
="${CFLAGS} -fstack-protector-strong --param=ssp-buffer-size=4 ${CFLAGS_ARCH}"
116 configure_target_guess
() {
117 case "${BUILD_ARCH}" in
121 aarch64|armv7
*|armv6
*|armv5
*)
125 exiterror
"Cannot guess target architecture"
131 if [ "$?" -eq "0" ]; then
132 beautify message DONE
136 beautify message FAIL
138 if [ $EXITCODE -ne "0" ]; then
146 # ARG1=starting position on screen
147 # ARG2=string to be printed
148 # ARG3=offset, negative for left movement, positive for right movement, relative to ARG1
149 # For example if your starting position is column 50 and you want to print Hello three columns to the right
150 # of your starting position, your call will look like this:
151 # position_cursor 50 "Hello" 3 (you'll get the string Hello at position 53 (= 50 + 3)
152 # If on the other hand you want your string "Hello" to end three columns to the left of position 50,
153 # your call will look like this:
154 # position_cursor 50 "Hello" -3 (you'll get the string Hello at position 42 (= 50 - 5 -3)
155 # If you want to start printing at the exact starting location, use offset 0
161 STRING_LENGTH
=${#STRING}
163 if [ ${OFFSET} -lt 0 ]; then
164 COL
=$
((${START} + ${OFFSET} - ${STRING_LENGTH}))
166 COL
=$
((${START} + ${OFFSET}))
169 SET_COL
="\\033[${COL}G"
172 } # End of position_cursor()
177 # Commands: build_stage, make_pkg, message, result
182 echo -ne "${SET_RESULT_COL}[${DONE} DONE ${NORMAL}]\n"
185 echo -ne "${WARN}${3}${NORMAL}${SET_RESULT_COL}[${WARN} WARN ${NORMAL}]\n"
188 echo -ne "${SET_RESULT_COL}[${FAIL} FAIL ${NORMAL}]\n"
191 echo -ne "${SET_RESULT_COL}[${SKIP} SKIP ${NORMAL}]\n"
197 if [ "$STAGE_TIME_START" ]; then
198 LAST_STAGE_TIME
=$
[ `date +%s` - $STAGE_TIME_START ]
200 STAGE_TIME_START
=`date +%s`
201 echo -ne "${BOLD}*** ${MESSAGE}${NORMAL}"
202 if [ "$LAST_STAGE_TIME" ]; then
203 echo -ne "${DONE} (Last stage took $LAST_STAGE_TIME secs)${NORMAL}"
205 echo -ne "${BOLD}${SET_VER_COL} version${SET_OPT_COL} options${SET_TIME_COL} time (sec)${SET_RESULT_COL} status${NORMAL}\n"
208 BUILD_TIME_START
=`date +%s`
211 BUILD_TIME_END
=`date +%s`
212 seconds
=$
[ $BUILD_TIME_END - $BUILD_TIME_START ]
213 hours
=$
((seconds
/ 3600))
214 seconds
=$
((seconds
% 3600))
215 minutes
=$
((seconds
/ 60))
216 seconds
=$
((seconds
% 60))
218 echo -ne "${DONE}***Build is finished now and took $hours hour(s) $minutes minute(s) $seconds second(s)!${NORMAL}\n"
221 echo "$2" |
while read PKG_VER PROGRAM OPTIONS
223 SET_VER_COL_REAL
=`position_cursor $OPT_COL $PKG_VER -3`
225 if [ "$OPTIONS" == "" ]; then
226 echo -ne "${PROGRAM}${SET_VER_COL}[ ${BOLD}${SET_VER_COL_REAL}${PKG_VER}"
227 echo -ne "${NORMAL} ]${SET_RESULT_COL}"
229 echo -ne "${PROGRAM}${SET_VER_COL}[ ${BOLD}${SET_VER_COL_REAL}${PKG_VER}"
230 echo -ne "${NORMAL} ]${SET_OPT_COL}[ ${BOLD}${OPTIONS}"
231 echo -ne "${NORMAL} ]${SET_RESULT_COL}"
244 SET_TIME_COL_REAL
=`position_cursor $RESULT_COL $PKG_TIME -3`
247 echo -ne "${SET_TIME_COL}[ ${BOLD}${SET_TIME_COL_REAL}$PKG_TIME${NORMAL} ]"
248 echo -ne "${SET_RESULT_COL}[${DONE} DONE ${NORMAL}]\n"
251 echo -ne "${SET_TIME_COL}[ ${BOLD}${SET_TIME_COL_REAL}$PKG_TIME${NORMAL} ]"
252 echo -ne "${SET_RESULT_COL}[${FAIL} FAIL ${NORMAL}]\n"
255 echo -ne "${SET_RESULT_COL}[${SKIP} SKIP ${NORMAL}]\n"
260 } # End of beautify()
265 PKG_VER
=`grep -E "^VER |^VER=|^VER " $1 | awk '{print $3}'`
267 if [ -z $PKG_VER ]; then
268 PKG_VER
=`grep "Exp " $1 | awk '{print $4}'`
270 if [ -z $PKG_VER ]; then
273 if [ ${#PKG_VER} -gt $VER_WIDTH ]; then
274 # If a package version number is greater than $VER_WIDTH, we keep the first 4 characters
275 # and replace enough characters to fit the resulting string on the screen. We'll replace
276 # the extra character with .. (two dots). That's why the "+ 2" in the formula below.
277 # Example: if we have a 21-long version number that we want to fit into a 10-long space,
278 # we have to remove 11 characters. But if we replace 11 characters with 2 characters, we'll
279 # end up with a 12-character long string. That's why we replace 12 characters with ..
280 REMOVE
=`expr substr "$PKG_VER" 4 $[ ${#PKG_VER} - $VER_WIDTH + 2 ]`
281 PKG_VER
=`echo ${PKG_VER/$REMOVE/..}`
285 } # End of get_pkg_ver()
289 umount
$BASEDIR/build
/sys
2>/dev
/null
;
290 umount
$BASEDIR/build
/dev
/shm
2>/dev
/null
;
291 umount
$BASEDIR/build
/dev
/pts
2>/dev
/null
;
292 umount
$BASEDIR/build
/dev
2>/dev
/null
;
293 umount
$BASEDIR/build
/proc
2>/dev
/null
;
294 umount
$BASEDIR/build
/install
/mnt
2>/dev
/null
;
295 umount
$BASEDIR/build
/usr
/src
/cache
2>/dev
/null
;
296 umount
$BASEDIR/build
/usr
/src
/ccache
2>/dev
/null
;
297 umount
$BASEDIR/build
/usr
/src
/config
2>/dev
/null
;
298 umount
$BASEDIR/build
/usr
/src
/doc
2>/dev
/null
;
299 umount
$BASEDIR/build
/usr
/src
/html
2>/dev
/null
;
300 umount
$BASEDIR/build
/usr
/src
/langs
2>/dev
/null
;
301 umount
$BASEDIR/build
/usr
/src
/lfs
2>/dev
/null
;
302 umount
$BASEDIR/build
/usr
/src
/log
2>/dev
/null
;
303 umount
$BASEDIR/build
/usr
/src
/src
2>/dev
/null
;
308 for i
in `seq 0 7`; do
309 if ( losetup
/dev
/loop
${i} 2>/dev
/null |
grep -q "/install/images" ); then
310 losetup
-d /dev
/loop
${i} 2>/dev
/null
314 if [ -n "${LOGFILE}" ]; then
318 while read -r line
; do
320 done <<< "$(tail -n30 ${LOGFILE})"
323 echo -e "\nERROR: $*"
324 echo " Check $LOGFILE for errors if applicable"
329 [ -e "${BASEDIR}/build/tools/lib/libpakfire_preload.so" ] ||
return
331 local env
="LD_PRELOAD=/tools/lib/libpakfire_preload.so"
333 # Fake kernel version, because some of the packages do not compile
334 # with kernel 3.0 and later.
335 env
="${env} UTS_RELEASE=${KVER}"
337 # Fake machine version.
338 env
="${env} UTS_MACHINE=${TARGET_ARCH}"
346 # Don't add anything if qemu is not used.
347 if ! qemu_is_required
; then
351 # Set default qemu options
352 case "${TARGET_ARCH}" in
354 QEMU_CPU
="${QEMU_CPU:-cortex-a9}"
356 env
="${env} QEMU_CPU=${QEMU_CPU}"
361 #env="${env} QEMU_STRACE=1"
367 local target_arch
="${1}"
369 if [ -z "${target_arch}" ]; then
370 target_arch
="${TARGET_ARCH}"
373 case "${BUILD_ARCH},${target_arch}" in
374 x86_64
,arm
*|i?
86,arm
*|i?
86,x86_64
)
383 qemu_install_helper
() {
384 # Do nothing, if qemu is not required
385 if ! qemu_is_required
; then
389 if [ ! -e /proc
/sys
/fs
/binfmt_misc
/status
]; then
390 exiterror
"binfmt_misc not mounted. QEMU_TARGET_HELPER not useable."
393 if [ ! $
(cat /proc
/sys
/fs
/binfmt_misc
/status
) = 'enabled' ]; then
394 exiterror
"binfmt_misc not enabled. QEMU_TARGET_HELPER not useable."
398 if [ -z "${QEMU_TARGET_HELPER}" ]; then
399 exiterror
"QEMU_TARGET_HELPER not set"
402 # Check if the helper is already installed.
403 if [ -x "${LFS}${QEMU_TARGET_HELPER}" ]; then
407 # Try to find a suitable binary that we can install
408 # to the build environment.
410 for file in "${QEMU_TARGET_HELPER}" "${QEMU_TARGET_HELPER}-static"; do
411 # file must exist and be executable.
412 [ -x "${file}" ] ||
continue
415 file_is_static
"${file}" ||
continue
417 local dirname="${LFS}$(dirname "${file}")"
418 mkdir
-p "${dirname}"
420 install -m 755 "${file}" "${LFS}${QEMU_TARGET_HELPER}"
424 exiterror
"Could not find a statically-linked QEMU emulator: ${QEMU_TARGET_HELPER}"
427 qemu_find_target_helper_name
() {
428 local target_arch
="${1}"
431 case "${target_arch}" in
433 magic
="7f454c4601010100000000000000000002002800"
436 magic
="7f454c4602010100000000000000000002003e00"
440 [ -z "${magic}" ] && return 1
443 for file in /proc
/sys
/fs
/binfmt_misc
/*; do
444 # skip write only register entry
445 [ $
(basename "${file}") = "register" ] && continue
446 # Search for the file with the correct magic value.
447 grep -qE "^magic ${magic}$" "${file}" ||
continue
449 local interpreter
="$(grep "^interpreter
" "${file}" | awk '{ print $2 }')"
451 [ -n "${interpreter}" ] ||
continue
452 [ "${interpreter:0:1}" = "/" ] ||
continue
453 [ -x "${interpreter}" ] ||
continue
455 echo "${interpreter}"
465 file ${file} 2>/dev
/null |
grep -q "statically linked"
469 if [ ! -e $BASEDIR/build
/usr
/src
/lfs
/ ]; then
470 exiterror
"No such file or directory: $BASEDIR/build/usr/src/lfs/"
473 # Install QEMU helper, if needed
476 echo "Entering to a shell inside LFS chroot, go out with exit"
477 chroot
$LFS /tools
/bin
/env
-i HOME
=/root TERM
=$TERM PS1
='ipfire build chroot ($(uname -m)) \u:\w\$ ' \
478 PATH
=/tools
/ccache
/bin
:/bin
:/usr
/bin
:/sbin
:/usr
/sbin
:/tools
/bin \
479 VERSION
=$VERSION CONFIG_ROOT
=$CONFIG_ROOT \
480 NAME
="$NAME" SNAME
="$SNAME" SLOGAN
="$SLOGAN" \
481 CFLAGS
="${CFLAGS}" CXXFLAGS
="${CXXFLAGS}" \
482 CCACHE_DIR
=/usr
/src
/ccache \
483 CCACHE_COMPRESS
="${CCACHE_COMPRESS}" \
484 CCACHE_COMPILERCHECK
="${CCACHE_COMPILERCHECK}" \
486 BUILDTARGET
="$BUILDTARGET" \
487 CROSSTARGET
="${CROSSTARGET}" \
489 MACHINE_TYPE
="$MACHINE_TYPE" \
493 if [ $?
-ne 0 ]; then
494 beautify message FAIL
495 exiterror
"chroot error"
501 ############################################################################
503 # Necessary shell functions #
505 ############################################################################
507 # Common checking before entering the chroot and compilling
509 # Return:0 caller can continue
510 # :1 skip (nothing to do)
511 # or fail if no script file found
516 if [ ! -f $BASEDIR/lfs
/$1 ]; then
517 exiterror
"No such file or directory: $BASEDIR/$1"
520 local PKG_VER
=`get_pkg_ver $BASEDIR/lfs/$1`
521 beautify make_pkg
"$PKG_VER $*"
523 # Check if this package is supported by our architecture.
524 # If no SUP_ARCH is found, we assume the package can be built for all.
525 if grep "^SUP_ARCH" ${BASEDIR}/lfs
/${1} >/dev
/null
; then
526 # Check if package supports ${MACHINE} or all architectures.
527 if ! grep -E "^SUP_ARCH.*${MACHINE}|^SUP_ARCH.*all" ${BASEDIR}/lfs/${1} >/dev/null; then
535 for i in $SKIP_PACKAGE_LIST
537 if [ "$i" == "$1" ]; then
543 echo -ne "`date -u '+%b %e %T'`: Building $
* " >> $LOGFILE
545 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MACHINE=$MACHINE \
546 MACHINE_TYPE="$MACHINE_TYPE" \
547 MESSAGE="$1\t " download >> $LOGFILE 2>&1
548 if [ $? -ne 0 ]; then
549 exiterror "Download error
in $1"
552 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MACHINE=$MACHINE \
553 MACHINE_TYPE="$MACHINE_TYPE" \
554 MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
555 if [ $? -ne 0 ]; then
556 exiterror "md5sum error
in $1, check
file in cache or signature
"
560 } # End of lfsmakecommoncheck()
563 lfsmakecommoncheck $*
564 [ $? == 1 ] && return 0
566 local PKG_TIME_START=`date +%s`
568 cd $BASEDIR/lfs && make -f $* BUILDTARGET=$BUILDTARGET \
569 CROSSTARGET="${CROSSTARGET}" \
571 MACHINE_TYPE=$MACHINE_TYPE \
572 LFS_BASEDIR=$BASEDIR \
575 MAKETUNING=$MAKETUNING \
576 install >> $LOGFILE 2>&1
577 local COMPILE_SUCCESS=$?
578 local PKG_TIME_END=`date +%s`
580 if [ $COMPILE_SUCCESS -ne 0 ]; then
581 beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
582 exiterror "Building $
*";
584 beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
591 lfsmakecommoncheck $*
592 [ $? == 1 ] && return 0
594 # Install QEMU helper, if needed
597 local PKG_TIME_START=`date +%s`
598 chroot $LFS /tools/bin/env -i HOME=/root \
599 TERM=$TERM PS1='\u:\w\$ ' \
600 PATH=/tools/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
601 VERSION=$VERSION PAKFIRE_CORE="${PAKFIRE_CORE}" \
602 SYSTEM_RELEASE="${SYSTEM_RELEASE}" \
603 CONFIG_ROOT=$CONFIG_ROOT \
604 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
605 CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
606 CCACHE_DIR=/usr/src/ccache \
607 CCACHE_COMPRESS="${CCACHE_COMPRESS}" \
608 CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
609 KVER=$KVER MAKETUNING=$MAKETUNING \
610 BUILDTARGET="$BUILDTARGET" \
611 CROSSTARGET="${CROSSTARGET}" \
613 MACHINE_TYPE="$MACHINE_TYPE" \
616 /tools/bin/bash -x -c "cd /usr
/src
/lfs
&& \
617 make -f $
* LFS_BASEDIR
=/usr
/src
install" >>$LOGFILE 2>&1
618 local COMPILE_SUCCESS=$?
619 local PKG_TIME_END=`date +%s`
621 if [ $COMPILE_SUCCESS -ne 0 ]; then
622 beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
623 exiterror "Building $
*";
625 beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
632 lfsmakecommoncheck $*
633 [ $? == 1 ] && return 0
635 # Install QEMU helper, if needed
638 local PKG_TIME_START=`date +%s`
639 chroot $LFS /tools/bin/env -i HOME=/root \
640 TERM=$TERM PS1='\u:\w\$ ' \
641 PATH=/tools/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin \
644 CONFIG_ROOT=$CONFIG_ROOT \
645 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
646 SYSTEM_RELEASE="$SYSTEM_RELEASE" \
647 CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
648 CCACHE_DIR=/usr/src/ccache \
649 CCACHE_COMPRESS="${CCACHE_COMPRESS}" \
650 CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
651 KVER=$KVER MAKETUNING=$MAKETUNING \
652 BUILDTARGET="$BUILDTARGET" \
653 CROSSTARGET="${CROSSTARGET}" \
655 MACHINE_TYPE="$MACHINE_TYPE" \
658 /bin/bash -x -c "cd /usr
/src
/lfs
&& \
659 make -f $
* LFS_BASEDIR
=/usr
/src
install" >>$LOGFILE 2>&1
661 local COMPILE_SUCCESS=$?
662 local PKG_TIME_END=`date +%s`
664 if [ $COMPILE_SUCCESS -ne 0 ]; then
665 beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
666 exiterror "Building $
*";
668 beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
674 lfsmakecommoncheck $*
675 [ $? == 1 ] && return 0
677 # Install QEMU helper, if needed
680 local PKG_TIME_START=`date +%s`
681 chroot $LFS /tools/bin/env -i HOME=/root \
682 TERM=$TERM PS1='\u:\w\$ ' \
683 PATH=/tools/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin \
685 CONFIG_ROOT=$CONFIG_ROOT \
686 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
687 CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
688 CCACHE_DIR=/usr/src/ccache \
689 CCACHE_COMPRESS="${CCACHE_COMPRESS}" \
690 CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
692 BUILDTARGET="$BUILDTARGET" \
693 CROSSTARGET="${CROSSTARGET}" \
695 MACHINE_TYPE="$MACHINE_TYPE" \
698 /bin/bash -x -c "cd /usr
/src
/lfs
&& \
699 make -f $1 LFS_BASEDIR
=/usr
/src dist
" >>$LOGFILE 2>&1
701 local COMPILE_SUCCESS=$?
702 local PKG_TIME_END=`date +%s`
704 if [ $COMPILE_SUCCESS -ne 0 ]; then
705 beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
706 exiterror "Packaging $
*";
708 beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
714 lfsmakecommoncheck $*
715 [ $? == 1 ] && return 0
717 # Install QEMU helper, if needed
720 local PKG_TIME_START=`date +%s`
721 chroot $LFS /tools/bin/env -i HOME=/root \
722 TERM=$TERM PS1='\u:\w\$ ' \
723 PATH=/tools/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin \
725 SYSTEM_RELEASE="${SYSTEM_RELEASE}" \
726 CONFIG_ROOT=$CONFIG_ROOT \
727 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
728 CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
729 CCACHE_DIR=/usr/src/ccache CCACHE_COMPRESS=1 CCACHE_HASHDIR=1 \
731 BUILDTARGET="$BUILDTARGET" \
732 CROSSTARGET="${CROSSTARGET}" \
734 MACHINE_TYPE="$MACHINE_TYPE" \
735 LD_LIBRARY_PATH=/tools/lib \
736 /tools/bin/bash -x -c "cd /usr
/src
/lfs
&& \
737 /tools
/bin
/make -f $
* LFS_BASEDIR
=/usr
/src
install" >>$LOGFILE 2>&1
739 local COMPILE_SUCCESS=$?
740 local PKG_TIME_END=`date +%s`
742 if [ $COMPILE_SUCCESS -ne 0 ]; then
743 beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
744 exiterror "Building $
*";
746 beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
752 echo -ne "Checking the translations
for missing or obsolete
strings...
"
753 chmod 755 $BASEDIR/tools/{check_strings.pl,sort_strings.pl,check_langs.sh}
754 $BASEDIR/tools/sort_strings.pl en
755 $BASEDIR/tools/sort_strings.pl de
756 $BASEDIR/tools/sort_strings.pl fr
757 $BASEDIR/tools/sort_strings.pl es
758 $BASEDIR/tools/sort_strings.pl pl
759 $BASEDIR/tools/sort_strings.pl ru
760 $BASEDIR/tools/sort_strings.pl nl
761 $BASEDIR/tools/sort_strings.pl tr
762 $BASEDIR/tools/sort_strings.pl it
763 $BASEDIR/tools/check_strings.pl en > $BASEDIR/doc/language_issues.en
764 $BASEDIR/tools/check_strings.pl de > $BASEDIR/doc/language_issues.de
765 $BASEDIR/tools/check_strings.pl fr > $BASEDIR/doc/language_issues.fr
766 $BASEDIR/tools/check_strings.pl es > $BASEDIR/doc/language_issues.es
767 $BASEDIR/tools/check_strings.pl es > $BASEDIR/doc/language_issues.pl
768 $BASEDIR/tools/check_strings.pl ru > $BASEDIR/doc/language_issues.ru
769 $BASEDIR/tools/check_strings.pl nl > $BASEDIR/doc/language_issues.nl
770 $BASEDIR/tools/check_strings.pl tr > $BASEDIR/doc/language_issues.tr
771 $BASEDIR/tools/check_strings.pl it > $BASEDIR/doc/language_issues.it
772 $BASEDIR/tools/check_langs.sh > $BASEDIR/doc/language_missings
773 beautify message DONE
775 echo -ne "Updating language lists...
"
776 update_language_list ${BASEDIR}/src/installer/po
777 update_language_list ${BASEDIR}/src/setup/po
778 beautify message DONE
781 update_language_list() {
785 for lang in ${path}/*.po; do
786 lang="$
(basename "${lang}")"
788 done | sort -u > "${path}/LINGUAS
"