+ echo '====== automated-ec2-builds [/tmp/automated-ec2-builds] ======' ====== automated-ec2-builds [/tmp/automated-ec2-builds] ====== + cd /tmp/automated-ec2-builds + bzr info Standalone tree (format: 2a) Location: branch root: . Related branches: parent branch: http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/ + bzr version-info revision-id: ben.howard@ubuntu.com-20150225232444-h958hduo33iqfvva date: 2015-02-25 16:24:44 -0700 build-date: 2015-02-27 19:57:37 +0000 revno: 652 branch-nick: automated-ec2-builds + bzr log -p -r-1 ------------------------------------------------------------ revno: 652 committer: Ben Howard branch nick: master timestamp: Wed 2015-02-25 16:24:44 -0700 message: Fixes for aarch64 builds diff: === modified file 'chroot_helper' --- chroot_helper 2015-02-25 00:36:49 +0000 +++ chroot_helper 2015-02-25 23:24:44 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # # For non-Intel builds (and building Intel on non-intel) we need the ability to # chroot into things. Proot is a package that allows you to use qemu without @@ -9,20 +9,39 @@ cmd=(chroot) target_arch=$(file ${root_d}/bin/bash | awk -F',' '{print$2}') my_arch=$(uname -m) +compat_arches=() case $target_arch in - *aarch64*) [[ "${my_arch}" =~ aarch ]] || qemu_static="qemu-aarch64-static";; - *ARM*|*arm*) [[ "${my_arch}" =~ (ARM|arm) ]] || qemu_static="qemu-arm-static";; - *80386*|*686*) [[ "${my_arch}" =~ (386|686|x86_64) ]] || qemu_static="qemu-i386-static";; - *x86-64*) [ "${my_arch}" == "x86_64" ] || qemu_static="qemu-x86_64-static";; + *aarch64*) compat_arches+=(aarch); + qemu_static="qemu-aarch64-static";; + *ARM*|*arm*) compat_arches+=(ARM arm); + qemu_static="qemu-arm-static";; + *80386*|*686*) compat_arches+=(386 686 x86_64); + qemu_static="qemu-i386-static";; + *x86-64*) compat_arches+=(x86_64); + qemu_static="qemu-x86_64-static";; esac +if [[ "${compat_arches[@]}" =~ ${my_arch} ]]; then + echo "${my_arch} is compatable as normal chroot with ${target_arch}" + unset qemu_static +fi + if [ -n "${qemu_static}" -a -x "/usr/bin/${qemu_static}" ]; then + # Test the proot version + proot_v=$(proot --version | awk '/3.0.?/{print"3"}') cmd=(proot -0 -w / -q ${qemu_static}) + + # Newer version of proot use different options + if [ "${proot_v:-4}" -eq 4 ]; then + cmd=(proot -0 -w / --qemu=${qemu_static} -S) + fi fi +cmd+=(${root_d}) + if [ "${#@}" -ge 1 ]; then - ${cmd[@]} ${root_d} ${@}; exit $? -else - ${cmd[@]} ${root_d}; exit $? + cmd+=(${@}) fi + +exec ${cmd[@]} === modified file 'ovf/part2disk-gpt.arm64' --- ovf/part2disk-gpt.arm64 2014-03-22 02:51:15 +0000 +++ ovf/part2disk-gpt.arm64 2015-02-25 23:24:44 +0000 @@ -153,17 +153,17 @@ ### GPT magic: # Creates the GPT partition table with two partition entries # 2: is the UEFI partition, where Grub will shove its bits -# 1: is the traditional root Fs -sgdisk ${dimg} \ - --new=15::+88M \ - --new=1: || +# 1: is the traditional root FS +sgdisk ${dimg} \ + --zap-all \ + +sgdisk ${dimg} \ + --new=15:0:204800 \ + --typecode=15:ef00 \ + --new=1: \ + --print || fail "Failed to create GPT partitions" -sgdisk ${dimg} -t 15:ef00 || - fail "Failed to type partitions properly" - -parted ${dimg} --script -- print - # #### @@ -198,7 +198,10 @@ debug 1 "Copied partition to disk" || fail "Failed to copy the partition into disk" +sync +blkid -o udev -p "${rootfs_dm}" clean_loops + trap - EXIT if [ -n "${phelper}" ] ; then === modified file 'ovf/part2disk-grubhelper.arm64' --- ovf/part2disk-grubhelper.arm64 2014-11-07 22:43:06 +0000 +++ ovf/part2disk-grubhelper.arm64 2015-02-25 23:24:44 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # part2disk-grubhelper.arm64 - helper for part2disk*.arm64 for # configuring a disk image for PReP boot with grub2 # @@ -28,7 +28,6 @@ my_dir=$(dirname $(readlink -f "${0}")) parent_dir=$(dirname ${my_dir}) . ${parent_dir}/functions/common -. ${my_dir}/part2disk-grubprobe.sh error() { echo "$@" 1>&2; } debug() { @@ -101,7 +100,7 @@ img=${1} -[ "$(id -u)" = "0" ] || fail "sorry, must be root" +[ "$(id -u)" -eq 0 ] || fail "sorry, must be root" imgf=$(readlink -f "${img}") || fail "failed to get full path to ${img}" @@ -111,7 +110,7 @@ # losetup ${dimg} LO_DEV=$(losetup --find --show "${imgf}") || fail "failed to losetup ${imgf}" -kpartx -a "${LO_DEV}" && KPARTX_DEV="${LO_DEV}" || +kpartx -g -a "${LO_DEV}" && KPARTX_DEV="${LO_DEV}" || fail "failed: kpartx -a ${LO_DEV}" bn_lodev="${LO_DEV##*/}" @@ -135,13 +134,14 @@ [ -e "${chroot_hlp}" ] && _chroot="${chroot_hlp}" debug "Running chroot: ${@}" - ( DEBIAN_FRONTEND=noninteractive LANG=C LC_ALL=C ${_chroot} "${mp}" "${@}" ) && + ( DEBIAN_FRONTEND=noninteractive LANG=C LC_ALL=C ${_chroot} "${mp}" ${@} ) && debug " Command Successfull" || { debug " Command FAILED!"; fail "chrooted-command failed!"; } } # mount root partition partition -mount "${part_dev}" "${mp}" && +blkid -o udev -p "${part_dev}" +mount -t ext4 "${part_dev}" "${mp}" && UMOUNTS="${mp} ${UMOUNTS}" || fail "failed to mount ${part_dev}" # make /tmp, tmp @@ -149,15 +149,15 @@ UMOUNTS="${mp}/tmp ${UMOUNTS}" || fail "failed to mount /tmp" # Get info about the root fs -blkid -o export "${part_dev}" > "${mp}/tmp/root_info" +blkid -p -o export "${part_dev}" > "${mp}/tmp/root_info" source "${mp}/tmp/root_info" || fail "unable to read ${mp}/tmp/root_info" # create and mount UEFI partition mkfs.vfat -F 32 -n UEFI ${uefi_dev} || fail "failed to create UEFI vfat" -mkdir "${mp}/boot/efi" || - fail "failed to create UEFI mount point" +mkdir -p "${mp}/boot/efi" || + fail "failed to create UEFI mount point"; mount "${uefi_dev}" "${mp}/boot/efi" && UMOUNTS="${mp}/boot/efi ${UMOUNTS}" || @@ -171,7 +171,7 @@ mkdir -p "${mp}/run/resolvconf" || fail "Unable to create ${mp}/run/resolvconf" -cp /run/resolvconf/resolv.conf "${mp}/run/resolvconf/resolv.conf" || +cp $(readlink -f /etc/resolv.conf) "${mp}/run/resolvconf/resolv.conf" || fail "failed to put in temporary resolvconf" # mount tmpfs over its /tmp @@ -218,9 +218,10 @@ # Install the bits xchroot apt-get -y clean -xchroot apt-get -y update -xchroot apt-get -y install grub-efi-arm64 +xchroot apt-get -y update -o Acquire::Languages=“none” +xchroot apt-get -y install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin xchroot apt-get -y remove --purge grub-legacy-ec2 +xchroot apt-get -y clean # set the kernel commandline to use ttyAMA0 mkdir -p ${mp}/etc/default/grub.d @@ -306,27 +307,38 @@ GRUB_PRELOAD_MODULES="part_gpt fat gzio ext2 normal chain boot configfile linux search_fs_uuid search_label terminal serial video video_fb efi_gop" EOF +xchroot find /usr/lib/grub +xchroot cp -avu /usr/lib/grub/arm64-efi /boot/grub + # We have to do this by hand, since grub-install fails miserably # in qemu-aarch64-static. xchroot grub-mkimage \ - -c /boot/efi/grub/grub.cfg \ - -o /boot/efi/EFI/BOOTaa64.EFI \ - -O arm64-efi \ - -p /boot/efi/EFI \ + --verbose \ + --config=/boot/efi/grub/grub.cfg \ + --output=/boot/efi/EFI/BOOTaa64.EFI \ + --format=arm64-efi \ + --prefix=/boot/efi/EFI \ part_gpt fat gzio ext2 normal chain boot configfile linux search_fs_uuid search_label terminal serial video video_fb efi_gop +# For some reason the grub disk is looking for /boot/grub/grub.cfg on +# part 15.... +xchroot cat /boot/efi/grub/grub.cfg + # update the grub configuration -xchroot dpkg-divert --local --rename /etc/grub.d/30_os-prober -xchroot grub-mkconfig -o /boot/grub/grub.cfg -xchroot dpkg-divert --local --remove /tmp/30_os-prober +xchroot dpkg-divert --local --rename /etc/grub.d/30_os-prober +xchroot update-grub +sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g"\ + ${mp}/boot/grub/grub.cfg || + fail "failed to update grub root label" -# Remove our fake grub-probe +# Remove our fake stuff xchroot rm /usr/sbin/grub-probe +xchroot dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober xchroot dpkg-divert --local --remove /usr/sbin/grub-probe # Some clean-up... xchroot apt-get -y clean -xchroot apt-get -y update +xchroot apt-get -y update -o Acquire::Languages=“none” xchroot rm /etc/mtab xchroot rm /usr/sbin/policy-rc.d exit === modified file 'ovf/part2disk-grubhelper.uefi' --- ovf/part2disk-grubhelper.uefi 2014-03-28 21:06:04 +0000 +++ ovf/part2disk-grubhelper.uefi 2015-02-25 23:24:44 +0000 @@ -252,8 +252,11 @@ --no-nvram \ --modules="part_gpt fat ext2 normal chain boot configfile linux multiboot search_fs_uuid search_label terminal serial video video_fb video_bochs usb usb_keyboard efi_gop efi_uga" -xchroot sed -i 's| root| root hd0,gpt1|' /boot/efi/EFI/BOOT/grub.cfg -sed -i "1i${CLOUD_IMG_STR}" /boot/efi/EFI/BOOT/grub.cfg +sed -i "s| root| root hd0,gpt1|" ${mp}/boot/efi/EFI/BOOT/grub.cfg || + fail "failed update hd0" + +sed -i "1i${CLOUD_IMG_STR}" ${mp}/boot/efi/EFI/BOOT/grub.cfg || + fail "failed to insert cloud image comment" # For some reason the grub disk is looking for /boot/grub/grub.cfg on # part 15.... @@ -267,8 +270,9 @@ # update the grub configuration xchroot dpkg-divert --local --rename /etc/grub.d/30_os-prober xchroot update-grub -xchroot sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g"\ - /boot/grub/grub.cfg +sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g"\ + ${mp}/boot/grub/grub.cfg || + fail "failed to update grub root label" xchroot dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober xchroot apt-get -y clean xchroot apt-get -y update + echo '' + echo '====== ec2-publishing-scripts [/tmp/ec2-publishing-scripts] ======' ====== ec2-publishing-scripts [/tmp/ec2-publishing-scripts] ====== + cd /tmp/ec2-publishing-scripts + bzr info Standalone tree (format: unnamed) Location: branch root: . Related branches: parent branch: http://bazaar.launchpad.net/~ubuntu-on-ec2/ubuntu-on-ec2/ec2-publishing-scripts/ + bzr version-info revision-id: ben.howard@ubuntu.com-20150128184707-k7dyj8s1zrjlllys date: 2015-01-28 11:47:07 -0700 build-date: 2015-02-27 19:57:38 +0000 revno: 611 branch-nick: ec2-publishing-scripts + bzr log -p -r-1 ------------------------------------------------------------ revno: 611 committer: Ben Howard branch nick: master timestamp: Wed 2015-01-28 11:47:07 -0700 message: Update dynamic EBS publisher selection to support CN and GovCloud. diff: === modified file 'publish-build-ebs' --- publish-build-ebs 2014-12-12 00:23:10 +0000 +++ publish-build-ebs 2015-01-28 18:47:07 +0000 @@ -22,11 +22,14 @@ PUBLISH_BUCKET=${PUBLISH_BUCKET:-"ubuntu-data"} AMI_REGIONS=( $(ec2-list-all-regions) ) -# These are Ubuntu 14.04, serials of 20140927 instance store HVM's -current_amis_url="http://cloud-images.ubuntu.com/query/trusty/server/released.current.txt" +# Get an updated list of AMI's current_out=$(mktemp) -wget -O ${current_out} ${current_amis_url} || - fail "failed to get current image list" +for q in query query.cn query.govcloud +do + amis_url="http://cloud-images.ubuntu.com/$q/trusty/server/released.current.txt" + debug 1 "Fetching ${amis_url}" + curl ${amis_url} >> ${current_out} +done DEF_AMI_IDS=() for region in ${AMI_REGIONS[@]}; @@ -34,7 +37,7 @@ match=$(awk '-F\t' '$7==region && $5==disk && $6==arch && $NF==btype {print$8}' \ 'OFS=\t' "region=${region}" arch="amd64" btype="hvm" disk="instance-store" ${current_out} ) - [ -z "${match}" ] && fail "failed to find AMI for ${region}" + [ -z "${match}" -a -z "${EBS_UTIL_AMIS}" ] && fail "failed to find AMI for ${region}" debug 1 "Using AMI ${match} for ${region}" DEF_AMI_IDS+=(${match}) done + echo '' + echo '====== live-build [/tmp/live-build] ======' ====== live-build [/tmp/live-build] ====== + cd /tmp/live-build + bzr info Standalone tree (format: 1.9-rich-root) Location: branch root: . Related branches: parent branch: http://bazaar.launchpad.net/~ubuntu-on-ec2/live-build/cloud-images/ + bzr version-info revision-id: ben.howard@canonical.com-20141208180246-js9ir7isckza6dli date: 2014-12-08 11:02:46 -0700 build-date: 2015-02-27 19:57:38 +0000 revno: 1881 branch-nick: live-build + bzr log -p -r-1 ------------------------------------------------------------ revno: 1881 committer: Ben Howard branch nick: live-build timestamp: Mon 2014-12-08 11:02:46 -0700 message: Allow for 2TB resizes diff: === modified file 'scripts/build/lb_binary_virtual-hdd-raw' --- scripts/build/lb_binary_virtual-hdd-raw 2014-02-25 20:46:27 +0000 +++ scripts/build/lb_binary_virtual-hdd-raw 2014-12-08 18:02:46 +0000 @@ -81,7 +81,7 @@ ext2|ext3|ext4) Echo_message "Creating virtual disk image..." Chroot chroot "dd if=/dev/zero of=binary-raw.img bs=1024k count=0 seek=${LB_HDD_SIZE}" - Chroot chroot "mkfs.${LB_BINARY_FILESYSTEM} -F /binary-raw.img -L ${LB_HDD_FILESYSTEM_LABEL} -U ${FS_UUID}" + Chroot chroot "mkfs.${LB_BINARY_FILESYSTEM} -F /binary-raw.img -L ${LB_HDD_FILESYSTEM_LABEL} -U ${FS_UUID} -E resize=536870912" ;; esac @@ -97,7 +97,7 @@ ext2|ext3|ext4) Echo_message "Creating virtual filesystem...(created outside chroot)" dd if=/dev/zero of=binary-raw.img bs=1024k count=0 seek=${LB_HDD_SIZE} - ${LB_ROOT_COMMAND} mkfs.${LB_BINARY_FILESYSTEM} -F binary-raw.img -L ${LB_HDD_FILESYSTEM_LABEL} -U ${FS_UUID} + ${LB_ROOT_COMMAND} mkfs.${LB_BINARY_FILESYSTEM} -F binary-raw.img -L ${LB_HDD_FILESYSTEM_LABEL} -U ${FS_UUID} -E resize=536870912 ${LB_ROOT_COMMAND} mount -o loop binary-raw.img binary-raw.tmp rsync -aXHAS \ --one-file-system \ + echo '' + echo '====== vmbuilder-0.11 [/tmp/vmbuilder-0.11] ======' ====== vmbuilder-0.11 [/tmp/vmbuilder-0.11] ====== + cd /tmp/vmbuilder-0.11 + bzr info Standalone tree (format: 2a) Location: branch root: . Related branches: parent branch: http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/0.11a/ + bzr version-info revision-id: ben.howard@canonical.com-20120605221454-crv9cc4612f907lh date: 2012-06-05 16:14:54 -0600 build-date: 2015-02-27 19:57:39 +0000 revno: 398 branch-nick: vmbuilder-0.11 + bzr log -p -r-1 ------------------------------------------------------------ revno: 398 committer: Ben Howard branch nick: vmbuilder timestamp: Tue 2012-06-05 16:14:54 -0600 message: Fix for allow vmbuilder to run on 12.04 LTS. diff: === modified file 'VMBuilder/plugins/ubuntu/dapper.py' --- VMBuilder/plugins/ubuntu/dapper.py 2011-05-18 20:49:25 +0000 +++ VMBuilder/plugins/ubuntu/dapper.py 2012-06-05 22:14:54 +0000 @@ -157,18 +157,15 @@ self.vm.addpkg += ['openssh-server'] def mount_dev_proc(self): - run_cmd('mount', '--bind', '/dev', '%s/dev' % self.destdir) - self.vm.add_clean_cmd('umount', '%s/dev' % self.destdir, ignore_fail=True) - - run_cmd('mount', '--bind', '/dev/pts', '%s/dev/pts' % self.destdir) + run_cmd('mkdir', '-p', '%s/dev/pts' % self.destdir) + run_cmd('mount', '-t', 'devpts', 'devpts-live', '%s/dev/pts' % self.destdir) self.vm.add_clean_cmd('umount', '%s/dev/pts' % self.destdir, ignore_fail=True) - self.run_in_target('mount', '-t', 'proc', 'proc', '/proc') + run_cmd('mount', '-t', 'proc', 'proc-live', '%s/proc' % self.destdir) self.vm.add_clean_cmd('umount', '%s/proc' % self.destdir, ignore_fail=True) def unmount_dev_proc(self): run_cmd('umount', '%s/dev/pts' % self.destdir) - run_cmd('umount', '%s/dev' % self.destdir) run_cmd('sh', '-c', 'grep -q "$1" /proc/mounts || exit 0; umount "$1"', 'umount_binfmt', "%s/proc/sys/fs/binfmt_misc" % self.destdir) run_cmd('umount', '%s/proc' % self.destdir) + echo ''