[Bug 1868138] Re: 18.04LTS upgrade of grub-common:amd64 FAILs in post-install; incorrectly REWRITES user's /etc/default/grub

Julian Andres Klode julian.klode at canonical.com
Thu Mar 19 21:15:07 UTC 2020


Anyway, both

GRUB_CMDLINE_LINUX="moo
bar"

and

GRUB_CMDLINE_LINUX="foo \
bar"

break.


I have looked at OPs claim that this is a new regression, and verified that this is a wrong assertion - it was broken in 8.13:

ubuntu at boo1:~$ sudo apt install ./*.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'grub-common' instead of './grub-common_2.02-2ubuntu8.13_amd64.deb'
Note, selecting 'grub-efi-amd64-bin' instead of './grub-efi-amd64-bin_2.02-2ubuntu8.13_amd64.deb'
Note, selecting 'grub-efi-amd64' instead of './grub-efi-amd64_2.02-2ubuntu8.13_amd64.deb'
Note, selecting 'grub2-common' instead of './grub2-common_2.02-2ubuntu8.13_amd64.deb'
Suggested packages:
  multiboot-doc grub-emu xorriso desktop-base
The following packages will be upgraded:
  grub-common grub-efi-amd64 grub-efi-amd64-bin grub2-common
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3006 kB of archives.
After this operation, 35.8 kB of additional disk space will be used.
Get:1 /home/ubuntu/grub-efi-amd64_2.02-2ubuntu8.13_amd64.deb grub-efi-amd64 amd64 2.02-2ubuntu8.13 [47.8 kB]
Get:2 /home/ubuntu/grub-efi-amd64-bin_2.02-2ubuntu8.13_amd64.deb grub-efi-amd64-bin amd64 2.02-2ubuntu8.13 [654 kB]
Get:3 /home/ubuntu/grub2-common_2.02-2ubuntu8.13_amd64.deb grub2-common amd64 2.02-2ubuntu8.13 [533 kB]
Get:4 /home/ubuntu/grub-common_2.02-2ubuntu8.13_amd64.deb grub-common amd64 2.02-2ubuntu8.13 [1771 kB]
Preconfiguring packages ...       
(Reading database ... 59745 files and directories currently installed.)
Preparing to unpack .../grub-efi-amd64_2.02-2ubuntu8.13_amd64.deb ...
Unpacking grub-efi-amd64 (2.02-2ubuntu8.13) over (2.02-2ubuntu8) ...
Preparing to unpack .../grub-efi-amd64-bin_2.02-2ubuntu8.13_amd64.deb ...
Unpacking grub-efi-amd64-bin (2.02-2ubuntu8.13) over (2.02-2ubuntu8) ...
Preparing to unpack .../grub2-common_2.02-2ubuntu8.13_amd64.deb ...
Unpacking grub2-common (2.02-2ubuntu8.13) over (2.02-2ubuntu8) ...
Preparing to unpack .../grub-common_2.02-2ubuntu8.13_amd64.deb ...
Unpacking grub-common (2.02-2ubuntu8.13) over (2.02-2ubuntu8) ...
Setting up grub-common (2.02-2ubuntu8.13) ...
Installing new version of config file /etc/grub.d/00_header ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Setting up grub-efi-amd64-bin (2.02-2ubuntu8.13) ...
Setting up grub2-common (2.02-2ubuntu8.13) ...
Setting up grub-efi-amd64 (2.02-2ubuntu8.13) ...
/etc/default/grub: line 25: unexpected EOF while looking for matching ``'
/etc/default/grub: line 36: syntax error: unexpected end of file
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 36: /etc/default/grub: Syntax error: EOF in backquote substitution
dpkg: error processing package grub-efi-amd64 (--configure):
 installed grub-efi-amd64 package post-installation script subprocess returned error exit status 2
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for systemd (237-3ubuntu10.39) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Errors were encountered while processing:
 grub-efi-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1868138

Title:
  18.04LTS upgrade of grub-common:amd64 FAILs in post-install;
  incorrectly REWRITES user's /etc/default/grub

Status in grub2 package in Ubuntu:
  Incomplete

Bug description:
  upgrading packages, as usual, on a long-time-in-production Ubuntu
  1804LTS server instance,

  	lsb_release -rd
  		Description:    Ubuntu 18.04.4 LTS
  		Release:        18.04
  	uname -rm
  		5.3.0-40-generic x86_64

  today's update included grub,

          cat /var/log/apt/history.log

  		Start-Date: 2020-03-19  08:58:38
  		Commandline: apt-get upgrade
  		Upgrade: grub-common:amd64 (2.02-2ubuntu8.14, 2.02-2ubuntu8.15), grub2-common:amd64 (2.02-2ubuntu8.14, 2.02-2ubuntu8.15), grub-pc:amd64 (2.02-2ubuntu8.14, 2.02-2ubuntu8.15), grub-pc-bin:amd64 (2.02-2ubuntu8.14, 2.02-2ubuntu8.15)
  		Error: Sub-process /usr/bin/dpkg returned an error code (1)
  		End-Date: 2020-03-19  09:01:52

  
  the update FAILs in grub post-processing

  apparently, the install is -- new behavior -- REWRITING, incorrectly,
  the 'GRUB_CMDLINE_LINUX=' stanza in /etc/default/grub -- my _local_
  end-user config

  before

  	cat /etc/default/grub
  		...
  		GRUB_CMDLINE_LINUX_DEFAULT=""
  	53	GRUB_CMDLINE_LINUX="rd.shell rd.udev.log_priority=info rd.auto=1 \
  		 dolvm lvmwait=/dev/mapper/VG0_ROOT \
  		 rootfstype=ext4 rootdelay=90 rootflags=journal_checksum \
  		 noresume pcie_aspm=off max_loop=256 transparent_hugepage=never clocksource=tsc clocksource_failover=tsc tsc=reliable force_tsc_stable=1 \
  		 scsi_mod.use_blk_mq=1 \
  		 net.ifnames=1 biosdevname=0 \
  		 showopts noquiet \
  		 log_buf_len=16M print_fatal_signals=1 systemd.log_level=info systemd.log_target=kmsg earlyprintk=vga,keep \
  		 mitigations=auto spec_store_bypass_disable=on \
  		"
  		...

  exec an update, as usual

  	apt-get update && apt-get upgrade
  		Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
  		Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
  		Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
  		Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
  		Reading package lists... Done
  		Reading package lists... Done
  		Building dependency tree
  		Reading state information... Done
  		Calculating upgrade... Done
  		0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  		1 not fully installed or removed.
  		After this operation, 0 B of additional disk space will be used.
  		Do you want to continue? [Y/n]
  	-> Y
  		Do you want to continue? [Y/n] Y

  now, fails

  		Setting up grub-pc (2.02-2ubuntu8.15) ...
  		Sourcing file `/etc/default/grub'
  		/etc/default/grub: line 53: unexpected EOF while looking for matching `"'
  		dpkg: error processing package grub-pc (--configure):
  		 installed grub-pc package post-installation script subprocess returned error exit status 2
  		Errors were encountered while processing:
  		 grub-pc
  		E: Sub-process /usr/bin/dpkg returned an error code (1)

  it's incorrectly re-written /etc/default/grub

  	cat /etc/default/grub
  		...
  		GRUB_CMDLINE_LINUX_DEFAULT=""
  	53	GRUB_CMDLINE_LINUX="rd.shell rd.udev.log_priority=info rd.auto=1 dolvm lvmwait=/dev/mapper/VG0_ROOT rootfstype=ext4 rootdelay=90 rootflags=journal_checksum noresume pcie_aspm=off max_loop=256 transparent_hugepage=never clocksource=tsc clocksource_failover=tsc tsc=reliable force_tsc_stable=1 scsi_mod.use_blk_mq=1 net.ifnames=1 biosdevname=0 showopts noquiet log_buf_len=16M print_fatal_signals=1 systemd.log_level=info systemd.log_target=kmsg earlyprintk=vga,keep mitigations=auto spec_store_bypass_disable=on"
  		 dolvm lvmwait=/dev/mapper/VG0_ROOT \
  		 rootfstype=ext4 rootdelay=90 rootflags=journal_checksum \
  		 noresume pcie_aspm=off max_loop=256 transparent_hugepage=never clocksource=tsc clocksource_failover=tsc tsc=reliable force_tsc_stable=1 \
  		 scsi_mod.use_blk_mq=1 \
  		 net.ifnames=1 biosdevname=0 \
  		 showopts noquiet \
  		 log_buf_len=16M print_fatal_signals=1 systemd.log_level=info systemd.log_target=kmsg earlyprintk=vga,keep \
  		 mitigations=auto spec_store_bypass_disable=on \
  		"

  prepending the EXISTING 'GRUB_CMDLINE_LINUX=' with a duplicate of
  itself ... plus an errant trailing `"'

  fyi,

  apt-cache policy grub2
  grub2:
    Installed: (none)
    Candidate: 2.02-2ubuntu8.15
    Version table:
       2.02-2ubuntu8.15 500
          500 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
       2.02-2ubuntu8 500
          500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1868138/+subscriptions



More information about the foundations-bugs mailing list