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