Magellan Linux

Contents of /smage/branches/alx-0_6_0/core/grub/grub-0.97-r18.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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