Contents of /branches/magellan-next/core/grub/grub-1.99-r2.smage2
Parent Directory | Revision Log
Revision 8093 -
(show annotations)
(download)
Mon Jul 4 16:02:02 2011 UTC (13 years, 2 months ago) by niro
File size: 2599 byte(s)
Mon Jul 4 16:02:02 2011 UTC (13 years, 2 months ago) by niro
File size: 2599 byte(s)
-fixed grub-mkconfig_lib path
1 | # $Id$ |
2 | |
3 | PNAME="grub" |
4 | PVER="1.99" |
5 | PBUILD="r2" |
6 | |
7 | PCATEGORIE="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 | SRC_URI=( |
23 | gnu://${PNAME}/${SRCFILE} |
24 | mirror://${PNAME}/${SRCFILE} |
25 | mirror://${PNAME}/${PNAME}-${PVER}-confd.patch |
26 | mirror://${PNAME}/grub.confd |
27 | ) |
28 | |
29 | UP2DATE="updatecmd_gnu ${PNAME} gz" |
30 | |
31 | # grub doesn't like CFLAG optimation, |
32 | # and do you really want that at your bootloader ?? |
33 | unset CFLAGS |
34 | unset CXXFLAGS |
35 | |
36 | src_prepare() |
37 | { |
38 | munpack ${SRCFILE} || die |
39 | cd ${SRCDIR} |
40 | |
41 | # use /etc/conf.d/grub instead of /etc/default/grub |
42 | mpatch ${PNAME}-${PVER}-confd.patch || die |
43 | } |
44 | |
45 | src_compile() |
46 | { |
47 | cd ${SRCDIR} |
48 | |
49 | mconfigure \ |
50 | --sbindir=/sbin \ |
51 | --bindir=/bin \ |
52 | --libdir=/$(mlibdir) \ |
53 | --disable-efiemu \ |
54 | --disable-werror \ |
55 | || die |
56 | |
57 | mmake || die |
58 | } |
59 | |
60 | src_install() |
61 | { |
62 | cd ${SRCDIR} |
63 | |
64 | mmake DESTDIR=${BINDIR} install || die |
65 | |
66 | # fix a missing symlink |
67 | mlink /bin/grub-mkimage /sbin || die |
68 | |
69 | # set distribution |
70 | echo 'GRUB_DISTRIBUTOR="Magellan-Linux"' >> /$(mlibdir)/grub/grub-mkconfig_lib || die |
71 | |
72 | # setup a proper grub default conf |
73 | minstallconf grub.confd grub || die |
74 | |
75 | # needed dir |
76 | minstalldir /boot/grub || die |
77 | |
78 | # docs |
79 | minstalldocs AUTHORS ChangeLog COPYING NEWS README THANKS TODO || die |
80 | } |
81 | |
82 | preinstall() |
83 | { |
84 | mount /boot &> /dev/null |
85 | } |
86 | |
87 | postinstall() |
88 | { |
89 | [ ! -d ${MROOT}/boot/grub ] && install -d ${MROOT}/boot/grub |
90 | |
91 | # creates some essential links |
92 | [ ! -e ${MROOT}/boot/boot ] && ln -sf . ${MROOT}/boot/boot |
93 | |
94 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && [[ ${MAGE_BOOTSTRAP} != true ]] |
95 | then |
96 | # create a device.map |
97 | if [[ ! -f /boot/grub/device.map ]] |
98 | then |
99 | grub-mkdevicemap |
100 | fi |
101 | |
102 | # needed by grub-mkconfig on the first run |
103 | if [[ ! -f /boot/grub/video.lst ]] |
104 | then |
105 | install -m0644 /$(mlibdir)/grub/*/video.lst /boot/grub/video.lst |
106 | fi |
107 | |
108 | # update grub.cfg |
109 | grub-mkconfig -o /boot/grub/grub.cfg |
110 | |
111 | # install bootloader to disk |
112 | #local bootpartition="$(df -h /boot |(read; awk '{print $1; exit}'))" |
113 | local bootdisk |
114 | bootdisk="$(grub-probe --target=drive /boot | sed 's:(\(.*\),.*):(\1):')" |
115 | |
116 | # Generate core.img, but don't let it be installed in boot sector |
117 | grub-install --no-floppy "${bootdisk}" |
118 | fi |
119 | |
120 | echo |
121 | echo "Begining with GRUB2 the location of the config file has changed." |
122 | echo "You will find it at /boot/grub/grub.cfg" |
123 | echo "Also be aware of the changed commands." |
124 | echo "'kernel' isn't used anymore but 'linux'." |
125 | echo |
126 | } |