summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/centos-img-modify.sh3
-rwxr-xr-xtools/daisy-img-modify.sh19
-rw-r--r--tools/daisy-post-fip.sh2
3 files changed, 18 insertions, 6 deletions
diff --git a/tools/centos-img-modify.sh b/tools/centos-img-modify.sh
index 5a2df82f..41c730cb 100755
--- a/tools/centos-img-modify.sh
+++ b/tools/centos-img-modify.sh
@@ -74,3 +74,6 @@ cd /etc
if [ ! -z $localtime_file ] && [ -f $localtime_file ]; then
ln -s -f $localtime_file /etc/localtime
fi
+
+# https://review.openstack.org/#/c/568180/
+test -e /etc/yum/vars/contentdir || echo centos > /etc/yum/vars/contentdir
diff --git a/tools/daisy-img-modify.sh b/tools/daisy-img-modify.sh
index 43fd186b..6d2ff53f 100755
--- a/tools/daisy-img-modify.sh
+++ b/tools/daisy-img-modify.sh
@@ -99,7 +99,10 @@ raw_imgfile="${workdir}/centos7.raw"
# download and checksum base image, conditionally if local copy is outdated
download() {
- test -d $workdir || mkdir -p $workdir
+ test -d $workdir || {
+ mkdir -p $workdir
+ test -z $SUDO_USER || chown -R $SUDO_USER:$SUDO_USER $workdir
+ }
cd $workdir
rm -f sha256sum.txt
wget $sha256sum_url
@@ -162,8 +165,8 @@ resize() {
kpartx -av $raw_imgfile
sleep 2
dmsetup ls
- fdisk -l /dev/${loopdevice:0:5} || true
- growpart /dev/${loopdevice:0:5} 1
+ fdisk -l /dev/${loopdevice:0:-2} || true
+ growpart /dev/${loopdevice:0:-2} 1
dmsetup clear $loopdevice
kpartx -dv $raw_imgfile || eliminate
}
@@ -176,8 +179,14 @@ setup() {
kpartx -av $raw_imgfile
sleep 2
dmsetup ls
- fdisk -l /dev/${loopdevice:0:5} || true
- mount /dev/mapper/$loopdevice $mountdir
+ fdisk -l /dev/${loopdevice:0:-2} || true
+
+ if [ "xfs" = "$(blkid -o value -s TYPE /dev/mapper/$loopdevice)" ]; then
+ mountopts="-o nouuid"
+ else
+ mountopts=""
+ fi
+ mount $mountopts /dev/mapper/$loopdevice $mountdir
mount -t proc none ${mountdir}/proc
if [[ -n $img_size ]]; then
diff --git a/tools/daisy-post-fip.sh b/tools/daisy-post-fip.sh
index 80d79e38..44e55064 100644
--- a/tools/daisy-post-fip.sh
+++ b/tools/daisy-post-fip.sh
@@ -56,7 +56,7 @@ openstack server create --image ${IMAGE_NAME} --flavor m1.micro \
--nic net-id=${DEMO_NET_ID} demo1
# Wait for guest ready to accept FIP, seems need it.
-sleep 10
+sleep 30
openstack server add floating ip demo1 ${DEMO_FIP}