This variable is set to 1 on an embedded build.
We use this to include special configuration
to save space, accesses to the storage card, and so on...
#TARGET=i686
+###############################################################################
+# Embedded Build #
+###############################################################################
+# Set this to "1" to make a build for embedded systems. #
+# This will use some other configurations, leave out the installer and #
+# generate images for flash cards. #
+# Default is 0 (=off). #
+###############################################################################
+
+#EMBEDDED=0
+
###############################################################################
# Stack Smashing Protector #
###############################################################################
build_spy set stage ${STAGE} &
toolchain_make strip
- ipfire_make initramfs
# Generate ChangeLog
git_log
- # Generating list of packages used
+ if [ ${EMBEDDED} -eq 0 ]; then
+ ipfire_make initramfs
- ipfire_make cdrom
-
- # Check if there is a loop device for building in virtual environments
- #if [ -e /dev/loop/0 ] || [ -e /dev/loop0 ]; then
- # ipfire_make usb-stick
- #fi
- mv $LFS/$IMAGES_DIR/{*.iso,*.tgz,*.img.gz} $BASEDIR >> $LOGFILE 2>&1
+ ipfire_make cdrom
+
+ if check_loop; then
+ #ipfire_make usb-stick
+ :
+ else
+ echo -n "Can't build usb-key images on this machine"
+ beautify message WARN
+ fi
+ mv $LFS/$IMAGES_DIR/{*.iso,*.tgz,*.img.gz} $BASEDIR >> $LOGFILE 2>&1
+ else
+ if check_loop; then
+ # We put here the code that is done when
+ # we do an embedded build
+ :
+ fi
+ fi
+ # Build packages
for i in $(ls -1 $BASEDIR/src/rootfiles/extras); do
if [ -e $BASEDIR/lfs/$i ]; then
echo -n $i
exit 1
fi
}
+
+check_loop() {
+ for i in $(seq 0 7); do
+ if [ -e /dev/loop/$i ] || [ -e /dev/loop$i ]; then
+ return 0
+ fi
+ done
+ return 1
+}
PIE=1
PAX=1
+# Embedded build
+EMBEDDED=0
+
# Parallelism flag
PARALLELISMFLAGS=-j$(( $(grep processor < /proc/cpuinfo | wc -l) * 2 + 1 ))
DISTCC_HOSTS=localhost
SSP=$SSP \
PIE=$PIE \
PAX=$PAX \
+ EMBEDDED=$EMBEDDED \
LOGFILE=`echo $LOGFILE | sed "s,$BASEDIR,/usr/src,g"` \
bash -x -c "cd /usr/src/lfs && \
$EXTRA_MAKE make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
export SSP PIE PAX
+ ##############################################################################
+ # Embedded build #
+ ##############################################################################
+
+ echo -ne "Embedded build"
+ if [ $EMBEDDED -eq 1 ]; then
+ beautify message ON
+ check_loop || exiterror "Can't build flash images on this machine."
+ else
+ beautify message OFF
+ fi
+
+ export EMBEDDED
+
##############################################################################
# Building Linux From Scratch system configuration #
##############################################################################