Magellan Linux

Contents of /branches/magellan-next/core/grub/grub-1.99-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8096 - (show annotations) (download)
Mon Jul 4 16:41:24 2011 UTC (12 years, 10 months ago) by niro
File size: 2732 byte(s)
-export LC_ALL=C to fix some utf8 issues
1 # $Id$
2
3 PNAME="grub"
4 PVER="1.99"
5 PBUILD="r2"
6
7 PCATEGORIE="sys-apps"
8
9 DESCRIPTION="GNU GRUB2 boot loader."
10 HOMEPAGE="http://www.gnu.org/software/grub/"
11
12 DEPEND=">= sys-libs/ncurses-5.9
13 >= sys-libs/zlib-1.2.5
14 >= media-libs/freetype-2.4
15 >= app-arch/xz-utils-5"
16
17 SRCFILE="${PNAME}-${PVER}.tar.gz"
18 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
19
20 sminclude mtools
21
22 SRC_URI=(
23 gnu://${PNAME}/${SRCFILE}
24 mirror://${PNAME}/${SRCFILE}
25 mirror://${PNAME}/${PNAME}-${PVER}-confd.patch
26 mirror://${PNAME}/${PNAME}-${PVER}-cosmetic.patch
27 mirror://${PNAME}/grub.confd
28 )
29
30 UP2DATE="updatecmd_gnu ${PNAME} gz"
31
32 # grub doesn't like CFLAG optimation,
33 # and do you really want that at your bootloader ??
34 unset CFLAGS
35 unset CXXFLAGS
36
37 src_prepare()
38 {
39 munpack ${SRCFILE} || die
40 cd ${SRCDIR}
41
42 # use /etc/conf.d/grub instead of /etc/default/grub
43 mpatch ${PNAME}-${PVER}-confd.patch || die
44 # cometic fixes
45 mpatch ${PNAME}-${PVER}-cosmetic.patch || die
46 }
47
48 src_compile()
49 {
50 cd ${SRCDIR}
51
52 mconfigure \
53 --sbindir=/sbin \
54 --bindir=/bin \
55 --libdir=/$(mlibdir) \
56 --disable-efiemu \
57 --disable-werror \
58 || die
59
60 mmake || die
61 }
62
63 src_install()
64 {
65 cd ${SRCDIR}
66
67 mmake DESTDIR=${BINDIR} install || die
68
69 # fix a missing symlink
70 mlink /bin/grub-mkimage /sbin || die
71
72 # set distribution
73 echo 'GRUB_DISTRIBUTOR="Magellan-Linux"' >> ${BINDIR}/$(mlibdir)/grub/grub-mkconfig_lib || die
74
75 # setup a proper grub default conf
76 minstallconf grub.confd grub || die
77
78 # needed dir
79 minstalldir /boot/grub || die
80
81 # docs
82 minstalldocs AUTHORS ChangeLog COPYING NEWS README THANKS TODO || die
83 }
84
85 preinstall()
86 {
87 mount /boot &> /dev/null
88 }
89
90 postinstall()
91 {
92 [ ! -d ${MROOT}/boot/grub ] && install -d ${MROOT}/boot/grub
93
94 # creates some essential links
95 [ ! -e ${MROOT}/boot/boot ] && ln -sf . ${MROOT}/boot/boot
96
97 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && [[ ${MAGE_BOOTSTRAP} != true ]]
98 then
99 # create a device.map
100 if [[ ! -f /boot/grub/device.map ]]
101 then
102 grub-mkdevicemap
103 fi
104
105 # needed by grub-mkconfig on the first run
106 if [[ ! -f /boot/grub/video.lst ]]
107 then
108 install -m0644 /$(mlibdir)/grub/*/video.lst /boot/grub/video.lst
109 fi
110
111 # update grub.cfg
112 LC_ALL=C grub-mkconfig -o /boot/grub/grub.cfg
113
114 # install bootloader to disk
115 #local bootpartition="$(df -h /boot |(read; awk '{print $1; exit}'))"
116 local bootdisk
117 bootdisk="$(grub-probe --target=drive /boot | sed 's:(\(.*\),.*):(\1):')"
118
119 # Generate core.img, but don't let it be installed in boot sector
120 grub-install --no-floppy "${bootdisk}"
121 fi
122
123 echo
124 echo "Begining with GRUB2 the location of the config file has changed."
125 echo "You will find it at /boot/grub/grub.cfg"
126 echo "Also be aware of the changed commands."
127 echo "'kernel' isn't used anymore but 'linux'."
128 echo
129 }