Compare commits

...

14 Commits

Author SHA1 Message Date
Steve Langasek
8af2c58d98 releasing package livecd-rootfs version 2.435.3 2017-06-06 22:01:46 -07:00
Steve Langasek
7fd6f602fb Merge lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix-for-yakkety 2017-06-06 22:01:27 -07:00
Balint Reczey
61302098e4 Update changelog 2017-05-12 22:06:02 +02:00
Balint Reczey
20d7483fe0 Work around kpartx's nonzero exit due to "Device or resource busy" errors
which still permit kpartx to finally remove loop device (LP: #1684090).
Also sync before calling kpartx to let writing to loop devices finish.
2017-05-11 16:17:13 +02:00
Steve Langasek
af894a7f89 Mark autopkgtests isolation-machine since debootstrap won't work in a
container.
2017-05-11 16:16:28 +02:00
Balint Reczey
d8adccd284 Add basic autopkgtest 2017-05-11 16:14:32 +02:00
Balint Reczey
da2d7fd268 Use all config hooks from the proper place, not from /build/ 2017-05-11 16:14:32 +02:00
Balint Reczey
6fe8773c74 Source ubuntu-cpc functions from the right place 2017-05-11 16:14:24 +02:00
Steve Langasek
cc04805c04 Merge lp:~rcj/livecd-rootfs/yakkety-proposed/ 2017-03-21 08:08:07 -07:00
Robert C Jennings
4d2e4846d3 Fix OVA generation and add grub label helper for ubuntu-cpc
[ Chris Glass ]
  * Fix the manifest generation in OVA files so that ovf files don't have
    double extensions.  (LP: #1627931)
  * Fix the OVF's metadata to include Ubuntu specific identifiers and
    descriptions instead of the generic Linux ones.  (LP: #1656293)
  [ Daniel Watkins ]
  * Add replace_grub_root_with_label function thereby consolidating multiple
    uses of the same calls to sed.
2017-03-17 13:47:25 -05:00
Daniel Watkins
dbab0a7464 Add replace_grub_root_with_label function
When update-grub is run, it will detect the disks in the build system.
Currently, we sed the grub configuration in places where this happens;
replace_grub_root_with_label moves that seddery in to a single callable
location to avoid ending up with multiple versions of it.

(It's worth noting that we also do this in 999-cpc-fixes.chroot, but as our
functions file isn't available within the chroot we don't use it there.)
2017-03-17 13:46:27 -05:00
Christopher Glass
fa985b74ef Fix the OVF's metadata to include Ubuntu specific identifiers and
descriptions instead of the generic Linux ones.  (LP: #1656293)
2017-03-17 13:45:42 -05:00
Christopher Glass
0f3066035d This branch fixes the manifest generation in OVA files (LP:1627931)
The .ova file extension was passed twice, resulting in file not found errors in
both the general case and the vagrant-specific file creation.
2017-03-17 13:44:41 -05:00
Mathieu Trudel-Lapierre
d271e408ca ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290) 2017-03-17 11:18:47 -07:00
15 changed files with 208 additions and 28 deletions

32
debian/changelog vendored
View File

@ -1,3 +1,35 @@
livecd-rootfs (2.435.3) yakkety; urgency=medium
[ Balint Reczey ]
* Source ubuntu-cpc functions from the right place
* Use all config hooks from the proper place, not from /build/
* Add basic but configurable autopkgtest (LP: #1690440)
* sync before calling kpartx to let writing to loop devices finish
* wrap kpartx and trap spurious errors, to work around kpartx
unreliability.
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 06 Jun 2017 22:01:41 -0700
livecd-rootfs (2.435.2) yakkety; urgency=medium
[ Chris Glass ]
* Fix the manifest generation in OVA files so that ovf files don't have
double extensions. (LP: #1627931)
* Fix the OVF's metadata to include Ubuntu specific identifiers and
descriptions instead of the generic Linux ones. (LP: #1656293)
[ Daniel Watkins ]
* Add replace_grub_root_with_label function thereby consolidating multiple
uses of the same calls to sed.
-- Robert C Jennings <robert.jennings@ubuntu.com> Fri, 17 Mar 2017 13:46:47 -0500
livecd-rootfs (2.435.1) yakkety; urgency=medium
[ Robert C Jennings ]
* ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290)
-- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com> Thu, 17 Nov 2016 16:13:28 -0500
livecd-rootfs (2.435) yakkety; urgency=medium livecd-rootfs (2.435) yakkety; urgency=medium
* Update the ubuntu-touch hints to try installing ubuntu-system-settings * Update the ubuntu-touch hints to try installing ubuntu-system-settings

3
debian/tests/control vendored Normal file
View File

@ -0,0 +1,3 @@
Tests: default-bootstraps
Depends: @, lsb-release
Restrictions: needs-root isolation-machine

97
debian/tests/default-bootstraps vendored Executable file
View File

@ -0,0 +1,97 @@
#!/bin/sh
# autopkgtest check: Build default rootfs for all supported project:subproject pairs
# (C) 2017 Canonical Ltd.
# Author: Balint Reczey <balint.reczey@canonical.com>
set -e
if [ -z "$SUITE"]; then
SUITE=$(lsb_release -c -s)
fi
# Known project:subproject:template combinations.
# Listed subprojects can be combined with other projects as well,
# but this list gives reasonable coverage.
ALL_TRIPLETS="
base::
edubuntu::
edubuntu-dvd::
kubuntu::
kubuntu-active::
kubuntu-dvd::
kubuntu-plasma5::
lubuntu::
lubuntu-next::
mythbuntu::
ubuntu::
ubuntu-base::
ubuntu-budgie::
ubuntu-budgie-desktop::
ubuntu-budgie-live::
ubuntu-core:system-image:ubuntu-core
ubuntu-cpc::ubuntu-cpc
ubuntu-desktop-next:system-image:ubuntu-desktop-next
ubuntu-desktop-next::ubuntu-desktop-next
ubuntu-dvd::
ubuntu-gnome::
ubuntukylin::
ubuntu-mate::
ubuntu-mate-core::
ubuntu-mate-desktop::
ubuntu-mate-live::
ubuntu-netbook::
ubuntu-server::
ubuntu-server:ubuntu-rtm:
ubuntu-server:ubuntu-rtm/foo:
ubuntu-server:wubi:
ubuntu-touch-custom::ubuntu-touch-custom
ubuntu-touch::ubuntu-touch
xubuntu::"
if [ -z "$SELECTED_TRIPLETS" ]; then
SELECTED_TRIPLETS="
ubuntu-base::
ubuntu-cpc::ubuntu-cpc
"
fi
live_build_rootfs() {
PROJECT=${1%%:*}
local SUBPROJECT_TMP=${1%:*}
SUBPROJECT=${SUBPROJECT_TMP#*:}
TEMPLATE=${1##*:}
ARCH=$(dpkg --print-architecture)
echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
cp -a /usr/share/livecd-rootfs/live-build/auto .
if [ -n "$TEMPLATE" ]; then
cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE .
fi
(env PROJECT=$PROJECT \
SUBPROJECT=$SUBPROJECT \
SUITE=$SUITE \
ARCH=$ARCH \
lb config
)
mkdir chroot
# this part needs root rights, but right now the whole script ran as root by autopkgtest
(env PROJECT=$PROJECT \
SUBPROJECT=$SUBPROJECT \
ARCH=$ARCH \
lb build
)
echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
du -sh *
echo ""
}
WORKDIR=$(mktemp -d)
trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
for i in $SELECTED_TRIPLETS; do
mkdir $i
(cd $i && live_build_rootfs $i)
# clean up after build to avoid filling the disk, needs root rights
rm -rf $i
done

View File

@ -11,9 +11,22 @@ backing_img=
apt-get -qqy install dosfstools gdisk apt-get -qqy install dosfstools gdisk
clean_loops() { clean_loops() {
local kpartx_ret
local kpartx_stdout
if [ -n "${backing_img}" ]; then if [ -n "${backing_img}" ]; then
kpartx -v -d "${backing_img}" # sync before removing loop to avoid "Device or resource busy" errors
sync
kpartx_ret=""
kpartx_stdout=$(kpartx -v -d "${backing_img}") || kpartx_ret=$?
echo "$kpartx_stdout"
if [ -n "$kpartx_ret" ]; then
if echo "$kpartx_stdout" | grep -q "loop deleted: "; then
echo "Suppressing kpartx returning error (#860894)"
else
exit $kpartx_ret
fi
fi
unset backing_img unset backing_img
fi fi
@ -249,4 +262,11 @@ convert_to_qcow2() {
qemu-img info "$destination" qemu-img info "$destination"
} }
replace_grub_root_with_label() {
# When update-grub is run, it will detect the disks in the build system.
# Instead, we want grub to use the cloudimg-rootfs labelled disk
CHROOT_ROOT="$1"
sed -i -e "s,root=[^ ]\+,root=LABEL=cloudimg-rootfs," \
"$CHROOT_ROOT/boot/grub/grub.cfg"
}

View File

@ -1,6 +1,6 @@
#!/bin/bash -ex #!/bin/bash -ex
. /build/config/functions . config/functions
BOOTPART_START= BOOTPART_START=
BOOTPART_END= BOOTPART_END=
@ -92,7 +92,7 @@ case $ARCH:$SUBARCH in
# not the best place for this, but neither flash-kernel nor # not the best place for this, but neither flash-kernel nor
# u-boot have provisions for installing u-boot via maintainer # u-boot have provisions for installing u-boot via maintainer
# script # script
/build/config/hooks/raspi2/mkknlimg --dtok \ config/hooks/raspi2/mkknlimg --dtok \
mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \ mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \
mountpoint/boot/firmware/uboot.bin mountpoint/boot/firmware/uboot.bin
;; ;;

View File

@ -8,7 +8,7 @@ if [ -n "$SUBARCH" ]; then
exit 0 exit 0
fi fi
. /build/config/functions . config/functions
mkdir binary/boot/squashfs.dir mkdir binary/boot/squashfs.dir
cp -a chroot/* binary/boot/squashfs.dir cp -a chroot/* binary/boot/squashfs.dir

View File

@ -9,7 +9,7 @@ case $ARCH in
;; ;;
esac esac
. /build/config/functions . config/functions
apt-get -qqy install dosfstools gdisk apt-get -qqy install dosfstools gdisk
@ -70,9 +70,6 @@ install_grub() {
amd64) amd64)
chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed
grub_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" grub_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"
chroot mountpoint cp /usr/lib/shim/shim.efi.signed "${efi_boot_dir}/shimx64.efi"
chroot mountpoint cp /usr/lib/shim/MokManager.efi.signed "${efi_boot_dir}/MokManager.efi"
chroot mountpoint cp /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed "${efi_boot_dir}/grubx64.efi"
efi_target=x86_64-efi efi_target=x86_64-efi
;; ;;
esac esac
@ -108,7 +105,7 @@ EOF
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
chroot mountpoint update-grub chroot mountpoint update-grub
sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g" mountpoint/boot/grub/grub.cfg replace_grub_root_with_label mountpoint
chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober
chroot mountpoint apt-get -y clean chroot mountpoint apt-get -y clean

View File

@ -7,7 +7,7 @@ case $ARCH in
;; ;;
esac esac
. /build/config/functions . config/functions
create_partitions() { create_partitions() {
disk_image="$1" disk_image="$1"
@ -52,7 +52,7 @@ EOF
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
chroot mountpoint update-grub chroot mountpoint update-grub
sed -i "s,root=.* ,root=LABEL=cloudimg-rootfs ,g" mountpoint/boot/grub/grub.cfg replace_grub_root_with_label mountpoint
chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober
umount_partition mountpoint umount_partition mountpoint

View File

@ -12,7 +12,7 @@ esac
apt-get install -qqy qemu-utils apt-get install -qqy qemu-utils
. /build/config/functions . config/functions
if [ -f binary/boot/disk-uefi.ext4 ]; then if [ -f binary/boot/disk-uefi.ext4 ]; then
convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img

View File

@ -9,7 +9,7 @@ case $ARCH in
exit 0;; exit 0;;
esac esac
. /build/config/functions . config/functions
if [ -e binary/boot/disk-uefi.ext4 ]; then if [ -e binary/boot/disk-uefi.ext4 ]; then
create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk

View File

@ -9,11 +9,24 @@
# #
# For this step, we re-use the VMDK's made in 040-vmdk-image.binary # For this step, we re-use the VMDK's made in 040-vmdk-image.binary
# Switch on $ARCH to determine which ID and description to use in the produced
# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
# well use them.
case $ARCH in case $ARCH in
amd64|i386) ;; amd64)
*) echo "OVA images are not supported for $ARCH yet."; ovf_id=94
ovf_os_type="ubuntu64Guest"
ovf_desc_bits=64 ;;
i386)
ovf_id=93
ovf_os_type="ubuntu32Guest"
ovf_desc_bits=32 ;;
*)
echo "OVA images are not supported for $ARCH yet.";
exit 0;; exit 0;;
esac esac
cur_d=${PWD} cur_d=${PWD}
my_d=$(dirname $(readlink -f ${0})) my_d=$(dirname $(readlink -f ${0}))
@ -57,7 +70,10 @@ sed -i "${ovf}" \
-e "s/@@NUM_CPUS@@/2/g" \ -e "s/@@NUM_CPUS@@/2/g" \
-e "s/@@VERSION@@/${version}/g" \ -e "s/@@VERSION@@/${version}/g" \
-e "s/@@DATE@@/${serial_stamp}/g" \ -e "s/@@DATE@@/${serial_stamp}/g" \
-e "s/@@MEM_SIZE@@/1024/g" -e "s/@@MEM_SIZE@@/1024/g" \
-e "s/@@OVF_ID@@/${ovf_id}/g" \
-e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \
-e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g"
# Get the checksums # Get the checksums
vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1) vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1)
@ -67,7 +83,7 @@ ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
manifest="${scratch_d}/${prefix}.mf" manifest="${scratch_d}/${prefix}.mf"
cat > "${manifest}" <<EOF cat > "${manifest}" <<EOF
SHA256(${vmdk_f##*/})= ${vmdk_sha256} SHA256(${vmdk_f##*/})= ${vmdk_sha256}
SHA256(${ovf##*/}.ovf)= ${ovf_sha256} SHA256(${ovf##*/})= ${ovf_sha256}
EOF EOF
# Now create the OVA # Now create the OVA

View File

@ -18,14 +18,24 @@
cur_d=${PWD} cur_d=${PWD}
my_d=$(dirname $(readlink -f ${0})) my_d=$(dirname $(readlink -f ${0}))
# Switch on $ARCH to determine which ID and description to use in the produced
# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
# well use them.
case $ARCH in case $ARCH in
amd64|i386) ;; amd64)
ovf_id=94
ovf_os_type="ubuntu64Guest"
ovf_desc_bits=64 ;;
i386)
ovf_id=93
ovf_os_type="ubuntu32Guest"
ovf_desc_bits=32 ;;
*) *)
echo "Vagrant images are not supported for $ARCH" echo "Vagrant images are not supported for $ARCH yet."
exit 0 exit 0;;
esac esac
. /build/config/functions . config/functions
# Virtualbox is needed for making a small VMDK # Virtualbox is needed for making a small VMDK
apt-get -qqy install genisoimage qemu-utils apt-get -qqy install genisoimage qemu-utils
@ -172,7 +182,10 @@ sed -i "${ovf}" \
-e "s/@@NUM_CPUS@@/2/g" \ -e "s/@@NUM_CPUS@@/2/g" \
-e "s/@@VERSION@@/${version}/g" \ -e "s/@@VERSION@@/${version}/g" \
-e "s/@@DATE@@/${serial_stamp}/g" \ -e "s/@@DATE@@/${serial_stamp}/g" \
-e "s/@@MEM_SIZE@@/1024/g" -e "s/@@MEM_SIZE@@/1024/g" \
-e "s/@@OVF_ID@@/${ovf_id}/g" \
-e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \
-e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g"
ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1) ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
@ -181,7 +194,7 @@ manifest="${box_d}/${prefix}.mf"
cat > "${manifest}" <<EOF cat > "${manifest}" <<EOF
SHA256(${vmdk_f##*/})= ${vmdk_sha256} SHA256(${vmdk_f##*/})= ${vmdk_sha256}
SHA256(${cdrom_vmdk_f##*/})= ${cdrom_sha256} SHA256(${cdrom_vmdk_f##*/})= ${cdrom_sha256}
SHA256(${ovf##*/}.ovf)= ${ovf_sha256} SHA256(${ovf##*/})= ${ovf_sha256}
EOF EOF
# Now create the box # Now create the box

View File

@ -9,7 +9,7 @@ if [ ! -d ${my_dir}/extra ]; then
fi fi
# Export the common functions to the extras # Export the common functions to the extras
. /build/config/functions . config/functions
# Cleaner execution # Cleaner execution
/bin/run-parts --regex ".*\.binary" "${extra_d}" /bin/run-parts --regex ".*\.binary" "${extra_d}"

View File

@ -18,8 +18,9 @@
<VirtualSystem ovf:id="@@NAME@@"> <VirtualSystem ovf:id="@@NAME@@">
<Info>A virtual machine</Info> <Info>A virtual machine</Info>
<Name>@@NAME@@</Name> <Name>@@NAME@@</Name>
<OperatingSystemSection ovf:id="100" vmw:osType="other3xLinux64Guest"> <OperatingSystemSection ovf:id="@@OVF_ID@@" vmw:osType="@@OVF_OS_TYPE@@">
<Info>The kind of installed guest operating system</Info> <Info>The kind of installed guest operating system</Info>
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
</OperatingSystemSection> </OperatingSystemSection>
<ProductSection ovf:required="false"> <ProductSection ovf:required="false">

View File

@ -16,8 +16,9 @@
<VirtualSystem ovf:id="@@NAME@@"> <VirtualSystem ovf:id="@@NAME@@">
<Info>A virtual machine</Info> <Info>A virtual machine</Info>
<Name>@@NAME@@</Name> <Name>@@NAME@@</Name>
<OperatingSystemSection ovf:id="100" vmw:osType="other3xLinux64Guest"> <OperatingSystemSection ovf:id="@@OVF_ID@@" vmw:osType="@@OVF_OS_TYPE@@">
<Info>The kind of installed guest operating system</Info> <Info>The kind of installed guest operating system</Info>
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
</OperatingSystemSection> </OperatingSystemSection>
<ProductSection ovf:required="false"> <ProductSection ovf:required="false">