[Bug 1922342] Re: HIrsute live session takes ages to boot on BIOS systems

Thomas Schmitt 1922342 at bugs.launchpad.net
Fri May 21 14:34:21 UTC 2021


Hi,

Chris Guiver wrote:
> Delay occurs regardless of ISO being written using mkusb, dd, or gnome-
> disks..

Hmm. IIRC mkusb offers to unpack the ISO into a filesystem of the USB stick.
If the problem survives that conversion, then it is far inside the GRUB
equipment.

It should be possible to make experimental changes with the .cfg files of
such an USB stick.
(I can propose xorriso runs which repack an ISO to bear new .cfg content
and the same boot entry points as the original ISO. But directly editing
in a FAT filesystem would be much more straightforward.)

Being curious i looked into ubuntu-20.10-desktop-amd64.iso for occurences
of grub_platform and found in /boot/grub/grub.cfg

    grub_platform
    if [ "$grub_platform" = "efi" ]; then
    menuentry 'Boot from next volume' {
            exit
    }

It could be that the complaint of GRUB is about the command grub_platform,
not about the use of $grub_platform.

I fail to find the implementation of the command in a freshly pulled GRUB git.
(Other known commands have a call to grub_register_command() with their
name as argument. grub_platform has not.)

A first experiment would be to remove above snippet from grub.cfg and
to check whether its presence caused the long delay.

--------------------------------------------------------------------------
Red herring warning:

The documentation about "normal" mode and grub_platform might be not helpful
for understanding our special problem. Possibly its text describes not the
work of the command but only the situation when it is _not_ needed.

Maybe GRUB is not running in "normal" mode, or maybe grub_platform updates the
variable, which is set at initialization time in grub-core/normal/main.c
from macro GRUB_PLATFORM:

    GRUB_MOD_INIT(normal)
    {
      ...
      grub_env_set ("grub_platform", GRUB_PLATFORM);
      ...

That macro seems to be set by the compile time configuration of GRUB in
./configure which is supposed to stem from configure.ac

    GRUB_PLATFORM="${platform}"
    ...
    AC_SUBST(GRUB_PLATFORM)

The variable platform is set in the same file, either from option
--with-platform or from automatic detection

    # Guess the platform if not specified.
    if test "x$with_platform" = x; then
      case "$target_cpu"-"$target_vendor" in
        ...
        x86_64-apple) platform=efi ;;
        x86_64-*) platform=pc ;;
        ...

So i'd assume that if /boot/grub/grub.cfg expects the possibility to see
"efi", then GRUB would have to be compiled with --with-platform=efi .
Meanwhile the GRUB in Ubuntu ISOs serves both, EFI and legacy BIOS.
I wonder how this is supposed to play with the compile time setting.

There is a compile time variable GRUB_PLATFORMS:
  https://wiki.gentoo.org/wiki/GRUB2_Quick_Start#Installing_GRUB2_software
  "To install GRUB2, first set the GRUB_PLATFORMS variable with one or more
   appropriate values in the system's make.conf. If unset, GRUB2 will guess
   which platform to use on the system. It guesses pc (which is the MBR
   style of installation) for x86/amd64 architectures."
But the relation of the single value GRUB_PLATFORM and the value list in
GRUB_PLATFORMS is not clear to me.

The GRUB manual talks in singular, not in plural:
  https://www.gnu.org/software/grub/manual/grub/grub.html#grub_005fplatform
  "In normal mode (see normal), GRUB sets the ‘grub_platform’ variable to
  the platform for which GRUB was built (e.g. ‘pc’ or ‘efi’). 

So this could want to say that each GRUB can serve in normal mode only one
platform. But the ISO wants to serve two of them. That would be a reason
not to run GRUB in normal mode.

In 2012 Vladimir Serbinko, then maintainer of GRUB, surely expected that
the ISO produced by grub-mkrescue can boot on "efi" and "pc" alike.
We discussed how xorriso should combine MBR boot code and GPT in one ISO.

:End of red herring warning.
--------------------------------------------------------------------------

Have a nice day :)

Thomas

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

Title:
  HIrsute live session takes ages to boot on BIOS systems

Status in casper package in Ubuntu:
  Confirmed

Bug description:
  First of all, I change the description of this bug because, thanks to
  Chris Guiver comments, I could check that the live session effectively
  works but it takes too long to complete. That's why I change the
  description of the bug from live session does not boot to live session
  takes ages to boot. I hope this is the best approach to this.

  I think the problem is the same as described here:
  https://discourse.ubuntubudgie.org/t/20-10-grub-error-can-t-find-
  command-grub-platform/4292. I can see prior to grub menu, briefly, the
  same error: Error can't find grub_platform. After the solution
  described below, this error is not showed and the system is able to
  boot.

  I try making the live usb using startup disk creator and with gnome-
  disks --> Restore disk image and get the same results.

  The live-usb has a gpt partition table instead of mbr like 20.04 live-
  usb has. That implies, I think, that the first one does not boot on
  BIOS systems and the second does.

  I try the same live-usb on an EFI laptop and it boots perfectly
  (perhaps it takes long time, but more less than in this case.

  If I try the solution described here:
  https://bugs.launchpad.net/ubuntu/+source/casper/+bug/1905491/comments/8
  then it works.

  ProblemType: Bug
  DistroRelease: Ubuntu 21.04
  Package: casper 1.461
  ProcVersionSignature: Ubuntu 5.11.0-13.14-generic 5.11.7
  Uname: Linux 5.11.0-13-generic x86_64
  NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
  ApportVersion: 2.20.11-0ubuntu61
  Architecture: amd64
  CasperMD5CheckResult: pass
  CasperVersion: 1.461
  CurrentDesktop: ubuntu:GNOME
  Date: Fri Apr  2 09:55:24 2021
  LiveMediaBuild: Ubuntu 21.04 "Hirsute Hippo" - Beta amd64 (20210331.1)
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=gl_ES.UTF-8
   SHELL=/bin/bash
  SourcePackage: casper
  UpgradeStatus: No upgrade log present (probably fresh install)

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



More information about the foundations-bugs mailing list