Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (bb11a6b0a989f647378be53b4561ef38567c32a9)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (bb11a6b0a989f647378be53b4561ef38567c32a9)
  • Date: Thu, 20 Nov 2008 20:32:04 -0600

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

scripts/cauldronchr.sh | 18 +++++++++++-------
scripts/spellcaster.sh | 37 +++++++++++++++++++++++++------------
2 files changed, 36 insertions(+), 19 deletions(-)

New commits:
commit bb11a6b0a989f647378be53b4561ef38567c32a9
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: correctly cast in chroot

Modified the spellcaster script to correctly handle casting inside the
chroot. This requires running the script inside of the chroot by copying
it to the target directory along with the spell listings, and cleaning
up the target directory after we're done. This change makes use of the
fault checking now provided in cauldronchr.sh.

commit 3fa8a03a9ae8de2be5c7bb55634b07f3aaf1c400
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: mod sorcery conf correctly

The sorcery config variables should have quoted contents, not bare
contents.

commit 3f6c8b4ad0a5f7f48ee06f6a3ad58ccc7d6ca1a3
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/cauldronchr.sh: export CAULDRON_CHROOT

Export an internal variable so that any cauldron scripts running inside
a cauldron chroot can know that they are in the chroot rather than
outside of it. This will enable fault-checking inside of chroots.

commit 604377f237db039ae2b7dceef90ff1bc172829ae
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/cauldronchr.sh: fixed formatting

Removed unnecessary leading spaces.

diff --git a/scripts/cauldronchr.sh b/scripts/cauldronchr.sh
index c73a330..a0e1c78 100755
--- a/scripts/cauldronchr.sh
+++ b/scripts/cauldronchr.sh
@@ -58,12 +58,16 @@ CHROOT_DIR="${CHROOT_DIR:-.}"
[[ $# -gt 0 ]] && CHROOT_CMD="$@"
CHROOT_CMD="${CHROOT_CMD:-/bin/bash -l}"

- mount --bind /dev "$CHROOT_DIR"/dev
- mount --bind /dev/pts "$CHROOT_DIR"/dev/pts
- mount --bind /proc "$CHROOT_DIR"/proc
+mount --bind /dev "$CHROOT_DIR"/dev
+mount --bind /dev/pts "$CHROOT_DIR"/dev/pts
+mount --bind /proc "$CHROOT_DIR"/proc

- chroot "$CHROOT_DIR" $CHROOT_CMD
+export CAULDRON_CHROOT="$CHROOT_DIR"

- umount "$CHROOT_DIR"/proc
- umount "$CHROOT_DIR"/dev/pts
- umount "$CHROOT_DIR"/dev
+chroot "$CHROOT_DIR" $CHROOT_CMD
+
+unset CAULDRON_CHROOT
+
+umount "$CHROOT_DIR"/proc
+umount "$CHROOT_DIR"/dev/pts
+umount "$CHROOT_DIR"/dev
diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index 23b06be..42648c1 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -4,6 +4,20 @@
# chroot, and also the casting and subsequent dispelling (with caches
enabled)
# of the optional spells.

+if [[ -n $CAULDRON_CHROOT && $# -eq 0 ]]
+then
+ # first cast the required spells (don't dispel, since these are needed
+ # for the ISO to function)
+ /usr/bin/cast $(tr '\n' ' ' </"$rspells") &&
+
+ # now cast and dispel the optional spells, so that we have the cache
+ # files available
+ /usr/bin/cast $(tr '\n' ' ' </"$rspells") &&
+ /usr/bin/cast $(tr '\n' ' ' </"$rspells")
+
+ exit $?
+fi
+
MYDIR="$(dirname $0)"
CAULDRONDIR="$MYDIR"/../data

@@ -60,8 +74,8 @@ shift
TYPE="x86"
[[ $# -gt 0 ]] && TYPE="$1"

-rspells="rspells.$TYPE"
-ospells="ospells.$TYPE"
+export rspells="rspells.$TYPE"
+export ospells="ospells.$TYPE"

# check to make sure that the chroot has sorcery set to do caches
if [[ -e "$TARGET"/etc/sorcery/local/config ]]
@@ -75,22 +89,21 @@ then

if [[ $CHOICE == 'y' ]]
then
- sed -i 's/ARCHIVE=.*/ARCHIVE=on/'
"$TARGET"/etc/sorcery/local/config
+ sed -i 's/ARCHIVE=.*/ARCHIVE="on"/'
"$TARGET"/etc/sorcery/local/config
else
exit 2
fi
fi
fi

-# first cast all the required spells
-cp "$CAULDRONDIR"/"$rspells" "$TARGET"/
-chroot "$TARGET" /usr/sbin/cast </"$rspells"
-rm "$TARGET"/"$rspells"
+cp "$CAULDRONDIR/$rspells" "$TARGET"/
+cp "$CAULDRONDIR/$ospells" "$TARGET"/
+"$MYDIR/cauldronchr.sh" "$TARGET" /"$(basename $0)"
+rm "$TARGET/$rspells"
+rm "$TARGET/$ospells"
+rm "$TARGET/$(basename $0)"

-# now cast all the optional spells
-cp "$CAULDRONDIR"/"$ospells" "$TARGET"/
-chroot "$TARGET" /usr/sbin/cast </"$ospells"
-chroot "$TARGET" /usr/sbin/dispel </"$ospells"
-rm "$TARGET"/"$ospells"
+unset rspells
+unset ospells

exit 0




Archive powered by MHonArc 2.6.24.

Top of Page