~ubuntu-branches/ubuntu/hardy/ubuntu-vm-builder/hardy-proposed

« back to all changes in this revision

Viewing changes to suites/dapper

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen, Soren Hansen, Nick Barcet
  • Date: 2008-04-02 11:52:35 UTC
  • Revision ID: james.westby@ubuntu.com-20080402115235-0bs22zvld88m67ly
Tags: 0.4
[ Soren Hansen ]
* FFe reference: (LP: #208161)
* Replace start-stop-daemon for a while to fix problems with daemons
  expecting to be able to listen on certaing ports, etc.
* Unmount volatile tmpfs from lrm.
* Make /opt opt-in.
* Make default rootsize 4096 (to match documentation).
* New grub installer code.
* Fix syntax error in kernel flavour check.
* Massive refactoring.
* Make more intelligent default choices based on chosen suite, architecture,
  kernel flavour, etc.
* Further quieting of the process.

[ Nick Barcet ]
* Added template support for vmware and qemu/kvm.
* Fix a bug reported by soren where loop devices could accendentally be
  overwritten.  Was also preventing concurrent runs of the script.
* Further quieting of the process.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
. /usr/share/ubuntu-vm-builder/suites/suites-common
 
2
 
 
3
updategrub="/sbin/update-grub"
 
4
grubroot=/lib/grub
 
5
 
 
6
check_kernel_flavour() {
 
7
        case "$ARCH" in
 
8
                i386)
 
9
                        case "$1" in
 
10
                                386|686|686-smp|k7|k7-smp|server|server-bigiron)
 
11
                                        :
 
12
                                ;;
 
13
                                *)
 
14
                                        echo "Unsupported kernel flavour for Dapper/i386."
 
15
                                        echo "Supported flavours are: 386 686 686-smp k7 k7-smp server server-bigiron"
 
16
                                        exit 1
 
17
                                ;;
 
18
                        esac
 
19
                        ;;
 
20
                amd64)
 
21
                        case "$1" in
 
22
                                amd64-generic|amd64-k8|amd64-k8-smp|amd64-server|amd64-xeon)
 
23
                                        :
 
24
                                ;;
 
25
                                *)
 
26
                                        echo "Unsupported kernel flavour for Dapper/amd64."
 
27
                                        echo "Supported flavours are: amd64-generic amd64-k8 amd64-k8-smp amd64-server amd64-xeon"
 
28
                                        exit 1
 
29
                                ;;
 
30
                        esac
 
31
                        ;;
 
32
                *)
 
33
                        echo "Unsupported architecture for Dapper"
 
34
                        exit 1
 
35
                        ;;
 
36
        esac
 
37
}
 
38
 
 
39
default_kernel() {
 
40
        case "$ARCH" in
 
41
                i386)
 
42
                        KERNEL_FLAVOUR=server
 
43
                        ;;
 
44
                amd64)
 
45
                        KERNEL_FLAVOUR=amd64-server
 
46
                        ;;
 
47
                *)
 
48
                        echo "Unsupported architecture for Dapper"
 
49
                        exit 1
 
50
        esac
 
51
}
 
52
 
 
53
suite_do_fstab() {
 
54
        #
 
55
        # Set up fstab
 
56
        #
 
57
        cat > root/etc/fstab << EOF
 
58
# /etc/fstab: static file system information.
 
59
#
 
60
# <file system>                                 <mount point>   <type>  <options>       <dump>  <pass>
 
61
proc                                            /proc           proc    defaults        0       0
 
62
EOF
 
63
        for ((i=0;i<${#MOUNTPOINTS[@]};i++)); do
 
64
                if [ "${MOUNTPOINTS[$i]}" = "root" ]; then
 
65
                        echo "/dev/hd${MOUNTDISKS[$i]}1 /       ext3    defaults        0       1">>root/etc/fstab
 
66
                elif [ "${MOUNTPOINTS[$i]}" = "swap" ]; then
 
67
                        echo "/dev/hd${MOUNTDISKS[$i]}1 swap      swap    defaults        0       1">>root/etc/fstab
 
68
                else 
 
69
                        echo "/dev/hd${MOUNTDISKS[$i]}1 ${MOUNTPOINTS[$i]}       ext3    defaults        0       1">>root/etc/fstab
 
70
                fi
 
71
        done
 
72
}
 
73
 
 
74
suite_generate_device_map() {
 
75
        common_write_device_map_no_uuids
 
76
}
 
77
 
 
78
suite_mangle_grub_menu_lst() {
 
79
        sed -ie '/^# kopt_2_6/ d' target/boot/grub/menu.lst
 
80
}
 
81
 
 
82
#
 
83
# Add package names to PKGS
 
84
#
 
85
suite_extra_packages() {
 
86
        :
 
87
}