Compare commits

...

17 Commits

Author SHA1 Message Date
Robert C Jennings
4244c30d25
releasing package livecd-rootfs version 2.694.4 2021-04-10 05:10:56 -05:00
Gauthier Jolly
806356e483
ubuntu-cpc: secure esp mountpoint (LP: #1881006)
Change mount option for ubuntu-cpc images from "defaults" to
"umask=0077". ESP partitions might contain sensitive data and
non-root users shouldn't have read access on it.
2021-03-18 10:02:17 +00:00
Dimitri John Ledkov
5f97f4913d
releasing package livecd-rootfs version 2.694.3 2021-02-09 00:41:43 +00:00
Dimitri John Ledkov
277ae5cf05
functions: stop removing systemd-detect-virt unconditionally in undivert_grub
One can call divert_grub; replace_kernel; undivert_grub. And
replace_kernel will call into force_boot_without_initramfs, which
under certain conditions can call divert_grub &
undivert_grub. Resulting in undivert_grub called twice in a row.

When undivert_grub is called twice in a row it wipes
systemd-detect-virt binary from disk, as the rm call is unguarded to
check that there is something to divert if systemd package is
installed. And if the systemd package is not installed, it does not
check that systemd-detect-virt file is in-fact what divert_grub has
created.

Add a guard to check that systemd-detect-virt is the placeholder one,
before removing it.

LP: #1902260
(cherry picked from commit 096a00f40459187719840ccad99e86c7ade2ec12)
2021-02-09 00:40:03 +00:00
Dimitri John Ledkov
40d9405aa3
Perform fsck on all rootfs.
LP: #1912835
(cherry picked from commit 33b7272a2331279b4c7aa8de73ed8a9069d0bd39)
2021-02-09 00:39:56 +00:00
Dimitri John Ledkov
e2b5f91355
esp: perform fsck.
LP: #1912835
(cherry picked from commit 53b28d5f58284657ee8efd08a633d557af1fcd97)
2021-02-09 00:39:48 +00:00
Dimitri John Ledkov
3f0ef7d92e
esp: install grub in ubuntu bootloader id path, instead of removable.
Do not use removable uefi bootloader path in the cloud-images by
default, as that prevents upgrades of the bootloader.

LP: #1912830
(cherry picked from commit 7c760864fdcb278ca37396f06f5e3f297428d63d)
2021-02-09 00:39:39 +00:00
Dimitri John Ledkov
e62a4560bc
Merge branch 'dk/groovy-buildd-unpack-kernel-initrd' of git+ssh://git.launchpad.net/~davidkrauser/livecd-rootfs/+git/livecd-rootfs into ubuntu/groovy
(Cherry-pick commit 065c82314464fa78337d5122e1d4826a7d6edbb0)
2021-02-09 00:36:10 +00:00
Robert C Jennings
4868b6c054
releasing package livecd-rootfs version 2.694.2 2021-02-05 15:06:48 -06:00
Cody Shepherd
c02b972a1f
Update changelog 2021-02-03 08:13:30 -08:00
Cody Shepherd
ffd4faca9a
Omit file type exensions in manifest names 2021-02-03 08:12:56 -08:00
Cody Shepherd
4ec61627a8
Create manifests for buildd tarballs 2021-02-03 08:12:46 -08:00
David Krauser
1814fdb369 Produce buildd kernel and initrd as separate artifacts
Multipass on Mac OS X requires standalone kernel and initrd artifacts
to boot.

Also call update-initramfs on all installed kernels. We only have one
kernel installed, so we don't need to specify an explicit version.
2021-01-08 14:46:59 -05:00
Dimitri John Ledkov
6c9120820a
releasing package livecd-rootfs version 2.694.1 2020-11-05 11:54:29 +00:00
Dimitri John Ledkov
b4fe728481
Merge branch 'ubuntu/master' of git+ssh://git.launchpad.net/livecd-rootfs into ubuntu/groovy 2020-11-05 11:27:43 +00:00
Dimitri John Ledkov
4aedf53772
auto/config: scope ubuntu:desktop-preinstalled:raspi image options
When desktop-preinstalled image options were added in
38157b37487d244b27af33f7863e6b15253c8f94, for the raspi subarch, the
options listed there were not scoped for raspi subarch. This results
in those options getting also applied for the HYPERV
ubuntu:desktop-preinstalled image.

Thus scope the newly added options under raspi subarch case only.

(cherry picked from commit 1c7d688319490a8a15a5aab47fb086482b3efe92)

LP: #1901846
2020-10-28 10:44:22 +00:00
Dimitri John Ledkov
aeb9e39ec9
auto/config: seed ubuntu-desktop when building hyperv image
Regression introduced in 38157b37487d244b27af33f7863e6b15253c8f94 when
desktop-preinstalled code branch was added, it dropped addint
ubuntu-desktop task. Instead it added ubuntu-desktop-raspi task, only
for the raspi subarch, which depends on ubuntu-desktop. But the hyperv
case, now ended up without ubuntu-desktop task.

It looks like introduction of "desktop-preinstalled" assumed, that it
is for raspi only, when in fact that code path now started to be used
for hyperv gallery image too.

(cherry picked from commit 5d9af7f3c59ec6e47bfac1483064f25ffbd80e63)

LP: #1901846
2020-10-28 10:44:03 +00:00
10 changed files with 64 additions and 38 deletions

63
debian/changelog vendored
View File

@ -1,38 +1,61 @@
livecd-rootfs (2.699) hirsute; urgency=medium livecd-rootfs (2.694.4) groovy; urgency=medium
* hyper-v hook: Fix writing of pkla file out to correct scratch directory [ Gauthier Jolly ]
for image build. * ubuntu-cpc: secure esp mountpoint (LP: #1881006)
Change mount option for ubuntu-cpc images from "defaults" to "umask=0077"
ESP partitions might contain sensitive data and non-root users shouldn't
have read access on it.
-- Jinming Wu, Patrick <me@patrickwu.space> Tue, 03 Nov 2020 10:13:53 +0000 -- Robert C Jennings <robert.jennings@canonical.com> Sat, 10 Apr 2021 05:08:58 -0500
livecd-rootfs (2.698) hirsute; urgency=medium livecd-rootfs (2.694.3) groovy; urgency=medium
* amd64: always install grub-pc with shim-signed (LP: #1901906) [ David Krauser ]
* control: install qemu-utils & snapd on riscv64. * buildd: produce kernel and initrd as separate artifacts LP: #1910557
* buildd: call update-initramfs for all installed kernels
We only have one kernel installed, so we don't need to
specify an explicit version. LP: #1910557
-- Dimitri John Ledkov <xnox@ubuntu.com> Thu, 29 Oct 2020 22:22:30 +0000 [ Dimitri John Ledkov ]
* esp: install grub in ubuntu bootloader id path, instead of removable.
(LP: #1912830)
* esp: perform fsck. (LP: #1912835)
* Perform fsck on all rootfs. (LP: #1912835)
* functions: stop removing systemd-detect-virt unconditionally in undivert_grub
(LP: #1902260)
livecd-rootfs (2.697) hirsute; urgency=medium -- Dimitri John Ledkov <xnox@ubuntu.com> Tue, 09 Feb 2021 00:40:38 +0000
[ John Chittum ] livecd-rootfs (2.694.2) groovy; urgency=medium
* Ensure vmtools version entered into vmdk header (LP: #1893898)
-- Robert C Jennings <robert.jennings@canonical.com> Wed, 28 Oct 2020 12:02:04 -0500 [ Cody Shepherd ]
* Create manifests for buildd tarball images (LP: #1914445)
livecd-rootfs (2.696) hirsute; urgency=medium -- Robert C Jennings <robert.jennings@canonical.com> Fri, 05 Feb 2021 14:41:05 -0600
livecd-rootfs (2.694.1) groovy; urgency=medium
* livecd-rootfs SRU of change up to 2.699 from hirsute to groovy.
= hyperv gallery image =
[ Jinming Wu, Patrick ]
* hyper-v hook: Fix writing of pkla file out to correct scratch
directory for image build. LP: #1901846
[ Dimitri John Ledkov ]
* auto/config: seed ubuntu-desktop when building hyperv image LP: #1901846 * auto/config: seed ubuntu-desktop when building hyperv image LP: #1901846
* auto/config: scope ubuntu:desktop-preinstalled:raspi image options LP: #1901846 * auto/config: scope ubuntu:desktop-preinstalled:raspi image options LP: #1901846
-- Dimitri John Ledkov <xnox@ubuntu.com> Wed, 28 Oct 2020 10:36:29 +0000 = CPC cloud images =
[ Dimitri John Ledkov & Joshua Powers ]
* amd64: always install grub-pc with shim-signed (LP: #1901906), and
ensure to autoremove packages
[ John Chittum ]
* Ensure vmtools version entered into vmdk header (LP: #1893898)
livecd-rootfs (2.695) hirsute; urgency=medium = RISC-V port =
* control: install qemu-utils & snapd on riscv64. (LP: #1903034)
* Install only shim-signed to prevent shipping conflicting, autoremovable -- Dimitri John Ledkov <xnox@ubuntu.com> Thu, 05 Nov 2020 11:54:14 +0000
packages
* Ensure autoremove is run after any package install
-- Joshua Powers <josh.powers@canonical.com> Mon, 26 Oct 2020 11:58:57 -0700
livecd-rootfs (2.694) groovy; urgency=medium livecd-rootfs (2.694) groovy; urgency=medium

View File

@ -49,7 +49,7 @@ create_and_mount_uefi_partition() {
mount "${uefi_dev}" "$mountpoint"/boot/efi mount "${uefi_dev}" "$mountpoint"/boot/efi
cat << EOF >> "mountpoint/etc/fstab" cat << EOF >> "mountpoint/etc/fstab"
LABEL=UEFI /boot/efi vfat defaults 0 0 LABEL=UEFI /boot/efi vfat defaults 0 1
EOF EOF
} }

View File

@ -4,6 +4,10 @@
# ourselves. # ourselves.
set -e set -e
. config/functions
create_manifest chroot "livecd.$PROJECT.rootfs.manifest"
# gzip was chosen for fastest decompression speed: it decompresses buildd # gzip was chosen for fastest decompression speed: it decompresses buildd
# chroots about twice as fast as xz and about five times as fast as bzip2. # chroots about twice as fast as xz and about five times as fast as bzip2.
tar --transform='s,^chroot,chroot-autobuild,' --sort=name --numeric-owner \ tar --transform='s,^chroot,chroot-autobuild,' --sort=name --numeric-owner \

View File

@ -3,12 +3,16 @@
set -e set -e
. config/bootstrap . config/bootstrap
. config/functions
TMPDIR="$(mktemp -d)" TMPDIR="$(mktemp -d)"
config/make-lxd-metadata "${LB_DISTRIBUTION%-*}" "$ARCH" \ config/make-lxd-metadata "${LB_DISTRIBUTION%-*}" "$ARCH" \
>"$TMPDIR/metadata.yaml" >"$TMPDIR/metadata.yaml"
tar --numeric-owner -cf "livecd.$PROJECT.lxd.tar" -C "$TMPDIR" metadata.yaml tar --numeric-owner -cf "livecd.$PROJECT.lxd.tar" -C "$TMPDIR" metadata.yaml
rm -rf "$TMPDIR" rm -rf "$TMPDIR"
create_manifest chroot "livecd.$PROJECT.lxd.manifest"
# When using the combined metadata/rootfs form, the rootfs must be under # When using the combined metadata/rootfs form, the rootfs must be under
# rootfs/ rather than under chroot-autobuild/. # rootfs/ rather than under chroot-autobuild/.
tar --transform='s,^chroot,rootfs,' --sort=name --numeric-owner \ tar --transform='s,^chroot,rootfs,' --sort=name --numeric-owner \

View File

@ -56,8 +56,11 @@ chroot "$mount_d" update-grub
undivert_grub "$mount_d" undivert_grub "$mount_d"
# Update initramfs image # Update initramfs image
chroot "$mount_d" \ chroot "$mount_d" update-initramfs -c -v -k all
sh -c 'update-initramfs -c -v -k $(ls /boot/vmlinuz*generic | sed 1q | cut -d- -f2-3)'
# extract kernel and initrd
cp $mount_d/boot/initrd.img-* livecd.$PROJECT.initrd-generic
cp $mount_d/boot/vmlinuz-* livecd.$PROJECT.vmlinuz-generic
# Cleanup # Cleanup
env DEBIAN_FRONTEND=noninteractive chroot "$mount_d" apt-get \ env DEBIAN_FRONTEND=noninteractive chroot "$mount_d" apt-get \

View File

@ -379,7 +379,9 @@ undivert_grub() {
--divert /etc/grub.d/30_os-prober.dpkg-divert \ --divert /etc/grub.d/30_os-prober.dpkg-divert \
--rename /etc/grub.d/30_os-prober --rename /etc/grub.d/30_os-prober
if grep -q "^exit 1$" "$CHROOT_ROOT"/usr/bin/systemd-detect-virt; then
rm "$CHROOT_ROOT"/usr/bin/systemd-detect-virt rm "$CHROOT_ROOT"/usr/bin/systemd-detect-virt
fi
chroot "$CHROOT_ROOT" dpkg-divert --remove --local \ chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
--rename /usr/bin/systemd-detect-virt --rename /usr/bin/systemd-detect-virt
} }

View File

@ -2,5 +2,5 @@
cat >>/etc/fstab<<EOT cat >>/etc/fstab<<EOT
# Minimal setup required for systemd to provide a r/w FS # Minimal setup required for systemd to provide a r/w FS
/dev/root / rootfs defaults 0 0 /dev/root / rootfs defaults 0 1
EOT EOT

View File

@ -58,7 +58,7 @@ create_and_mount_uefi_partition() {
mount "${uefi_dev}" "$mountpoint"/boot/efi mount "${uefi_dev}" "$mountpoint"/boot/efi
cat << EOF >> "mountpoint/etc/fstab" cat << EOF >> "mountpoint/etc/fstab"
LABEL=UEFI /boot/efi vfat defaults 0 0 LABEL=UEFI /boot/efi vfat umask=0077 0 1
EOF EOF
} }
@ -100,19 +100,9 @@ install_grub() {
--boot-directory=/boot \ --boot-directory=/boot \
--efi-directory=/boot/efi \ --efi-directory=/boot/efi \
--target=${efi_target} \ --target=${efi_target} \
--removable \
--uefi-secure-boot \ --uefi-secure-boot \
--no-nvram --no-nvram
if [ -f mountpoint/boot/efi/EFI/BOOT/grub.cfg ]; then
sed -i "s| root| root hd0,gpt1|" mountpoint/boot/efi/EFI/BOOT/grub.cfg
sed -i "1i${IMAGE_STR}" mountpoint/boot/efi/EFI/BOOT/grub.cfg
# For some reason the grub disk is looking for /boot/grub/grub.cfg on
# part 15....
chroot mountpoint mkdir -p /boot/efi/boot/grub
chroot mountpoint cp /boot/efi/EFI/BOOT/grub.cfg /boot/efi/boot/grub
fi
if [ "$ARCH" = "amd64" ]; then if [ "$ARCH" = "amd64" ]; then
# Install the BIOS/GPT bits. Since GPT boots from the ESP partition, # Install the BIOS/GPT bits. Since GPT boots from the ESP partition,
# it means that we just run this simple command and we're done # it means that we just run this simple command and we're done

View File

@ -72,7 +72,7 @@ if [ -n "${root_fs_label}" ]; then
sed -i "s,^[^#${bl}]*\([${bl}]*/[${bl}].*\),${lstr}\1," "${rootd}/etc/fstab" sed -i "s,^[^#${bl}]*\([${bl}]*/[${bl}].*\),${lstr}\1," "${rootd}/etc/fstab"
fi fi
cat > /etc/fstab << EOM cat > /etc/fstab << EOM
LABEL=cloudimg-rootfs / ext4 defaults 0 0 LABEL=cloudimg-rootfs / ext4 defaults 0 1
EOM EOM
# for quantal and newer, add /etc/overlayroot.local.conf # for quantal and newer, add /etc/overlayroot.local.conf

View File

@ -48,7 +48,7 @@ hv_sock
EOF EOF
cat << EOF >> "${scratch_d}/etc/fstab" cat << EOF >> "${scratch_d}/etc/fstab"
LABEL=$FS_LABEL / ext4 defaults 0 0 LABEL=$FS_LABEL / ext4 defaults 0 1
EOF EOF
# Customise xrdp # Customise xrdp