2065 Commits

Author SHA1 Message Date
John Chittum
fb33fe9026
Minor fixes to Vagrantfile comments 2020-08-27 15:46:36 -05:00
John Chittum
cfd43992a8
Reorder comments to ensure clarity
Long history comment moved to the end with short clarifying comments
before the relevant code. Update changelog with proper attribution
2020-08-27 15:11:15 -05:00
John Chittum
c92e885303
ubuntu-cpc: Vagrant Serial to Null (LP: #1874453)
Original fix proposed by Stanislav German-Evtushenko (giner)

CPC Ubuntu cloud images default to enabling a serial console connection
via the kernel commandline option `console=ttyS0`. Many clouds support
the serial connection, and utilize it for debugging purposes. Virtualbox
supports the serial connection as well. In Bionic and earlier images,
Vagrant boxes created a serial log file in the directory of the
Vagrantfile by default. However this is not standard behaviour for
Vagrant images, and so it was removed in Eoan onwards.

Starting in Eoan, there were reports of image booting slowdown (1874453
is a single example). After testing, it was determined that the serial
connection starting, without a device attached, was the cause of the
slow down. However, we did not want to revert to the old functionality
of creating a file. Much thanks to <giner> for providing the Ruby syntax
for sending to File::NULL.

This option will not create a local file, however, the default
Vagrantfile configuration is overwritable via a users Vagrantfile. The
original syntax for creating a file local to the users Vagrantfile has
been included as an example.
2020-08-27 14:37:40 -05:00
Stanislav German-Evtushenko
b0144d3018
vagrant: Use dummy file for the console output
Links:
- https://bugs.launchpad.net/cloud-images/+bug/1874453
2020-08-27 14:36:22 -05:00
Steve Langasek
37f5f8881f Revert "Revert "Remove fstab from squashfs images""
This reverts commit d9de2701897608710ed97e206ee29f28af8cc82a.
2020-08-27 12:17:22 -07:00
Robert C Jennings
2844aa530d
Revert ubuntu-cpc: Disable boot splash
These introduced a regression for ppc64el and needs more time to bake.
This reverts commits 1deb0c68e8be6b06190402e32292c3c55134eee2 &
6dbb30f53bd3f2086021abdecaee04645c9ccda0.

 * "ubuntu-cpc: Fix ppc64el grub console update"
 * "ubuntu-cpc: Disable boot splash in all cloud images (LP: #1725358)"
2020-08-12 16:49:41 -05:00
Robert C Jennings
1deb0c68e8
ubuntu-cpc: Fix ppc64el grub console update
The commit 6dbb30f5 (2.682) which disabled boot splash for all cloud
images introduced an error in the ppc64el hook.  This patch corrects the
name of the variable that contains grub console overrides.  The error
seen during testing was
 'disk-image-ppc64el.binary: line 44: CONSOLES: unbound variable'
and this was due to a typo.
2020-08-12 13:48:03 -05:00
Steve Langasek
d9de270189 Revert "Remove fstab from squashfs images"
This reverts commit f96e874ed12e7e080111d27aa14c4f97aa6bec87.
2020-08-12 11:35:06 -07:00
Robert C Jennings
6dbb30f53b
ubuntu-cpc: Disable boot splash in all cloud images (LP: #1725358)
When trying to debug an issue on ARM64 it was reported that it was
quite difficult to debug because of control codes on the console from
the splash.

For cloud image there is a chroot customization the drops 'quiet splash'
but this is only applied to amd64.  It hasn't made it into other
architectures because they don't have grub by default in the chroot.
However, when we get into binary hook for the uefi disk image and it's
derivatives grub is installed and this includes architectures that were
skipped in the chroot hook.

This patch changes the cpc-fixes chroot hook to add a cloud-images
grub config with basic overrides, including dropping the boot splash,
for all architectures.  For images that never get grub installed this
addition is harmless and small while ensuring that the grub experience
is consistent for images that have grub.  The configuration of console
devices as hard-coded remains arch specific.
2020-08-12 04:50:36 -05:00
Steve Langasek
9348a2e9cb Merge remote-tracking branch 'callmepk/ubuntu/master' into ubuntu/master 2020-08-10 14:52:07 -07:00
Steve Langasek
e1c745e193 Merge remote-tracking branch 'codyshepherd/bootable-buildd/dist-upgrade/groovy' into ubuntu/master 2020-08-04 12:29:52 -07:00
Robert C Jennings
e3dce0ab17
Handle seeded lxd snap with channel name for ubuntu-cpc:minimized
The seed now specifies the lxd snap in focal as
'lxd=4.0/stable/ubuntu-20.04' which doesn't match the expectations of
the code with looks for lxd as the only snap in the seed for minimized
images.  This patch updates the pattern to accept 'lxd' or 'lxd=*'.
2020-07-29 14:56:26 -05:00
Dimitri John Ledkov
4d4f113f42
functions: provide nss_systemd-less nsswitch.conf in chroots. 2020-07-24 21:03:55 +01:00
Dimitri John Ledkov
109e6c6613
auto/build: use setup|teardown_mountpoint to reduce duplication 2020-07-24 20:59:57 +01:00
David Krauser
83499f1a95 Add mechanism to detect initrdless boot fallback
In v2.672 the default boot behavior of cloud images changed:

- Prior to v2.672, cloud images with the linux-generic kernel attempt
  to boot without an initramfs, would fail, and then retry with an
  initramfs.

- After v2.672, cloud images with the linux-generic kernel boot with
  an initramfs on the first try.

While the behavior is different between the two, they both result in
an instance that has booted with an initramfs. To ensure the changes
in v2.672 do not regress, we need an automated way to check if we are
attempting to boot without an initramfs and failing.

With this change, when we attempt to boot with an initramfs and fail,
initrdless_boot_fallback_triggered is set to non-zero in the grubenv.
This value can be checked after boot by looking in /boot/grub/grubenv
or by using the grub-editenv list command.
2020-07-22 16:41:10 -04:00
Jinming Wu, Patrick
afda365565
Additional fixes for Hyper-V builds
use of linux-azure, which is the optimized kernel for Hyper-V by
Microsoft
2020-07-22 17:27:03 +08:00
Robert C Jennings
84397b5098
Avoid rbind /sys for chroot snap pre-seeding (cgroups fail to unmount)
Builds in LP with the Xenial kernel were happy with the recursive mount of
/sys inside the chroot while performing snap-preseeding but autopkgtests
with the groovy kernel failed.  With the groovy kernel the build was
unable to unmount sys/kernel/slab/*/cgroup/* (Operation not permitted).

This patch mounts /sys and /sys/kernel/security in the chroot in the
same way we've added for binary hooks.  This provides the paths under
/sys needed for snap-preseed while avoiding issues unmounting other
paths.
2020-07-18 16:52:18 -05:00
Dimitri John Ledkov
b14f79ce2e
apparmor: compile all profiles 2020-07-18 00:45:26 +01:00
Dimitri John Ledkov
31861fd40d
seccomp: mount more up-to-date seccomp features 2020-07-18 00:24:16 +01:00
Dimitri John Ledkov
bc4d32a422
seccomp: add more up-to-date seccomp actions 2020-07-18 00:20:42 +01:00
Dimitri John Ledkov
a14a31b751
apparmor: mount more up-to-date apparmor features in the chroot. 2020-07-18 00:20:41 +01:00
Dimitri John Ledkov
37be000f39
apparmor: Add generic v5.4 kernel apparmor features 2020-07-17 23:42:53 +01:00
Dimitri John Ledkov
6e6ab16bf2
live-server: remove duplicate snaps, due to overlayfs vs snap-preseed. 2020-07-17 21:17:34 +01:00
Robert C Jennings
1ca11c9795
Apply snap-preseed optimizations after seeding snaps
The snap-preseed command can do a number of things during the build
that are currently performed at first boot (apparmor profiles, systemd
unit generation, etc).  This patch adds a call to reset the seeding and
apply these optimizations when adding a seeded snap.  As a prerequisite
to calling snap-preseed we need to make /dev/mem available as well as
mounts from the host to perform this work, so those are also added here.
2020-07-17 21:17:33 +01:00
David Krauser
4c504f6781 Fix broken minimal cloud image boot on amd64
I recently pulled initramfs logic out of the base build hook, and
dropped that into the `replace_kernel` function. Any cloud image that
does not leverage the generic virtual kernel was expected to call
`replace_kernel` to pull in a custom kernel. That function will
disable initramfs boot for images that use a custom kernel.

Minimal cloud images on amd64 use the linux-kvm kernel, but the build
hook does not utilize the `replace_kernel` function. Instead, the
kernel flavor is set in `auto/config`. I pulled that logic out of
`auto/config` and am now calling `replace_kernel` in the build hook.

I also moved a call to generate the package list so that it will pick
up the change to the linux-kvm kernel.
2020-07-16 17:25:46 -04:00
Joshua Powers
d542e8e4a0
functions: fix unbound variable 2020-07-13 13:05:43 -07:00
Cody Shepherd
7ad64297f7
Remove explicit install of grub-efi-* package as it is not necessary,
and potentially overexplicit
2020-07-13 09:10:50 -07:00
Robert C Jennings
a6a7be7c18
Release package livecd-rootfs version 2.672
* Boot with an initramfs by default in cloud images, except when using a non-generic kernel.
   MP: https://code.launchpad.net/~davidkrauser/livecd-rootfs/+git/livecd-rootfs/+merge/386913
2020-07-10 07:48:22 -05:00
Dimitri John Ledkov
2976a99f29 Fix-up seeding snaps with tracks. 2020-07-10 01:56:10 +01:00
Cody Shepherd
5136ee4104
Perform a dist-upgrade prior to installing packages for bootable-buildd
image in order to pull in package updates
2020-07-09 13:00:04 -07:00
Dimitri John Ledkov
bdec14015c Merge branch 'snap-preseed-channel-specification' of git+ssh://git.launchpad.net/~xnox/livecd-rootfs into ubuntu/master 2020-07-09 18:34:31 +01:00
Dimitri John Ledkov
7bae9201d2 snap_preseed: support channel specification with snap name
snap_name[/classic]=track/risk/branch is now the supported snap name
specification, which allows to specify the full default track and
optional classic confinemnt.

Supporting such specification in the seedtext allows one to specify a
better default channel. For example, this will allow lxd to switch
from latest/stable/ubuntu-20.04 to 4.0/stable/ubuntu-20.04 as 4.0 is
the LTS track matching 20.04 support timeframe.

LP: #1882374
2020-07-09 18:32:10 +01:00
David Krauser
e8e3e6760f Drop hack in kvm image that forces initramfs-less boot
Since the kvm image now boots without an initramfs by default, we
don't need to force it in the build hook.
2020-07-08 17:29:15 -04:00
David Krauser
8a2cdec470 Boot without an initramfs by default if running a custom kernel
Initramfs-less boot, which is a boot optimization, should only be
applied where we know it could work for users and provide an improved
boot boot experience; images with custom kernels are candidates for
that.
2020-07-08 17:26:50 -04:00
David Krauser
1ca1330eae Boot with an initramfs by default in cloud images
Generic cloud images with the linux-generic kernel are not able to
boot without an initramfs. Previously, these images attempted to boot
without an initramfs, would fail, and then retry with an initramfs.
This slows the boot and is confusing behavior.
2020-07-08 17:13:49 -04:00
Dimitri John Ledkov
1ff35cf438 chroot: disable amd64 codepath on riscv64 2020-06-24 16:08:31 +01:00
Dimitri John Ledkov
90602e00de Merge branch 'empty-fstab-in-lxd' of git+ssh://git.launchpad.net/~rbalint/livecd-rootfs into ubuntu/master 2020-06-23 15:04:46 +01:00
Steve Langasek
4a02400dec Merge remote-tracking branch 'callmepk/hyper-v-fix' into ubuntu/master 2020-06-22 08:45:21 -07:00
Balint Reczey
f96e874ed1 Remove fstab from squashfs images
The default fstab is not valid, since squashfs does not support labels.

LP: #1877078
2020-06-16 22:14:59 +02:00
Łukasz 'sil2100' Zemczak
40103430d8 Enable overrides of UC20 grade dangerous channels 2020-05-25 19:11:22 +02:00
Philip Roche
60665a434b Revert of initramfs package removal in KVM image (LP: #1875400)
It was reported and confirmed in LP bug #1875400
(https://bugs.launchpad.net/cloud-images/+bug/1875400) that on the public
KVM cloud image there exists a large list of packages marked for auto-removal.

This should never be the case on a released cloud image.

These packages are marked for auto-removal because in the KVM image binary hook
we removed both initramfs-tools and busybox-initramfs packages. Due to package
dependencies this also removed:

busybox-initramfs* cloud-initramfs-copymods* cloud-initramfs-dyn-netconf*
cryptsetup-initramfs* initramfs-tools* initramfs-tools-core* multipath-tools*
overlayroot* sg3-utils-udev* ubuntu-server*

But it did not remove all the packages that the above list depended on.
This resulted in all those packages being marked for auto-removal because they
were not manually installed nor did they have any manually installed packages
that depended on them.

The removal of initramfs-tools and busybox-initramfs was to avoid the
generation of initramfs in images that should boot initramfsless.

This requirement is obsolete now because the initramfsless boot handling
is now handled via setting GRUB_FORCE_PARTUUID in /etc/default/grub.d/40-force-partuuid.cfg.

In test images I have verified that GRUB_FORCE_PARTUUID is set and that
boot speeds have not regressed.

LP: #1875400
2020-05-18 17:08:30 +01:00
Dimitri John Ledkov
dbf5b84bc8 Merge branch 'xnox/lxd-add-riscv64' of git+ssh://git.launchpad.net/livecd-rootfs into ubuntu/master 2020-05-12 12:28:56 +01:00
Dimitri John Ledkov
1979e61c36 Merge branch 'kpartx-fun' of git+ssh://git.launchpad.net/~mwhudson/livecd-rootfs/+git/livecd-rootfs into ubuntu/master 2020-05-12 12:19:32 +01:00
Dimitri John Ledkov
bb9a7dd43e make-lxd-metadata: add riscv64 lxd architecture tag 2020-05-11 14:20:34 +01:00
Jinming Wu, Patrick
81b1cbbfc2
Add extra policy for xrdp session 2020-05-11 19:45:04 +08:00
Jinming Wu, Patrick
8d26a3036c
force to use systemwide config 2020-05-11 19:43:27 +08:00
Jinming Wu, Patrick
c9a2d8abad
Hyper-V: remove legacy option 2020-05-11 19:39:38 +08:00
Dimitri John Ledkov
b9177cfd59 Fixup indentation
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
2020-05-07 15:09:57 +01:00
Jinming Wu, Patrick
bc24ef964e
hyper-v enhanced mode fix: port change 2020-05-05 18:03:10 +08:00
Dimitri John Ledkov
6e8b5b94c4 ubuntu-image: fix focal+ pi images for armhf to use pi-armhf model name.
LP: #1876358
2020-05-01 19:50:41 +01:00