Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jul 2005 17:52:20 GMT
From:      soc-saturnero <soc-saturnero@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 80354 for review
Message-ID:  <200507161752.j6GHqKqO017460@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=80354

Change 80354 by soc-saturnero@soc-saturnero_sberta on 2005/07/16 17:51:31

	Continuing work. Buildworld phase.
	
	head-banging with exit 1 inside an sh function

Affected files ...

.. //depot/projects/soc2005/freesbie/Makefile#2 edit
.. //depot/projects/soc2005/freesbie/conf/freesbie.defaults.conf#3 edit
.. //depot/projects/soc2005/freesbie/scripts/buildworld.sh#1 add
.. //depot/projects/soc2005/freesbie/scripts/launch.sh#2 edit
.. //depot/projects/soc2005/freesbie/scripts/mtree.sh#2 delete

Differences ...

==== //depot/projects/soc2005/freesbie/Makefile#2 (text+ko) ====

@@ -5,14 +5,14 @@
 #
 # $FreeBSD$
 
-all: mtree
+all: buildworld
 
-mtree: .done_mtree
-.done_mtree:
-	@-rm -f .tmp_mtree
-	@touch .tmp_mtree
-	./scripts/mtree.sh
-	@mv .tmp_mtree .done_mtree
+buildworld: .done_buildworld
+.done_buildworld:
+	@-rm -f .tmp_buildworld
+	@touch .tmp_buildworld
+	@sh ./scripts/launch.sh buildworld .tmp_buildworld
+	@mv .tmp_buildworld .done_buildworld
 
 clean:
-	@-rm -rf .tmp* .done* > /dev/null 2>&1+	@-rm -rf .tmp* .done* > /dev/null 2>&1

==== //depot/projects/soc2005/freesbie/conf/freesbie.defaults.conf#3 (text+ko) ====

@@ -26,23 +26,21 @@
 IMGPATH="FreeSBIE.img"
 
 
-
-
+#
 # Optional variables
 
 # Arguments passed to make(1) when building world and kernel
 #
 MAKEOPT="-j3"
 
-# Kernel configuration file, transparently passed to the kernel build,
-# if defined
+# Kernel configuration file, with complete path
 #
-#KERNCONF=MYCUSTOMKERNEL
+#KERNELCONF=/complete/path/to/MYCUSTOMKERNEL
 
-# Kernel configuration directory, transparently passed to the kernel
-# build, if defined
+# If you want to use a custom make.conf, define it here. Otherwise,
+# make.conf or make.conf.minimal under conf/ are used.
 #
-#KERNCONFDIR=/my/custom/dir
+#MAKE_CONF=/etc/make.conf
 
 # Define MINIMAL to build a minimal world (i.e.: use
 # make.conf.minimal, full of NO_* knobs.

==== //depot/projects/soc2005/freesbie/scripts/launch.sh#2 (text+ko) ====

@@ -7,10 +7,51 @@
 # See COPYING for license terms.
 #
 # $FreeBSD$
+#
+# Usage: launch.sh ${TARGET} [ ${LOGFILE} ]
+
+set -e -u
+
+if [ "`id -u`" != "0" ]; then
+    echo "Sorry, this must be done as root."
+    exit 1
+fi
+
+# If the DEBUG environment variable is set, be verbose.
+[ ! -z "${DEBUG:-}" ] && set -x
+
+# Set the absolute path for the toolkit dir
+LOCALDIR=$(cd $(dirname $0)/.. && pwd)
 
+TARGET=$1;
+shift;
+if [ -n "$1" ]; then
+    LOGFILE=${LOCALDIR}/$1
+else
+    LOGFILE=$(mktemp -q /tmp/freesbie.XXXXXX)
+fi
+
 . ./conf/freesbie.defaults.conf
 
+[ -f ./conf/freesbie.conf ] && . ./conf/freesbie.conf
+
 # XXX set $ARCH and mandatory variables here.
 
-env
+ARCH=${ARCH:-`uname -m`}
+
+
+# XXX set common functions here
+
+print_error() {
+    echo "Something went wrong, check errors!" >&2
+    [ -n "${LOGFILE:-}" ] && \
+	echo "Log saved on ${LOGFILE}" >&2
+#    kill $$ # XXX exit 1 won't work.
+    exit 1
+}
 
+if [ -f "${LOCALDIR}/scripts/${ARCH}/${TARGET}.sh" ]; then
+    . ${LOCALDIR}/scripts/${ARCH}/${TARGET}.sh
+elif [ -f "${LOCALDIR}/scripts/${TARGET}.sh" ]; then
+    . ${LOCALDIR}/scripts/${TARGET}.sh
+fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507161752.j6GHqKqO017460>