Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11376 - (show annotations) (download)
Mon Mar 5 12:50:54 2012 UTC (12 years, 3 months ago) by niro
File size: 2695 byte(s)
auto added: ver bump to 1.99-r4
1 # $Id$
2
3 PNAME="grub"
4 PVER="1.99"
5 PBUILD="r4"
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.3
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 \
56 --sbindir=/sbin \
57 --bindir=/bin \
58 --libdir=/$(mlibdir) \
59 --disable-efiemu \
60 --disable-werror \
61 || die
62
63 mmake || die
64 }
65
66 src_install()
67 {
68 cd ${SRCDIR}
69
70 mmake DESTDIR=${BINDIR} install || die
71
72 # fix a missing symlink
73 mlink /bin/grub-mkimage /sbin || die
74
75 # set distribution
76 echo 'GRUB_DISTRIBUTOR="Magellan-Linux"' >> ${BINDIR}/$(mlibdir)/grub/grub-mkconfig_lib || die
77
78 # setup a proper grub default conf
79 minstallconf grub.confd-${CONF_REV} grub || die
80
81 # enable a splash screen by default
82 sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT=/s:\"\(.*\)\":\"\1 splash\":' ${BINDIR}/etc/conf.d/grub || die
83
84 # needed dir
85 minstalldir /boot/grub || die
86
87 # docs
88 minstalldocs AUTHORS ChangeLog COPYING NEWS README THANKS TODO || die
89 }
90
91 preinstall()
92 {
93 mount /boot &> /dev/null
94 }
95
96 postinstall()
97 {
98 [ ! -d ${MROOT}/boot/grub ] && install -d ${MROOT}/boot/grub
99
100 # creates some essential links
101 [ ! -e ${MROOT}/boot/boot ] && ln -sf . ${MROOT}/boot/boot
102
103 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && [[ ${MAGE_BOOTSTRAP} != true ]]
104 then
105 # create a device.map
106 if [[ ! -f /boot/grub/device.map ]]
107 then
108 grub-mkdevicemap
109 fi
110
111 # needed by grub-mkconfig on the first run
112 if [[ ! -f /boot/grub/video.lst ]]
113 then
114 install -m0644 /$(mlibdir)/grub/*/video.lst /boot/grub/video.lst
115 fi
116
117 # update grub.cfg
118 LC_ALL=C grub-mkconfig -o /boot/grub/grub.cfg
119
120 # install bootloader to disk
121 #local bootpartition="$(df -h /boot |(read; awk '{print $1; exit}'))"
122 local bootdisk
123 bootdisk="$(grub-probe --target=drive /boot | sed 's:(\(.*\),.*):(\1):')"
124
125 # Generate core.img, but don't let it be installed in boot sector
126 grub-install --no-floppy "${bootdisk}"
127 fi
128 }