2 for dir in /lib/udev /sbin; do
3 if [ -f $dir/vol_id -a -x $dir/vol_id ]; then
8 if [ -z "$VOL_ID" ]; then
9 echo "vol_id not found, please install udev"
13 get_api5_arguments() {
14 TEMP=`getopt -o o:n:i:b:s: -n '$0' -- "$@"`
15 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
16 # Note the quotes around `$TEMP': they are essential!
20 -i|-n) instance=$2; shift 2;;
22 -o) old_name=$2; shift 2;;
24 -b) blockdev=$2; shift 2;;
26 -s) swapdev=$2; shift 2;;
30 *) echo "Internal error!"; exit 1;;
33 if [ -z "$instance" -o -z "$blockdev" ]; then
34 echo "Missing OS API Argument"
37 if [ "$0" != "export" -a -z "$swapdev" ]; then
38 echo "Missing OS API Argument"
41 if [ "$0" = "rename" -a -z "$new_name" ]; then
42 echo "Missing OS API Argument"
47 get_api10_arguments() {
48 if [ -z "$INSTANCE_NAME" -o -z "$HYPERVISOR" -o -z "$DISK_COUNT" ]; then
49 echo "Missing OS API Variable"
52 instance=$INSTANCE_NAME
53 if [ $DISK_COUNT -lt 1 -o -z "$DISK_0_PATH" ]; then
54 echo "At least one disk is needed"
58 if [ "$0" = "rename" -a -z "$OLD_INSTANCE_NAME" ]; then
59 echo "Missing OS API Variable"
61 old_name=$OLD_INSTANCE_NAME
64 if [ -z "$OS_API_VERSION" -o "$OS_API_VERSION" = "5" ]; then
67 elif [ "$OS_API_VERSION" = "10" ]; then
69 if [ $0 = "import" -o $0 = "export" ]; then
70 echo "import/export still not compatible with API version 10"
74 echo "Unknown OS API VERSION $OS_API_VERSION"