1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../grub/grub.conf
5 # Copyright (C) 2004 - 2016 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 ---
17 local f="`match_source_file -p diff`"
19 $compressor -d < $f | patch -p0
24 mkdir -p $root/boot/grub
26 trg=${arch_target/-linux-*}
29 cp -v $root$libdir/grub/$trg/* $root/boot/grub/
30 cp docs/menu.lst $root/boot/grub/menu.lst.example
33 grub_build_diskless() {
35 var_append confopt ' ' '--enable-diskless --enable-pxe'
37 echo "Driver-map for PXE and Etherboot 2nd stage GRUB images:"
38 echo "======================================================="
40 } > $root/boot/grub/README.pxe_nb
42 # this is to work around very broken Makefiles in due the grub-os patch
43 var_append GCC_WRAPPER_INSERT ' ' ' -DCONGESTED=1 -DCONFIG_PCI -DNE_SCAN=0x280,0x300,0x320,0x340 -DWD_DEFAULT_MEM=0xCC000'
46 echo Running "./configure $confopt --enable-${drivers// / --enable-}"
47 eval "./configure $confopt --enable-${drivers// / --enable-}"
48 echo Running "make -C netboot clean; make"
49 make -C netboot clean; make
50 { echo "pxegrub.$counter and nbgrub.$counter:"
51 echo " $drivers"; echo
52 } >> $root/boot/grub/README.pxe_nb
53 cp stage2/pxegrub $root/boot/grub/pxegrub.$counter
54 cp stage2/nbgrub $root/boot/grub/nbgrub.$counter
57 ./configure --help | grep ' driver$' |
58 cut -f4- -d- | cut -f1 -d' ' | sort -u |
59 paste -d' ' - - - - - - -
63 # for the bootsplash patch
64 [ "$pkg" = "grub" ] && hook_add preconf 3 "autoreconf -fi"
65 hook_add prepatch 5 "grub_prepatch"
66 hook_add postmake 5 "grub_postmake"
67 hook_add postmake 7 "grub_build_diskless"
68 hook_add postmake 9 "cp -fv $base/package/*/grub/t2.xpm.gz $root/boot/"
70 # Every other optimization would cause build errors like
72 # pre_stage2_exec-builtins.o: In function `terminfo_func':
73 # pre_stage2_exec-builtins.o(.text+0x3b0e): undefined reference to `memcpy'
75 GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT/-march=/-mtune=}"
76 var_append GCC_WRAPPER_APPEND " " "-Os -march=i486 -fgnu89-inline"
79 var_append GCC_WRAPPER_APPEND " " "-fno-strict-aliasing -fno-reorder-functions"
81 if [ $arch = x86-64 ]; then
82 libdir=\$root/\$prefix/lib
83 var_insert GCC_WRAPPER_INSERT " " "-m32"
84 arch_target="`echo $arch_target | sed -e 's/[-_]*64//' -e 's/x86/i386/'`"
85 echo_status "Set arch_target to $arch_target"