Magellan Linux

Contents of /trunk/core/grub/grub-2.00-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16965 - (show annotations) (download)
Tue Apr 2 14:00:18 2013 UTC (11 years, 2 months ago) by niro
File size: 2757 byte(s)
-fixed dependencies
1 # $Id$
2
3 PNAME="grub"
4 PVER="2.00"
5 PBUILD="r3"
6
7 PCAT="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 >= sys-apps/os-prober-1.56
17 >= sys-fs/device-mapper-2.02"
18
19 SRCFILE="${PNAME}-${PVER}.tar.gz"
20 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
21
22 sminclude mtools
23
24 # grub.confd revision
25 CONF_REV=1.4
26
27 SRC_URI=(
28 gnu://${PNAME}/${SRCFILE}
29 mirror://${PNAME}/${SRCFILE}
30 mirror://${PNAME}/${PNAME}-${PVER}-confd.patch
31 mirror://${PNAME}/${PNAME}-${PVER}-cosmetic.patch
32 mirror://${PNAME}/${PNAME}-${PVER}-gnulib-gets.patch
33 mirror://${PNAME}/grub.confd-${CONF_REV}
34 )
35
36 UP2DATE="updatecmd_gnu ${PNAME} gz"
37
38 # grub doesn't like CFLAG optimation,
39 # and do you really want that at your bootloader ??
40 unset CFLAGS
41 unset CXXFLAGS
42
43 src_prepare()
44 {
45 munpack ${SRCFILE} || die
46 cd ${SRCDIR}
47
48 # use /etc/conf.d/grub instead of /etc/default/grub
49 mpatch ${PNAME}-${PVER}-confd.patch || die
50 # cosmetic fixes
51 mpatch ${PNAME}-${PVER}-cosmetic.patch || die
52 # fix ftbfs with newer glibc (>= 2.16)
53 mpatch ${PNAME}-${PVER}-gnulib-gets.patch || die
54 }
55
56 src_compile()
57 {
58 cd ${SRCDIR}
59
60 mconfigure --disable-efiemu --disable-werror || die
61 mmake || die
62 }
63
64 src_install()
65 {
66 cd ${SRCDIR}
67
68 mmake DESTDIR=${BINDIR} install || die
69
70 # set distribution
71 echo 'GRUB_DISTRIBUTOR="Magellan-Linux"' >> ${BINDIR}/usr/share/grub/grub-mkconfig_lib || die
72
73 # setup a proper grub default conf
74 minstallconf grub.confd-${CONF_REV} grub || die
75
76 # enable a splash screen by default
77 sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT=/s:\"\(.*\)\":\"\1 splash\":' ${BINDIR}/etc/conf.d/grub || die
78
79 # needed dir
80 minstalldir /boot/grub || die
81
82 # docs
83 minstalldocs AUTHORS ChangeLog COPYING NEWS README THANKS TODO || die
84 }
85
86 preinstall()
87 {
88 mount /boot &> /dev/null
89 }
90
91 postinstall()
92 {
93 [ ! -d ${MROOT}/boot/grub ] && install -d ${MROOT}/boot/grub
94
95 # creates some essential links
96 [ ! -e ${MROOT}/boot/boot ] && ln -sf . ${MROOT}/boot/boot
97
98 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && [[ ${MAGE_BOOTSTRAP} != true ]]
99 then
100 # create a device.map
101 if [[ ! -f /boot/grub/device.map ]]
102 then
103 grub-mkdevicemap
104 fi
105
106 # needed by grub-mkconfig on the first run
107 if [[ ! -f /boot/grub/video.lst ]]
108 then
109 install -m0644 /$(mlibdir)/grub/*/video.lst /boot/grub/video.lst
110 fi
111
112 # update grub.cfg
113 LC_ALL=C grub-mkconfig -o /boot/grub/grub.cfg
114
115 # install bootloader to disk
116 #local bootpartition="$(df -h /boot |(read; awk '{print $1; exit}'))"
117 local bootdisk
118 bootdisk="$(grub-probe --target=drive /boot | sed 's:(\(.*\),.*):(\1):')"
119
120 # Generate core.img, but don't let it be installed in boot sector
121 grub-install --no-floppy "${bootdisk}"
122 fi
123 }