Bug 53117 - Unbreak GRUB2 upgrade
Unbreak GRUB2 upgrade
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Grub
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 4.4-8
Assigned To: Philipp Hahn
Jürn Brodersen
:
Depends on: ucs448changelog
Blocks: 51984
  Show dependency treegraph
 
Reported: 2021-04-17 11:34 CEST by Philipp Hahn
Modified: 2022-04-28 12:00 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Screenshot broken 4.4-8 secure boot installation (28.19 KB, image/png)
2021-04-19 17:18 CEST, Jürn Brodersen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2021-04-17 11:34:02 CEST
The Upgrade to UCS 5.0-0 fails:
1. linux-image-amd64 pulls in linux-image-...
2. this calls /etc/kernel/postinst.d/zz-update-grub
3. this calls update-grub
4. this calls grub-mkconfig
5. this calls /etc/grub.d/05_debian_theme
6. this generates /boot/grub/grub.cfg.new with

> if background_image /grub/uniboot.png; then
> else
>   ...
> fi

This syntax is invalid as there must be at least one statement between "then" and "else":

> error: syntax error.
> error: Incorrect command.
> error: syntax error.
> Syntax error at line 114

The bug is introduced by grub2/4.4-0-0-ucs/2.02~beta3-5+deb9u2-ucs4.4-2/51-menu-color.patch, which removed the required statement:

-	if [ -z "${2}" ] && [ -z "${3}" ]; then
-		echo "  true"



+++ This bug was initially created as a clone of Bug #51984 +++
Comment 1 Philipp Hahn univentionstaff 2021-04-17 17:07:08 CEST
# dpkg-query -W -f '${Package}\t${Version}\t${Config-Version}\t${Status}\n' grub\* linux-image-\* univention-grub | grep -Fv not-installed
grub-common     2.02+dfsg1-20+deb10u4   2.02~beta3-5+deb9u2A~4.4.0.201909191538 install ok unpacked
grub-pc 2.02+dfsg1-20+deb10u4   2.02~beta3-5+deb9u2A~4.4.0.201909191538 install ok unpacked
grub-pc-bin     2.02+dfsg1-20+deb10u4   2.02~beta3-5+deb9u2A~4.4.0.201909191538 install ok unpacked
grub2-common    2.02+dfsg1-20+deb10u4   2.02~beta3-5+deb9u2A~4.4.0.201909191538 install ok unpacked
linux-image-4.19.0-16-amd64     4.19.181-1              install ok half-configured
linux-image-4.9.0-15-amd64      4.9.258-1               install ok installed
linux-image-4.9.0-15-amd64-signed       5.0.0-16A~4.4.0.202103182253            install ok installed
linux-image-amd64       4.19+105+deb10u11               install ok unpacked
univention-grub 13.0.0-6A~5.0.0.202104161759            install ok installed

Notice that "grub*" is transitioning from our patched UCS version to the un-patched version from Debian and is in the "unpacked" state.
The the new binaries are already installed, but the conffiles below /etc/ are not yet renamed from .dpkg-new to their final location.
The newer grub-mkconfig does not like the grub.cfg generated by our patched config file, so this has been fixed.

r19358 | Bug #53117: GRUB2 upgrade

Package: grub2
Version: 2.02~beta3-5+deb9u2A~4.4.0.202104171136
Branch: ucs_4.4-0
Scope: ucs4.4-8

[4.4-8] 86563c994f Bug #53117: GRUB2 changelog
 doc/changelog/changelog-4.4-8.xml | 9 +++++++++
 1 file changed, 9 insertions(+)

DONE: <https://jenkins.knut.univention.de:8181/view/Publish/job/Publish%20UCS%204%20to%20testing/3127/console>
OK: Upgrade 4.4-7 → 4.4-8 → 5.0-0 (BIOS and UEFI-SB)
OK: New installation with ucs_4.4-8-20210417-164826-dvd-amd64.iso
Comment 2 Jürn Brodersen univentionstaff 2021-04-19 17:17:10 CEST
Reopen: grub-efi-amd64-signed needs to be updated
Comment 3 Jürn Brodersen univentionstaff 2021-04-19 17:18:36 CEST
Created attachment 10693 [details]
Screenshot broken 4.4-8 secure boot installation
Comment 4 Philipp Hahn univentionstaff 2021-04-19 18:35:52 CEST
[4.4-8] 7ba3e77784 Bug #53117: Bump version number for UCS 4.4-8
 base/grub-efi-amd64-signed/debian/changelog | 6 ++++++
 1 file changed, 6 insertions(+)

Package: grub-efi-amd64-signed
Version: 3.0.0-2A~4.4.0.202104191750
Branch: ucs_4.4-0

https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-8/job/BuildDVD/8/console

OK: ucs_4.4-8-20210419-175224-dvd-amd64.iso
Comment 5 Jürn Brodersen univentionstaff 2021-04-19 22:37:52 CEST
What I tested:
Unsetting all grub colors via ucr now creates a valid grub.cfg -> OK
Update -> OK
UEFI -> OK
UEFI + Secure boot installation from 4.4-8 cd -> OK
Comment 6 Erik Damrose univentionstaff 2022-04-28 12:00:28 CEST
UCS 4.4-8 has been released:
 https://docs.software-univention.de/release-notes-4.4-8-en.html

If this error occurs again, please use the 'Clone This Bug' option.