MAKETUNING="-j${parallelism}"
fi
+
+ # Compression parameters
+ # We use mode 8 for reasonable memory usage when decompressing
+ # but with overall good compression
+ XZ_OPT="-8"
+
+ # We try to use as many cores as possible
+ XZ_OPT="${XZ_OPT} -T0"
+
+ # We need to limit memory because XZ uses too much when running
+ # in parallel and it isn't very smart in limiting itself.
+ # We allow XZ to use up to 70% of all system memory.
+ local xz_memory=$(( HOST_MEM * 7 / 10 ))
+
+ # XZ memory cannot be larger than 2GB on 32 bit systems
+ case "${build_arch}" in
+ i*86|armv*)
+ if [ ${xz_memory} -gt 2048 ]; then
+ xz_memory=2048
+ fi
+ ;;
+ esac
+
+ XZ_OPT="${XZ_OPT} --memory=${xz_memory}MiB"
}
configure_build_guess() {
# Get the amount of memory in this build system
HOST_MEM=$(system_memory)
-# Checking host memory, tuning XZ_OPT
-if [ ${HOST_MEM} -lt 1024 ]; then
- exiterror "You will need more than 1GB or host memory to run the build"
-fi
-
-# We compress archives with "xz -8", using all cores and up to 70% of memory
-XZ_MEM=$(( HOST_MEM * 7 / 10 ))
-
-# XZ memory cannot be larger than 2GB on 32 bit systems
-case "${HOST_ARCH}" in
- i*86|armv*)
- if [ ${XZ_MEM} -gt 2048 ]; then
- XZ_MEM=2048
- fi
- ;;
-esac
-
-XZ_OPT="-T$(system_processors) -8 --memory=${XZ_MEM}MiB"
-
if [ -n "${BUILD_ARCH}" ]; then
configure_build "${BUILD_ARCH}"
else
lfsmake2 linux-initrd KCFG="-multi"
;;
esac
+ lfsmake2 intel-microcode
lfsmake2 xtables-addons USPACE="1"
lfsmake2 openssl
[ "${BUILD_ARCH}" = "i586" ] && lfsmake2 openssl KCFG='-sse2'
lfsmake2 flash-images
fi
- mv $LFS/install/images/{*.iso,*.tgz,*.img.xz,*.bz2} $BASEDIR >> $LOGFILE 2>&1
+ mv $LFS/install/images/{*.iso,*.img.xz,*.bz2} $BASEDIR >> $LOGFILE 2>&1
ipfirepackages
# remove not useable iso on armv5tel (needed to build flash images)
[ "${BUILD_ARCH}" = "armv5tel" ] && rm -rf *.iso
- for i in `ls *.bz2 *.img.gz *.iso`; do
+ for i in `ls *.bz2 *.img.xz *.iso`; do
md5sum $i > $i.md5
done
cd $PWD
buildtoolchain
echo "`date -u '+%b %e %T'`: Create toolchain image for ${BUILD_ARCH}" | tee -a $LOGFILE
test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains
- cd $BASEDIR && XZ_OPT="$(XZ_OPT)" tar -Jc --exclude='log/_build.*.log' -f cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.xz --xz \
- build/${TOOLS_DIR} build/bin/sh log >> $LOGFILE
+ cd $BASEDIR && tar -cf- --exclude='log/_build.*.log' build/${TOOLS_DIR} build/bin/sh log | xz ${XZ_OPT} \
+ > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.xz
md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.xz \
> cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.md5
stdumount