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