Magellan Linux

Contents of /branches/magellan-next/core/grub/grub-1.99-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8092 - (show annotations) (download)
Mon Jul 4 15:59:20 2011 UTC (12 years, 10 months ago) by niro
File size: 2767 byte(s)
-fixed config file
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 local mkconfiglib
71 case ${ARCH} in
72 i*86 | x86_64) mkconfiglib="/$(mlibdir)/grub/i386-pc/grub-mkconfig_lib" ;;
73 *) mkconfiglib="/$(mlibdir)/grub/${ARCH}-pc/grub-mkconfig_lib" ;;
74 esac
75 echo 'GRUB_DISTRIBUTOR="Magellan-Linux"' >> ${mkconfiglib} || die
76
77 # setup a proper grub default conf
78 minstallconf grub.confd grub || die
79
80 # needed dir
81 minstalldir /boot/grub || die
82
83 # docs
84 minstalldocs AUTHORS ChangeLog COPYING NEWS README THANKS TODO || die
85 }
86
87 preinstall()
88 {
89 mount /boot &> /dev/null
90 }
91
92 postinstall()
93 {
94 [ ! -d ${MROOT}/boot/grub ] && install -d ${MROOT}/boot/grub
95
96 # creates some essential links
97 [ ! -e ${MROOT}/boot/boot ] && ln -sf . ${MROOT}/boot/boot
98
99 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] && [[ ${MAGE_BOOTSTRAP} != true ]]
100 then
101 # create a device.map
102 if [[ ! -f /boot/grub/device.map ]]
103 then
104 grub-mkdevicemap
105 fi
106
107 # needed by grub-mkconfig on the first run
108 if [[ ! -f /boot/grub/video.lst ]]
109 then
110 install -m0644 /$(mlibdir)/grub/*/video.lst /boot/grub/video.lst
111 fi
112
113 # update grub.cfg
114 grub-mkconfig -o /boot/grub/grub.cfg
115
116 # install bootloader to disk
117 #local bootpartition="$(df -h /boot |(read; awk '{print $1; exit}'))"
118 local bootdisk
119 bootdisk="$(grub-probe --target=drive /boot | sed 's:(\(.*\),.*):(\1):')"
120
121 # Generate core.img, but don't let it be installed in boot sector
122 grub-install --no-floppy "${bootdisk}"
123 fi
124
125 echo
126 echo "Begining with GRUB2 the location of the config file has changed."
127 echo "You will find it at /boot/grub/grub.cfg"
128 echo "Also be aware of the changed commands."
129 echo "'kernel' isn't used anymore but 'linux'."
130 echo
131 }