Last change
on this file since 2988 was
2899,
checked in by gdb, 15 years ago
|
Changed xen.network -> xen; fixed style for omitted option
|
File size:
901 bytes
|
Rev | Line | |
---|
[929] | 1 | #!/bin/bash |
---|
| 2 | # Usage: no command-line args. |
---|
| 3 | # "arguments" come in environment: |
---|
[937] | 4 | # TARGET a device filename |
---|
[2161] | 5 | # FSSIZE the desired filesystem size in mebibytes (rest will be swap) |
---|
[929] | 6 | # ARCH, DIST, MIRROR |
---|
| 7 | # HOSTNAME, IP |
---|
[2844] | 8 | # |
---|
| 9 | # Optional: GATEWAY, NETMASK. These default to values in invirt-getconf, if installed |
---|
[929] | 10 | |
---|
[937] | 11 | set -e |
---|
| 12 | |
---|
[2899] | 13 | if [ -z "$GATEWAY" ]; then |
---|
| 14 | GATEWAY=$(invirt-getconf network.gateway) |
---|
[2844] | 15 | fi |
---|
| 16 | |
---|
[2899] | 17 | if [ -z "$NETMASK" ]; then |
---|
| 18 | NETMASK=$(invirt-getconf network.netmask) |
---|
[2844] | 19 | fi |
---|
| 20 | |
---|
[938] | 21 | echo ,"${FSSIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET" |
---|
[929] | 22 | |
---|
[1147] | 23 | dmsetup info "$TARGET" 2>/dev/null && kpartx -a "$TARGET" |
---|
[931] | 24 | |
---|
[929] | 25 | xen-create-image --image-dev "${TARGET}1" --swap-dev "${TARGET}2" --fs ext3 --ide \ |
---|
[2844] | 26 | --hostname "$HOSTNAME" --ip="$IP" --netmask="$NETMASK" --gateway="$GATEWAY" \ |
---|
[1124] | 27 | --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes --verbose |
---|
[929] | 28 | |
---|
[1147] | 29 | dmsetup info "$TARGET" 2>/dev/null && kpartx -d "$TARGET" |
---|
[931] | 30 | |
---|
[929] | 31 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.