# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/grub2/grub2.conf # Copyright (C) 2004 - 2023 The T2 SDE Project # Copyright (C) 1998 - 2003 ROCK Linux Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # TODO: some arch variants currently only some ISA variant if [ "$SDECFG_ARM_ENDIANESS" = 'eb' ]; then custmain=true else grub_postmake() { mkdir -p $root/boot/grub cp docs/grub.cfg $root/boot/grub/grub.cfg.example } hook_add postmake 5 "grub_postmake" atstage toolchain && var_remove_regex confopt " " "--target=.*" hook_add preconf 5 "./autogen.sh" # for apple efi magic / ieee1275_fb hook_add preconf 7 "cp -vf `match_source_file -p unifont` unifont.ttf" var_append confopt ' ' '--enable-device-mapper' var_remove GCC_WRAPPER_APPEND " " "-s" var_append GCC_WRAPPER_REMOVE " " "-Werror" # for clang case $arch in arm) var_append confopt ' ' '--with-platform=efi' ;; sparc*) export ac_cv_prog_TARGET_OBJCOPY=$OBJCOPY ;; powerpc*) var_append GCC_WRAPPER_APPEND " " "-mno-altivec" ;; x86*) # 386-pc 1st: Decompressor is too big, keep in sync below! var_append GCC_WRAPPER_INSERT " " "-Os -Wa,-mx86-used-note=no" var_append GCC_WRAPPER_APPEND " " "-mno-avx -mno-avx2" ;; esac unset CPP var_remove_regex makeopt ' ' 'CPP=.*' pkg_grub_rebuild() { var_append confopt ' ' '--with-platform=efi' var_remove GCC_WRAPPER_INSERT " " "-Os -Wa,-mx86-used-note=no" # looks like SSE, 2, 3 usually works within EFI? var_append GCC_WRAPPER_REMOVE " " "-mno-sse -mno-sse2 -mno-sse3" eval $MAKE distclean eval_config_command $confopt $extraconfopt eval $MAKE $makeopt eval $MAKE $makeinstopt } [[ "$arch" = x86* ]] && ! atstage toolchain && hook_add postmake 7 pkg_grub_rebuild var_append INSTALL_WRAPPER_FILTER '|' 'sed -e s,info/grub.info,info/grub2.info, \ -e s,man8/grub-install.8,man8/grub2-install.8, \ -e s,bin/grub-install,bin/grub2-install, -e s,bin/grub-set-default,bin/grub2-set-default,' fi