====== cloudimg-build-launcher [/home/vmbuilder/ec2-daily/automated-ec2-builds/cloudimg-build-launcher] ====== Standalone tree (format: 2a) Location: branch root: . Related branches: parent branch: http://bazaar.launchpad.net/~ubuntu-on-ec2/vmbuilder/automated-ec2-builds/ revision-id: smoser@ubuntu.com-20111129201342-kphkomlx2m7eto4c date: 2011-11-29 15:13:42 -0500 build-date: 2011-11-30 04:40:44 +0000 revno: 432 branch-nick: automated-ec2-builds === modified file 'crontab' --- crontab 2011-10-14 20:53:54 +0000 +++ crontab 2011-10-14 20:54:06 +0000 @@ -1,4 +1,4 @@ -MAILTO = xxxxxx@ubuntu.com +MAILTO = ben.howard@canonical.com;smoser@canonical.com PATH = /home/vmbuilder/ec2-daily/automated-ec2-builds:/usr/sbin:/usr/bin:/sbin:/bin CLEAN_SCHEDULE = /home/vmbuilder/ec2-daily/automated-ec2-builds/daily-build-cleaner-schedule.txt === modified file 'ovf/armel2qemu' --- ovf/armel2qemu 2011-09-17 16:06:42 +0000 +++ ovf/armel2qemu 2011-11-29 06:04:38 +0000 @@ -8,7 +8,7 @@ cat < /dev/null; } + [ -z "${rootfs_dm}" ] || { umount "${rootfs_dm}" 2> /dev/null; } [ -z "${bootfs_dm}" ] || { umount "${bootfs_dm}" 2> /dev/null; } [ -z "${copy_rootfs_dm}" ] || { umount "${copy_rootfs_dm}" 2> /dev/null; } - # Clean up the device mappings. - # Due to bugginess in kpartx on lucid, dmsetup is being used first to remove devices - # and then fallback to kpartx just in case. - [ -z "${copy_rootfs_loop}" ] || { + # Clean up the device mappings. + # Due to bugginess in kpartx on lucid, dmsetup is being used first to remove devices + # and then fallback to kpartx just in case. + [ -z "${copy_rootfs_loop}" ] || { local loop_dev=$(echo $copy_rootfs_loop | awk -F\/ '{print$NF}') find /dev/mapper -iname "${loop_dev}*" | xargs -n1 -I DEVICE dmsetup remove DEVICE || kpartx -d "${copy_rootfs_loop}" || - echo "Failed to remove device mapper devices for ${copy_rootfs_loop}" - losetup -d "${copy_rootfs_loop}"; + echo "Failed to remove device mapper devices for ${copy_rootfs_loop}" + losetup -d "${copy_rootfs_loop}"; } - [ -z "${loop}" ] || { + [ -z "${loop}" ] || { local loop_dev=$(echo ${loop} | awk -F\/ '{print$NF}') find /dev/mapper -iname "${loop_dev}*" | xargs -n1 -I DEVICE dmsetup remove DEVICE || kpartx -d "${loop}" || - echo "Failed to remove device mapper devices for ${loop}" - losetup -d "${loop}" || - echo "Failed to remove loop device ${loop}" + echo "Failed to remove device mapper devices for ${loop}" + losetup -d "${loop}" || + echo "Failed to remove loop device ${loop}" } # Clean up temporary directories @@ -59,12 +59,12 @@ [ -z "${mp_uboot}" ] || rm -rf "${mp_uboot}" } -fail() { - [ $# -eq 0 ] || { +fail() { + [ $# -eq 0 ] || { error "$(date -R): $@"; do_done - exit 1; - } + exit 1; + } } check_prog() { @@ -92,7 +92,7 @@ while [ $# -ne 0 ]; do case "${1}" in - --disk) img="${2}.raw"; shift;; + --disk) img="${2}.raw"; shift;; --rootfs) stuff_img="${2}"; shift;; --mlo) mlo_firmware="${2}"; shift;; --uboot) uboot_firmware="${2}"; shift;; @@ -179,7 +179,7 @@ fail "Failed to create uInitrd" debug "Making boot.cmd image" - mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ubuntu" -d "${TEMPDIR}/boot.cmd" "${bootscr}" || + mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ubuntu" -d "${TEMPDIR}/boot.cmd" "${bootscr}" || fail "Failed to create boot.scr" [ -e "${uimage}" ] || fail "Failed to find ${uimage}" @@ -192,7 +192,7 @@ # build the disk mk_disk() { debug "Creating disk image...may take a while" - [ -e "${img}" ] || { + [ -e "${img}" ] || { dd if=/dev/zero of=${img} bs=1M count=2120 debug "Created ${img}" } || fail "Destination disk image already exists, bailing" @@ -204,10 +204,10 @@ loop_raw="$(kpartx -v -a ${img} )" || fail "Failed to add image via kpartx" debug "Setup raw destination disk" - echo -e "${loop_raw}" - - - sfdisk -l ${img} + echo -e "${loop_raw}" + + + sfdisk -l ${img} #Extract information about loop loop="$(echo -e ${loop_raw} | head -n1 | awk '{print$8}')" || @@ -228,38 +228,38 @@ create_boot_fs() { # boot fs must be 32-bit vFAT - mkfs.msdos -F32 -v "${bootfs_dm}" 2> /dev/null || + mkfs.msdos -F32 -v "${bootfs_dm}" 2> /dev/null || fail "Failed to create boot file system" - [ -e "${mp_uboot}" -o -z "${bootfs_dm}" ] && mount "${bootfs_dm}" "${mp_uboot}" || - fail "Unable to mount uboot partition" - + [ -e "${mp_uboot}" -o -z "${bootfs_dm}" ] && mount "${bootfs_dm}" "${mp_uboot}" || + fail "Unable to mount uboot partition" + copy_or_fail "${mlo_firmware}" "${mp_uboot}/MLO" - copy_or_fail "${uboot_firmware}" "${mp_uboot}/u-boot.bin" + copy_or_fail "${uboot_firmware}" "${mp_uboot}/u-boot.bin" copy_or_fail "${uimage}" "${mp_uboot}/uImage" - copy_or_fail "${uinitrd}" "${mp_uboot}/uInitrd" + copy_or_fail "${uinitrd}" "${mp_uboot}/uInitrd" copy_or_fail "${bootscr}" "${mp_uboot}/boot.scr" sync debug "Contents of u-boot device" ls -lh1 "${mp_uboot}" -} +} stuff_image() { - [ -e "${working_stuff_img}" ] || + [ -e "${working_stuff_img}" ] || fail "Unable to find the working copy of root file system image" # Set up image for extacting kernel and initrd - mp_rootfs=$(mktemp -d) || + mp_rootfs=$(mktemp -d) || fail "Unable to create temp mont point for rootfs" - copy_root_raw=$(kpartx -a -v "${working_stuff_img}" ) || + copy_root_raw=$(kpartx -a -v "${working_stuff_img}" ) || fail "Unable to map rootfs" debug "Setup Source FS:" - echo -e "${copy_root_raw}" + echo -e "${copy_root_raw}" # Determine devices of rootfs image and mount - copy_rootfs_loop=$(echo ${copy_root_raw} | head -n 1 | awk '{print$8}' ) || + copy_rootfs_loop=$(echo ${copy_root_raw} | head -n 1 | awk '{print$8}' ) || fail "Unable to determine copy_rootfs_loop" # Assume that the last partition has the root file system copy_rootfs_dm=$(echo ${copy_root_raw} | tail -n1 | awk '{print"/dev/mapper/"$3}' ) || @@ -271,20 +271,22 @@ rootfs_label=$(blkid ${copy_rootfs_dm} | awk -F\" '/LABEL/ {print$2}') || fail "Unable to determine copy rootfs id" - [ -n "${rootfs_label}" ] || + blkid ${copy_rootfs_dm} + + [ -n "${rootfs_label}" ] || fail "root file system lacks a label, this is fatal" mount "${copy_rootfs_dm}" "${mp_rootfs}" || - fail "Failed to mount copy_rootfs" + fail "Failed to mount copy_rootfs" # Extract the kernel and intrd after mounting [ -d "${mp_rootfs}/boot" ] || fail "Unable to find boot directory within image" - cp -a "${mp_rootfs}/boot/" "${TEMPDIR}" || + cp -a "${mp_rootfs}/boot/" "${TEMPDIR}" || fail "Unable to copy boot directory to ${TEMPDIR}" - - # Get the most recent kernel and initrd name + + # Get the most recent kernel and initrd name kernel=$(find ${TEMPDIR}/ -iname "vmlinuz*" | sort -rn | head -n1 ) - initrd=$(find ${TEMPDIR}/ -iname "initrd*" | sort -rn | head -n1 ) + initrd=$(find ${TEMPDIR}/ -iname "initrd*" | sort -rn | head -n1 ) [ -e "${kernel}" ] || fail "Did not find any kernel images" [ -e "${initrd}" ] || fail "Did not find any initrd images" @@ -297,19 +299,19 @@ dd if="${copy_rootfs_dm}" of="${rootfs_dm}" && debug "Finished copying rootfile system" || error "Potential problem copying rootfs image into parition" -} +} finalize_img() { if [ "${img_type}" = "qcow2" ]; then - debug "Converting ${img} to QCOW2 format" + debug "Converting ${img} to QCOW2 format" qemu-img convert -c -O qcow2 ${img} ${final_img} && rm "${img}" || fail "Failed to convert image to qcow format" - else + else mv "${img}" "${final_img}" || fail "Unable to write ${final} from ${img}" fi - [ -e "${final_img}" ] && debug "Final image emitted to ${final_img}" || + [ -e "${final_img}" ] && debug "Final image emitted to ${final_img}" || fail "Final image ${final} is missing; FATAL" } ====== vmbuilder [/home/vmbuilder/ec2-daily/vmbuilder/vmbuilder] ====== Standalone tree (format: 2a) Location: branch root: . Related branches: parent branch: http://bazaar.launchpad.net/~ubuntu-virt/vmbuilder/0.11/ revision-id: smoser@ubuntu.com-20110727194119-whc8vhnu4to3d2qr date: 2011-07-27 15:41:19 -0400 build-date: 2011-11-30 04:40:48 +0000 revno: 397 branch-nick: vmbuilder ====== live-build [/home/vmbuilder/ec2-daily/live-build/live-build] ====== 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/ revision-id: ben.howard@canonical.com-20111128034224-buyhagym1wgbywrr date: 2011-11-27 20:42:24 -0700 build-date: 2011-11-30 04:40:52 +0000 revno: 1834 branch-nick: live-build