~ubuntu-core-dev/ubuntu/xenial/ubuntu-release-upgrader/xenial

« back to all changes in this revision

Viewing changes to AutoUpgradeTester/jeos/create-base-image.sh

  • Committer: Michael Terry
  • Date: 2012-06-06 21:23:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2509.
  • Revision ID: michael.terry@canonical.com-20120606212335-dt5xyu2v3ct5hcey
first pass at converting update-manager source into ubuntu-release-upgrader

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
set -e
4
 
 
5
 
DIST=$(lsb_release -c -s)
6
 
 
7
 
if [ -z "$1" ]; then
8
 
    echo "need distro codename to create as first argument "
9
 
    exit 1
10
 
fi
11
 
 
12
 
# check depends
13
 
if [ ! -f /usr/bin/ubuntu-vm-builder ]; then
14
 
    apt-get install -y ubuntu-vm-builder
15
 
fi
16
 
 
17
 
if [ ! -f /usr/bin/kvm ]; then
18
 
    apt-get install -y kvm
19
 
fi
20
 
 
21
 
# create a default ssh key
22
 
if [ ! -e ssh-key ]; then
23
 
    ssh-keygen -N '' -f ssh-key
24
 
fi
25
 
 
26
 
KERNEL=generic
27
 
if [ "$1" = "dapper" ]; then
28
 
        KERNEL=386
29
 
fi
30
 
 
31
 
# create the image
32
 
ubuntu-vm-builder kvm $1 --kernel-flavour $KERNEL --ssh-key $(pwd)/ssh-key.pub \
33
 
    --components main,restricted --rootsize 80000 --arch i386 --dest ubuntu-$1
34
 
 
35
 
# move into place
36
 
mv ubuntu-$1/*.qcow2 $1-i386.qcow2