-# install grub2 files {{{
-# as we don't want to rely on a grub2 installation on the
-# running system let's grab it from the net
- if which dpkg >/dev/null 2>&1 ; then
- ARCH="$(dpkg --print-architecture)"
- else
- [[ $(uname -m) == x86_64 ]] && ARCH=amd64 || ARCH=i386
- fi
- GRUB_DEB="${GRUB_VERSION}_${ARCH}.deb"
-
- cd "$WRKDIR"/grub_tmp/
- wget http://ftp.de.debian.org/debian/pool/main/g/grub2/"$GRUB_DEB"
- ar x "$GRUB_DEB"
- tar xzf data.tar.gz
- ./usr/bin/grub-mkimage -d usr/lib/grub/i386-pc \
- -o "$WRKDIR"/cddir/boot/grub/core.img biosdisk iso9660
-
- for a in usr/lib/grub/i386-pc/{*.mod,efiemu??.o,command.lst,moddep.lst,fs.lst,handler.lst,parttool.lst}; do
- test -e $a && cp $a "$WRKDIR"/cddir/boot/grub/
- done