Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 734 - (show annotations) (download)
Thu Oct 21 15:26:36 2010 UTC (13 years, 6 months ago) by niro
File size: 5349 byte(s)
auto added: ver bump to 0.97-r17
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-2.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 pic issues with the net drivers
97 mpatch ${PNAME}-${PVER}-netboot-pic.patch || die
98
99 # fix compilation issues
100 mpatch ${PNAME}-${PVER}-netboot-compile-fixes.patch || die
101
102 # rebuild makefiles
103 autoreconf --install --force || die
104 }
105
106 src_compile()
107 {
108 cd ${SRCDIR}
109
110 # fixes compilation on x86_64; grub cannot build natively on 64bit
111 # building a static grub, with -m32 in this case
112 if [[ ${ARCH} = x86_64 ]]
113 then
114 export CC="gcc -m32"
115 export LDFLAGS="-static"
116 fi
117
118 # build netboot grub first
119 mconfigure \
120 --enable-diskless \
121 --enable-3c503 \
122 --enable-3c507 \
123 --enable-3c509 \
124 --enable-3c529 \
125 --enable-3c595 \
126 --enable-3c590x \
127 --enable-cs89x0 \
128 --enable-davicom \
129 --enable-depca \
130 --enable-eepro \
131 --enable-eepro100 \
132 --enable-epic100 \
133 --enable-exos205 \
134 --enable-ni5210 \
135 --enable-lance \
136 --enable-ne2100 \
137 --enable-ni5010 \
138 --enable-ni6510 \
139 --enable-natsemi \
140 --enable-ne \
141 --enable-ns8390 \
142 --enable-wd \
143 --enable-otulip \
144 --enable-rtl8139 \
145 --enable-sis900 \
146 --enable-sk-g16 \
147 --enable-smc9000 \
148 --enable-tiara \
149 --enable-tulip \
150 --enable-via-rhine \
151 --enable-w89c840\
152 || die
153
154 mmake w89c840_o_CFLAGS="-O" || die
155 mv stage2/nbgrub ${SRCDIR}/ || die
156 mv stage2/pxegrub ${SRCDIR}/ || die
157 mv stage2/stage2 stage2/stage2.netboot || die
158
159 # clean up sources
160 make clean || die
161
162 # build the normal grub
163 mconfigure || die
164 mmake || die
165 }
166
167 src_install()
168 {
169 cd ${SRCDIR}
170
171 # needed directories
172 minstalldir /boot/grub || die
173
174 mmake DESTDIR=${BINDIR} install || die
175
176 # install netboot grub
177 minstallexec nbgrub /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die
178 minstallexec pxegrub /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die
179 minstallexec stage2/stage2.netboot /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die
180
181 # now copying all stage files
182 for i in ${BINDIR}/usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/*
183 do
184 [ -f ${i} ] && cp -p ${i} ${BINDIR}/boot/grub || die ${i}
185 done
186 }
187
188 preinstall()
189 {
190 mount /boot &> /dev/null
191 }
192
193 postinstall()
194 {
195 # creates some essential links
196 if [ ! -e ${MROOT}/boot/boot ]
197 then
198 ln -sf . ${MROOT}/boot/boot
199 fi
200
201 if [ ! -e ${MROOT}/boot/grub/menu.lst ]
202 then
203 ln -sf /boot/grub/grub.conf ${MROOT}/boot/grub/menu.lst
204 fi
205
206 # creates example grub.conf
207 if [ ! -e ${MROOT}/boot/grub/grub.conf.example ]
208 then
209 cat > ${MROOT}/boot/grub/grub.conf.example << "EOF"
210 default 0
211 timeout 30
212
213 title Magellan-Linux
214 root (hd0,0)
215 kernel (hd0,0)/boot/bzImage root=/dev/hda1
216 EOF
217 fi
218
219 # update grub
220 grub --batch --device-map=/boot/grub/device.map </boot/grub/grub.conf >&/dev/null;
221 }