Magellan Linux

Contents of /trunk/core/grub/grub-1.99-r5.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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