Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7851 - (show annotations) (download)
Wed Jun 1 22:09:56 2011 UTC (12 years, 11 months ago) by niro
File size: 5519 byte(s)
-disabled netboot atm
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}-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 local archhost
177 case ${ARCH} in
178 i486) archhost="${CHOST/-linux-gnu/}"
179 archhost="${archhost/i486/i386}"
180 ;;
181 *) archhost="${CHOST/-linux-gnu/}" ;;
182 esac
183
184 # # install netboot grub
185 # minstallexec nbgrub /usr/$(mlibdir)/grub/${archhost}/ || die
186 # minstallexec pxegrub /usr/$(mlibdir)/grub/${archhost}/ || die
187 # minstallexec stage2/stage2.netboot /usr/$(mlibdir)/grub/${archhost}/ || die
188
189 # now copying all stage files
190 for i in ${BINDIR}/usr/$(mlibdir)/grub/${archhost}/*
191 do
192 [ -f ${i} ] && cp -p ${i} ${BINDIR}/boot/grub || die ${i}
193 done
194 }
195
196 preinstall()
197 {
198 mount /boot &> /dev/null
199 }
200
201 postinstall()
202 {
203 # creates some essential links
204 if [ ! -e ${MROOT}/boot/boot ]
205 then
206 ln -sf . ${MROOT}/boot/boot
207 fi
208
209 if [ ! -e ${MROOT}/boot/grub/menu.lst ]
210 then
211 ln -sf /boot/grub/grub.conf ${MROOT}/boot/grub/menu.lst
212 fi
213
214 # creates example grub.conf
215 if [ ! -e ${MROOT}/boot/grub/grub.conf.example ]
216 then
217 cat > ${MROOT}/boot/grub/grub.conf.example << "EOF"
218 default 0
219 timeout 30
220
221 title Magellan-Linux
222 root (hd0,0)
223 kernel (hd0,0)/boot/bzImage root=/dev/hda1
224 EOF
225 fi
226
227 # update grub
228 grub --batch --device-map=/boot/grub/device.map </boot/grub/grub.conf >&/dev/null;
229 }