Skip to content
This repository was archived by the owner on Apr 6, 2020. It is now read-only.
This repository was archived by the owner on Apr 6, 2020. It is now read-only.

OSX Install Script - can't build grub #200

@jameslawson

Description

@jameslawson

Hi! 👋 ... The MacOS install script currently did not successfully compile grub on my machine (MacBook Pro (Retina, 15-inch, Mid 2015); macOS Sierra 10.12.6 (16G1618)). Seems like a bug with official grub. Below has details and a fix.

The script shallow clones latest grub from the official repo git://git.savannah.gnu.org/grub.git - unfortunately, the current commit on master (9223eff8f8025511938c7eec908d60bdaa74106a) does not build on Mac OSX (MacOS). After ../configure ... (params omitted) and make, I ran into the following compilation error:

$ make
...
../grub-core/osdep/generic/blocklist.c:62:67: error: use of undeclared identifier 'FILE_TYPE_NO_DECOMPRESS'; did you mean 'GRUB_FILE_TYPE_NO_DECOMPRESS'?
      file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | FILE_TYPE_NO_DECOMPRESS);
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~
                                                                  GRUB_FILE_TYPE_NO_DECOMPRESS
../include/grub/file.h:135:5: note: 'GRUB_FILE_TYPE_NO_DECOMPRESS' declared here
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
    ^
In file included from ../grub-core/osdep/blocklist.c:6:
../grub-core/osdep/generic/blocklist.c:119:63: error: use of undeclared identifier 'FILE_TYPE_NO_DECOMPRESS'; did you mean 'GRUB_FILE_TYPE_NO_DECOMPRESS'?
  file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | FILE_TYPE_NO_DECOMPRESS);
                                                              ^~~~~~~~~~~~~~~~~~~~~~~
                                                              GRUB_FILE_TYPE_NO_DECOMPRESS
../include/grub/file.h:135:5: note: 'GRUB_FILE_TYPE_NO_DECOMPRESS' declared here
    GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000
    ^
2 errors generated.
make[2]: *** [grub-core/osdep/grub_mkrescue-blocklist.o] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2

Looks like there is a fork of grub that fixes this problem: ar-OS/grub@8514607 ...
and indeed, when I used this fork of grub instead of the offcial, grub built on my machine 🎉 :

-git clone --depth 1 git://git.savannah.gnu.org/grub.git
+git clone --depth 1 git@github.com:ar-OS/grub.git

Seems like a helpful fix in the short-term. Possible long-term solutions...

  • find the commit SHA of grub that did previously work in git://git.savannah.gnu.org/grub.git and change the script to check out this commit instead of the latest commit on master (more stable, but will fall behind and not receive updates)
  • post a bug report on grub linking to this commit and ask them to fix the bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions