From owner-p4-projects@FreeBSD.ORG Sat Jul 16 17:52:22 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8D76016A420; Sat, 16 Jul 2005 17:52:21 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49E8316A41C for ; Sat, 16 Jul 2005 17:52:21 +0000 (GMT) (envelope-from soc-saturnero@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DB5843D45 for ; Sat, 16 Jul 2005 17:52:21 +0000 (GMT) (envelope-from soc-saturnero@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6GHqKRR017463 for ; Sat, 16 Jul 2005 17:52:20 GMT (envelope-from soc-saturnero@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6GHqKqO017460 for perforce@freebsd.org; Sat, 16 Jul 2005 17:52:20 GMT (envelope-from soc-saturnero@freebsd.org) Date: Sat, 16 Jul 2005 17:52:20 GMT Message-Id: <200507161752.j6GHqKqO017460@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-saturnero@freebsd.org using -f From: soc-saturnero To: Perforce Change Reviews Cc: Subject: PERFORCE change 80354 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2005 17:52:22 -0000 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