datasone / grub-mod-setup_var

A modified grub allowing tweaking hidden BIOS settings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when using make

Backpackstudio opened this issue · comments

I get an error when using make

util/getroot.c: In function 'grub_util_biosdisk_is_floppy':
util/getroot.c:1718:13: error: In the GNU C Library, "major" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>. [-Werror]
   if (major(st.st_rdev) == FLOPPY_MAJOR)
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                                                                                            
cc1: all warnings being treated as errors
Makefile:22956: recipe for target 'util/libgrubkern_a-getroot.o' failed
make[2]: *** [util/libgrubkern_a-getroot.o] Error 1
make[2]: Leaving directory '/home/**/Downloads/grub/grubx'
Makefile:25885: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/**/Downloads/grub/grubx'
Makefile:21133: recipe for target 'all' failed
make: *** [all] Error 2

The repository is based on a very old version of grub, which may result in many errors in a new building environment.
As said in the error message, you may try including sys/sysmacros.h in util/getroot.c. But I recommend using an old environment (I used Ubuntu 16.04 + gcc 4.8) to build it to prevent any other problems. If you don't want to bother installing it on physical machine, virtual machine or docker is a good idea.

Thank you!

Makes sense!