~ubuntu-virt/vmbuilder/trunk

« back to all changes in this revision

Viewing changes to suites/suites-common

  • Committer: Soren Hansen
  • Date: 2008-06-27 12:47:26 UTC
  • Revision ID: soren.hansen@canonical.com-20080627124726-kj690sepircudc3h
Import python rewrite.. It's not quite at a useful point yet (only cli+kvm+hardy is in a usable state), but it's getting there..

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
common_do_fstab() {
3
 
        #
4
 
        # Set up fstab
5
 
        #
6
 
        cat > root/etc/fstab << EOF
7
 
# /etc/fstab: static file system information.
8
 
#
9
 
# <file system>                                 <mount point>   <type>  <options>       <dump>  <pass>
10
 
proc                                            /proc           proc    defaults        0       0
11
 
EOF
12
 
        for ((i=0;i<${#MOUNTPOINTS[@]};i++)); do
13
 
                if [ "${MOUNTPOINTS[$i]}" = "root" ]; then
14
 
                        echo "UUID=$(cat ${MOUNTPOINTS[$i]}.uuid) /       ext3    defaults        0       1">>root/etc/fstab
15
 
                elif [ "${MOUNTPOINTS[$i]}" = "swap" ]; then
16
 
                        echo "UUID=$(cat ${MOUNTPOINTS[$i]}.uuid) swap      swap    defaults        0       1">>root/etc/fstab
17
 
                else
18
 
                        echo "UUID=$(cat ${MOUNTPOINTS[$i]}.uuid) ${MOUNTPOINTS[$i]}       ext3    defaults        0       1">>root/etc/fstab
19
 
                fi
20
 
        done
21
 
}
22
 
 
23
 
common_write_device_map_with_uuids() {
24
 
        echo "(hd0) UUID=$(cat ${MOUNTPOINTS[0]}.uuid)" >> target/boot/grub/device.map
25
 
}
26
 
 
27
 
common_write_device_map_no_uuids() {
28
 
        echo "(hd0) /dev/sd${letters[0]}" >> target/boot/grub/device.map
29
 
}
30
 
 
31
 
common_mangle_grub_menu_list_with_uuid() {
32
 
        rep="UUID=$(cat ${MOUNTPOINTS[0]}.uuid)"
33
 
        sed -ie "s/\/dev\/hda1/$rep/g" target/boot/grub/menu.lst
34
 
}