1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/grub2/grub2.conf
3 # Copyright (C) 2004 - 2024 The T2 SDE Project
4 # Copyright (C) 1998 - 2003 ROCK Linux Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 # *** No rule to make target '../grub-core/extra_deps.lst', needed by 'syminfo.lst'.
14 hook_add premake 5 "touch grub-core/extra_deps.lst"
17 mkdir -p $root/boot/grub
18 cp docs/grub.cfg $root/boot/grub/grub.cfg.example
20 hook_add postmake 5 "grub_postmake"
22 atstage toolchain && var_remove_regex confopt " " "--target=.*"
23 hook_add preconf 5 "./autogen.sh" # for apple efi magic, ieee1275_fb, luks2-argon2, riscv64
24 hook_add preconf 7 "cp -vf `match_source_file -p unifont` unifont.ttf"
26 var_append confopt ' ' '--enable-device-mapper'
27 var_append confopt ' ' '--disable-libzfs'
29 var_remove GCC_WRAPPER_APPEND " " "-c?:-s"
30 var_append GCC_WRAPPER_REMOVE " " "-Werror" # for clang
33 arm) var_append confopt ' ' '--with-platform=efi' ;;
34 sparc*) export ac_cv_prog_TARGET_OBJCOPY=$OBJCOPY ;;
35 powerpc*) var_append GCC_WRAPPER_APPEND " " "-mno-altivec" ;;
36 x86*) # 386-pc 1st: Decompressor is too big, keep in sync below!
37 [ "$SDECFG_DEFAULT_CC" = gcc ] &&
38 var_append GCC_WRAPPER_INSERT " " "-Wa,-mx86-used-note=no"
39 var_append GCC_WRAPPER_INSERT " " "-Os"
40 var_append GCC_WRAPPER_APPEND " " "-mno-avx -mno-avx2"
41 # TODO: fix grub's Makefile to always add -m32?
42 [ "$SDECFG_X8664_X32" = 1 ] && var_append GCC_WRAPPER_INSERT " " "-m32"
47 var_remove_regex makeopt ' ' 'CPP=.*'
50 var_append confopt ' ' '--with-platform=efi'
52 var_remove GCC_WRAPPER_INSERT " " "-Os -Wa,-mx86-used-note=no"
53 # looks like SSE, 2, 3 usually works within EFI?
54 var_append GCC_WRAPPER_REMOVE " " "-mno-sse -mno-sse2 -mno-sse3"
55 var_remove GCC_WRAPPER_INSERT " " "-m32"
58 eval_config_command $confopt $extraconfopt
60 # TODO: build x32 utils
61 [ "$SDECFG_X8664_X32" = 1 ] &&
62 var_append makeopt ' ' 'bin_PROGRAMS= sbin_PROGRAMS=' &&
63 var_append makeinstopt ' ' 'bin_PROGRAMS= sbin_PROGRAMS='
66 eval $MAKE $makeinstopt
68 [[ "$arch" = x86* ]] && ! atstage toolchain && hook_add postmake 7 pkg_grub_rebuild
70 var_append INSTALL_WRAPPER_FILTER '|' 'sed -e s,info/grub.info,info/grub2.info, \
71 -e s,man8/grub-install.8,man8/grub2-install.8, \
72 -e s,bin/grub-install,bin/grub2-install, -e s,bin/grub-set-default,bin/grub2-set-default,'