mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-03-12 20:01:20 +00:00
ubuntu-cpc: apt sources.list fixes, OVA manifest fixes
[ Daniel Watkins ] * Don't overwrite the default sources.list in cloud images. * Replace sources.list generated using COMPONENTS with the sources.list from an Ubuntu Server installation (i.e. with all components enabled, and all deb-src lines commented). LP: #1513529. [ 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 ] * ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290)
This commit is contained in:
parent
f83f97bc8b
commit
f0b2591de5
23
debian/changelog
vendored
23
debian/changelog
vendored
@ -1,3 +1,26 @@
|
||||
livecd-rootfs (2.209.19) trusty; urgency=medium
|
||||
|
||||
[ Daniel Watkins ]
|
||||
* Don't overwrite the default sources.list in cloud images.
|
||||
* Replace sources.list generated using COMPONENTS with the sources.list from
|
||||
an Ubuntu Server installation (i.e. with all components enabled, and all
|
||||
deb-src lines commented). LP: #1513529.
|
||||
|
||||
[ 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 ]
|
||||
* ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290)
|
||||
|
||||
-- Robert C Jennings <robert.jennings@canonical.com> Tue, 24 May 2017 15:09:47 -0500
|
||||
|
||||
livecd-rootfs (2.209.18) trusty; urgency=medium
|
||||
|
||||
[Steve Langasek]
|
||||
|
@ -55,116 +55,56 @@ EOF
|
||||
# preinstalled being slightly different in what it doesn't ask) from
|
||||
# debian-installer's apt-setup:
|
||||
|
||||
codename=$LB_DISTRIBUTION
|
||||
file="chroot/etc/apt/sources.list"
|
||||
dists="main"
|
||||
alldists="main"
|
||||
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q restricted; then
|
||||
dists="$dists restricted"
|
||||
alldists="$alldists restricted"
|
||||
fi
|
||||
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q universe; then
|
||||
UNIVERSE=true
|
||||
else
|
||||
UNIVERSE=false
|
||||
fi
|
||||
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q multiverse; then
|
||||
MULTIVERSE=true
|
||||
else
|
||||
MULTIVERSE=false
|
||||
fi
|
||||
|
||||
cat > $file <<EOF
|
||||
cat > chroot/etc/apt/sources.list << EOF
|
||||
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
|
||||
# newer versions of the distribution.
|
||||
|
||||
deb $LB_PARENT_MIRROR_BINARY $codename $dists
|
||||
deb-src $LB_PARENT_MIRROR_BINARY $codename $dists
|
||||
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
|
||||
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
|
||||
|
||||
## Major bug fix updates produced after the final release of the
|
||||
## distribution.
|
||||
deb $LB_PARENT_MIRROR_BINARY $codename-updates $dists
|
||||
deb-src $LB_PARENT_MIRROR_BINARY $codename-updates $dists
|
||||
EOF
|
||||
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted
|
||||
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted
|
||||
|
||||
# Even if universe isn't enabled, we write example lines for it.
|
||||
echo >> $file
|
||||
if [ "$UNIVERSE" = true ]; then
|
||||
alldists="$alldists universe"
|
||||
COMMENT=
|
||||
else
|
||||
cat >> $file <<EOF
|
||||
## Uncomment the following two lines to add software from the 'universe'
|
||||
## repository.
|
||||
EOF
|
||||
COMMENT='# '
|
||||
fi
|
||||
cat >> $file <<EOF
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team. Also, please note that software in universe WILL NOT receive any
|
||||
## review or updates from the Ubuntu security team.
|
||||
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename universe
|
||||
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename universe
|
||||
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-updates universe
|
||||
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-updates universe
|
||||
EOF
|
||||
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe
|
||||
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe
|
||||
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe
|
||||
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe
|
||||
|
||||
# Multiverse is different, don't write anything unless enabled.
|
||||
if [ "$MULTIVERSE" = true ]; then
|
||||
alldists="$alldists multiverse"
|
||||
cat >> $file <<EOF
|
||||
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team, and may not be under a free licence. Please satisfy yourself as to
|
||||
## your rights to use the software. Also, please note that software in
|
||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
||||
## team, and may not be under a free licence. Please satisfy yourself as to
|
||||
## your rights to use the software. Also, please note that software in
|
||||
## multiverse WILL NOT receive any review or updates from the Ubuntu
|
||||
## security team.
|
||||
deb $LB_PARENT_MIRROR_BINARY $codename multiverse
|
||||
deb-src $LB_PARENT_MIRROR_BINARY $codename multiverse
|
||||
deb $LB_PARENT_MIRROR_BINARY $codename-updates multiverse
|
||||
deb-src $LB_PARENT_MIRROR_BINARY $codename-updates multiverse
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat >> $file <<EOF
|
||||
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse
|
||||
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse
|
||||
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse
|
||||
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse
|
||||
|
||||
## N.B. software from this repository may not have been tested as
|
||||
## extensively as that contained in the main release, although it includes
|
||||
## newer versions of some applications which may provide useful features.
|
||||
## Also, please note that software in backports WILL NOT receive any review
|
||||
## or updates from the Ubuntu security team.
|
||||
# deb $LB_PARENT_MIRROR_BINARY $codename-backports $alldists
|
||||
# deb-src $LB_PARENT_MIRROR_BINARY $codename-backports $alldists
|
||||
EOF
|
||||
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse
|
||||
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse
|
||||
|
||||
cat >> $file <<EOF
|
||||
## Uncomment the following two lines to add software from Canonical's
|
||||
## 'partner' repository.
|
||||
## This software is not part of Ubuntu, but is offered by Canonical and the
|
||||
## respective vendors as a service to Ubuntu users.
|
||||
# deb http://archive.canonical.com/ubuntu $LB_DISTRIBUTION partner
|
||||
# deb-src http://archive.canonical.com/ubuntu $LB_DISTRIBUTION partner
|
||||
|
||||
deb $LB_PARENT_MIRROR_BINARY $codename-security $dists
|
||||
deb-src $LB_PARENT_MIRROR_BINARY $codename-security $dists
|
||||
EOF
|
||||
|
||||
# Security sources for Ubuntu universe; not used much, but e.g. unsupported
|
||||
# binary packages from a supported source package will end up here.
|
||||
if [ "$UNIVERSE" = true ]; then
|
||||
COMMENT=
|
||||
else
|
||||
COMMENT='# '
|
||||
fi
|
||||
cat >> $file <<EOF
|
||||
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-security universe
|
||||
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-security universe
|
||||
EOF
|
||||
|
||||
# Security sources for Ubuntu multiverse, with the same caveats as for
|
||||
# universe.
|
||||
if [ "$MULTIVERSE" = true ]; then
|
||||
COMMENT=
|
||||
else
|
||||
COMMENT='# '
|
||||
fi
|
||||
cat >> $file <<EOF
|
||||
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-security multiverse
|
||||
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-security multiverse
|
||||
deb http://security.ubuntu.com/ubuntu $LB_DISTRIBUTION-security main restricted
|
||||
# deb-src http://security.ubuntu.com/ubuntu $LB_DISTRIBUTION-security main restricted
|
||||
deb http://security.ubuntu.com/ubuntu $LB_DISTRIBUTION-security universe
|
||||
# deb-src http://security.ubuntu.com/ubuntu $LB_DISTRIBUTION-security universe
|
||||
deb http://security.ubuntu.com/ubuntu $LB_DISTRIBUTION-security multiverse
|
||||
# deb-src http://security.ubuntu.com/ubuntu $LB_DISTRIBUTION-security multiverse
|
||||
EOF
|
||||
|
||||
fi
|
||||
@ -246,16 +186,6 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
|
||||
build_name: server
|
||||
serial: $BUILDSTAMP
|
||||
EOF
|
||||
cat > chroot/etc/apt/sources.list << EOF
|
||||
deb ${LB_PARENT_MIRROR_BINARY} ${LB_DISTRIBUTION} main restricted universe multiverse
|
||||
deb ${LB_PARENT_MIRROR_BINARY} ${LB_DISTRIBUTION}-updates main restricted universe multiverse
|
||||
deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}-security main restricted universe multiverse
|
||||
EOF
|
||||
lb chroot_hosts install
|
||||
lb chroot_resolv install
|
||||
Chroot chroot "apt-get update"
|
||||
lb chroot_resolv remove
|
||||
lb chroot_hosts remove
|
||||
fi
|
||||
|
||||
echo "===== Checking size of /usr/share/doc ====="
|
||||
|
@ -249,4 +249,11 @@ convert_to_qcow2() {
|
||||
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"
|
||||
}
|
||||
|
@ -70,9 +70,6 @@ install_grub() {
|
||||
amd64)
|
||||
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"
|
||||
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
|
||||
;;
|
||||
esac
|
||||
@ -108,7 +105,7 @@ EOF
|
||||
|
||||
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
|
||||
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 apt-get -y clean
|
||||
|
@ -51,7 +51,7 @@ EOF
|
||||
|
||||
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
|
||||
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
|
||||
|
||||
umount_partition mountpoint
|
||||
|
@ -9,11 +9,24 @@
|
||||
#
|
||||
# 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
|
||||
amd64|i386) ;;
|
||||
*) echo "OVA images are not supported for $ARCH yet.";
|
||||
exit 0;;
|
||||
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 "OVA images are not supported for $ARCH yet.";
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
cur_d=${PWD}
|
||||
my_d=$(dirname $(readlink -f ${0}))
|
||||
|
||||
@ -57,7 +70,10 @@ sed -i "${ovf}" \
|
||||
-e "s/@@NUM_CPUS@@/2/g" \
|
||||
-e "s/@@VERSION@@/${version}/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
|
||||
vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1)
|
||||
@ -67,7 +83,7 @@ ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
|
||||
manifest="${scratch_d}/${prefix}.mf"
|
||||
cat > "${manifest}" <<EOF
|
||||
SHA256(${vmdk_f##*/})= ${vmdk_sha256}
|
||||
SHA256(${ovf##*/}.ovf)= ${ovf_sha256}
|
||||
SHA256(${ovf##*/})= ${ovf_sha256}
|
||||
EOF
|
||||
|
||||
# Now create the OVA
|
||||
|
@ -18,11 +18,21 @@
|
||||
cur_d=${PWD}
|
||||
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
|
||||
amd64|i386) ;;
|
||||
*)
|
||||
echo "Vagrant images are not supported for $ARCH"
|
||||
exit 0
|
||||
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 yet."
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
. /build/config/functions
|
||||
@ -172,7 +182,10 @@ sed -i "${ovf}" \
|
||||
-e "s/@@NUM_CPUS@@/2/g" \
|
||||
-e "s/@@VERSION@@/${version}/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)
|
||||
|
||||
@ -181,7 +194,7 @@ manifest="${box_d}/${prefix}.mf"
|
||||
cat > "${manifest}" <<EOF
|
||||
SHA256(${vmdk_f##*/})= ${vmdk_sha256}
|
||||
SHA256(${cdrom_vmdk_f##*/})= ${cdrom_sha256}
|
||||
SHA256(${ovf##*/}.ovf)= ${ovf_sha256}
|
||||
SHA256(${ovf##*/})= ${ovf_sha256}
|
||||
EOF
|
||||
|
||||
# Now create the box
|
||||
|
@ -18,8 +18,9 @@
|
||||
<VirtualSystem ovf:id="@@NAME@@">
|
||||
<Info>A virtual machine</Info>
|
||||
<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>
|
||||
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
|
||||
</OperatingSystemSection>
|
||||
|
||||
<ProductSection ovf:required="false">
|
||||
|
@ -16,8 +16,9 @@
|
||||
<VirtualSystem ovf:id="@@NAME@@">
|
||||
<Info>A virtual machine</Info>
|
||||
<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>
|
||||
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
|
||||
</OperatingSystemSection>
|
||||
|
||||
<ProductSection ovf:required="false">
|
||||
|
Loading…
x
Reference in New Issue
Block a user