Annotation of /branches/R11-stable/core/grub/grub-2.00-r6.smage2
Parent Directory | Revision Log
Revision 24111 -
(hide annotations)
(download)
Fri Feb 20 09:00:29 2015 UTC (9 years, 3 months ago) by niro
File size: 3522 byte(s)
Fri Feb 20 09:00:29 2015 UTC (9 years, 3 months ago) by niro
File size: 3522 byte(s)
-release branches/R11-stable
1 | niro | 23238 | # $Id$ |
2 | |||
3 | PNAME="grub" | ||
4 | PVER="2.00" | ||
5 | PBUILD="r6" | ||
6 | |||
7 | PCAT="sys-apps" | ||
8 | |||
9 | DESCRIPTION="GNU GRUB2 boot loader." | ||
10 | HOMEPAGE="http://www.gnu.org/software/grub/" | ||
11 | |||
12 | DEPEND=">= sys-apps/mage-release-1 | ||
13 | >= sys-libs/ncurses-5.9 | ||
14 | >= sys-libs/zlib-1.2.5 | ||
15 | >= media-libs/freetype-2.5 | ||
16 | >= app-arch/xz-utils-5 | ||
17 | >= sys-apps/os-prober-1.56 | ||
18 | >= sys-fs/device-mapper-2.02" | ||
19 | |||
20 | SRCFILE="${PNAME}-${PVER}.tar.gz" | ||
21 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
22 | |||
23 | sminclude mtools | ||
24 | |||
25 | # grub.confd revision | ||
26 | CONF_REV=1.4 | ||
27 | |||
28 | SRC_URI=( | ||
29 | gnu://${PNAME}/${SRCFILE} | ||
30 | mirror://${PNAME}/${SRCFILE} | ||
31 | mirror://${PNAME}/${PNAME}-${PVER}-confd.patch | ||
32 | mirror://${PNAME}/${PNAME}-${PVER}-cosmetic.patch | ||
33 | mirror://${PNAME}/${PNAME}-${PVER}-gnulib-gets.patch | ||
34 | mirror://${PNAME}/${PNAME}-${PVER}-freetype25.patch | ||
35 | mirror://${PNAME}/${PNAME}-${PVER}-10_linux-pretty-names-from-etc-os-release.patch | ||
36 | mirror://${PNAME}/grub.confd-${CONF_REV} | ||
37 | ) | ||
38 | |||
39 | UP2DATE="updatecmd_gnu ${PNAME} gz" | ||
40 | |||
41 | # grub doesn't like CFLAG optimation, | ||
42 | # and do you really want that at your bootloader ?? | ||
43 | unset CFLAGS | ||
44 | unset CXXFLAGS | ||
45 | |||
46 | src_prepare() | ||
47 | { | ||
48 | munpack ${SRCFILE} || die | ||
49 | cd ${SRCDIR} | ||
50 | |||
51 | # use /etc/conf.d/grub instead of /etc/default/grub | ||
52 | mpatch ${PNAME}-${PVER}-confd.patch || die | ||
53 | # cosmetic fixes | ||
54 | mpatch ${PNAME}-${PVER}-cosmetic.patch || die | ||
55 | # fix ftbfs with newer glibc (>= 2.16) | ||
56 | mpatch ${PNAME}-${PVER}-gnulib-gets.patch || die | ||
57 | # fix ftbfs with newer freetype (>= 2.5) | ||
58 | mpatch ${PNAME}-${PVER}-freetype25.patch || die | ||
59 | # generate pretty names from os-release if GRUB_DISTRIBUTOR is not set | ||
60 | mpatch ${PNAME}-${PVER}-10_linux-pretty-names-from-etc-os-release.patch || die | ||
61 | } | ||
62 | |||
63 | src_compile() | ||
64 | { | ||
65 | cd ${SRCDIR} | ||
66 | |||
67 | mconfigure --disable-efiemu --disable-werror || die | ||
68 | mmake || die | ||
69 | } | ||
70 | |||
71 | src_install() | ||
72 | { | ||
73 | cd ${SRCDIR} | ||
74 | |||
75 | mmake DESTDIR=${BINDIR} install || die | ||
76 | |||
77 | # not required by pretty name patch anymore | ||
78 | # set distribution | ||
79 | #echo 'GRUB_DISTRIBUTOR="Magellan-Linux"' >> ${BINDIR}/usr/share/grub/grub-mkconfig_lib || die | ||
80 | |||
81 | # setup a proper grub default conf | ||
82 | minstallconf grub.confd-${CONF_REV} grub || die | ||
83 | |||
84 | # enable a splash screen by default | ||
85 | sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT=/s:\"\(.*\)\":\"\1 splash\":' ${BINDIR}/etc/conf.d/grub || die | ||
86 | |||
87 | # needed dir | ||
88 | minstalldir /boot/grub || die | ||
89 | |||
90 | # remove debugging related files | ||
91 | mdelete /usr/$(mlibdir)/grub/i386-pc/\*.module || die | ||
92 | mdelete /usr/$(mlibdir)/grub/i386-pc/\*.image || die | ||
93 | mdelete /usr/$(mlibdir)/grub/i386-pc/kernel.exec || die | ||
94 | mdelete /usr/$(mlibdir)/grub/i386-pc/gdb_grub || die | ||
95 | mdelete /usr/$(mlibdir)/grub/i386-pc/gmodule.pl || die | ||
96 | |||
97 | # docs | ||
98 | minstalldocs AUTHORS ChangeLog COPYING NEWS README THANKS TODO || die | ||
99 | } | ||
100 | |||
101 | preinstall() | ||
102 | { | ||
103 | mount /boot &> /dev/null | ||
104 | } | ||
105 | |||
106 | postinstall() | ||
107 | { | ||
108 | [ ! -d ${MROOT}/boot/grub ] && install -d ${MROOT}/boot/grub | ||
109 | |||
110 | # creates some essential links | ||
111 | [ ! -e ${MROOT}/boot/boot ] && ln -sf . ${MROOT}/boot/boot | ||
112 | |||
113 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && [[ ${MAGE_BOOTSTRAP} != true ]] | ||
114 | then | ||
115 | # create a device.map | ||
116 | if [[ ! -f /boot/grub/device.map ]] | ||
117 | then | ||
118 | grub-mkdevicemap | ||
119 | fi | ||
120 | |||
121 | # needed by grub-mkconfig on the first run | ||
122 | if [[ ! -f /boot/grub/video.lst ]] | ||
123 | then | ||
124 | install -m0644 /$(mlibdir)/grub/*/video.lst /boot/grub/video.lst | ||
125 | fi | ||
126 | |||
127 | # update grub.cfg | ||
128 | LC_ALL=C grub-mkconfig -o /boot/grub/grub.cfg | ||
129 | |||
130 | # install bootloader to disk | ||
131 | #local bootpartition="$(df -h /boot |(read; awk '{print $1; exit}'))" | ||
132 | local bootdisk | ||
133 | bootdisk="$(grub-probe --target=drive /boot | sed 's:(\(.*\),.*):(\1):')" | ||
134 | |||
135 | # Generate core.img, but don't let it be installed in boot sector | ||
136 | grub-install --no-floppy "${bootdisk}" | ||
137 | fi | ||
138 | } |