** Description changed:

  # Motivation
  The latest 22.04 HWE kernel (6.5.0-41) doesn't work with my dock (#2070020), 
so I'm trying to set a previous stable kernel (6.5.0-35) as a default in GRUB.
  # What I did
  I've added the following to /etc/default/grub.d/pin-6.5.0-35.cfg:
  GRUB_DEFAULT="Ubuntu, with Linux 6.5.0-35-generic"
  # What went wrong
  update-grub warns:
  Warning: Please don't use old title `Ubuntu, with Linux 6.5.0-35-generic' for 
GRUB_DEFAULT, use `Advanced options for Ubuntu>Ubuntu, with Linux 
6.5.0-35-generic' (for versions before 2.00) or 
 (for 2.00 or later)
  It does add an override to grub.cfg to change the default to "Advanced 
options for Ubuntu>Ubuntu, with Linux 6.5.0-35-generic", though:
  if [ "x$default" = 'Ubuntu, with Linux 6.5.0-35-generic' ]; then 
default='Advanced options for Ubuntu>Ubuntu, with Linux 6.5.0-35-generic'; fi;
  That's why I initially thought I did everything right and disregarded the 
- However, the generated code for that override is broken (should be 
`"x$default" = 'xUbuntu, ...'` instead of `"x$default" = 'Ubuntu, ...'`) and 
GRUB falls back to booting the first available kernel.
  # Workaround
  I changed /etc/default/grub.d/pin-6.5.0-35.cfg to the following:
  GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 6.5.0-35-generic"
  # Remarks
  The workaround is the preferred way to set a default by name.
  However, I believe that if there is code that generates a broken override, it 
should be fixed or removed.
  # Relation to other bugs
  I believe this is NOT a duplicate of #2049681, since it also occurs without 
"GRUB_DISABLE_SUBMENU=true", but depending on what the issue was with #2049681, 
that bug might be covered by a solution for mine, so a "duplicates" pointing in 
the other direction might be more appropriate, if I understand the meaning of 
"duplicates" correctly.
+ # Causes
+ grub-mkconfig generates broken grub.cfg code to add the submenu part to the 
+ It's still present in the current master branch:
+ It's missing an `x` before `$quoted`.
+ Because of that, the condition always fails and GRUB falls back to booting 
the first available kernel.
+ This was introduced when grub-mkconfig was updated to support submenus in 
  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: grub2 (not installed)
  ProcVersionSignature: Ubuntu 6.5.0-35.35~22.04.1-generic 6.5.13
  Uname: Linux 6.5.0-35-generic x86_64
  NonfreeKernelModules: zfs
  ApportVersion: 2.20.11-0ubuntu82.5
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: KDE
  Date: Mon Jun 24 11:41:59 2024
  InstallationDate: Installed on 2023-07-05 (354 days ago)
  InstallationMedia: Kubuntu 22.04.2 LTS "Jammy Jellyfish" - Release amd64 
  SourcePackage: grub2
  UpgradeStatus: No upgrade log present (probably fresh install)

You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

  update-grub fails to set submenu item as default by name

To manage notifications about this bug go to:

ubuntu-bugs mailing list

Reply via email to