Merge "Generate glance image with SCSI bus type for ppc arch"
This commit is contained in:
commit
b20d4d124e
16
functions
16
functions
@ -554,7 +554,7 @@ function exit_distro_not_supported {
|
|||||||
function is_arch {
|
function is_arch {
|
||||||
ARCH_TYPE=$1
|
ARCH_TYPE=$1
|
||||||
|
|
||||||
[ "($uname -m)" = "$ARCH_TYPE" ]
|
[[ "$(uname -m)" == "$ARCH_TYPE" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Checks if installed Apache is <= given version
|
# Checks if installed Apache is <= given version
|
||||||
@ -1588,11 +1588,15 @@ function upload_image() {
|
|||||||
*) echo "Do not know what to do with $IMAGE_FNAME"; false;;
|
*) echo "Do not know what to do with $IMAGE_FNAME"; false;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if is_arch "ppc64"; then
|
||||||
|
IMG_PROPERTY="--property hw_disk_bus=scsi --property hw_cdrom_bus=scsi"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$CONTAINER_FORMAT" = "bare" ]; then
|
if [ "$CONTAINER_FORMAT" = "bare" ]; then
|
||||||
if [ "$UNPACK" = "zcat" ]; then
|
if [ "$UNPACK" = "zcat" ]; then
|
||||||
glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" --is-public True --container-format=$CONTAINER_FORMAT --disk-format $DISK_FORMAT < <(zcat --force "${IMAGE}")
|
glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" $IMG_PROPERTY --is-public True --container-format=$CONTAINER_FORMAT --disk-format $DISK_FORMAT < <(zcat --force "${IMAGE}")
|
||||||
else
|
else
|
||||||
glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" --is-public True --container-format=$CONTAINER_FORMAT --disk-format $DISK_FORMAT < "${IMAGE}"
|
glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" $IMG_PROPERTY --is-public True --container-format=$CONTAINER_FORMAT --disk-format $DISK_FORMAT < "${IMAGE}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Use glance client to add the kernel the root filesystem.
|
# Use glance client to add the kernel the root filesystem.
|
||||||
@ -1600,12 +1604,12 @@ function upload_image() {
|
|||||||
# kernel for use when uploading the root filesystem.
|
# kernel for use when uploading the root filesystem.
|
||||||
KERNEL_ID=""; RAMDISK_ID="";
|
KERNEL_ID=""; RAMDISK_ID="";
|
||||||
if [ -n "$KERNEL" ]; then
|
if [ -n "$KERNEL" ]; then
|
||||||
KERNEL_ID=$(glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME-kernel" --is-public True --container-format aki --disk-format aki < "$KERNEL" | grep ' id ' | get_field 2)
|
KERNEL_ID=$(glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME-kernel" $IMG_PROPERTY --is-public True --container-format aki --disk-format aki < "$KERNEL" | grep ' id ' | get_field 2)
|
||||||
fi
|
fi
|
||||||
if [ -n "$RAMDISK" ]; then
|
if [ -n "$RAMDISK" ]; then
|
||||||
RAMDISK_ID=$(glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME-ramdisk" --is-public True --container-format ari --disk-format ari < "$RAMDISK" | grep ' id ' | get_field 2)
|
RAMDISK_ID=$(glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME-ramdisk" $IMG_PROPERTY --is-public True --container-format ari --disk-format ari < "$RAMDISK" | grep ' id ' | get_field 2)
|
||||||
fi
|
fi
|
||||||
glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "${IMAGE_NAME%.img}" --is-public True --container-format ami --disk-format ami ${KERNEL_ID:+--property kernel_id=$KERNEL_ID} ${RAMDISK_ID:+--property ramdisk_id=$RAMDISK_ID} < "${IMAGE}"
|
glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "${IMAGE_NAME%.img}" $IMG_PROPERTY --is-public True --container-format ami --disk-format ami ${KERNEL_ID:+--property kernel_id=$KERNEL_ID} ${RAMDISK_ID:+--property ramdisk_id=$RAMDISK_ID} < "${IMAGE}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user