summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ubuntu-server-cloudimg-modify.sh41
-rw-r--r--tools/yardstick-img-dpdk-modify12
-rwxr-xr-xtools/yardstick-img-lxd-modify12
-rwxr-xr-xtools/yardstick-img-modify47
4 files changed, 26 insertions, 86 deletions
diff --git a/tools/ubuntu-server-cloudimg-modify.sh b/tools/ubuntu-server-cloudimg-modify.sh
index bffd83a7b..4b0c07a5b 100755
--- a/tools/ubuntu-server-cloudimg-modify.sh
+++ b/tools/ubuntu-server-cloudimg-modify.sh
@@ -46,17 +46,6 @@ chpasswd: { expire: False }
ssh_pwauth: True
EOF
apt-get update
-if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then
- apt-get install -y \
- linux-headers-$(echo $CLOUD_KERNEL_VERSION | cut -d'-' -f3,4,5) \
- unzip
- #resize root partition (/dev/vdb1) It is supposed to be default but the image is booted differently for arm64
-cat <<EOF >/etc/cloud/cloud.cfg.d/15_growpart.cfg
-#cloud-config
-bootcmd:
- - [growpart, /dev/vdb, 1]
-EOF
-fi
apt-get install -y \
bc \
fio \
@@ -81,37 +70,17 @@ CLONE_DEST=/opt/tempT
# remove before cloning
rm -rf -- "${CLONE_DEST}"
-if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then
- wget https://github.com/kdlucas/byte-unixbench/archive/master.zip
- unzip master.zip && rm master.zip
- mkdir "${CLONE_DEST}"
- mv byte-unixbench-master/UnixBench "${CLONE_DEST}"
- sed -i -e 's/OPTON += -march=native -mtune=native/OPTON += -march=armv8-a -mtune=generic/g' \
- -e 's/OPTON += -march=native/OPTON += -march=armv8-a/g' "${CLONE_DEST}/UnixBench/Makefile"
-else
- git clone https://github.com/kdlucas/byte-unixbench.git "${CLONE_DEST}"
-fi
+git clone https://github.com/kdlucas/byte-unixbench.git "${CLONE_DEST}"
+
make --directory "${CLONE_DEST}/UnixBench/"
-if [ "${YARD_IMG_ARCH}" = "arm64" ]; then
- wget https://github.com/beefyamoeba5/ramspeed/archive/master.zip
- unzip master.zip && rm master.zip
- mkdir "${CLONE_DEST}/RAMspeed"
- mv ramspeed-master/* "${CLONE_DEST}/RAMspeed/"
-else
- git clone https://github.com/beefyamoeba5/ramspeed.git "${CLONE_DEST}/RAMspeed"
-fi
+git clone https://github.com/beefyamoeba5/ramspeed.git "${CLONE_DEST}/RAMspeed"
+
cd "${CLONE_DEST}/RAMspeed/ramspeed-2.6.0"
mkdir temp
bash build.sh
-if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then
- wget https://github.com/beefyamoeba5/cachestat/archive/master.zip
- unzip master.zip && rm master.zip
- mv cachestat-master/cachestat "${CLONE_DEST}"
-else
- git clone https://github.com/beefyamoeba5/cachestat.git "${CLONE_DEST}/Cachestat"
-fi
+git clone https://github.com/beefyamoeba5/cachestat.git "${CLONE_DEST}/Cachestat"
# restore symlink
ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf
diff --git a/tools/yardstick-img-dpdk-modify b/tools/yardstick-img-dpdk-modify
index ec2672d27..9f3d11957 100644
--- a/tools/yardstick-img-dpdk-modify
+++ b/tools/yardstick-img-dpdk-modify
@@ -44,8 +44,8 @@ host=${HOST:-"cloud-images.ubuntu.com"}
release=${RELEASE:-"wily"}
image_path="${release}/current/${release}-server-cloudimg-amd64-disk1.img"
image_url=${IMAGE_URL:-"https://${host}/${image_path}"}
-md5sums_path="${release}/current/MD5SUMS"
-md5sums_url=${MD5SUMS_URL:-"https://${host}/${md5sums_path}"}
+sha256sums_path="${release}/current/SHA256SUMS"
+sha256sums_url=${SHA256SUMS_URL:-"https://${host}/${sha256sums_path}"}
imgfile="${workspace}/yardstick-${release}-server"
raw_imgfile="${workspace}/yardstick-${release}-server.raw"
@@ -55,14 +55,14 @@ filename=$(basename $image_url)
download() {
test -d $workspace || mkdir -p $workspace
cd $workspace
- rm -f MD5SUMS # always download the checksum file to a detect stale image
- wget $md5sums_url
+ rm -f SHA256SUMS # always download the checksum file to a detect stale image
+ wget $sha256sums_url
test -e $filename || wget -nc $image_url
- grep $filename MD5SUMS | md5sum -c ||
+ grep $filename SHA256SUMS | sha256sum -c ||
if [ $? -ne 0 ]; then
rm $filename
wget -nc $image_url
- grep $filename MD5SUMS | md5sum -c
+ grep $filename SHA256SUMS | sha256sum -c
fi
qemu-img convert $filename $raw_imgfile
cd -
diff --git a/tools/yardstick-img-lxd-modify b/tools/yardstick-img-lxd-modify
index 4ca4eb489..b977d2a52 100755
--- a/tools/yardstick-img-lxd-modify
+++ b/tools/yardstick-img-lxd-modify
@@ -44,8 +44,8 @@ host=${HOST:-"cloud-images.ubuntu.com"}
release=${RELEASE:-"xenial"}
image_path="${release}/current/${release}-server-cloudimg-amd64-root.tar.gz"
image_url=${IMAGE_URL:-"https://${host}/${image_path}"}
-md5sums_path="${release}/current/MD5SUMS"
-md5sums_url=${MD5SUMS_URL:-"https://${host}/${md5sums_path}"}
+sha256sums_path="${release}/current/SHA256SUMS"
+sha256sums_url=${SHA256SUMS_URL:-"https://${host}/${sha256sums_path}"}
imgfile="${workspace}/yardstick-image.tar.gz"
filename=$(basename $image_url)
@@ -54,14 +54,14 @@ filename=$(basename $image_url)
download() {
test -d $workspace || mkdir -p $workspace
cd $workspace
- rm -f MD5SUMS # always download the checksum file to a detect stale image
- wget $md5sums_url
+ rm -f SHA256SUMS # always download the checksum file to a detect stale image
+ wget $sha256sums_url
test -e $filename || wget -nc --progress=dot:giga $image_url
- grep $filename MD5SUMS | md5sum -c ||
+ grep $filename SHA256SUMS | sha256sum -c ||
if [ $? -ne 0 ]; then
rm $filename
wget -nc --progress=dot:giga $image_url
- grep $filename MD5SUMS | md5sum -c
+ grep $filename SHA256SUMS | sha256sum -c
fi
cd -
}
diff --git a/tools/yardstick-img-modify b/tools/yardstick-img-modify
index b4f632bb2..599768555 100755
--- a/tools/yardstick-img-modify
+++ b/tools/yardstick-img-modify
@@ -48,8 +48,8 @@ fi
image_path="${release}/current/${release}-server-cloudimg-${YARD_IMG_ARCH}-${boot_mode}.img"
image_url=${IMAGE_URL:-"https://${host}/${image_path}"}
-md5sums_path="${release}/current/MD5SUMS"
-md5sums_url=${MD5SUMS_URL:-"https://${host}/${md5sums_path}"}
+sha256sums_path="${release}/current/SHA256SUMS"
+sha256sums_url=${SHA256SUMS_URL:-"https://${host}/${sha256sums_path}"}
imgfile="${workspace}/yardstick-image.img"
raw_imgfile_basename="yardstick-${release}-server.raw"
@@ -62,41 +62,20 @@ apt-get install -y parted
download() {
test -d $workspace || mkdir -p $workspace
cd $workspace
- rm -f MD5SUMS # always download the checksum file to a detect stale image
- wget $md5sums_url
+ rm -f SHA256SUMS # always download the checksum file to a detect stale image
+ wget $sha256sums_url
test -e $filename || wget -nc --progress=dot:giga $image_url
- grep $filename MD5SUMS | md5sum -c ||
+ grep $filename SHA256SUMS | sha256sum -c ||
if [ $? -ne 0 ]; then
rm $filename
wget -nc --progress=dot:giga $image_url
- grep $filename MD5SUMS | md5sum -c
+ grep $filename SHA256SUMS | sha256sum -c
fi
for i in $(seq 0 9); do
[ -a /dev/loop$i ] || mknod -m 660 /dev/loop$i b 7 $i
done
- if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then
- cd /tmp
- if [ ! -f /tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}-kernel-info.txt ]; then
- wget http://${host}/${release}/current/${release}-server-cloudimg-${YARD_IMG_ARCH}-kernel-info.txt
- fi
- export CLOUD_KERNEL_VERSION=$(cut -d$'\t' -f4 ${release}-server-cloudimg-${YARD_IMG_ARCH}-kernel-info.txt)
-
- mkdir -p /tmp/${release}-modules
- if [ ! -f "/tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}.tar.gz" ]; then
- wget $CLOUD_IMG_URL
- fi
- if [ ! -f "/tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}.img" ]; then
- tar zxvf ${release}-server-cloudimg-${YARD_IMG_ARCH}.tar.gz ${release}-server-cloudimg-${YARD_IMG_ARCH}.img
- fi
- mkdir -p /mnt/${release}
- mount /tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}.img /mnt/${release}
- cp -r /mnt/${release}/lib/modules/$(echo $CLOUD_KERNEL_VERSION) /tmp/${release}-modules
- umount /mnt/${release}
- rm /tmp/${release}-server-cloudimg-${YARD_IMG_ARCH}.img
- cd $workspace
- fi
qemu-img convert $filename $raw_imgfile
cd -
}
@@ -104,19 +83,12 @@ download() {
# mount image
setup() {
# qemu-img resize $raw_imgfile +5GB
- if [ "${YARD_IMG_ARCH}" = "arm64" ]; then
- echo -e "d\nn\np\n1\n\n\nw" | parted -l $raw_imgfile
- fi
mkdir -p $mountdir
loopdevice=$(kpartx -l $raw_imgfile | head -1 | cut -f1 -d ' ')
kpartx -av $raw_imgfile
- if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then
- e2fsck -p -f /dev/mapper/$loopdevice
- resize2fs /dev/mapper/$loopdevice
- fi
# for trouble shooting
sleep 2
dmsetup ls
@@ -124,11 +96,10 @@ setup() {
mount /dev/mapper/$loopdevice $mountdir
mount -t proc none $mountdir/proc
- if [[ "${YARD_IMG_ARCH}" = "arm64" && "$release" = "vivid" ]]; then
- cp -r /tmp/${release}-modules/$(echo $CLOUD_KERNEL_VERSION) "$mountdir/lib/modules"
- cp $(which "qemu-aarch64-static") "$mountdir/usr/bin"
- fi
cp $cmd $mountdir/$(basename $cmd)
+ if [ "${YARD_IMG_ARCH}" = "arm64" ]; then
+ cp /usr/bin/qemu-aarch64-static $mountdir/usr/bin
+ fi
}
# modify image running a script using in a chrooted environment