aboutsummaryrefslogtreecommitdiff
path: root/examples/lvmpbuilder/sample_setup_base
blob: 5ce5ce5c2d1e2a1f20963b17cd76c5ef1c95d46c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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.