# $Id$ PNAME="grub" PVER="1.99" PBUILD="r1" PCATEGORIE="sys-apps" DESCRIPTION="GNU GRUB2 boot loader." HOMEPAGE="http://www.gnu.org/software/grub/" DEPEND=">= sys-libs/ncurses-5.9 >= sys-libs/zlib-1.2.5 >= media-libs/freetype-2.4" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mtools SRC_URI=( gnu://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-${PVER}-confd.patch mirror://${PNAME}/${PNAME}-${PVER}-alx.patch ) UP2DATE="updatecmd_gnu ${PNAME} gz" # grub doesn't like CFLAG optimation, # and do you really want that at your bootloader ?? unset CFLAGS unset CXXFLAGS src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # use /etc/conf.d/grub instead of /etc/default/grub mpatch ${PNAME}-${PVER}-confd.patch || die # fixes some issues with busybox mpatch ${PNAME}-${PVER}-alx.patch || die } src_compile() { cd ${SRCDIR} mconfigure \ --sbindir=/sbin \ --bindir=/bin \ --libdir=/$(mlibdir) \ --disable-efiemu \ --disable-werror \ --disable-nls \ || die mmake || die } src_install() { cd ${SRCDIR} mmake DESTDIR=${BINDIR} install || die # fix a missing symlink mlink /bin/grub-mkimage /sbin || die # setup a proper grub default conf minstalldir /etc/conf.d || die cat > ${BINDIR}/etc/conf.d/grub << EOF GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="ALX Thinclient" GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="" GRUB_TERMINAL_INPUT=console GRUB_GFXMODE=auto GRUB_GFXPAYLOAD_LINUX=keep GRUB_DISABLE_RECOVERY=true GRUB_COLOR_NORMAL="light-blue/black" GRUB_COLOR_HIGHLIGHT="light-cyan/blue" #GRUB_BACKGROUND="/path/to/wallpaper" #GRUB_THEME="/path/to/gfxtheme" EOF minstalldir /boot/grub || die cat > ${BINDIR}/boot/grub/grub.cfg.example << "EOF" default 0 timeout 30 title ALX Thinclient linux (hd0,0)/boot/vmlinuz root=/dev/hda3 initrd (hd0,0)/boot/initrd EOF # docs minstalldocs AUTHORS ChangeLog COPYING NEWS README THANKS TODO || die } preinstall() { mount /boot &> /dev/null } postinstall() { [ ! -d ${MROOT}/boot/grub ] && install -d ${MROOT}/boot/grub # creates some essential links [ ! -e ${MROOT}/boot/boot ] && ln -sf . ${MROOT}/boot/boot echo echo "Begining with GRUB2 the location of the config file has changed." echo "You will find it at /boot/grub/grub.cfg" echo "Also be aware of the changed commands." echo "'kernel' isn't used anymore but 'linux'." echo }