2 # Filename: create-grub-dir.sh
3 # Purpose: generate core.img and according files for templates/boot/grub/
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 # Latest change: Thu Mar 11 14:25:15 CET 2010 [mika]
8 ################################################################################
13 echo "Usage: $0 <grub_package.deb>">&2
14 echo "Usage example: $0 grub-pc_1.98-1_i386.deb">&2
19 echo "Directory 'grub' exists in current working directory already, will not continue.">&2
26 if ! [ -f "$GRUB" ] ; then
27 wget http://ftp.de.debian.org/debian/pool/main/g/grub2/"$GRUB"
30 if ! [ -f "$GRUB" ] ; then
31 echo "Error reading $GRUB - exiting.">&2
40 ar x "${oldpwd}"/"$GRUB"
42 ./usr/bin/grub-mkimage -d usr/lib/grub/i386-pc -o core.img biosdisk iso9660
44 for a in usr/lib/grub/i386-pc/{*.mod,efiemu??.o,command.lst,moddep.lst,fs.lst,handler.lst,parttool.lst}; do \
45 [[ -e $a ]] && cp $a grub/
51 mv "${GRUBDIR}"/grub .
54 echo "Generated new grub boot directory 'grub'."
56 ## END OF FILE #################################################################