/
ubuntu
executable file
·41 lines (30 loc) · 1.1 KB
/
ubuntu
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
35
36
37
38
39
40
41
# A local debian mirror
UBUNTU_MIRROR="http://jp.archive.ubuntu.com/ubuntu"
DEFAULT_UBUNTU_RELEASE="hardy"
#ARCH="i386"
ARCH="amd64"
############################################################
## No configurable variables past this point ##
############################################################
DISTROS_AVAILABLE="$DISTROS_AVAILABLE ubuntu"
init_ubuntu() {
UBUREL=${RELEASE:-$DEFAULT_UBUNTU_RELEASE}
verbose_echo Initializing Ubuntu $UBUREL ...
if test "x$VERBOSE" != "x"; then
DSTRAP_OPTS="--verbose"
fi
try_run "Installing Ubuntu base system from $UBUNTU_MIRROR" \
debootstrap $DSTRAP_OPTS --arch $ARCH $UBUREL $MOUNTPOINT $UBUNTU_MIRROR
if test "x$DRYRUN" = "x" ; then
cat > $MOUNTPOINT/etc/apt/sources.list << EOF
deb $UBUNTU_MIRROR $UBUREL main
deb-src $UBUNTU_MIRROR $UBUREL main
deb http://security.ubuntu.com/ubuntu $UBUREL-security main
EOF
fi
try_run "Initializing Ubuntu guest filesystem" \
"(cp initU.d/initU-debian $MOUNTPOINT/sbin && \
chroot $MOUNTPOINT /sbin/initU-debian $DOMNAME)"
try_run "Unmounting $MOUNTPOINT" \
umount $MOUNTPOINT
}