source: trunk/packages/sipb-xen-autoinstaller/common/usr/sbin/sipb-xen-create-image @ 1102

Last change on this file since 1102 was 1083, checked in by broder, 16 years ago

Skip kpartx call when running autoinstaller on physical devices

File size: 625 bytes
RevLine 
[929]1#!/bin/bash
2# Usage: no command-line args.
3# "arguments" come in environment:
[937]4#  TARGET a device filename
[938]5#  FSSIZE the desired filesystem size in megabytes (rest will be swap)
[929]6#  ARCH, DIST, MIRROR
7#  HOSTNAME, IP
8
[937]9set -e
10
[938]11echo ,"${FSSIZE}"$',L,*\n,,S\n;\n;' | sfdisk -uM -H 255 -S 63 "$TARGET"
[929]12
[1083]13dmsetup info "$TARGET" && kpartx -a "$TARGET"
[931]14
[929]15xen-create-image --image-dev "${TARGET}1" --swap-dev "${TARGET}2" --fs ext3 --ide \
16 --hostname "$HOSTNAME" --ip="$IP" --netmask=255.255.0.0 --gateway=18.181.0.1 \
17 --arch "$ARCH" --dist "$DIST" --mirror "$MIRROR" --cache=yes
18
[1083]19dmsetup info "$TARGET" && kpartx -d "$TARGET"
[931]20
[929]21exit 0
Note: See TracBrowser for help on using the repository browser.