Annotation of /branches/magellan-next/core/grub/grub-0.97-r17.smage2
Parent Directory | Revision Log
Revision 6062 -
(hide annotations)
(download)
Wed Aug 18 19:02:05 2010 UTC (13 years, 8 months ago) by niro
File size: 5002 byte(s)
Wed Aug 18 19:02:05 2010 UTC (13 years, 8 months ago) by niro
File size: 5002 byte(s)
auto added: ver bump to 0.97-r17
1 | niro | 6062 | # $Id: grub-0.97-r16.smage2 5463 2010-06-25 10:59:38Z niro $ |
2 | |||
3 | PNAME="grub" | ||
4 | PVER="0.97" | ||
5 | PBUILD="r17" | ||
6 | |||
7 | PCATEGORIE="sys-apps" | ||
8 | STATE="unstable" | ||
9 | |||
10 | DESCRIPTION="GNU GRUB boot loader." | ||
11 | HOMEPAGE="http://www.gnu.org/software/grub/" | ||
12 | |||
13 | DEPEND=">= sys-libs/ncurses-5.7" | ||
14 | |||
15 | SDEPEND=">= sys-dev/automake-4 | ||
16 | >= sys-dev/autoconf-5" | ||
17 | |||
18 | SRCFILE="${PNAME}-${PVER}.tar.gz" | ||
19 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
20 | |||
21 | sminclude mtools | ||
22 | |||
23 | SRC_URI=( | ||
24 | ftp://alpha.gnu.org/gnu/${PNAME}/${SRCFILE} | ||
25 | mirror://${PNAME}/${SRCFILE} | ||
26 | mirror://${PNAME}/${PNAME}-${PVER}-splash.patch | ||
27 | mirror://${PNAME}/${PNAME}-${PVER}-pic.patch | ||
28 | mirror://${PNAME}/${PNAME}-${PVER}-initrdmax.patch | ||
29 | mirror://${PNAME}/${PNAME}-${PVER}-nxstack.patch | ||
30 | mirror://${PNAME}/${PNAME}-${PVER}-unsigned-addresses.patch | ||
31 | mirror://${PNAME}/${PNAME}-${PVER}-ext4-4.patch | ||
32 | mirror://${PNAME}/${PNAME}-${PVER}-virtio-blk-support-2.patch | ||
33 | mirror://${PNAME}/${PNAME}-${PVER}-gpt.patch | ||
34 | mirror://${PNAME}/${PNAME}-${PVER}-i2o.patch | ||
35 | mirror://${PNAME}/${PNAME}-${PVER}-intelmac.patch | ||
36 | mirror://${PNAME}/${PNAME}-${PVER}-more-raid.patch | ||
37 | mirror://${PNAME}/${PNAME}-${PVER}-special-devices.patch | ||
38 | mirror://${PNAME}/${PNAME}-${PVER}-inode-size.patch | ||
39 | ) | ||
40 | |||
41 | # get only 0.xx versions! | ||
42 | UP2DATE="updatecmd ftp://alpha.gnu.org/gnu/${PNAME} | grep -- -0.[0-9].* | lasttarball gz" | ||
43 | |||
44 | # grub doesn't like CFLAG optimation, | ||
45 | # and do you really want that at your bootloader ?? | ||
46 | unset CFLAGS | ||
47 | unset CXXFLAGS | ||
48 | |||
49 | src_prepare() | ||
50 | { | ||
51 | munpack ${SRCFILE} || die | ||
52 | cd ${SRCDIR} | ||
53 | |||
54 | # splash support | ||
55 | mpatch ${PNAME}-${PVER}-splash.patch || die | ||
56 | |||
57 | # fix pic issues | ||
58 | mpatch ${PNAME}-${PVER}-pic.patch || die | ||
59 | |||
60 | # do not check initrdmax -> we are using more than 4mb | ||
61 | mpatch ${PNAME}-${PVER}-initrdmax.patch || die | ||
62 | |||
63 | # fix nx issues on x86_64 | ||
64 | mpatch ${PNAME}-${PVER}-nxstack.patch || die | ||
65 | |||
66 | # fix issues on systems with more than 2gb of ram | ||
67 | mpatch ${PNAME}-${PVER}-unsigned-addresses.patch || die | ||
68 | |||
69 | # support booting from ext4 filesystems | ||
70 | mpatch ${PNAME}-${PVER}-ext4-4.patch || die | ||
71 | |||
72 | # handle virtio_blk device names in grub-install | ||
73 | mpatch ${PNAME}-${PVER}-virtio-blk-support-2.patch || die | ||
74 | |||
75 | # support gpt partition tables | ||
76 | mpatch ${PNAME}-${PVER}-gpt.patch || die | ||
77 | |||
78 | # support I2O disks | ||
79 | mpatch ${PNAME}-${PVER}-i2o.patch || die | ||
80 | |||
81 | # support Intel Macs (gateA20) | ||
82 | mpatch ${PNAME}-${PVER}-intelmac.patch || die | ||
83 | |||
84 | # support cciss and other raid devices | ||
85 | mpatch ${PNAME}-${PVER}-more-raid.patch || die | ||
86 | |||
87 | # support dev/{ida,cciss,ataraid,rd} devices names | ||
88 | mpatch ${PNAME}-${PVER}-special-devices.patch || die | ||
89 | |||
90 | # support bigger inode sizes (dynamic/V2 inodes) | ||
91 | mpatch ${PNAME}-${PVER}-inode-size.patch || die | ||
92 | |||
93 | # rebuild makefiles | ||
94 | autoreconf --install --force || die | ||
95 | } | ||
96 | |||
97 | src_compile() | ||
98 | { | ||
99 | cd ${SRCDIR} | ||
100 | |||
101 | # fixes compilation on x86_64; grub cannot build natively on 64bit | ||
102 | # building a static grub, with -m32 in this case | ||
103 | if [[ ${ARCH} = x86_64 ]] | ||
104 | then | ||
105 | export CC="gcc -m32" | ||
106 | export LDFLAGS="-static" | ||
107 | fi | ||
108 | |||
109 | # build netboot grub first | ||
110 | mconfigure \ | ||
111 | --enable-diskless \ | ||
112 | --enable-3c503 \ | ||
113 | --enable-3c507 \ | ||
114 | --enable-3c509 \ | ||
115 | --enable-3c529 \ | ||
116 | --enable-3c595 \ | ||
117 | --enable-3c590x \ | ||
118 | --enable-cs89x0 \ | ||
119 | --enable-davicom \ | ||
120 | --enable-depca \ | ||
121 | --enable-eepro \ | ||
122 | --enable-eepro100 \ | ||
123 | --enable-epic100 \ | ||
124 | --enable-exos205 \ | ||
125 | --enable-ni5210 \ | ||
126 | --enable-lance \ | ||
127 | --enable-ne2100 \ | ||
128 | --enable-ni5010 \ | ||
129 | --enable-ni6510 \ | ||
130 | --enable-natsemi \ | ||
131 | --enable-ne \ | ||
132 | --enable-ns8390 \ | ||
133 | --enable-wd \ | ||
134 | --enable-otulip \ | ||
135 | --enable-rtl8139 \ | ||
136 | --enable-sis900 \ | ||
137 | --enable-sk-g16 \ | ||
138 | --enable-smc9000 \ | ||
139 | --enable-tiara \ | ||
140 | --enable-tulip \ | ||
141 | --enable-via-rhine \ | ||
142 | --enable-w89c840\ | ||
143 | || die | ||
144 | |||
145 | mmake w89c840_o_CFLAGS="-O" || die | ||
146 | mv stage2/nbgrub ${SRCDIR}/ || die | ||
147 | mv stage2/pxegrub ${SRCDIR}/ || die | ||
148 | mv stage2/stage2 stage2/stage2.netboot || die | ||
149 | |||
150 | # clean up sources | ||
151 | make clean || die | ||
152 | |||
153 | # build the normal grub | ||
154 | mconfigure || die | ||
155 | mmake || die | ||
156 | } | ||
157 | |||
158 | src_install() | ||
159 | { | ||
160 | cd ${SRCDIR} | ||
161 | |||
162 | # needed directories | ||
163 | minstalldir /boot/grub || die | ||
164 | |||
165 | mmake DESTDIR=${BINDIR} install || die | ||
166 | |||
167 | # install netboot grub | ||
168 | minstallexec nbgrub /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die | ||
169 | minstallexec pxegrub /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die | ||
170 | minstallexec stage2/stage2.netboot /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die | ||
171 | |||
172 | # now copying all stage files | ||
173 | for i in ${BINDIR}/usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/* | ||
174 | do | ||
175 | [ -f ${i} ] && cp -p ${i} ${BINDIR}/boot/grub || die ${i} | ||
176 | done | ||
177 | } | ||
178 | |||
179 | preinstall() | ||
180 | { | ||
181 | mount /boot &> /dev/null | ||
182 | } | ||
183 | |||
184 | postinstall() | ||
185 | { | ||
186 | # creates some essential links | ||
187 | if [ ! -e ${MROOT}/boot/boot ] | ||
188 | then | ||
189 | ln -sf . ${MROOT}/boot/boot | ||
190 | fi | ||
191 | |||
192 | if [ ! -e ${MROOT}/boot/grub/menu.lst ] | ||
193 | then | ||
194 | ln -sf /boot/grub/grub.conf ${MROOT}/boot/grub/menu.lst | ||
195 | fi | ||
196 | |||
197 | # creates example grub.conf | ||
198 | if [ ! -e ${MROOT}/boot/grub/grub.conf.example ] | ||
199 | then | ||
200 | cat > ${MROOT}/boot/grub/grub.conf.example << "EOF" | ||
201 | default 0 | ||
202 | timeout 30 | ||
203 | |||
204 | title Magellan-Linux | ||
205 | root (hd0,0) | ||
206 | kernel (hd0,0)/boot/bzImage root=/dev/hda1 | ||
207 | EOF | ||
208 | fi | ||
209 | |||
210 | # update grub | ||
211 | grub --batch --device-map=/boot/grub/device.map </boot/grub/grub.conf >&/dev/null; | ||
212 | } |