Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 735 - (hide annotations) (download)
Thu Oct 21 15:29:32 2010 UTC (13 years, 6 months ago) by niro
File size: 5555 byte(s)
-mcore
1 niro 734 # $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 niro 735 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     usr/sbin"
29     sminclude mtools mcore-split
30 niro 734
31     SRC_URI=(
32     ftp://alpha.gnu.org/gnu/${PNAME}/${SRCFILE}
33     mirror://${PNAME}/${SRCFILE}
34     mirror://${PNAME}/${PNAME}-${PVER}-splash.patch
35     mirror://${PNAME}/${PNAME}-${PVER}-pic.patch
36     mirror://${PNAME}/${PNAME}-${PVER}-initrdmax.patch
37     mirror://${PNAME}/${PNAME}-${PVER}-nxstack.patch
38     mirror://${PNAME}/${PNAME}-${PVER}-unsigned-addresses.patch
39     mirror://${PNAME}/${PNAME}-${PVER}-ext4-4.patch
40     mirror://${PNAME}/${PNAME}-${PVER}-virtio-blk-support-2.patch
41     mirror://${PNAME}/${PNAME}-${PVER}-gpt.patch
42     mirror://${PNAME}/${PNAME}-${PVER}-i2o.patch
43     mirror://${PNAME}/${PNAME}-${PVER}-intelmac.patch
44     mirror://${PNAME}/${PNAME}-${PVER}-more-raid.patch
45     mirror://${PNAME}/${PNAME}-${PVER}-special-devices.patch
46     mirror://${PNAME}/${PNAME}-${PVER}-inode-size.patch
47     mirror://${PNAME}/${PNAME}-${PVER}-kvm-vda-2.patch
48     mirror://${PNAME}/${PNAME}-${PVER}-netboot-pic.patch
49     mirror://${PNAME}/${PNAME}-${PVER}-netboot-compile-fixes.patch
50     )
51    
52     # get only 0.xx versions!
53     UP2DATE="updatecmd ftp://alpha.gnu.org/gnu/${PNAME} | grep -- -0.[0-9].* | lasttarball gz"
54    
55     # grub doesn't like CFLAG optimation,
56     # and do you really want that at your bootloader ??
57     unset CFLAGS
58     unset CXXFLAGS
59    
60     src_prepare()
61     {
62     munpack ${SRCFILE} || die
63     cd ${SRCDIR}
64    
65     # splash support
66     mpatch ${PNAME}-${PVER}-splash.patch || die
67    
68     # fix pic issues
69     mpatch ${PNAME}-${PVER}-pic.patch || die
70    
71     # do not check initrdmax -> we are using more than 4mb
72     mpatch ${PNAME}-${PVER}-initrdmax.patch || die
73    
74     # fix nx issues on x86_64
75     mpatch ${PNAME}-${PVER}-nxstack.patch || die
76    
77     # fix issues on systems with more than 2gb of ram
78     mpatch ${PNAME}-${PVER}-unsigned-addresses.patch || die
79    
80     # support booting from ext4 filesystems
81     mpatch ${PNAME}-${PVER}-ext4-4.patch || die
82    
83     # handle virtio_blk device names in grub-install
84     mpatch ${PNAME}-${PVER}-virtio-blk-support-2.patch || die
85    
86     # support gpt partition tables
87     mpatch ${PNAME}-${PVER}-gpt.patch || die
88    
89     # support I2O disks
90     mpatch ${PNAME}-${PVER}-i2o.patch || die
91    
92     # support Intel Macs (gateA20)
93     mpatch ${PNAME}-${PVER}-intelmac.patch || die
94    
95     # support cciss and other raid devices
96     mpatch ${PNAME}-${PVER}-more-raid.patch || die
97    
98     # support dev/{ida,cciss,ataraid,rd} devices names
99     mpatch ${PNAME}-${PVER}-special-devices.patch || die
100    
101     # support bigger inode sizes (dynamic/V2 inodes)
102     mpatch ${PNAME}-${PVER}-inode-size.patch || die
103    
104     # fix pic issues with the net drivers
105     mpatch ${PNAME}-${PVER}-netboot-pic.patch || die
106    
107     # fix compilation issues
108     mpatch ${PNAME}-${PVER}-netboot-compile-fixes.patch || die
109    
110     # rebuild makefiles
111     autoreconf --install --force || die
112     }
113    
114     src_compile()
115     {
116     cd ${SRCDIR}
117    
118     # fixes compilation on x86_64; grub cannot build natively on 64bit
119     # building a static grub, with -m32 in this case
120     if [[ ${ARCH} = x86_64 ]]
121     then
122     export CC="gcc -m32"
123     export LDFLAGS="-static"
124     fi
125    
126     # build netboot grub first
127     mconfigure \
128     --enable-diskless \
129     --enable-3c503 \
130     --enable-3c507 \
131     --enable-3c509 \
132     --enable-3c529 \
133     --enable-3c595 \
134     --enable-3c590x \
135     --enable-cs89x0 \
136     --enable-davicom \
137     --enable-depca \
138     --enable-eepro \
139     --enable-eepro100 \
140     --enable-epic100 \
141     --enable-exos205 \
142     --enable-ni5210 \
143     --enable-lance \
144     --enable-ne2100 \
145     --enable-ni5010 \
146     --enable-ni6510 \
147     --enable-natsemi \
148     --enable-ne \
149     --enable-ns8390 \
150     --enable-wd \
151     --enable-otulip \
152     --enable-rtl8139 \
153     --enable-sis900 \
154     --enable-sk-g16 \
155     --enable-smc9000 \
156     --enable-tiara \
157     --enable-tulip \
158     --enable-via-rhine \
159     --enable-w89c840\
160     || die
161    
162     mmake w89c840_o_CFLAGS="-O" || die
163     mv stage2/nbgrub ${SRCDIR}/ || die
164     mv stage2/pxegrub ${SRCDIR}/ || die
165     mv stage2/stage2 stage2/stage2.netboot || die
166    
167     # clean up sources
168     make clean || die
169    
170     # build the normal grub
171     mconfigure || die
172     mmake || die
173     }
174    
175 niro 735 mcore_generic_src_install()
176 niro 734 {
177     cd ${SRCDIR}
178    
179     # needed directories
180     minstalldir /boot/grub || die
181    
182     mmake DESTDIR=${BINDIR} install || die
183    
184     # install netboot grub
185     minstallexec nbgrub /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die
186     minstallexec pxegrub /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die
187     minstallexec stage2/stage2.netboot /usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/ || die
188    
189     # now copying all stage files
190     for i in ${BINDIR}/usr/$(mlibdir)/grub/${CHOST/-linux-gnu/}/*
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     }