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

OSX Install Script - can't build grub #200

Open
jameslawson opened this issue Feb 10, 2019 · 1 comment
Open

OSX Install Script - can't build grub #200

jameslawson opened this issue Feb 10, 2019 · 1 comment

Comments

@jameslawson
Copy link
Contributor

jameslawson commented Feb 10, 2019

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 [email protected]: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
@z3ntu
Copy link

z3ntu commented Oct 26, 2019

Upstream commit is http://git.savannah.gnu.org/cgit/grub.git/commit/?id=dabdfa1c6a80639197d05f683a445fa8615517fe btw

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants