2 ############################################################################
4 # This file is part of the IPFire Firewall. #
6 # IPFire is free software; you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation; either version 2 of the License, or #
9 # (at your option) any later version. #
11 # IPFire is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with IPFire; if not, write to the Free Software #
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
20 # Copyright (C) 2007-2017 IPFire Team <info@ipfire.org>. #
22 ############################################################################
25 NAME
="IPFire" # Software name
26 SNAME
="ipfire" # Short name
27 VERSION
="2.19" # Version number
28 CORE
="117" # Core Level (Filename)
29 PAKFIRE_CORE
="116" # Core Level (PAKFIRE)
30 GIT_BRANCH
=`git rev-parse --abbrev-ref HEAD` # Git Branch
31 SLOGAN
="www.ipfire.org" # Software slogan
32 CONFIG_ROOT
=/var
/ipfire
# Configuration rootdir
34 MAX_RETRIES
=1 # prefetch/check loop
35 BUILD_IMAGES
=1 # Flash and Xen Downloader
36 KVER
=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
37 GIT_TAG
=$
(git tag |
tail -1) # Git Tag
38 GIT_LASTCOMMIT
=$
(git log |
head -n1 | cut
-d" " -f2 |
head -c8) # Last commit
42 ###############################################################################
44 # Beautifying variables & presentation & input output interface
46 ###############################################################################
49 # Find current screen size
50 if [ -z "${COLUMNS}" ]; then
52 COLUMNS
=${COLUMNS##* }
55 # When using remote connections, such as a serial port, stty size returns 0
56 if [ "${COLUMNS}" = "0" ]; then
60 ## Measurements for positioning result messages
65 RESULT_COL
=$
((${COLUMNS} - $RESULT_WIDTH - 4))
66 TIME_COL
=$
((${RESULT_COL} - $TIME_WIDTH - 5))
67 OPT_COL
=$
((${TIME_COL} - $OPT_WIDTH - 5))
68 VER_COL
=$
((${OPT_COL} - $VER_WIDTH - 5))
70 ## Set Cursur Position Commands, used via echo -e
71 SET_RESULT_COL
="\\033[${RESULT_COL}G"
72 SET_TIME_COL
="\\033[${TIME_COL}G"
73 SET_OPT_COL
="\\033[${OPT_COL}G"
74 SET_VER_COL
="\\033[${VER_COL}G"
76 # Define color for messages
84 # New architecture variables
85 HOST_ARCH
="$(uname -m)"
88 BASENAME
=$
(basename $0)
90 # Debian specific settings
91 if [ ! -e /etc
/debian_version
]; then
94 if [ -x /usr
/bin
/realpath
]; then
95 FULLPATH
=`/usr/bin/realpath $0`
97 echo "ERROR: Need to do apt-get install realpath"
102 # This is the directory where make.sh is in
103 BASEDIR
=$
(echo $FULLPATH |
sed "s/\/$BASENAME//g")
105 LOGFILE
=$BASEDIR/log
/_build.preparation.log
106 export BASEDIR LOGFILE
107 DIR_CHK
=$BASEDIR/cache
/check
108 mkdir
$BASEDIR/log
/ 2>/dev
/null
110 system_processors
() {
111 getconf _NPROCESSORS_ONLN
2>/dev
/null ||
echo "1"
117 while read -r key val unit
; do
121 echo "$(( ${val} / 1024 ))"
129 local build_arch
="${1}"
131 if [ "${build_arch}" = "default" ]; then
132 build_arch
="$(configure_build_guess)"
135 case "${build_arch}" in
137 BUILDTARGET
="${build_arch}-unknown-linux-gnu"
138 CROSSTARGET
="${build_arch}-cross-linux-gnu"
140 CFLAGS_ARCH
="-m64 -mtune=generic"
144 BUILDTARGET
="${build_arch}-pc-linux-gnu"
145 CROSSTARGET
="${build_arch}-cross-linux-gnu"
147 CFLAGS_ARCH
="-march=i586 -mtune=generic -fomit-frame-pointer"
151 BUILDTARGET
="${build_arch}-unknown-linux-gnu"
152 CROSSTARGET
="${build_arch}-cross-linux-gnu"
158 BUILDTARGET
="${build_arch}-unknown-linux-gnueabi"
159 CROSSTARGET
="${build_arch}-cross-linux-gnueabi"
161 CFLAGS_ARCH
="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
165 BUILDTARGET
="${build_arch}-unknown-linux-gnueabi"
166 CROSSTARGET
="${build_arch}-cross-linux-gnueabi"
168 CFLAGS_ARCH
="-march=armv5te -mfloat-abi=soft -fomit-frame-pointer"
172 exiterror
"Cannot build for architure ${build_arch}"
176 # Check if the QEMU helper is available if needed.
177 if qemu_is_required
"${build_arch}"; then
178 local qemu_build_helper
="$(qemu_find_build_helper_name "${build_arch}")"
180 if [ -n "${qemu_build_helper}" ]; then
181 QEMU_TARGET_HELPER
="${qemu_build_helper}"
183 exiterror
"Could not find a binfmt_misc helper entry for ${build_arch}"
187 BUILD_ARCH
="${build_arch}"
188 TOOLS_DIR
="/tools_${BUILD_ARCH}"
191 HARDENING_CFLAGS
="-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4"
193 CFLAGS
="-O2 -pipe -Wall -fexceptions -fPIC ${CFLAGS_ARCH}"
196 # Determine parallelism
197 if [ -z "${MAKETUNING}" ]; then
198 # We assume that each process consumes about
199 # 192MB of memory. Therefore we find out how
200 # many processes fit into memory.
201 local mem_max
=$
(( ${HOST_MEM} / 192 ))
203 local processors
="$(system_processors)"
204 local cpu_max
=$
(( ${processors} * 2 ))
207 if [ ${mem_max} -lt ${cpu_max} ]; then
208 parallelism
=${mem_max}
210 parallelism
=${cpu_max}
213 MAKETUNING
="-j${parallelism}"
217 configure_build_guess
() {
218 case "${HOST_ARCH}" in
227 armv7
*|armv6
*|armv5
*)
232 exiterror
"Cannot guess build architecture"
238 if [ "$?" -eq "0" ]; then
239 beautify message DONE
243 beautify message FAIL
245 if [ $EXITCODE -ne "0" ]; then
252 # ARG1=starting position on screen
253 # ARG2=string to be printed
254 # ARG3=offset, negative for left movement, positive for right movement, relative to ARG1
255 # For example if your starting position is column 50 and you want to print Hello three columns to the right
256 # of your starting position, your call will look like this:
257 # position_cursor 50 "Hello" 3 (you'll get the string Hello at position 53 (= 50 + 3)
258 # If on the other hand you want your string "Hello" to end three columns to the left of position 50,
259 # your call will look like this:
260 # position_cursor 50 "Hello" -3 (you'll get the string Hello at position 42 (= 50 - 5 -3)
261 # If you want to start printing at the exact starting location, use offset 0
267 STRING_LENGTH
=${#STRING}
269 if [ ${OFFSET} -lt 0 ]; then
270 COL
=$
((${START} + ${OFFSET} - ${STRING_LENGTH}))
272 COL
=$
((${START} + ${OFFSET}))
275 SET_COL
="\\033[${COL}G"
281 # Commands: build_stage, make_pkg, message, result
286 echo -ne "${SET_RESULT_COL}[${DONE} DONE ${NORMAL}]\n"
289 echo -ne "${WARN}${3}${NORMAL}${SET_RESULT_COL}[${WARN} WARN ${NORMAL}]\n"
292 echo -ne "${SET_RESULT_COL}[${FAIL} FAIL ${NORMAL}]\n"
295 echo -ne "${SET_RESULT_COL}[${SKIP} SKIP ${NORMAL}]\n"
301 if [ "$STAGE_TIME_START" ]; then
302 LAST_STAGE_TIME
=$
[ `date +%s` - $STAGE_TIME_START ]
304 STAGE_TIME_START
=`date +%s`
305 echo -ne "${BOLD}*** (${BUILD_ARCH}) ${MESSAGE}${NORMAL}"
306 if [ "$LAST_STAGE_TIME" ]; then
307 echo -ne "${DONE} (Last stage took $LAST_STAGE_TIME secs)${NORMAL}\n"
309 echo -ne "${BOLD}${SET_VER_COL} version${SET_OPT_COL} options${SET_TIME_COL} time (sec)${SET_RESULT_COL} status${NORMAL}\n"
312 BUILD_TIME_START
=`date +%s`
315 BUILD_TIME_END
=`date +%s`
316 seconds
=$
[ $BUILD_TIME_END - $BUILD_TIME_START ]
317 hours
=$
((seconds
/ 3600))
318 seconds
=$
((seconds
% 3600))
319 minutes
=$
((seconds
/ 60))
320 seconds
=$
((seconds
% 60))
322 echo -ne "${DONE}***Build is finished now and took $hours hour(s) $minutes minute(s) $seconds second(s)!${NORMAL}\n"
325 echo "$2" |
while read PKG_VER PROGRAM OPTIONS
327 SET_VER_COL_REAL
=`position_cursor $OPT_COL $PKG_VER -3`
329 if [ "$OPTIONS" == "" ]; then
330 echo -ne "${PROGRAM}${SET_VER_COL}[ ${BOLD}${SET_VER_COL_REAL}${PKG_VER}"
331 echo -ne "${NORMAL} ]${SET_RESULT_COL}"
333 echo -ne "${PROGRAM}${SET_VER_COL}[ ${BOLD}${SET_VER_COL_REAL}${PKG_VER}"
334 echo -ne "${NORMAL} ]${SET_OPT_COL}[ ${BOLD}${OPTIONS}"
335 echo -ne "${NORMAL} ]${SET_RESULT_COL}"
348 SET_TIME_COL_REAL
=`position_cursor $RESULT_COL $PKG_TIME -3`
351 echo -ne "${SET_TIME_COL}[ ${BOLD}${SET_TIME_COL_REAL}$PKG_TIME${NORMAL} ]"
352 echo -ne "${SET_RESULT_COL}[${DONE} DONE ${NORMAL}]\n"
355 echo -ne "${SET_TIME_COL}[ ${BOLD}${SET_TIME_COL_REAL}$PKG_TIME${NORMAL} ]"
356 echo -ne "${SET_RESULT_COL}[${FAIL} FAIL ${NORMAL}]\n"
359 echo -ne "${SET_RESULT_COL}[${SKIP} SKIP ${NORMAL}]\n"
367 PKG_VER
=`grep -E "^VER |^VER=|^VER " $1 | awk '{print $3}'`
369 if [ -z $PKG_VER ]; then
370 PKG_VER
=`grep "Exp " $1 | awk '{print $4}'`
372 if [ -z $PKG_VER ]; then
375 if [ ${#PKG_VER} -gt $VER_WIDTH ]; then
376 # If a package version number is greater than $VER_WIDTH, we keep the first 4 characters
377 # and replace enough characters to fit the resulting string on the screen. We'll replace
378 # the extra character with .. (two dots). That's why the "+ 2" in the formula below.
379 # Example: if we have a 21-long version number that we want to fit into a 10-long space,
380 # we have to remove 11 characters. But if we replace 11 characters with 2 characters, we'll
381 # end up with a 12-character long string. That's why we replace 12 characters with ..
382 REMOVE
=`expr substr "$PKG_VER" 4 $[ ${#PKG_VER} - $VER_WIDTH + 2 ]`
383 PKG_VER
=`echo ${PKG_VER/$REMOVE/..}`
390 umount
$BASEDIR/build
/sys
2>/dev
/null
;
391 umount
$BASEDIR/build
/dev
/shm
2>/dev
/null
;
392 umount
$BASEDIR/build
/dev
/pts
2>/dev
/null
;
393 umount
$BASEDIR/build
/dev
2>/dev
/null
;
394 umount
$BASEDIR/build
/proc
2>/dev
/null
;
395 umount
$BASEDIR/build
/install
/mnt
2>/dev
/null
;
396 umount
$BASEDIR/build
/usr
/src
/cache
2>/dev
/null
;
397 umount
$BASEDIR/build
/usr
/src
/ccache
2>/dev
/null
;
398 umount
$BASEDIR/build
/usr
/src
/config
2>/dev
/null
;
399 umount
$BASEDIR/build
/usr
/src
/doc
2>/dev
/null
;
400 umount
$BASEDIR/build
/usr
/src
/html
2>/dev
/null
;
401 umount
$BASEDIR/build
/usr
/src
/langs
2>/dev
/null
;
402 umount
$BASEDIR/build
/usr
/src
/lfs
2>/dev
/null
;
403 umount
$BASEDIR/build
/usr
/src
/log
2>/dev
/null
;
404 umount
$BASEDIR/build
/usr
/src
/src
2>/dev
/null
;
409 for i
in `seq 0 7`; do
410 if ( losetup
/dev
/loop
${i} 2>/dev
/null |
grep -q "/install/images" ); then
411 losetup
-d /dev
/loop
${i} 2>/dev
/null
415 if [ -n "${LOGFILE}" ]; then
419 while read -r line
; do
421 done <<< "$(tail -n30 ${LOGFILE})"
424 echo -e "\nERROR: $*"
425 echo " Check $LOGFILE for errors if applicable"
430 # Install QEMU helper, if needed
433 local PATH
="${TOOLS_DIR}/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:${TOOLS_DIR}/bin"
435 PATH
="${PATH}" chroot
${LFS} env
-i \
440 SYSTEM_RELEASE
="${SYSTEM_RELEASE}" \
441 PAKFIRE_CORE
="${PAKFIRE_CORE}" \
444 VERSION
="${VERSION}" \
447 TOOLS_DIR
="${TOOLS_DIR}" \
448 CONFIG_ROOT
="${CONFIG_ROOT}" \
449 CFLAGS
="${CFLAGS} ${HARDENING_CFLAGS}" \
450 CXXFLAGS
="${CXXFLAGS} ${HARDENING_CFLAGS}" \
451 BUILDTARGET
="${BUILDTARGET}" \
452 CROSSTARGET
="${CROSSTARGET}" \
453 BUILD_ARCH
="${BUILD_ARCH}" \
454 BUILD_PLATFORM
="${BUILD_PLATFORM}" \
455 CCACHE_DIR
=/usr
/src
/ccache \
456 CCACHE_COMPRESS
="${CCACHE_COMPRESS}" \
457 CCACHE_COMPILERCHECK
="${CCACHE_COMPILERCHECK}" \
465 if [ ! -e $BASEDIR/build
/usr
/src
/lfs
/ ]; then
466 exiterror
"No such file or directory: $BASEDIR/build/usr/src/lfs/"
469 echo "Entering to a shell inside LFS chroot, go out with exit"
470 local PS1
="ipfire build chroot ($(uname -m)) \u:\w\$ "
472 if enterchroot bash
-i; then
475 beautify message FAIL
476 exiterror
"chroot error"
480 lfsmakecommoncheck
() {
482 if [ ! -f $BASEDIR/lfs
/$1 ]; then
483 exiterror
"No such file or directory: $BASEDIR/$1"
486 local PKG_VER
=`get_pkg_ver $BASEDIR/lfs/$1`
487 beautify make_pkg
"$PKG_VER $*"
489 # Check if this package is supported by our architecture.
490 # If no SUP_ARCH is found, we assume the package can be built for all.
491 if grep "^SUP_ARCH" ${BASEDIR}/lfs
/${1} >/dev
/null
; then
492 # Check if package supports ${BUILD_ARCH} or all architectures.
493 if ! grep -E "^SUP_ARCH.*${BUILD_ARCH}|^SUP_ARCH.*all" ${BASEDIR}/lfs/${1} >/dev/null; then
501 for i in $SKIP_PACKAGE_LIST
503 if [ "$i" == "$1" ]; then
509 echo -ne "`date -u '+%b %e %T'`: Building $
* " >> $LOGFILE
511 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
512 MESSAGE="$1\t " download >> $LOGFILE 2>&1
513 if [ $? -ne 0 ]; then
514 exiterror "Download error
in $1"
517 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR BUILD_ARCH="${BUILD_ARCH}" \
518 MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
519 if [ $? -ne 0 ]; then
520 exiterror "md5sum error
in $1, check
file in cache or signature
"
527 lfsmakecommoncheck $*
528 [ $? == 1 ] && return 0
530 local PKG_TIME_START=`date +%s`
532 cd $BASEDIR/lfs && env -i \
533 PATH="${TOOLS_DIR}/ccache
/bin
:${TOOLS_DIR}/bin
:$PATH" \
534 CCACHE_DIR="${CCACHE_DIR}" \
535 CCACHE_COMPRESS="${CCACHE_COMPRESS}" \
536 CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
538 CXXFLAGS="${CXXFLAGS}" \
539 MAKETUNING="${MAKETUNING}" \
542 TOOLS_DIR="${TOOLS_DIR}" \
543 CROSSTARGET="${CROSSTARGET}" \
544 BUILDTARGET="${BUILDTARGET}" \
545 BUILD_ARCH="${BUILD_ARCH}" \
546 BUILD_PLATFORM="${BUILD_PLATFORM}" \
547 LFS_BASEDIR="${BASEDIR}" \
550 install >> $LOGFILE 2>&1
552 local COMPILE_SUCCESS=$?
553 local PKG_TIME_END=`date +%s`
555 if [ $COMPILE_SUCCESS -ne 0 ]; then
556 beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
557 exiterror "Building $
*";
559 beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
566 lfsmakecommoncheck $*
567 [ $? == 1 ] && return 0
569 local PKG_TIME_START=`date +%s`
573 bash -x -c "cd /usr
/src
/lfs
&& \
574 MAKETUNING
=${MAKETUNING} \
576 LFS_BASEDIR
=/usr
/src
install" \
579 local COMPILE_SUCCESS=$?
580 local PKG_TIME_END=`date +%s`
582 if [ $COMPILE_SUCCESS -ne 0 ]; then
583 beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
584 exiterror "Building $
*";
586 beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
593 lfsmakecommoncheck $*
594 [ $? == 1 ] && return 0
596 local PKG_TIME_START=`date +%s`
600 bash -x -c "cd /usr
/src
/lfs
&& make -f $
* LFS_BASEDIR
=/usr
/src dist
" \
603 local COMPILE_SUCCESS=$?
604 local PKG_TIME_END=`date +%s`
606 if [ $COMPILE_SUCCESS -ne 0 ]; then
607 beautify result FAIL $[ $PKG_TIME_END - $PKG_TIME_START ]
608 exiterror "Packaging $
*";
610 beautify result DONE $[ $PKG_TIME_END - $PKG_TIME_START ]
616 [ -e "${BASEDIR}/build
${TOOLS_DIR}/lib
/libpakfire_preload.so
" ] || return
618 local env="LD_PRELOAD
=${TOOLS_DIR}/lib
/libpakfire_preload.so
"
620 # Fake kernel version, because some of the packages do not compile
621 # with kernel 3.0 and later.
622 env="${env} UTS_RELEASE
=${KVER}"
624 # Fake machine version.
625 env="${env} UTS_MACHINE
=${BUILD_ARCH}"
633 # Don't add anything if qemu is not used.
634 if ! qemu_is_required; then
638 # Set default qemu options
639 case "${BUILD_ARCH}" in
641 QEMU_CPU="${QEMU_CPU:-cortex-a9}"
643 env="${env} QEMU_CPU
=${QEMU_CPU}"
648 #env="${env} QEMU_STRACE
=1"
654 local build_arch="${1}"
656 if [ -z "${build_arch}" ]; then
657 build_arch="${BUILD_ARCH}"
660 case "${HOST_ARCH},${build_arch}" in
661 x86_64,arm*|i?86,arm*|i?86,x86_64)
670 qemu_install_helper() {
671 # Do nothing, if qemu is not required
672 if ! qemu_is_required; then
676 if [ ! -e /proc/sys/fs/binfmt_misc/status ]; then
677 exiterror "binfmt_misc not mounted. QEMU_TARGET_HELPER not useable.
"
680 if [ ! $(cat /proc/sys/fs/binfmt_misc/status) = 'enabled' ]; then
681 exiterror "binfmt_misc not enabled. QEMU_TARGET_HELPER not useable.
"
685 if [ -z "${QEMU_TARGET_HELPER}" ]; then
686 exiterror "QEMU_TARGET_HELPER not
set"
689 # Check if the helper is already installed.
690 if [ -x "${LFS}${QEMU_TARGET_HELPER}" ]; then
694 # Try to find a suitable binary that we can install
695 # to the build environment.
697 for file in "${QEMU_TARGET_HELPER}" "${QEMU_TARGET_HELPER}-static"; do
698 # file must exist and be executable.
699 [ -x "${file}" ] || continue
702 file_is_static "${file}" || continue
704 local dirname="${LFS}$
(dirname "${file}")"
705 mkdir -p "${dirname}"
707 install -m 755 "${file}" "${LFS}${QEMU_TARGET_HELPER}"
711 exiterror "Could not
find a statically-linked QEMU emulator
: ${QEMU_TARGET_HELPER}"
714 qemu_find_build_helper_name() {
715 local build_arch="${1}"
718 case "${build_arch}" in
720 magic="7f454c4601010100000000000000000002002800
"
723 magic="7f454c4602010100000000000000000002003e00
"
727 [ -z "${magic}" ] && return 1
730 for file in /proc/sys/fs/binfmt_misc/*; do
731 # skip write only register entry
732 [ $(basename "${file}") = "register
" ] && continue
733 # Search for the file with the correct magic value.
734 grep -qE "^magic
${magic}$
" "${file}" || continue
736 local interpreter="$
(grep "^interpreter" "${file}" |
awk '{ print $2 }')"
738 [ -n "${interpreter}" ] || continue
739 [ "${interpreter:0:1}" = "/" ] || continue
740 [ -x "${interpreter}" ] || continue
742 echo "${interpreter}"
752 file ${file} 2>/dev/null | grep -q "statically linked
"
755 update_language_list() {
759 for lang in ${path}/*.po; do
760 lang="$
(basename "${lang}")"
762 done | sort -u > "${path}/LINGUAS
"
765 # Load configuration file
766 if [ -f .config ]; then
770 # TARGET_ARCH is BUILD_ARCH now
771 if [ -n "${TARGET_ARCH}" ]; then
772 BUILD_ARCH="${TARGET_ARCH}"
776 # Get the amount of memory in this build system
777 HOST_MEM=$(system_memory)
779 if [ -n "${BUILD_ARCH}" ]; then
780 configure_build "${BUILD_ARCH}"
782 configure_build "default
"
786 ############################################################################
788 # Are we running the right shell? #
790 ############################################################################
791 if [ ! "$BASH" ]; then
792 exiterror "BASH environment variable is not
set. You
're probably running the wrong shell."
795 if [ -z "${BASH_VERSION}" ]; then
796 exiterror "Not running BASH shell."
800 ############################################################################
802 # Trap on emergency exit #
804 ############################################################################
805 trap "exiterror 'Build process interrupted
'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
808 ############################################################################
810 # Resetting our nice level #
812 ############################################################################
813 echo -ne "Resetting our nice level to $NICE" | tee -a $LOGFILE
814 renice $NICE $$ > /dev/null
815 if [ `nice` != "$NICE" ]; then
816 beautify message FAIL
817 exiterror "Failed to set correct nice level"
819 beautify message DONE
823 ############################################################################
825 # Checking if running as root user #
827 ############################################################################
828 echo -ne "Checking if we're running as root user
" | tee -a $LOGFILE
829 if [ `id -u` != 0 ]; then
830 beautify message FAIL
831 exiterror "Not building as root
"
833 beautify message DONE
837 ############################################################################
839 # Checking for necessary temporary space #
841 ############################################################################
842 echo -ne "Checking
for necessary space on disk
$BASE_DEV" | tee -a $LOGFILE
843 BASE_DEV=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $1 }'`
844 BASE_ASPACE=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $4 }'`
845 if (( 2048000 > $BASE_ASPACE )); then
846 BASE_USPACE=`du -skx $BASEDIR | awk '{print $1}'`
847 if (( 2048000 - $BASE_USPACE > $BASE_ASPACE )); then
848 beautify message FAIL
849 exiterror "Not enough temporary space available
, need
at least
2GB on
$BASE_DEV"
852 beautify message DONE
855 ############################################################################
857 # Building Linux From Scratch system #
859 ############################################################################
866 # Check ${TOOLS_DIR} symlink
867 if [ -h "${TOOLS_DIR}" ]; then
871 if [ ! -e "${TOOLS_DIR}" ]; then
872 ln -s "${BASEDIR}/build${TOOLS_DIR}" "${TOOLS_DIR}"
875 if [ ! -h "${TOOLS_DIR}" ]; then
876 exiterror "Could not create
${TOOLS_DIR} symbolic link
"
882 export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
883 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
885 # Make some extra directories
886 mkdir -p "${BASEDIR}/build
${TOOLS_DIR}" 2>/dev/null
887 mkdir -p $BASEDIR/build/{etc,usr/src} 2>/dev/null
888 mkdir -p $BASEDIR/build/{dev/{shm,pts},proc,sys}
889 mkdir -p $BASEDIR/{cache,ccache} 2>/dev/null
890 mkdir -p $BASEDIR/build/usr/src/{cache,config,doc,html,langs,lfs,log,src,ccache}
892 mknod -m 600 $BASEDIR/build/dev/console c 5 1 2>/dev/null
893 mknod -m 666 $BASEDIR/build/dev/null c 1 3 2>/dev/null
895 # Make all sources and proc available under lfs build
896 mount --bind /dev $BASEDIR/build/dev
897 mount --bind /dev/pts $BASEDIR/build/dev/pts
898 mount --bind /dev/shm $BASEDIR/build/dev/shm
899 mount --bind /proc $BASEDIR/build/proc
900 mount --bind /sys $BASEDIR/build/sys
901 mount --bind $BASEDIR/cache $BASEDIR/build/usr/src/cache
902 mount --bind $BASEDIR/ccache $BASEDIR/build/usr/src/ccache
903 mount --bind $BASEDIR/config $BASEDIR/build/usr/src/config
904 mount --bind $BASEDIR/doc $BASEDIR/build/usr/src/doc
905 mount --bind $BASEDIR/html $BASEDIR/build/usr/src/html
906 mount --bind $BASEDIR/langs $BASEDIR/build/usr/src/langs
907 mount --bind $BASEDIR/lfs $BASEDIR/build/usr/src/lfs
908 mount --bind $BASEDIR/log $BASEDIR/build/usr/src/log
909 mount --bind $BASEDIR/src $BASEDIR/build/usr/src/src
911 # Run LFS static binary creation scripts one by one
912 export CCACHE_DIR=$BASEDIR/ccache
913 export CCACHE_COMPRESS=1
914 export CCACHE_COMPILERCHECK="string
:toolchain-
${TOOLCHAINVER} ${BUILD_ARCH}"
916 # Remove pre-install list of installed files in case user erase some files before rebuild
917 rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
919 # Prepare string for /etc/system-release.
920 SYSTEM_RELEASE="${NAME} ${VERSION} (${BUILD_ARCH})"
921 if [ "$
(git status
-s |
wc -l)" == "0" ]; then
926 case "$GIT_BRANCH" in
928 SYSTEM_RELEASE="${SYSTEM_RELEASE} - $GIT_BRANCH$GIT_STATUS"
931 SYSTEM_RELEASE="${SYSTEM_RELEASE} - Development Build
: $GIT_BRANCH/$GIT_LASTCOMMIT$GIT_STATUS"
938 case "${BUILD_ARCH}:${HOST_ARCH}" in
945 i586:i586|i586:i686|i586:x86_64)
953 arvm7hl:armv7hl|armv7hl:armv7l)
957 armv5tel:armv5tel|armv5tel:armv5tejl|armv5tel:armv6l|armv5tel:armv7l|armv5tel:aarch64)
966 exiterror "Cannot build
${BUILD_ARCH} toolchain on $
(uname
-m). Please use the download
if any.
"
968 local gcc=$(type -p gcc)
969 if [ -z "${gcc}" ]; then
970 exiterror "Could not
find GCC. You will need a working build enviroment
in order to build the toolchain.
"
973 LOGFILE="$BASEDIR/log
/_build.toolchain.log
"
977 lfsmake1 ccache PASS=1
978 lfsmake1 binutils PASS=1
980 lfsmake1 linux KCFG="-headers"
983 lfsmake1 binutils PASS=2
985 lfsmake1 ccache PASS=2
1009 lfsmake1 fake-environ
1010 lfsmake1 cleanup-toolchain
1014 LOGFILE="$BASEDIR/log
/_build.base.log
"
1017 lfsmake2 linux KCFG="-headers"
1021 lfsmake2 cleanup-toolchain
1038 lfsmake2 ncurses-compat
1044 lfsmake2 readline-compat
1047 lfsmake2 pcre-compat
1084 LOGFILE="$BASEDIR/log
/_build.ipfire.log
"
1087 lfsmake2 initscripts
1091 lfsmake2 libusb-compat
1097 lfsmake2 linux-firmware
1098 lfsmake2 ath10k-firmware
1099 lfsmake2 dvb-firmwares
1100 lfsmake2 mt7601u-firmware
1101 lfsmake2 zd1211-firmware
1102 lfsmake2 rpi-firmware
1109 lfsmake2 multipath-tools
1113 lfsmake2 libnfnetlink
1114 lfsmake2 libnetfilter_queue
1115 lfsmake2 libnetfilter_conntrack
1116 lfsmake2 libnetfilter_cthelper
1117 lfsmake2 libnetfilter_cttimeout
1120 case "${BUILD_ARCH}" in
1122 lfsmake2 linux KCFG=""
1123 lfsmake2 backports KCFG=""
1124 lfsmake2 e1000e KCFG=""
1125 lfsmake2 igb KCFG=""
1126 lfsmake2 ixgbe KCFG=""
1127 lfsmake2 xtables-addons KCFG=""
1128 lfsmake2 linux-initrd KCFG=""
1131 # x86-pae (Native and new XEN) kernel build
1132 lfsmake2 linux KCFG="-pae"
1133 lfsmake2 backports KCFG="-pae"
1134 lfsmake2 e1000e KCFG="-pae"
1135 lfsmake2 igb KCFG="-pae"
1136 lfsmake2 ixgbe KCFG="-pae"
1137 lfsmake2 xtables-addons KCFG="-pae"
1138 lfsmake2 linux-initrd KCFG="-pae"
1141 lfsmake2 linux KCFG=""
1142 lfsmake2 backports KCFG=""
1143 lfsmake2 e1000e KCFG=""
1144 lfsmake2 igb KCFG=""
1145 lfsmake2 ixgbe KCFG=""
1146 lfsmake2 xtables-addons KCFG=""
1147 lfsmake2 linux-initrd KCFG=""
1151 # arm-rpi (Raspberry Pi) kernel build
1152 lfsmake2 linux KCFG="-rpi"
1153 lfsmake2 backports KCFG="-rpi"
1154 lfsmake2 xtables-addons KCFG="-rpi"
1155 lfsmake2 linux-initrd KCFG="-rpi"
1157 # arm multi platform (Panda, Wandboard ...) kernel build
1158 lfsmake2 linux KCFG="-multi"
1159 lfsmake2 backports KCFG="-multi"
1160 lfsmake2 e1000e KCFG="-multi"
1161 lfsmake2 igb KCFG="-multi"
1162 lfsmake2 ixgbe KCFG="-multi"
1163 lfsmake2 xtables-addons KCFG="-multi"
1164 lfsmake2 linux-initrd KCFG="-multi"
1166 # arm-kirkwood (Dreamplug, ICY-Box ...) kernel build
1167 lfsmake2 linux KCFG="-kirkwood"
1168 lfsmake2 backports KCFG="-kirkwood"
1169 lfsmake2 e1000e KCFG="-kirkwood"
1170 lfsmake2 igb KCFG="-kirkwood"
1171 lfsmake2 ixgbe KCFG="-kirkwood"
1172 lfsmake2 xtables-addons KCFG="-kirkwood"
1173 lfsmake2 linux-initrd KCFG="-kirkwood"
1176 lfsmake2 xtables-addons USPACE="1"
1178 [ "${BUILD_ARCH}" = "i586
" ] && lfsmake2 openssl KCFG='-sse2'
1179 lfsmake2 libgpg-error
1185 lfsmake2 libevent2-compat
1204 lfsmake2 ca-certificates
1212 lfsmake2 libjpeg-compat
1235 lfsmake2 web-user-interface
1243 lfsmake2 reiserfsprogs
1249 lfsmake2 ez-ipupdate
1253 lfsmake2 GD-TextUtil
1254 lfsmake2 perl-Device-SerialPort
1255 lfsmake2 perl-Device-Modem
1256 lfsmake2 perl-Apache-Htpasswd
1262 lfsmake2 conntrack-tools
1266 lfsmake2 l7-protocols
1268 lfsmake2 capi4k-utils
1275 lfsmake2 HTML-Tagset
1276 lfsmake2 HTML-Parser
1277 lfsmake2 HTML-Template
1278 lfsmake2 Compress-Zlib
1280 lfsmake2 Digest-SHA1
1281 lfsmake2 Digest-HMAC
1282 lfsmake2 libwww-perl
1284 lfsmake2 Net-IPv4Addr
1287 lfsmake2 IO-Socket-SSL
1288 lfsmake2 Unix-Syslog
1292 lfsmake2 Convert-TNEF
1293 lfsmake2 Convert-UUlib
1294 lfsmake2 Archive-Tar
1295 lfsmake2 Archive-Zip
1296 lfsmake2 Text-Tabs+Wrap
1297 lfsmake2 Locale-Country
1299 lfsmake2 Crypt-PasswdMD5
1301 lfsmake2 python-setuptools
1302 lfsmake2 python-clientform
1303 lfsmake2 python-mechanize
1304 lfsmake2 python-feedparser
1305 lfsmake2 python-rssdler
1306 lfsmake2 python-inotify
1307 lfsmake2 python-docutils
1308 lfsmake2 python-daemon
1309 lfsmake2 python-ipaddress
1312 lfsmake2 noip_updater
1316 lfsmake2 dejavu-fonts-ttf
1317 lfsmake2 ubuntu-font-family
1347 lfsmake2 ghostscript
1350 lfsmake2 cups-filters
1351 lfsmake2 epson-inkjet-printer-escpr
1360 lfsmake2 bridge-utils
1362 lfsmake2 smartmontools
1367 lfsmake2 cyrus-imapd
1368 lfsmake2 openmailadmin
1370 lfsmake2 spamassassin
1406 lfsmake2 pcmciautils
1415 lfsmake2 python-pyparsing
1416 lfsmake2 spice-protocol
1419 lfsmake2 libusbredir
1427 lfsmake2 nagios_nrpe
1434 lfsmake2 vdr_streamdev
1435 lfsmake2 vdr_epgsearch
1440 lfsmake2 icegenerator
1442 lfsmake2 libmpdclient
1444 lfsmake2 perl-Net-SMTP-SSL
1445 lfsmake2 perl-MIME-Base64
1446 lfsmake2 perl-Authen-SASL
1447 lfsmake2 perl-MIME-Lite
1448 lfsmake2 perl-Email-Date-Format
1450 lfsmake2 squidclamav
1453 lfsmake2 wpa_supplicant
1459 lfsmake2 cpufrequtils
1467 lfsmake2 streamripper
1472 lfsmake2 perl-gettext
1473 lfsmake2 perl-Sort-Naturally
1477 lfsmake2 perl-DBD-mysql
1478 lfsmake2 perl-DBD-SQLite
1479 lfsmake2 perl-File-ReadBackwards
1481 lfsmake2 openvmtools
1492 lfsmake2 usb_modeswitch
1493 lfsmake2 usb_modeswitch_data
1503 lfsmake2 python-m2crypto
1504 lfsmake2 wireless-regdb
1507 lfsmake2 python-distutils-extra
1508 lfsmake2 python-lzma
1509 lfsmake2 python-progressbar
1510 lfsmake2 python-xattr
1512 lfsmake2 transmission
1525 lfsmake2 libstatgrab
1527 lfsmake2 check_mk_agent
1534 lfsmake2 ipfire-netboot
1540 lfsmake2 perl-Carp-Clan
1541 lfsmake2 perl-Date-Calc
1542 lfsmake2 perl-Date-Manip
1543 lfsmake2 perl-File-Tail
1544 lfsmake2 perl-TimeDate
1556 lfsmake2 perl-Font-TTF
1557 lfsmake2 perl-IO-String
1558 lfsmake2 perl-PDF-API2
1559 lfsmake2 squid-accounting
1562 lfsmake2 perl-Text-CSV_XS
1572 lfsmake2 util-macros
1573 lfsmake2 libpciaccess
1576 lfsmake2 python3-libvirt
1578 lfsmake2 perl-common-sense
1579 lfsmake2 perl-inotify2
1580 lfsmake2 perl-Net-IP
1586 # Run installer scripts one by one
1587 LOGFILE="$BASEDIR/log
/_build.installer.log
"
1595 LOGFILE="$BASEDIR/log
/_build.packages.log
"
1597 echo "... see detailed log
in _build.
*.log files
" >> $LOGFILE
1600 # Generating list of packages used
1601 echo -n "Generating packages list from logs
" | tee -a $LOGFILE
1602 rm -f $BASEDIR/doc/packages-list
1603 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
1604 if [ "$i" != "$BASEDIR/log
/FILES
" -a -n $i ]; then
1605 echo "* `basename $i`" >>$BASEDIR/doc/packages-list
1608 echo "== List of softwares used to build
$NAME Version
: $VERSION ==" > $BASEDIR/doc/packages-list.txt
1609 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|.tgz$\|-config$\|_missing_rootfile$\|install1$\|install2$\|pass1$\|pass2$\|pass3$' \
1610 $BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt
1611 rm -f $BASEDIR/doc/packages-list
1612 # packages-list.txt is ready to be displayed for wiki page
1613 beautify message DONE
1617 [ -z $GIT_TAG ] || LAST_TAG=$GIT_TAG
1618 [ -z $LAST_TAG ] || EXT="$LAST_TAG..HEAD
"
1619 git log -n 500 --no-merges --pretty=medium --shortstat $EXT > $BASEDIR/doc/ChangeLog
1621 # Create images for install
1624 # Check if there is a loop device for building in virtual environments
1625 modprobe loop 2>/dev/null
1626 if [ $BUILD_IMAGES == 1 ] && ([ -e /dev/loop/0 ] || [ -e /dev/loop0 ] || [ -e "/dev
/loop-control
" ]); then
1627 lfsmake2 flash-images
1628 lfsmake2 flash-images SCON=1
1631 mv $LFS/install/images/{*.iso,*.tgz,*.img.gz,*.bz2} $BASEDIR >> $LOGFILE 2>&1
1636 mv $LFS/install/images/*.bz2 $BASEDIR >> $LOGFILE 2>&1
1640 # remove not useable iso on armv5tel (needed to build flash images)
1641 [ "${BUILD_ARCH}" = "armv5tel
" ] && rm -rf *.iso
1643 for i in `ls *.bz2 *.img.gz *.iso`; do
1650 rm -rf $BASEDIR/build/tmp/*
1652 # Generating total list of files
1653 echo -n "Generating files list from logs
" | tee -a $LOGFILE
1654 rm -f $BASEDIR/log/FILES
1655 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
1656 if [ "$i" != "$BASEDIR/log
/FILES
" -a -n $i ]; then
1657 echo "##" >>$BASEDIR/log/FILES
1658 echo "## `basename $i`" >>$BASEDIR/log
/FILES
1659 echo "##" >>$BASEDIR/log
/FILES
1660 cat $i |
sed "s%^\./%#%" |
sort >> $BASEDIR/log
/FILES
1663 beautify message DONE
1669 lfsmake2 core-updates
1672 for i
in $
(find $BASEDIR/config
/rootfiles
/packages
{/${BUILD_ARCH},} -maxdepth 1 -type f
); do
1674 if [ -e $BASEDIR/lfs
/$i ]; then
1678 beautify message SKIP
1681 test -d $BASEDIR/packages || mkdir
$BASEDIR/packages
1682 mv -f $LFS/install
/packages
/* $BASEDIR/packages
>> $LOGFILE 2>&1
1683 rm -rf $BASEDIR/build
/install
/packages
/*
1686 while [ $# -gt 0 ]; do
1689 configure_build
"${1#--target=}"
1692 exiterror
"Unknown configuration option: ${1}"
1695 # Found a command, so exit options parsing.
1702 # See what we're supposed to do
1706 PACKAGE
=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz 2> /dev/null | head -n 1`
1707 #only restore on a clean disk
1708 if [ ! -e "${BASEDIR}/build${TOOLS_DIR}/.toolchain-successful" ]; then
1709 if [ ! -n "$PACKAGE" ]; then
1710 beautify build_stage
"Full toolchain compilation"
1714 PACKAGENAME
=${PACKAGE%.tar.gz}
1715 beautify build_stage
"Packaged toolchain compilation"
1716 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
1720 exiterror
"$PACKAGENAME md5 did not match, check downloaded package"
1724 echo -n "Using installed toolchain" |
tee -a $LOGFILE
1725 beautify message SKIP
1729 beautify build_start
1730 beautify build_stage
"Building LFS"
1733 beautify build_stage
"Building IPFire"
1736 beautify build_stage
"Building installer"
1739 beautify build_stage
"Building packages"
1742 beautify build_stage
"Checking Logfiles for new Files"
1745 tools
/checknewlog.pl
1746 tools
/checkrootfiles
1752 # enter a shell inside LFS chroot
1753 # may be used to changed kernel settings
1758 echo -en "${BOLD}Cleaning build directory...${NORMAL}"
1759 for i
in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
1760 $LOSETUP -d $i 2>/dev
/null
1762 for i
in `mount | grep $BASEDIR | cut -d " " -f 1`; do
1766 for i
in `seq 0 7`; do
1767 if ( losetup
/dev
/loop
${i} 2>/dev
/null |
grep -q "/install/images" ); then
1768 umount
/dev
/loop
${i} 2>/dev
/null
;
1769 losetup
-d /dev
/loop
${i} 2>/dev
/null
;
1772 rm -rf $BASEDIR/build
1773 rm -rf $BASEDIR/cdrom
1774 rm -rf $BASEDIR/packages
1776 if [ -h "${TOOLS_DIR}" ]; then
1777 rm -f "${TOOLS_DIR}"
1779 rm -f $BASEDIR/ipfire-
*
1780 beautify message DONE
1783 if [ ! -d $BASEDIR/cache
]; then
1784 mkdir
$BASEDIR/cache
1786 mkdir
-p $BASEDIR/log
1787 echo -e "${BOLD}Preload all source files${NORMAL}" |
tee -a $LOGFILE
1790 for c
in `seq $MAX_RETRIES`; do
1791 if (( FINISHED
==1 )); then
1797 if [ -f "$i" -a "$i" != "Config" ]; then
1798 lfsmakecommoncheck
${i} ||
continue
1800 make -s -f $i LFS_BASEDIR
=$BASEDIR BUILD_ARCH
="${BUILD_ARCH}" \
1801 MESSAGE
="$i\t ($c/$MAX_RETRIES)" download
>> $LOGFILE 2>&1
1802 if [ $?
-ne 0 ]; then
1803 beautify message FAIL
1806 if [ $c -eq 1 ]; then
1807 beautify message DONE
1813 echo -e "${BOLD}***Verifying md5sums${NORMAL}"
1816 if [ -f "$i" -a "$i" != "Config" ]; then
1817 lfsmakecommoncheck
${i} > /dev
/null ||
continue
1818 make -s -f $i LFS_BASEDIR
=$BASEDIR BUILD_ARCH
="${BUILD_ARCH}" \
1819 MESSAGE
="$i\t " md5
>> $LOGFILE 2>&1
1820 if [ $?
-ne 0 ]; then
1821 echo -ne "MD5 difference in lfs/$i"
1822 beautify message FAIL
1827 if [ $ERROR -eq 0 ]; then
1828 echo -ne "${BOLD}all files md5sum match${NORMAL}"
1829 beautify message DONE
1831 echo -ne "${BOLD}not all files were correctly download${NORMAL}"
1832 beautify message FAIL
1834 cd - >/dev
/null
2>&1
1839 beautify build_stage
"Toolchain compilation"
1841 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for ${BUILD_ARCH}" |
tee -a $LOGFILE
1842 test -d $BASEDIR/cache
/toolchains || mkdir
-p $BASEDIR/cache
/toolchains
1843 cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache
/toolchains
/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.
tar.gz \
1844 build
/${TOOLS_DIR} build
/bin
/sh log
>> $LOGFILE
1845 md5sum cache
/toolchains
/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.
tar.gz \
1846 > cache
/toolchains
/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.md5
1850 # arbitrary name to be updated in case of new toolchain package upload
1851 PACKAGE
=$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}
1852 if [ ! -f $BASEDIR/cache
/toolchains
/$PACKAGE.
tar.gz
]; then
1853 URL_TOOLCHAIN
=`grep URL_TOOLCHAIN lfs/Config | awk '{ print $3 }'`
1854 test -d $BASEDIR/cache
/toolchains || mkdir
-p $BASEDIR/cache
/toolchains
1855 echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for ${BUILD_ARCH}" |
tee -a $LOGFILE
1856 cd $BASEDIR/cache
/toolchains
1857 wget
-U "IPFireSourceGrabber/2.x" $URL_TOOLCHAIN/$PACKAGE.
tar.gz
$URL_TOOLCHAIN/$PACKAGE.md5
>& /dev
/null
1858 if [ $?
-ne 0 ]; then
1859 echo "`date -u '+%b %e %T'`: error downloading $PACKAGE toolchain for ${BUILD_ARCH} machine" |
tee -a $LOGFILE
1861 if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
1862 echo "`date -u '+%b %e %T'`: toolchain md5 ok" |
tee -a $LOGFILE
1864 exiterror
"$PACKAGE.md5 did not match, check downloaded package"
1868 echo "Toolchain is already downloaded. Exiting..."
1873 if [ -z $IPFIRE_USER ]; then
1874 echo -n "You have to setup IPFIRE_USER first. See .config for details."
1875 beautify message FAIL
1879 URL_SOURCE
=$
(grep URL_SOURCE lfs
/Config |
awk '{ print $3 }')
1880 REMOTE_FILES
=$
(echo "ls -1" | sftp
-C ${IPFIRE_USER}@
${URL_SOURCE})
1882 for file in ${BASEDIR}/cache
/*; do
1883 [ -d "${file}" ] && continue
1884 grep -q "$(basename ${file})" <<<$REMOTE_FILES && continue
1885 NEW_FILES
="$NEW_FILES $file"
1887 [ -n "$NEW_FILES" ] && scp
-2 $NEW_FILES ${IPFIRE_USER}@
${URL_SOURCE}
1893 echo -ne "Checking the translations for missing or obsolete strings..."
1894 chmod 755 $BASEDIR/tools
/{check_strings.pl
,sort_strings.pl
,check_langs.sh
}
1895 $BASEDIR/tools
/sort_strings.pl en
1896 $BASEDIR/tools
/sort_strings.pl de
1897 $BASEDIR/tools
/sort_strings.pl fr
1898 $BASEDIR/tools
/sort_strings.pl es
1899 $BASEDIR/tools
/sort_strings.pl pl
1900 $BASEDIR/tools
/sort_strings.pl ru
1901 $BASEDIR/tools
/sort_strings.pl
nl
1902 $BASEDIR/tools
/sort_strings.pl
tr
1903 $BASEDIR/tools
/sort_strings.pl it
1904 $BASEDIR/tools
/check_strings.pl en
> $BASEDIR/doc
/language_issues.en
1905 $BASEDIR/tools
/check_strings.pl de
> $BASEDIR/doc
/language_issues.de
1906 $BASEDIR/tools
/check_strings.pl fr
> $BASEDIR/doc
/language_issues.fr
1907 $BASEDIR/tools
/check_strings.pl es
> $BASEDIR/doc
/language_issues.es
1908 $BASEDIR/tools
/check_strings.pl es
> $BASEDIR/doc
/language_issues.pl
1909 $BASEDIR/tools
/check_strings.pl ru
> $BASEDIR/doc
/language_issues.ru
1910 $BASEDIR/tools
/check_strings.pl
nl > $BASEDIR/doc
/language_issues.
nl
1911 $BASEDIR/tools
/check_strings.pl
tr > $BASEDIR/doc
/language_issues.
tr
1912 $BASEDIR/tools
/check_strings.pl it
> $BASEDIR/doc
/language_issues.it
1913 $BASEDIR/tools
/check_langs.sh
> $BASEDIR/doc
/language_missings
1914 beautify message DONE
1916 echo -ne "Updating language lists..."
1917 update_language_list
${BASEDIR}/src
/installer
/po
1918 update_language_list
${BASEDIR}/src
/setup
/po
1919 beautify message DONE
1922 echo "Usage: $0 {build|changelog|clean|gettoolchain|downloadsrc|shell|sync|toolchain}"
1923 cat doc
/make.sh-usage