Magellan Linux

Contents of /branches/magellan-next/core/grub/grub-0.97-r17.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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