[SM-Commit] GIT changes to master cauldron by Karsten Behrmann (b438fd6a2b2444b22c59505170c7dfbe7cf80417)

Karsten Behrmann scm at sourcemage.org
Sat Feb 23 15:59:22 EST 2008


GIT changes to master cauldron by Karsten Behrmann <BearPerson at sourcemage.org>:

 scripts/add-sauce.sh |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+)

New commits:
commit b438fd6a2b2444b22c59505170c7dfbe7cf80417
Author: Karsten Behrmann <BearPerson at sourcemage.org>
Commit: Karsten Behrmann <BearPerson at sourcemage.org>

    add a small script to reproducedly add our skeletons to chroots

diff --git a/scripts/add-sauce.sh b/scripts/add-sauce.sh
new file mode 100755
index 0000000..87dc1db
--- /dev/null
+++ b/scripts/add-sauce.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+TEMPDIR="/tmp/sauce.$$"
+
+FORCE=false
+if [[ $1 == "-f" ]] ;then
+  shift
+  FORCE=true
+fi
+
+TYPE=bad
+if [[ $1 == "-i" ]] ;then
+  TYPE=iso
+elif [[ $1 == "-s" ]] ;then
+  TYPE=system
+fi
+
+if [[ $TYPE == "bad" || -z $2 ]] ;then
+  echo "Usage: $0 [-f] <-i|-s> /path/to/target"
+  echo "Adds the cauldron team files to the given chroot"
+  echo "Use -i for an iso target, -s for the system tarball"
+  exit 1
+fi >&2
+
+CHROOTDIR=$2
+
+if ! $FORCE ;then
+  if [[ ! -x $CHROOTDIR/bin/bash ]] ;then
+    echo "Chroot at $CHROOTDIR failed sanity check (no bash?)"
+    exit 2
+  fi >&2
+fi
+
+MYDIR=$(readlink -f ${0%/*}/..)
+
+if ! [[ -e $MYDIR/base/etc/shadow ]] ;then
+  echo "Failed sanity check: Cannot find base/etc/shadow in my dir"
+  echo "(assumed to be $MYDIR)"
+  exit 2
+fi >&2
+
+
+rm -rf $TEMPDIR
+mkdir -m 0700 $TEMPDIR
+cp -a $MYDIR/base/* $TEMPDIR/
+if [[ $TYPE == "iso" ]] ;then
+  cp -a $MYDIR/iso/* $TEMPDIR/
+fi
+# Insert copy of system here, once/if we need one.
+
+# ==== FIXUP starts here ====
+chown -R 0:0 $TEMPDIR/
+chmod -R u=rwX,go=u-w $TEMPDIR/
+chmod 0600 $TEMPDIR/etc/shadow
+# ==== end fixup ====
+
+cp -a $TEMPDIR/* $CHROOTDIR/
+rm -rf $TEMPDIR



More information about the SM-Commit mailing list