Annotation of /branches/magellan-next/core/grub/grub-1.99-r2.smage2
Parent Directory | Revision Log
Revision 8091 -
(hide annotations)
(download)
Mon Jul 4 15:42:50 2011 UTC (12 years, 10 months ago) by niro
File size: 3971 byte(s)
Mon Jul 4 15:42:50 2011 UTC (12 years, 10 months ago) by niro
File size: 3971 byte(s)
auto added: ver bump to 1.99-r2
1 | niro | 8091 | # $Id$ |
2 | |||
3 | PNAME="grub" | ||
4 | PVER="1.99" | ||
5 | PBUILD="r2" | ||
6 | |||
7 | PCATEGORIE="sys-apps" | ||
8 | |||
9 | DESCRIPTION="GNU GRUB2 boot loader." | ||
10 | HOMEPAGE="http://www.gnu.org/software/grub/" | ||
11 | |||
12 | DEPEND=">= sys-libs/ncurses-5.9 | ||
13 | >= sys-libs/zlib-1.2.5 | ||
14 | >= media-libs/freetype-2.4 | ||
15 | >= app-arch/xz-utils-5" | ||
16 | |||
17 | SRCFILE="${PNAME}-${PVER}.tar.gz" | ||
18 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
19 | |||
20 | sminclude mtools | ||
21 | |||
22 | SRC_URI=( | ||
23 | gnu://${PNAME}/${SRCFILE} | ||
24 | mirror://${PNAME}/${SRCFILE} | ||
25 | mirror://${PNAME}/${PNAME}-${PVER}-confd.patch | ||
26 | ) | ||
27 | |||
28 | UP2DATE="updatecmd_gnu ${PNAME} gz" | ||
29 | |||
30 | # grub doesn't like CFLAG optimation, | ||
31 | # and do you really want that at your bootloader ?? | ||
32 | unset CFLAGS | ||
33 | unset CXXFLAGS | ||
34 | |||
35 | src_prepare() | ||
36 | { | ||
37 | munpack ${SRCFILE} || die | ||
38 | cd ${SRCDIR} | ||
39 | |||
40 | # use /etc/conf.d/grub instead of /etc/default/grub | ||
41 | mpatch ${PNAME}-${PVER}-confd.patch || die | ||
42 | } | ||
43 | |||
44 | src_compile() | ||
45 | { | ||
46 | cd ${SRCDIR} | ||
47 | |||
48 | mconfigure \ | ||
49 | --sbindir=/sbin \ | ||
50 | --bindir=/bin \ | ||
51 | --libdir=/$(mlibdir) \ | ||
52 | --disable-efiemu \ | ||
53 | --disable-werror \ | ||
54 | || die | ||
55 | |||
56 | mmake || die | ||
57 | } | ||
58 | |||
59 | src_install() | ||
60 | { | ||
61 | cd ${SRCDIR} | ||
62 | |||
63 | mmake DESTDIR=${BINDIR} install || die | ||
64 | |||
65 | # fix a missing symlink | ||
66 | mlink /bin/grub-mkimage /sbin || die | ||
67 | |||
68 | # setup a proper grub default conf | ||
69 | minstalldir /etc/conf.d || die | ||
70 | cat > ${BINDIR}/etc/conf.d/grub << EOF | ||
71 | GRUB_DEFAULT=0 | ||
72 | GRUB_TIMEOUT=5 | ||
73 | GRUB_DISTRIBUTOR="Magellan-Linux" | ||
74 | GRUB_CMDLINE_LINUX_DEFAULT="quiet" | ||
75 | GRUB_CMDLINE_LINUX="" | ||
76 | |||
77 | # Preload both GPT and MBR modules so that they are not missed | ||
78 | GRUB_PRELOAD_MODULES="part_gpt part_msdos" | ||
79 | |||
80 | # Uncomment to enable Hidden Menu, and optionally hide the timeout count | ||
81 | #GRUB_HIDDEN_TIMEOUT=5 | ||
82 | #GRUB_HIDDEN_TIMEOUT_QUIET=true | ||
83 | |||
84 | # Uncomment to use basic console | ||
85 | GRUB_TERMINAL_INPUT=console | ||
86 | |||
87 | # Uncomment to disable graphical terminal | ||
88 | #GRUB_TERMINAL_OUTPUT=console | ||
89 | |||
90 | # The resolution used on graphical terminal | ||
91 | # note that you can use only modes which your graphic card supports via VBE | ||
92 | # you can see them in real GRUB with the command `vbeinfo' | ||
93 | GRUB_GFXMODE=auto | ||
94 | |||
95 | # Uncomment to allow the kernel use the same resolution used by grub | ||
96 | GRUB_GFXPAYLOAD_LINUX=keep | ||
97 | |||
98 | # Uncomment if you want GRUB to pass to the Linux kernel the old parameter | ||
99 | # format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" | ||
100 | #GRUB_DISABLE_LINUX_UUID=true | ||
101 | |||
102 | # Uncomment to disable generation of recovery mode menu entries | ||
103 | GRUB_DISABLE_RECOVERY=true | ||
104 | |||
105 | # Uncomment and set to the desired menu colors. Used by normal and wallpaper | ||
106 | # modes only. Entries specified as foreground/background. | ||
107 | GRUB_COLOR_NORMAL="light-blue/black" | ||
108 | GRUB_COLOR_HIGHLIGHT="light-cyan/blue" | ||
109 | |||
110 | # Uncomment one of them for the gfx desired, a image background or a gfxtheme | ||
111 | #GRUB_BACKGROUND="/path/to/wallpaper" | ||
112 | #GRUB_THEME="/path/to/gfxtheme" | ||
113 | |||
114 | # Uncomment to get a beep at GRUB start | ||
115 | #GRUB_INIT_TUNE="480 440 1" | ||
116 | EOF | ||
117 | |||
118 | minstalldir /boot/grub || die | ||
119 | |||
120 | # docs | ||
121 | minstalldocs AUTHORS ChangeLog COPYING NEWS README THANKS TODO || die | ||
122 | } | ||
123 | |||
124 | preinstall() | ||
125 | { | ||
126 | mount /boot &> /dev/null | ||
127 | } | ||
128 | |||
129 | postinstall() | ||
130 | { | ||
131 | [ ! -d ${MROOT}/boot/grub ] && install -d ${MROOT}/boot/grub | ||
132 | |||
133 | # creates some essential links | ||
134 | [ ! -e ${MROOT}/boot/boot ] && ln -sf . ${MROOT}/boot/boot | ||
135 | |||
136 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && [[ ${MAGE_BOOTSTRAP} != true ]] | ||
137 | then | ||
138 | # create a device.map | ||
139 | if [[ ! -f /boot/grub/device.map ]] | ||
140 | then | ||
141 | grub-mkdevicemap | ||
142 | fi | ||
143 | |||
144 | # needed by grub-mkconfig on the first run | ||
145 | if [[ ! -f /boot/grub/video.lst ]] | ||
146 | then | ||
147 | install -m0644 /$(mlibdir)/grub/*/video.lst /boot/grub/video.lst | ||
148 | fi | ||
149 | |||
150 | # update grub.cfg | ||
151 | grub-mkconfig -o /boot/grub/grub.cfg | ||
152 | |||
153 | # install bootloader to disk | ||
154 | #local bootpartition="$(df -h /boot |(read; awk '{print $1; exit}'))" | ||
155 | local bootdisk | ||
156 | bootdisk="$(grub-probe --target=drive /boot | sed 's:(\(.*\),.*):(\1):')" | ||
157 | |||
158 | # Generate core.img, but don't let it be installed in boot sector | ||
159 | grub-install --no-floppy "${bootdisk}" | ||
160 | fi | ||
161 | |||
162 | echo | ||
163 | echo "Begining with GRUB2 the location of the config file has changed." | ||
164 | echo "You will find it at /boot/grub/grub.cfg" | ||
165 | echo "Also be aware of the changed commands." | ||
166 | echo "'kernel' isn't used anymore but 'linux'." | ||
167 | echo | ||
168 | } |