[Lunar-commits] r14831 - in lunar-iso/trunk: . conf scripts
Auke Kok
sofar at lunar-linux.org
Thu May 19 12:16:18 UTC 2005
Author: sofar
Date: 2005-05-19 12:16:17 +0000 (Thu, 19 May 2005)
New Revision: 14831
Added:
lunar-iso/trunk/scripts/cachefill
Modified:
lunar-iso/trunk/Makefile
lunar-iso/trunk/conf/config.in
lunar-iso/trunk/scripts/etc
lunar-iso/trunk/scripts/kernels
lunar-iso/trunk/scripts/rebuild
lunar-iso/trunk/scripts/unpack
Log:
Adding $ISO_MAKES to allow SMP builds of the ISO to speed things up. Adding 'cachefill' misc target before doing 'unpack', which saves some time on subsequent builds. Edited makefile with some deps.
Modified: lunar-iso/trunk/Makefile
===================================================================
--- lunar-iso/trunk/Makefile 2005-05-19 10:58:44 UTC (rev 14830)
+++ lunar-iso/trunk/Makefile 2005-05-19 12:16:17 UTC (rev 14831)
@@ -16,7 +16,7 @@
# define the location where the ISO will be generated
ISO_TARGET = $(ISO_SOURCE)/BUILD
-export ISO_SOURCE ISO_TARGET ISO_VERSION ISO_CODENAME ISO_DATE ISO_CNAME ISO_KVER ISO_PVER ISO_LUNAR_MODULE ISO_KSUFFIX
+export ISO_SOURCE ISO_TARGET ISO_VERSION ISO_CODENAME ISO_DATE ISO_CNAME ISO_KVER ISO_PVER ISO_LUNAR_MODULE ISO_KSUFFIX ISO_MAKES
all: iso
@@ -78,12 +78,16 @@
@echo "Getting a proper moonbase"
@scripts/moonbase
-
-unpack: dirs $(ISO_TARGET)/.unpack
+unpack: cachefill dirs $(ISO_TARGET)/.unpack
$(ISO_TARGET)/.unpack:
@echo "Unpacking binaries and copying sources"
@scripts/unpack
+cachefill: dirs $(ISO_TARGET)/.cachefill
+$(ISO_TARGET)/.cachefill:
+ @echo "Fetching cache tarballs and sources"
+ @scripts/cachefill
+
dirs: init $(ISO_TARGET)/.dirs
$(ISO_TARGET)/.dirs:
@echo "Creating LSB directory structure"
@@ -94,6 +98,7 @@
@echo "Creating BUILD root"
@scripts/init
+
clean:
umount BUILD/dev &> /dev/null || true
umount BUILD/proc &> /dev/null || true
Modified: lunar-iso/trunk/conf/config.in
===================================================================
--- lunar-iso/trunk/conf/config.in 2005-05-19 10:58:44 UTC (rev 14830)
+++ lunar-iso/trunk/conf/config.in 2005-05-19 12:16:17 UTC (rev 14831)
@@ -26,3 +26,5 @@
# which lunar core tools do we want on the ISO
ISO_LUNAR_MODULE = lunar
+# set this to number of makes for parallel builds or leave empty
+#ISO_MAKES = 2
Added: lunar-iso/trunk/scripts/cachefill
===================================================================
--- lunar-iso/trunk/scripts/cachefill 2005-05-19 10:58:44 UTC (rev 14830)
+++ lunar-iso/trunk/scripts/cachefill 2005-05-19 12:16:17 UTC (rev 14831)
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/lunar/config
+
+export VERBOSE=off
+optimize
+
+RESULT=0
+
+mkdir -p ${ISO_SOURCE}/{spool,cache}
+
+# unpack all the ISO required var/cache/lunar tarballs
+# in case of file conflict preserve glibc and gcc files first!
+for mod in ${ISO_LUNAR_MODULE} $(cat conf/base.list conf/base.list-$ISO_KSUFFIX conf/extended.list) ; do
+ CACHE=$mod-$(module_version $mod)-$BUILD.tar.bz2
+ if [ ! -f ${ISO_SOURCE}/cache/$CACHE ]; then
+ echo "# $CACHE"
+ cp /var/cache/lunar/$CACHE ${ISO_SOURCE}/cache/ || RESULT=1
+ fi
+done
+
+# fill var/spool/lunar dir
+for mod in $(cat conf/sources.list conf/sources.list-${ISO_KSUFFIX} conf/base.list conf/base.list-${ISO_KSUFFIX} conf/extended.list) ; do
+ for file in $(lvu sources $mod) ; do
+ if [ ! -f ${ISO_SOURCE}/spool/$file ] ; then
+ echo -e "\n# /var/spool/lunar/$file"
+ cp -p /var/spool/lunar/$file ${ISO_SOURCE}/spool/ || RESULT=1
+ fi
+ done
+done
+
+if [ "$RESULT" == 0 ]; then
+ touch $ISO_TARGET/.cachefill
+fi
+exit $RESULT
+
Modified: lunar-iso/trunk/scripts/etc
===================================================================
--- lunar-iso/trunk/scripts/etc 2005-05-19 10:58:44 UTC (rev 14830)
+++ lunar-iso/trunk/scripts/etc 2005-05-19 12:16:17 UTC (rev 14831)
@@ -24,7 +24,7 @@
echo "+ installing moonbase"
cd $ISO_TARGET/var/lib/lunar && (
tar xjf $ISO_SOURCE/template/moonbase.tar.bz2
- tar tjlf $ISO_SOURCE/template/moonbase.tar.bz2 | sed 's/^/\/var\/lib\/lunar\//g' > $ISO_TARGET/var/log/lunar/install/moonbase-${ISO_DATE}
+ tar tjf $ISO_SOURCE/template/moonbase.tar.bz2 --one-file-system | sed 's/^/\/var\/lib\/lunar\//g' > $ISO_TARGET/var/log/lunar/install/moonbase-${ISO_DATE}
)
chroot $ISO_TARGET /sbin/lsh add_module moonbase installed $ISO_DATE
echo "+ installing module.index"
Modified: lunar-iso/trunk/scripts/kernels
===================================================================
--- lunar-iso/trunk/scripts/kernels 2005-05-19 10:58:44 UTC (rev 14830)
+++ lunar-iso/trunk/scripts/kernels 2005-05-19 12:16:17 UTC (rev 14831)
@@ -52,16 +52,17 @@
sedit "s/^EXTRAVERSION =.*/EXTRAVERSION = $1/" $ISO_SOURCE/kernels/linux-$ISO_KVER/Makefile
}
+
build_kernel()
{
echo "+ building $ISO_KVER$1"
cd $ISO_SOURCE/kernels/linux-$ISO_KVER
yes n | make oldconfig &&
if [ "${ISO_KSUFFIX}" = "2.4" ]; then
- make dep
+ make dep
fi &&
- make bzImage &&
- make modules &&
+ make ${ISO_MAKES:+-j$ISO_MAKES} bzImage &&
+ make ${ISO_MAKES:+-j$ISO_MAKES} modules &&
mkdir -p $ISO_SOURCE/kernels/TAR
mkdir -p $ISO_SOURCE/kernels/BUILD
mkdir -p $ISO_SOURCE/kernels/BUILD/boot
@@ -141,7 +142,7 @@
# build -om-smp-4gb "smp mem om" "fix om" \
# "OpenMosix clustering, SMP, 4GB"
-else
+else # [ "${ISO_KSUFFIX}" = "2.6" ]; then
build -safe-i386 "i386 nosmp lowmem safe" "" \
"Very safe i386 (default is i686) minimal kernel (no ACPI, DMA, SMP)" "safe"
Modified: lunar-iso/trunk/scripts/rebuild
===================================================================
--- lunar-iso/trunk/scripts/rebuild 2005-05-19 10:58:44 UTC (rev 14830)
+++ lunar-iso/trunk/scripts/rebuild 2005-05-19 12:16:17 UTC (rev 14831)
@@ -3,9 +3,17 @@
echo "+ Starting rebuild of all modules"
. /etc/lunar/config
+# do the parallel thingy?
+if [ -n "$ISO_MAKES" ]; then
+ sedit '/MAKES=/d' $ISO_TARGET/etc/lunar/local/optimizations
+ echo "MAKES=$ISO_MAKES" >> $ISO_TARGET/etc/lunar/local/optimizations
+fi
+
export VERBOSE=off
optimize
+mkdir -p $ISO_TARGET/var/build
+
mount -t proc proc $ISO_TARGET/proc
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Modified: lunar-iso/trunk/scripts/unpack
===================================================================
--- lunar-iso/trunk/scripts/unpack 2005-05-19 10:58:44 UTC (rev 14830)
+++ lunar-iso/trunk/scripts/unpack 2005-05-19 12:16:17 UTC (rev 14831)
@@ -8,10 +8,6 @@
resurrect ()
{
CACHE=$1-$(module_version $1)-$BUILD.tar.bz2
- if [ ! -f cache/$CACHE ]; then
- echo "# $CACHE"
- cp /var/cache/lunar/$CACHE cache/
- fi
if [ ! -f cache/$CACHE ] ; then
echo -e "\n! $1: $CACHE missing"
else
@@ -38,10 +34,6 @@
echo -n "."
if [ -f ${ISO_SOURCE}/spool/$file ] ; then
cp -p ${ISO_SOURCE}/spool/$file $ISO_TARGET/var/spool/lunar/
- elif [ -f /var/spool/lunar/$file ] ; then
- echo -e "\n# /var/spool/lunar/$file"
- cp -p /var/spool/lunar/$file ${ISO_SOURCE}/spool/
- cp -p /var/spool/lunar/$file $ISO_TARGET/var/spool/lunar/
else
echo -ne "\n! $mod: $file\n"
fi
More information about the Lunar-commits
mailing list