#!/bin/sh set -e set -x S=grub-1.99 MODS="efi_gop efi_uga tftp part_gpt part_msdos hfsplus fat ext2 chain reboot linux ls multiboot gfxterm gzio fw" if [ ! -d ${S} ]; then git clone ssh://git@git.panaceas.org/git/xen/${S}.git || git clone git://git.panaceas.org/xen/${S}.git fi if [ ! -d ${S}-pq ]; then git clone ssh://git@git.panaceas.org/git/xen/${S}-pq.git || git clone git://git.panaceas.org/xen/${S}-pq.git fi if [ ! -d ${S}/.git/patches ]; then ln -sf ../../${S}-pq ${S}/.git/patches fi (cd ${S} && guilt refresh || true) (cd ${S} && guilt push -a) if [ ! -f ${S}/configure ]; then (cd ${S} && sh autogen.sh ) fi D=${PWD} rm -rf dest mkdir -p dest for A in x86_64 i386; do P=${D}/prefix_${A} B=${D}/build_${A} DO=${D}/dest/${A} mkdir -p ${B} ${P} ${P}/bin ${P}/sbin ${P}/lib if [ ! -f $B/Makefile ]; then (cd $B && TARGET_CC=gcc CC=gcc $D/${S}/configure --prefix=${P} --with-platform=efi --target=${A} ) fi make -C ${B} mkdir -p ${DO} mkdir -p ${DO}/grub if false; then make -C ${B} install ${P}/bin/${A}-grub-mkimage -p /grub -O ${A}-efi -o ${DO}/grub.efi ${MODS} for i in ${P}/lib/${A}-grub/${A}-efi/*; do install -m 644 $i ${DO}/grub/ done else (cd ${B} && ./grub-mkimage -d grub-core -p /grub -O ${A}-efi -o ${DO}/grub.efi ${MODS} ) set +x for i in command.lst moddep.lst terminal.lst crypto.lst partmap.lst video.lst fs.lst parttool.lst ; do install -m 644 ${B}/grub-core/$i ${DO}/grub/ done install -m 644 ${B}/grub-core/*.mod ${DO}/grub/ set -x fi done