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.
raspi-desktop-1
Robert C Jennings 5 years ago
parent c39b9b2d54
commit 6dbb30f53b
No known key found for this signature in database
GPG Key ID: 740C3D9EEDF2ED73

@ -35,19 +35,15 @@ install_grub() {
chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2 chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2
# set the kernel commandline to use hvc0 # set the kernel commandline to use hvc0
mkdir -p mountpoint/etc/default/grub.d CONSOLE="console=hvc0 earlyprintk"
cat << EOF > mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg # Append to the existing GRUB_CMDLINE_LINUX_DEFAULT line
${IMAGE_STR} if [ ! -f mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg ]; then
echo "Expected to find an existing grub config override"
exit 1
fi
sed -e "/^\s*GRUB_CMDLINE_LINUX_DEFAULT=/{s/=\"\"/=\"$CONSOLES$itemNum\"/;t;s/\"$/ $CONSOLES$itemNum&/;}" \
mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
# Set the recordfail timeout
GRUB_RECORDFAIL_TIMEOUT=0
# Do not wait on grub prompt
GRUB_TIMEOUT=0
# Set the default commandline
GRUB_CMDLINE_LINUX_DEFAULT="console=hvc0 earlyprintk"
EOF
prep_partition="/dev/mapper${loop_device///dev/}p2" prep_partition="/dev/mapper${loop_device///dev/}p2"
chroot mountpoint grub-install "${prep_partition}" \ chroot mountpoint grub-install "${prep_partition}" \
--no-nvram \ --no-nvram \

@ -112,8 +112,26 @@ if [ "${SUBPROJECT:-}" = minimized ]; then
_xchroot "${rootd}" apt clean _xchroot "${rootd}" apt clean
fi fi
#### END COMMON ARCH FUNCTIONS # for Quantal and later, use /etc/default/grub.d functionality
# rather than modifying the grub configuration itself.
# This avoids the mess of having to do dpkg stuff
# LP: 1179940
mkdir -p "${rootd}/etc/default/grub.d"
cat << EOF > "${rootd}/etc/default/grub.d/50-cloudimg-settings.cfg"
# Cloud Image specific Grub settings for Generic Cloud Images
${CLOUD_IMG_STR}
# Set the recordfail timeout
GRUB_RECORDFAIL_TIMEOUT=0
# Do not wait on grub prompt
GRUB_TIMEOUT=0
# Drop 'quiet' and 'splash' for cloud images
GRUB_CMDLINE_LINUX_DEFAULT=""
EOF
#### END COMMON ARCH FUNCTIONS
case $arch in case $arch in
# ARM, ppc, riscv64 and s390x images are special # ARM, ppc, riscv64 and s390x images are special
@ -187,23 +205,15 @@ fi
psuedo_grub_probe > "${gprobe}" psuedo_grub_probe > "${gprobe}"
chmod 755 "${gprobe}" chmod 755 "${gprobe}"
# for Quantal and later, use /etc/default/grub.d functionality
# rather than modifying the grub configuration itself.
# This avoids the mess of having to do dpkg stuff
# LP: 1179940
mkdir -p "${rootd}/etc/default/grub.d"
cat << EOF > "${rootd}/etc/default/grub.d/50-cloudimg-settings.cfg"
# Cloud Image specific Grub settings for Generic Cloud Images
${CLOUD_IMG_STR}
# Set the recordfail timeout # Set the consoles on the default grub commandline
GRUB_RECORDFAIL_TIMEOUT=0 CONSOLES="console=tty1 console=ttyS0"
# Append to the existing GRUB_CMDLINE_LINUX_DEFAULT line
# Do not wait on grub prompt sed -e "/^\s*GRUB_CMDLINE_LINUX_DEFAULT=/{s/=\"\"/=\"$CONSOLES$itemNum\"/;t;s/\"$/ $CONSOLES$itemNum&/;}" \
GRUB_TIMEOUT=0 "${rootd}/etc/default/grub.d/50-cloudimg-settings.cfg"
# Set the default commandline # Append the terminal console setting to the cloud grub config
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0" cat << EOF >> "${rootd}/etc/default/grub.d/50-cloudimg-settings.cfg"
# Set the grub console type # Set the grub console type
GRUB_TERMINAL=console GRUB_TERMINAL=console

Loading…
Cancel
Save