aboutsummaryrefslogtreecommitdiff
path: root/examples/lvmpbuilder/sample_setup_base
diff options
context:
space:
mode:
Diffstat (limited to 'examples/lvmpbuilder/sample_setup_base')
-rwxr-xr-xexamples/lvmpbuilder/sample_setup_base34
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/lvmpbuilder/sample_setup_base b/examples/lvmpbuilder/sample_setup_base
new file mode 100755
index 0000000..5ce5ce5
--- /dev/null
+++ b/examples/lvmpbuilder/sample_setup_base
@@ -0,0 +1,34 @@
+#!/bin/sh
+#The files in this directory (except pbuilderrc) were written by
+#(C) 2006 Kapil Hari Paranjape <kapil@imsc.res.in>.
+#They are placed in the public domain. You can do with them exactly as you wish.
+
+# Source the pbuilderrc file
+. /usr/lib/pbuilder/pbuilder-loadconfig
+
+echo $HOME : $BASEDEV : $COWDEV
+
+if [ -z "$BASEDEV" -o -z "$COWDEV" ]
+then
+ echo Please define BASEDEV and COWDEV in the pbuilderrc file
+ exit 1
+fi
+
+# setup for creation
+mke2fs -O dir_index $BASEDEV
+mount $BASEDEV $BUILDPLACE
+
+# Use debootstrap to create
+DISTRIBUTION=${DISTRIBUTION:-"sid"}
+$DEBOOTSTRAP ${DEBOOTSTRAPOPTS[@]} $DISTRIBUTION $BUILDPLACE $MIRRORSITE
+
+# run update
+pbuilder update --no-targz
+
+# finalise base
+umount $BUILDPLACE
+e2fsck -f $BASEDEV
+blockdev --setro $BASEDEV
+
+echo Done.
+