Magellan Linux

Contents of /smage/trunk/core/grub/grub-0.97-r18.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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