1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 # T2 SDE: package/*/grub2/grub2.conf
5 # Copyright (C) 2004 - 2021 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 # TODO: ppc64le currently does not support any 32-bit/big-endian
17 if [ "$SDECFG_POWERPC64_ENDIANESS" = "le" ]; then
22 mkdir -p $root/boot/grub
23 cp docs/grub.cfg $root/boot/grub/grub.cfg.example
26 atstage toolchain && var_remove_regex confopt " " "--target=.*"
27 hook_add preconf 5 "./autogen.sh" # for apple efi magic
28 hook_add preconf 7 "cp -vf `match_source_file -p unifont` unifont.ttf"
30 hook_add postmake 5 "grub_postmake"
32 var_append confopt ' ' '--enable-device-mapper'
34 var_remove GCC_WRAPPER_APPEND " " "-s"
35 var_append GCC_WRAPPER_REMOVE " " "-Werror" # for clang
38 sparc*) export ac_cv_prog_TARGET_OBJCOPY=$OBJCOPY ;;
39 powerpc*) var_append GCC_WRAPPER_APPEND " " "-mno-altivec" ;;
40 x86*) # 386-pc 1st: Decompressor is too big, keep in sync below!
41 var_append GCC_WRAPPER_INSERT " " "-Os -Wa,-mx86-used-note=no"
42 var_append GCC_WRAPPER_APPEND " " "-mno-avx -mno-avx2"
47 var_remove_regex makeopt ' ' 'CPP=.*'
49 function pkg_grub_rebuild() {
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"
57 eval_config_command $confopt $extraconfopt
59 eval $MAKE $makeinstopt
61 [[ "$arch" = x86* ]] && ! atstage toolchain && hook_add postmake 7 pkg_grub_rebuild
63 var_append INSTALL_WRAPPER_FILTER '|' 'sed -e s,info/grub.info,info/grub2.info, \
64 -e s,man8/grub-install.8,man8/grub2-install.8, \
65 -e s,bin/grub-install,bin/grub2-install, -e s,bin/grub-set-default,bin/grub2-set-default,'