]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Introduced the new EMBEDDED variable.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jul 2008 00:25:45 +0000 (00:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jul 2008 00:25:45 +0000 (00:25 +0000)
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...

.config-default
make.sh
tools/make-check
tools/make-include

index 2dadf5c2c0244599a9db6efe1c32210f26067dec..b116758e192a1d6a6cfa639d49056418fe2fca68 100644 (file)
 
 #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                                                    #
 ###############################################################################
diff --git a/make.sh b/make.sh
index 60b84dd549fa464c42e7062ab03c7c6ec6571ca1..2ec707f03b6b7ce4b7cda282d105868da4f9198a 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -482,21 +482,32 @@ packages_build() {
        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
index d85f0b69f8984531b7c31c631c46ab86c4545074..50095c539ddb50e9901e982324e7cc5c5658d3ff 100644 (file)
@@ -185,3 +185,12 @@ check_user() {
                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
+}
index 044a31b5a694a919f60741421c7df3467ea9076f..4dbd9174ad4bf881951a010eb2be4f7cd558fc2c 100644 (file)
@@ -36,6 +36,9 @@ SSP=1
 PIE=1
 PAX=1
 
+# Embedded build
+EMBEDDED=0
+
 # Parallelism flag
 PARALLELISMFLAGS=-j$(( $(grep processor < /proc/cpuinfo | wc -l) * 2 + 1 ))
 DISTCC_HOSTS=localhost
@@ -397,6 +400,7 @@ ipfire_make() {
                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
@@ -524,6 +528,20 @@ prepareenv() {
 
        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                           #
        ##############################################################################