[SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (dd2e372f0e92d4987d2b92ea4c163a99b2eb03c0)

Justin Boffemmyer scm at sourcemage.org
Thu Jan 8 10:48:17 EST 2009


GIT changes to test cauldron by Justin Boffemmyer <flux at sourcemage.org>:

 scripts/cleaniso.sh    |   76 ++-----------------
 scripts/fhs-hack.sh    |  187 +++++++++++++++++++++++++++++++++++++++++++++++++
 scripts/spellcaster.sh |  125 ++++++++++++++++++++++++--------
 3 files changed, 290 insertions(+), 98 deletions(-)

New commits:
commit dd2e372f0e92d4987d2b92ea4c163a99b2eb03c0
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/spellcaster.sh: new NOBUILD option
    
    New option for generating the ISO and SYS trees without going through
    the build steps. Mostly useful when you've already run spellcaster.sh
    once but messed something up later, and you need to regenerate your ISO
    and SYS trees.

commit 2295ed3159af2266e55cf763c7943525c88669c1
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/spellcaster.sh: use smgl-fhs workaround
    
    Use the new fhs-hack.sh as a workaround for the smgl-fhs problem, and do
    early add-sauce.sh runs to put minimal files inside the respective
    product dirs. Later add-sauce.sh runs will still be necessary to ensure
    that all the files are correct.

commit a172e10b3d9840cc91f0864f98cf5d101276b109
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/fhs-hack.sh: new, hack for smgl-fhs bug
    
    This is a modified version of the INSTALL script from the smgl-fhs spell
    that will let us run the same "install" but on any target passed in.
    This is a workaround for the bug with the smgl-fhs spell until that gets
    resolved.

commit 3bf4d514a49703dbae0bc2cdcbc54266302aaf44
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/spellcaster.sh: remove spurious spaces
    
    Remove unnecessary spaces from end of line.

commit bafb2c1918336a1ef66288adb2bd2357208e9e4f
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/spellcaster.sh: don't force rm resolv.conf
    
    Don't blindly remove resolv.conf. Only swap it with the one in tmp/ if
    that one exists.

commit ef0f9b27c1fa29609a7e42ef49c149b69a65e150
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/spellcaster.sh: fix codex path
    
    Forgot to include 'codex' in the path to the grimoire.

commit 4758ac24da385950f8aad59c011371ae7553b648
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/spellcaster.sh: generate tablet in chroot
    
    Generate all the tablet info from within the chroot, so the proper
    sorcery config can be sourced. This is a much cleaner way to generate
    the depends and packages files.

commit a684abf0ee496d76908177ed09f932c9d15488c0
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/spellcaster.sh: inc verbose output
    
    Increased the verbosity of the script by adding a new function, msg,
    that outputs it's argument if QUIET is not set. Correspondingly, there
    is a new option for setting QUIET. Various messages were added using the
    new msg function to make it clear what the script is doing as it's
    processing things.

commit 1ddbdbd6bf2672bbb4f6a985ba0ce970c1db40d4
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/cleaniso.sh: simplify for new process
    
    The new generation process doesn't require all the cleaning previously
    necessary, since the iso dir only starts with what we specifically put
    into it anyway. Therefore, cleaniso.sh does much less than it used to.
    Cleaner files are no longer necessary. Instead, it only cleans out a few
    specific directories of all their files, so this can be included
    directly into the script.

diff --git a/scripts/cleaniso.sh b/scripts/cleaniso.sh
index 0ec4b53..71dc6b3 100755
--- a/scripts/cleaniso.sh
+++ b/scripts/cleaniso.sh
@@ -1,33 +1,21 @@
 #/bin/bash
 
-# CLEANFILEs are located in cauldron/data/cleaners
-
-CLEANALL=false
-CLEANERS="$(dirname $0)/../data/cleaners"
-
 function usage() {
 	cat <<EndUsage
-Usage: $(basename $0) [-a] iso_chroot cleaner(s)
+Usage: $(basename $0) iso_chroot
 
-For each cleaner specified as an argument, cleans the files and
-directories listed therein from iso_chroot.  A cleaner is the ouput of
-'gaze install \$SPELL' minus whatever you don't want removed. This
-script requires superuser privileges.
+Cleans unwanted files and directories from iso_chroot. This script requires
+superuser privileges.
 
 Options:
-	-a  Run on all cleaner files in the cauldron cleaner
-	    directory. If this option is specified, any arguments
-	    provided beyond iso_chroot are ignored.
-
 	-h  Shows this help information
 EndUsage
 	exit 1
 } >&2
 
-while getopts ":ah" Option
+while getopts ":h" Option
 do
 	case $Option in
-		a ) CLEANALL=true ;;
 		h ) usage ;;
 		* ) echo "Unrecognized option." >&2 && usage ;;
 	esac
@@ -49,13 +37,7 @@ fi
 
 # Check to make sure we have the right number of arguments
 # taking the option flag into account
-if [[ $# -eq 1 ]]
-then
-	if ! $CLEANALL
-	then
-		usage
-	fi
-elif [[ $# -lt 2 ]]
+if [[ $# -ne 1 ]]
 then
 	usage
 fi
@@ -71,54 +53,18 @@ then
 	echo "Error: /bin/rm not found in $ISOCHROOT" >&2
 	exit 2
 fi
-if ! [[ -e "$ISOCHROOT/bin/rmdir" ]]
-then
-	echo "Error: /bin/rmdir not found in $ISOCHROOT" >&2
-	exit 2
-fi
 
-if $CLEANALL
-then
-	LIST=( $(ls $CLEANERS/*) )
-else
-	LIST=( $@ )
-fi
-
-for CLEANER in "${LIST[@]}"
-do
-	# Reverse sort ensures that the gaze install output we have lists files
-	# before directories, so that directories can be cleaned using rmdir
-	# after the files are cleaned first. This is safer, since it avoids the
-	# mighty 'rm -fr' oopses.
-	for DIRT in $(sort -r "$CLEANER")
-	do
-		if [[ -e $ISOCHROOT/$DIRT ]]
-		then
-			# test if current listing is a dir, should only be true after
-			# the files under the dir are already cleaned
-			if [[ -d "$DIRT" ]]
-			then
-				# chroot and clean a directory using rmdir
-				echo "Attempting to remove directory $ISOCHROOT/$DIRT"
-				chroot "$ISOCHROOT" /bin/rmdir --ignore-fail-on-non-empty "$DIRT"
-			else
-				# chroot and clean an individual file
-				echo "Attempting to delete $ISOCHROOT/$DIRT"
-				chroot "$ISOCHROOT" /bin/rm -f "$DIRT"
-			fi
-		fi
-	done
-done
+echo "Removing $ISOCHROOT/boot/grub"
+chroot "$ISOCHROOT" /bin/rm -fr /boot/grub
 
 echo "Removing $ISOCHROOT/usr/include"
-chroot /bin/rm -fr "$ISOCHROOT/usr/include"
+chroot "$ISOCHROOT" /bin/rm -fr /usr/include
 
 echo "Removing $ISOCHROOT/usr/share/doc"
-chroot /bin/rm -fr "$ISOCHROOT/usr/share/doc"
+chroot $ISOCHROOT /bin/rm -fr /usr/share/doc
 
 echo "Removing $ISOCHROOT/var/log/sorcery"
-chroot /bin/rm -fr "$ISOCHROOT/var/log/sorcery"
+chroot $ISOCHROOT /bin/rm -fr /var/log/sorcery
 
 echo "Removing $ISOCHROOT/var/state/sorcery"
-chroot /bin/rm -fr "$ISOCHROOT/var/state/sorcery"
-
+chroot $ISOCHROOT /bin/rm -fr /var/state/sorcery
diff --git a/scripts/fhs-hack.sh b/scripts/fhs-hack.sh
new file mode 100755
index 0000000..ccab408
--- /dev/null
+++ b/scripts/fhs-hack.sh
@@ -0,0 +1,187 @@
+#!/bin/bash
+#
+# WARNING: THIS FILE IS A HACKED VERSION OF THE smgl-fhs INSTALL SCRIPT!
+# this file should not be used once smgl-fhs can properly install all the
+# necessary directories via sorcery
+#
+
+INSTALL_ROOT="${INSTALL_ROOT:-$1}"
+INSTALL_ROOT="${INSTALL_ROOT%/}"
+
+if [[ -z $INSTALL_ROOT ]]
+then
+  echo "No INSTALL_ROOT defined! You must pass an argument!"
+  exit 2
+fi
+
+root="0"
+games="60"
+mail="8"
+utmp="43"
+
+function  fhs_mkdir()
+{
+  install  -d  -o ${3:-root}  -g ${4:-root}  -m ${2:-0755}  "$INSTALL_ROOT"/$1
+}
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-3.html
+#
+for  root_directory  in  bin  etc  boot  dev  home  lib  mnt  opt  sbin  \
+                         usr  var
+do
+  fhs_mkdir  $root_directory
+done  &&
+
+fhs_mkdir tmp 1777  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-6.1.html
+# in the linux specific section, /proc is indeed mentioned
+#
+fhs_mkdir proc &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-3.7.html
+#
+for  etc_directory  in  opt  X11  sgml
+do
+  fhs_mkdir  etc/$etc_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-3.9.html
+#
+for  lib_directory  in  modules
+do
+  fhs_mkdir  lib/$lib_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-4.html
+#
+for  usr_directory  in  X11R6  bin  include  lib  local  sbin  share  src
+do
+  fhs_mkdir  usr/$usr_directory
+done  &&
+
+#
+# For games
+#
+#create_group  games  &&
+fhs_mkdir  usr/games  0750  $root  $games  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-4.6.html
+#
+for  include_directory  in  bsd
+do
+  fhs_mkdir  usr/include/$include_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-4.9.html
+#
+for  local_directory  in  bin  games  include  lib  man  sbin  share  src
+do
+  fhs_mkdir  usr/local/$local_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-4.11.html
+#
+for  share_directory  in  dict  doc  games  info  locale  man  misc  nls  \
+                          sgml  terminfo  tmac  zoneinfo
+do
+  fhs_mkdir  usr/share/$share_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-4.11.html (4.11.5.2)
+#
+for  man_directory in 1 2 3 4 5 6 7 8
+do
+  fhs_mkdir  usr/share/man/man$man_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-4.4.html
+#
+for  X11_subdir in lib include
+do
+  fhs_mkdir  usr/X11R6/$X11_subdir
+done  &&
+
+for  X11_directory  in  bin  lib/X11  include/X11
+do
+  fhs_mkdir  usr/$X11_directory &&
+  ln  -sf  /usr/$X11_directory \
+           "$INSTALL_ROOT"/usr/X11R6/$X11_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-5.html
+#
+for  var_directory  in  account  cache  crash  games  lib  lock  log  \
+                        opt  run  spool  yp
+do
+  fhs_mkdir  var/$var_directory
+done  &&
+
+#
+# This is the permission set I have on mine
+#
+fhs_mkdir var/tmp  1777  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-5.5.html
+#
+for  cache_directory  in  fonts  man  www
+do
+  fhs_mkdir  var/cache/$cache_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-5.14.html
+#
+for  spool_directory  in  lpd  mqueue  news  rwho  uucp
+do
+  fhs_mkdir  var/spool/$spool_directory
+done  &&
+
+#create_group mail &&
+fhs_mkdir  var/spool/mail  3775 $root $mail &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-5.11.html
+#
+if  [ ! -e "$INSTALL_ROOT"/var/mail ]
+then
+  ln  -sf  spool/mail         \
+           "$INSTALL_ROOT"/var/mail
+fi &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-5.8.html
+#
+for  varlib_directory  in  hwclock  misc  xdm
+do
+  fhs_mkdir  var/lib/$varlib_directory
+done  &&
+
+#
+# http://www.pathname.com/fhs/2.2/fhs-3.13.html
+#
+# Doesn't mention permissions, but usually you don't want other users
+# able to access a different users folders, so why would root be different?
+#
+fhs_mkdir  root  0750
+
+for  file  in  "$INSTALL_ROOT"/var/run/utmp  "$INSTALL_ROOT"/var/log/wtmp
+do
+  if  test  !  -e  $file; then
+    touch  $file
+  fi  &&
+  chmod  664   $file  &&
+  chgrp  $utmp  $file
+done
diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index ebd017e..ae4d498 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -9,7 +9,7 @@ CAULDRONDIR="$MYDIR"/../data
 
 function usage() {
   cat << EndUsage
-Usage: $(basename $0) [-h] [-i ISO] [-s SYS] /path/to/target ARCHITECTURE
+Usage: $(basename $0) [-hnq] [-i ISO] [-s SYS] /path/to/target ARCHITECTURE
 
 Casts the required and optional spells onto the ISO.
 This script requires superuser privileges.
@@ -32,16 +32,25 @@ Options:
 
 	-s  Path to system build directory (SYS). Defaults to
 	    /tmp/cauldron/system.
+
+	-n  Don't process the build tree. Instead, generate ISO and SYS using
+	    an already existing build tree. This is useful if you already have
+	    all the caches, but you need to regenerate your ISO and SYS trees
+	    if something went wrong during later processing.
+
+	-q  Suppress output messages. Defaults to off (output shown on STDERR).
 EndUsage
   exit 1
 } >&2
 
 function parse_options() {
-	while getopts ":i:s:h" Option
+	while getopts ":i:s:nqh" Option
 	do
 		case $Option in
 			i ) ISODIR="${OPTARG%/}" ;;
 			s ) SYSDIR="${OPTARG%/}" ;;
+			n ) NOBUILD="yes" ;;
+			q ) QUIET="yes" ;;
 			h ) usage ;;
 			* ) echo "Unrecognized option." >&2 && usage ;;
 		esac
@@ -64,6 +73,13 @@ function priv_check() {
 	fi
 }
 
+function msg() {
+	if [[ -z $QUIET ]]
+	then
+		echo $1 >&2
+	fi
+}
+
 function directory_check() {
 	if [[ ! -d $1 ]]
 	then
@@ -240,7 +256,7 @@ function install_kernel() {
 			kconfig="$SRC/boot/config"
 		fi
 	fi
-	if [[ -z $kconfig ]] 
+	if [[ -z $kconfig ]]
 	then
 		echo "Could not find $SRC kernel config!"
 		exit 13
@@ -269,7 +285,7 @@ function install_kernel() {
 			version="${version##*version: }"
 		fi
 	fi
-	if [[ -z $version ]] 
+	if [[ -z $version ]]
 	then
 		echo "Could not determine $SRC kernel version!"
 		exit 14
@@ -286,7 +302,7 @@ function install_kernel() {
 			kernel="$SRC/usr/src/linux/arch/i386/boot/bzImage"
 		fi
 	fi
-	if [[ -z $kernel ]] 
+	if [[ -z $kernel ]]
 	then
 		echo "Could not find $SRC kernel image!"
 		exit 15
@@ -315,16 +331,22 @@ function setup_sys() {
 	local grimoire='GRIMOIRE_DIR[0]=/var/lib/sorcery/codex/stable'
 	local index="$SYSDIR/etc/sorcery/local/grimoire"
 
-	local tablet="$SYSDIR/var/state/sorcery/tablet"
-	local packages="$SYSDIR/var/state/sorcery/packages"
-	local depends="$SYSDIR/var/state/sorcery/depends"
-
 	# unpack the sys caches into SYSDIR
+	msg "Installing caches into SYSDIR"
 	for cache in $(<"$TARGET"/sys-list)
 	do
+		msg "Unpacking $cache"
 		tar xjf "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 -C "$SYSDIR"/
 	done
 
+	# perform smgl-fhs hack on SYSDIR
+	msg "Performing smgl-fhs hack on SYSDIR"
+	"$MYDIR"/fhs-hack.sh "$SYSDIR"
+
+	# add the necessary and basic files to SYSDIR
+	msg "Running add-sauce.sh on SYSDIR"
+	"$MYDIR"/add-sauce.sh -o -s "$SYSDIR"
+
 	# download sorcery source
 	(
 		cd "$SPOOL"
@@ -332,6 +354,7 @@ function setup_sys() {
 	)
 
 	# unpack and install sorcery into SYSDIR
+	msg "Installing sorcery in SYSDIR"
 	tar jxf "$SPOOL"/$SORCERY -C "$TARGET/usr/src"
 	pushd "$SORCERYDIR" &> /dev/null
 	./install "$SYSDIR"
@@ -342,64 +365,95 @@ function setup_sys() {
 		cd "$SPOOL"
 		wget http://download.sourcemage.org/codex/$stable
 	)
-	echo "Installing grimoire ${stable%.tar.bz2} ..."
+	msg "Installing grimoire ${stable%.tar.bz2} into SYSDIR"
 	[[ -d "$syscodex" ]] || mkdir -p $syscodex &&
 	tar jxf "$SPOOL"/$stable -C "$syscodex"/ &&
 	mv "$syscodex"/${stable%.tar.bz2} "$syscodex"/stable
 	echo "$grimoire" > "$index"
+
+	msg "Reindexing SYSDIR codex"
 	"$MYDIR"/cauldronchr.sh -d "$SYSDIR" /usr/sbin/scribe reindex
 
 	# generate the depends and packages info for sorcery to use
-	rm -f "$depends" "$packages"
-	. "$SYSDIR"/etc/sorcery/config
-	for spell in "$tablet"/*
-	do
-		for date in "$spell"/*
+	cat > "$SYSDIR"/tablets.sh <<-"TABLETS"
+		#!/bin/bash
+		tablet="/var/state/sorcery/tablet"
+		packages="/var/state/sorcery/packages"
+		depends="/var/state/sorcery/depends"
+
+		rm -f "$depends" "$packages"
+		. /etc/sorcery/config &&
+		for spell in "$tablet"/*
 		do
-			tablet_get_version $date ver
-			tablet_get_status $date stat
-			tablet_get_depends $date dep
-			echo "${spell##*/}:${date##*/}:$stat:$ver" >> "$packages"
-			cat "$dep" >> "$depends"
-		done
-	done
-	sort -u -o "$depends" "$depends"
-	sort -u -o "$packages" "$packages"
+			for date in "$spell"/*
+			do
+				tablet_get_version $date ver &&
+				tablet_get_status $date stat &&
+				tablet_get_depends $date dep &&
+				echo "${spell##*/}:${date##*/}:$stat:$ver" >> "$packages"
+				cat "$dep" >> "$depends"
+			done
+		done &&
+		sort -u -o "$depends" "$depends" &&
+		sort -u -o "$packages" "$packages"
+	TABLETS
+
+	msg "Generating SYSDIR tablet info"
+	chmod a+x "$SYSDIR"/tablets.sh &&
+	chroot "$SYSDIR" /tablets.sh &&
+	rm -f "$SYSDIR"/tablets.sh
 
 	# populate /dev with static device nodes
 	cat > "$SYSDIR/makedev" <<-"DEV"
 		#!/bin/bash
 		cd /dev
 		/sbin/MAKEDEV generic
-DEV
+	DEV
+
+	msg "Making static device nodes in SYSDIR"
 	chmod a+x "$SYSDIR/makedev"
 	chroot "$SYSDIR" /makedev
 	rm -f "$SYSDIR/makedev"
 
 	# ensure the existence of /dev/initctl
+	msg "Ensuring /dev/initctl exists in SYSDIR"
 	chroot "$SYSDIR" mkfifo -m 0600 /dev/initctl
 }
 
 function setup_iso() {
-	local GVERS="$TARGET/var/lib/sorcery/stable/VERSION"
+	local GVERS="$TARGET/var/lib/sorcery/codex/stable/VERSION"
 
 	# copy the iso caches over and unpack their contents
+	msg "Unpacking ISO caches in ISODIR"
 	for cache in $(<"$TARGET"/iso-list)
 	do
+		msg "Unpacking and copying $cache"
 		tar xjf "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 -C "$ISODIR"/
 		cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 "$ISODIR"/var/cache/sorcery/
 	done
 
 	# copy (only!) the optional caches over
+	msg "Copying optional caches to ISODIR"
 	for cache in $(<"$TARGET"/opt-list)
 	do
+		msg "Copying $cache"
 		cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 "$ISODIR"/var/cache/sorcery/
 	done
 
+	# perform smgl-fhs hack on ISODIR
+	msg "Performing smgl-fhs hack on ISODIR"
+	"$MYDIR"/fhs-hack.sh "$ISODIR"
+
 	# install the kernel into ISODIR
+	msg "Installing kernel into ISODIR"
 	install_kernel "$TARGET" "$ISODIR"
 
+	# add the necessary and basic files to ISODIR
+	msg "Running add-sauce.sh on ISODIR"
+	"$MYDIR"/add-sauce.sh -o -i "$ISODIR"
+
 	# save the grimoire version used for building everything to ISODIR for reference
+	msg "Saving grimoire version to ISODIR"
 	cp -f $GVERS "$ISODIR"/etc/grimoire_version
 
 	# populate /dev with static device nodes
@@ -407,21 +461,26 @@ function setup_iso() {
 		#!/bin/bash
 		cd /dev
 		/sbin/MAKEDEV generic
-DEV
+	DEV
+
+	msg "Generating static device nodes in ISODIR"
 	chmod a+x "$ISODIR/makedev"
 	chroot "$ISODIR" /makedev
 	rm -f "$ISODIR/makedev"
 
 	# ensure the existence of /dev/initctl
+	msg "Ensuring /dev/initctl exists in ISODIR"
 	chroot "$ISODIR" mkfifo -m 0600 /dev/initctl
 }
 
 function clean_target() {
 	# Restore resolv.conf, the first rm is needed in case something
 	# installs a hardlink (like ppp)
-	rm -f "$TARGET/etc/resolv.conf" &&
-	cp -f "$TARGET/tmp/resolv.conf" "$TARGET/etc/resolv.conf" &&
-	rm -f "$TARGET/tmp/resolv.conf"
+	if [[ -f "$TARGET/tmp/resolv.conf" ]]
+	then
+		cp -f "$TARGET/tmp/resolv.conf" "$TARGET/etc/resolv.conf" &&
+		rm -f "$TARGET/tmp/resolv.conf"
+	fi
 
 	# Clean up the target
 	rm -f "$TARGET/build_spells.sh"
@@ -455,10 +514,10 @@ fi
 
 sanity_check
 
-prepare_target
+[[ -z $NOBUILD ]] && prepare_target
 
 # chroot and build all of the spells inside the TARGET
-"$MYDIR/cauldronchr.sh" -d "$TARGET" /build_spells.sh
+[[ -z $NOBUILD ]] && "$MYDIR/cauldronchr.sh" -d "$TARGET" /build_spells.sh
 
 # unpack sys caches and set up sorcery into SYSDIR
 setup_sys
@@ -471,4 +530,4 @@ touch "$SYSDIR"/etc/ld.so.conf
 "$MYDIR/cauldronchr.sh" -d "$ISODIR" /sbin/ldconfig
 
 # Keep a clean kitchen, wipes up the leftovers from the preparation step
-clean_target
+[[ -z $NOBUILD ]] && clean_target



More information about the SM-Commit mailing list