--- grub-0.93.orig/config.guess +++ grub-0.93/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2002-03-20' +timestamp='2003-05-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -88,30 +88,41 @@ exit 1 fi +trap 'exit 1' 1 2 15 -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. -# CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c ; +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; - if test $? = 0 ; then + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; - rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -142,6 +153,7 @@ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; @@ -167,7 +179,18 @@ ;; esac # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. @@ -216,63 +239,47 @@ if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - cat <$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - eval $set_cc_for_build - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - esac - fi - rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) @@ -313,6 +320,10 @@ NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; @@ -419,15 +430,20 @@ exit (-1); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -500,8 +516,7 @@ exit(0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -599,11 +614,21 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) @@ -637,8 +662,7 @@ exit (0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -696,15 +720,15 @@ CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` @@ -720,8 +744,19 @@ *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -733,13 +768,16 @@ echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:3*) - echo i386-pc-interix3 + echo i586-pc-interix3 + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix + echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin @@ -759,6 +797,9 @@ arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -782,8 +823,26 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu @@ -845,7 +904,7 @@ ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; @@ -878,7 +937,6 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; @@ -896,6 +954,23 @@ # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -917,22 +992,19 @@ UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -956,9 +1028,15 @@ # "miniframe" echo m68010-convergent-sysv exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -975,9 +1053,6 @@ mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; @@ -1049,6 +1124,9 @@ SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; @@ -1056,7 +1134,11 @@ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1069,7 +1151,7 @@ *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1092,11 +1174,6 @@ fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; @@ -1115,12 +1192,6 @@ *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1241,8 +1312,7 @@ } EOF -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. --- grub-0.93.orig/config.sub +++ grub-0.93/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2002-04-26' +timestamp='2003-05-09' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -118,7 +118,7 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -229,24 +229,36 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dsp16xx \ - | fr30 \ + | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ + | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ - | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el | mips64vr4300 \ - | mips64vr4300el | mips64vr5000 | mips64vr5000el \ - | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ - | mipsisa32 | mipsisa64 \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ @@ -281,34 +293,49 @@ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armv*-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ - | d10v-* | d30v-* \ + | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | fx80-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ - | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ - | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ - | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ @@ -346,6 +373,9 @@ basic_machine=a29k-none os=-bsd ;; + amd64) + basic_machine=x86_64-pc + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -695,6 +725,10 @@ np1) basic_machine=np1-gould ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -728,13 +762,13 @@ pbb) basic_machine=m68k-tti ;; - pc532 | pc532-*) + pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86 | athlon) + pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2) @@ -755,22 +789,22 @@ power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown - ;; + ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown - ;; + ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown - ;; + ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown - ;; + ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; @@ -801,6 +835,12 @@ basic_machine=a29k-amd os=-udi ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; sequent) basic_machine=i386-sequent ;; @@ -866,7 +906,7 @@ sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) + sv1) basic_machine=sv1-cray os=-unicos ;; @@ -874,10 +914,6 @@ basic_machine=i386-sequent os=-dynix ;; - t3d) - basic_machine=alpha-cray - os=-unicos - ;; t3e) basic_machine=alphaev5-cray os=-unicos @@ -886,10 +922,22 @@ basic_machine=t90-cray os=-unicos ;; + tic4x | c4x*) + basic_machine=tic4x-unknown + os=-coff + ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -924,8 +972,8 @@ os=-vms ;; vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -946,11 +994,7 @@ basic_machine=hppa1.1-winbond os=-proelf ;; - windows32) - basic_machine=i386-pc - os=-windows32-msvcrt - ;; - xps | xps100) + xps | xps100) basic_machine=xps100-honeywell ;; ymp) @@ -996,7 +1040,7 @@ we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh3eb | sh4eb) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) @@ -1005,7 +1049,7 @@ sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; - cydra) + cydra) basic_machine=cydra-cydrome ;; orion) @@ -1020,10 +1064,6 @@ pmac | pmac-mpw) basic_machine=powerpc-apple ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; @@ -1086,11 +1126,12 @@ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* ) + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1102,8 +1143,10 @@ ;; esac ;; + -nto-qnx*) + ;; -nto*) - os=-nto-qnx + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ @@ -1155,7 +1198,7 @@ os=-rtmk-nova ;; -ns2 ) - os=-nextstep2 + os=-nextstep2 ;; -nsk*) os=-nsk @@ -1194,8 +1237,14 @@ -xenix) os=-xenix ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos ;; -none) ;; @@ -1232,7 +1281,7 @@ pdp10-*) os=-tops20 ;; - pdp11-*) + pdp11-*) os=-none ;; *-dec | vax-*) @@ -1325,19 +1374,19 @@ *-next) os=-nextstep3 ;; - *-gould) + *-gould) os=-sysv ;; - *-highlevel) + *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; - *-sgi) + *-sgi) os=-irix ;; - *-siemens) + *-siemens) os=-sysv4 ;; *-masscomp) --- grub-0.93.orig/docs/grub.info +++ grub-0.93/docs/grub.info @@ -1,4 +1,4 @@ -This is grub.info, produced by makeinfo version 4.1 from grub.texi. +This is grub.info, produced by makeinfo version 4.3 from grub.texi. INFO-DIR-SECTION Kernel START-INFO-DIR-ENTRY @@ -31,7 +31,7 @@ Indirect: grub.info-1: 1323 grub.info-2: 50835 -grub.info-3: 100586 +grub.info-3: 100368  Tag Table: (Indirect) @@ -92,99 +92,100 @@ Node: Hidden menu interface61569 Node: Commands62141 Node: Menu-specific commands62693 -Node: default63856 -Node: fallback64319 -Node: hiddenmenu64797 -Node: timeout65270 -Node: title65533 -Node: General commands65789 -Node: bootp67091 -Node: color67555 -Node: device69024 -Node: dhcp69581 -Node: hide70152 -Node: ifconfig70514 -Node: pager71075 -Node: partnew71394 -Node: parttype71834 -Node: password72186 -Node: rarp72989 -Node: serial73273 -Node: setkey74521 -Node: terminal76666 -Node: terminfo78186 -Node: tftpserver78856 -Node: unhide79385 -Node: Command-line and menu entry commands79743 -Node: blocklist82266 -Node: boot82493 -Node: cat82796 -Node: chainloader83085 -Node: cmp83686 -Node: configfile84222 -Node: debug84421 -Node: displayapm84790 -Node: displaymem84986 -Node: embed85673 -Node: embed-Footnotes86190 -Ref: embed-Footnote-186245 -Node: find86302 -Node: fstest86653 -Node: geometry87321 -Node: halt87923 -Node: help88233 -Node: impsprobe88837 -Node: initrd89187 -Node: install89509 -Node: install-Footnotes92326 -Ref: install-Footnote-192385 -Node: ioprobe92482 -Node: kernel92790 -Node: lock93833 -Node: makeactive94391 -Node: map94686 -Node: md5crypt95236 -Node: module95566 -Node: modulenounzip96127 -Node: pause96403 -Node: quit96800 -Node: reboot97059 -Node: read97223 -Node: root97448 -Node: rootnoverify98308 -Node: savedefault98846 -Node: setup99537 -Node: testload100586 -Node: testvbe101180 -Node: uppermem101534 -Node: vbeprobe102099 -Node: Troubleshooting102465 -Node: Stage1 errors103000 -Node: Stage1.5 errors104370 -Node: Stage2 errors104801 -Node: Invoking the grub shell112344 -Node: Basic usage113094 -Node: Installation under UNIX115343 -Node: Device map117021 -Node: Invoking grub-install118178 -Node: Invoking grub-md5-crypt119751 -Node: Invoking grub-terminfo120396 -Node: Invoking mbchk121150 -Node: Obtaining and Building GRUB121658 -Node: Reporting bugs123321 -Node: Future126077 -Node: Internals126518 -Node: Memory map127722 -Node: Embedded data129195 -Node: Filesystem interface131207 -Node: Command interface134635 -Node: Bootstrap tricks135945 -Node: I/O ports detection138089 -Node: Memory detection138356 -Node: Low-level disk I/O138643 -Node: MBR138907 -Node: Partition table139099 -Node: Submitting patches139365 -Node: Index140846 +Node: default63917 +Node: fallback64380 +Node: gfxmenu64858 +Node: hiddenmenu65151 +Node: timeout65624 +Node: title65884 +Node: General commands66140 +Node: bootp67442 +Node: color67906 +Node: device69375 +Node: dhcp69932 +Node: hide70503 +Node: ifconfig70865 +Node: pager71426 +Node: partnew71745 +Node: parttype72185 +Node: password72537 +Node: rarp73340 +Node: serial73624 +Node: setkey74872 +Node: terminal77017 +Node: terminfo78537 +Node: tftpserver79207 +Node: unhide79736 +Node: Command-line and menu entry commands80094 +Node: blocklist82617 +Node: boot82844 +Node: cat83147 +Node: chainloader83436 +Node: cmp84037 +Node: configfile84573 +Node: debug84772 +Node: displayapm85141 +Node: displaymem85337 +Node: embed86024 +Node: embed-Footnotes86541 +Ref: embed-Footnote-186596 +Node: find86653 +Node: fstest87004 +Node: geometry87672 +Node: halt88274 +Node: help88584 +Node: impsprobe89188 +Node: initrd89538 +Node: install89860 +Node: install-Footnotes93157 +Ref: install-Footnote-193216 +Node: ioprobe93313 +Node: kernel93621 +Node: lock94664 +Node: makeactive95222 +Node: map95517 +Node: md5crypt96067 +Node: module96397 +Node: modulenounzip96958 +Node: pause97234 +Node: quit97631 +Node: reboot97890 +Node: read98054 +Node: root98279 +Node: rootnoverify99139 +Node: savedefault99677 +Node: setup100368 +Node: testload101417 +Node: testvbe102011 +Node: uppermem102365 +Node: vbeprobe102930 +Node: Troubleshooting103296 +Node: Stage1 errors103831 +Node: Stage1.5 errors105201 +Node: Stage2 errors105632 +Node: Invoking the grub shell113175 +Node: Basic usage113925 +Node: Installation under UNIX116174 +Node: Device map117852 +Node: Invoking grub-install119009 +Node: Invoking grub-md5-crypt120582 +Node: Invoking grub-terminfo121227 +Node: Invoking mbchk121981 +Node: Obtaining and Building GRUB122489 +Node: Reporting bugs124152 +Node: Future126908 +Node: Internals127349 +Node: Memory map128553 +Node: Embedded data130026 +Node: Filesystem interface132038 +Node: Command interface135466 +Node: Bootstrap tricks136776 +Node: I/O ports detection138920 +Node: Memory detection139187 +Node: Low-level disk I/O139474 +Node: MBR139738 +Node: Partition table139930 +Node: Submitting patches140196 +Node: Index141677  End Tag Table --- grub-0.93.orig/docs/grub.info-1 +++ grub-0.93/docs/grub.info-1 @@ -1,4 +1,4 @@ -This is grub.info, produced by makeinfo version 4.1 from grub.texi. +This is grub.info, produced by makeinfo version 4.3 from grub.texi. INFO-DIR-SECTION Kernel START-INFO-DIR-ENTRY --- grub-0.93.orig/docs/grub.info-2 +++ grub-0.93/docs/grub.info-2 @@ -1,4 +1,4 @@ -This is grub.info, produced by makeinfo version 4.1 from grub.texi. +This is grub.info, produced by makeinfo version 4.3 from grub.texi. INFO-DIR-SECTION Kernel START-INFO-DIR-ENTRY @@ -395,6 +395,7 @@ * default:: Set the default entry * fallback:: Set the fallback entry * hiddenmenu:: Hide the menu interface +* gfxmenu:: Use graphical menu interface * timeout:: Set the timeout * title:: Start a menu entry @@ -427,7 +428,18 @@ the machine was rebooted by a kernel that GRUB loaded.  -File: grub.info, Node: hiddenmenu, Next: timeout, Prev: fallback, Up: Menu-specific commands +File: grub.info, Node: gfxmenu, Next: timeout, Prev: hiddenmenu, Up: Menu-specific commands + +gfxmenu +------- + + - Command: gfxmenu file + Use the graphical menu interface. The graphics data are taken from + FILE and must be created using 'mkbootmsg' from the gfxboot + package. + + +File: grub.info, Node: hiddenmenu, Next: gfxmenu, Prev: fallback, Up: Menu-specific commands hiddenmenu ---------- @@ -440,7 +452,7 @@ See also *Note Hidden menu interface::.  -File: grub.info, Node: timeout, Next: title, Prev: hiddenmenu, Up: Menu-specific commands +File: grub.info, Node: timeout, Next: title, Prev: gfxmenu, Up: Menu-specific commands timeout ------- @@ -1202,7 +1214,7 @@ install ------- - - Command: install [`--force-lba'] [`--stage2=os_stage2_file'] + - Command: install [`--force-lba[=off]'] [`--stage2=os_stage2_file'] stage1_file [`d'] dest_dev stage2_file [addr] [`p'] [config_file] [real_config_file] This command is fairly complex, and you should not use this command @@ -1249,7 +1261,14 @@ bitmap even if they do have the support. So GRUB provides a solution to ignore the wrong bitmap, that is, the option `--force-lba'. Don't use this option if you know that your BIOS - doesn't have LBA support. + doesn't have LBA support. On the other hand there is at least one + known BIOS that does the opposite, it claims to support LBA and + then fails to provide it. Iff you have an Adaptec 2940 with BIOS + revision 1.21 ( newer ones just work and older ones don't make the + false claim ), or otherwise experience grub hanging after stage1, + you can try to use the option `--force-lba=off', as long as all + disk blocks involved in booting reside within the first 1024 + cylinders. *Caution3:* You must specify the option `--stage2' in the grub shell, if you cannot unmount the filesystem where your stage2 file @@ -1480,27 +1499,3 @@ With this configuration, GRUB will choose the entry booted previously as the default entry. See also *Note default::. - -File: grub.info, Node: setup, Next: testload, Prev: savedefault, Up: Command-line and menu entry commands - -setup ------ - - - Command: setup [`--force-lba'] [`--stage2=os_stage2_file'] - [`--prefix=dir'] install_device [image_device] - Set up the installation of GRUB automatically. This command uses - the more flexible command `install' (*note install::) in the - backend and installs GRUB into the device INSTALL_DEVICE. If - IMAGE_DEVICE is specified, then find the GRUB images (*note - Images::) in the device IMAGE_DEVICE, otherwise use the current - "root device", which can be set by the command `root'. If - INSTALL_DEVICE is a hard disk, then embed a Stage 1.5 in the disk - if possible. - - The option `--prefix' specifies the directory under which GRUB - images are put. If it is not specified, GRUB automatically - searches them in `/boot/grub' and `/grub'. - - The options `--force-lba' and `--stage2' are just passed to - `install' if specified. *Note install::, for more information. - --- grub-0.93.orig/docs/grub.info-3 +++ grub-0.93/docs/grub.info-3 @@ -1,4 +1,4 @@ -This is grub.info, produced by makeinfo version 4.1 from grub.texi. +This is grub.info, produced by makeinfo version 4.3 from grub.texi. INFO-DIR-SECTION Kernel START-INFO-DIR-ENTRY @@ -28,6 +28,30 @@ versions.  +File: grub.info, Node: setup, Next: testload, Prev: savedefault, Up: Command-line and menu entry commands + +setup +----- + + - Command: setup [`--force-lba'] [`--stage2=os_stage2_file'] + [`--prefix=dir'] install_device [image_device] + Set up the installation of GRUB automatically. This command uses + the more flexible command `install' (*note install::) in the + backend and installs GRUB into the device INSTALL_DEVICE. If + IMAGE_DEVICE is specified, then find the GRUB images (*note + Images::) in the device IMAGE_DEVICE, otherwise use the current + "root device", which can be set by the command `root'. If + INSTALL_DEVICE is a hard disk, then embed a Stage 1.5 in the disk + if possible. + + The option `--prefix' specifies the directory under which GRUB + images are put. If it is not specified, GRUB automatically + searches them in `/boot/grub' and `/grub'. + + The options `--force-lba' and `--stage2' are just passed to + `install' if specified. *Note install::, for more information. + + File: grub.info, Node: testload, Next: testvbe, Prev: setup, Up: Command-line and menu entry commands testload @@ -1178,6 +1202,7 @@ * fstest: fstest. * FSYS_BUF: Filesystem interface. * geometry: geometry. +* gfxmenu: gfxmenu. * grub_read: Filesystem interface. * halt: halt. * help: help. --- grub-0.93.orig/debian/README.Debian +++ grub-0.93/debian/README.Debian @@ -0,0 +1,9 @@ +grub-gfxboot for Debian +----------------------- + +This is a version of GRUB that contains the SuSE 'gfxmenu' patches. + +It is based on stock 0.93 though, not CVS, as I experienced problems +getting the SuSE patches to apply and actually work on 0.93+CVS. + + -- leon j. breedt , Mon, 9 Jun 2003 21:25:20 +1200 --- grub-0.93.orig/debian/changelog +++ grub-0.93/debian/changelog @@ -0,0 +1,6 @@ +grub (0.93-1) unstable; urgency=low + + * Initial Release. + + -- leon j. breedt Mon, 9 Jun 2003 21:25:20 +1200 + --- grub-0.93.orig/debian/compat +++ grub-0.93/debian/compat @@ -0,0 +1 @@ +4 --- grub-0.93.orig/debian/update-grub +++ grub-0.93/debian/update-grub @@ -0,0 +1,615 @@ +#!/bin/sh +# +# Insert a list of installed kernels in a grub menu.lst file +# Copyright 2001 Wichert Akkerman +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Contributors: +# Jason Thomas +# David B.Harris +# Marc Haber +# Crispin Flowerday + +# Abort on errors +set -e + +find_grub_dir () +{ + echo -n "Searching for GRUB installation directory ... " >&2 + + for d in $grub_dirs ; do + if [ -d "$d" ] ; then + grub_dir="$d" + break + fi + done + + if [ -z "$grub_dir" ] ; then + abort "No GRUB directory found. To create a template run 'mkdir /boot/grub' first. To install grub, install it manually or try the 'grub-install' command. ### Warning, grub-install is used to change your MBR. ###" + else + echo "found: $grub_dir ." >&2 + fi + + echo $grub_dir +} + +find_root_device () +{ + # Autodetect current root device + root_device= + if [ -f /etc/fstab ] ; then + script=' + /^#/ { next } + $2 == "/" { print $1 ; exit } + ' + root_device=$(awk "$script" /etc/fstab) + fi + if [ -z "$root_device" ]; then + echo "$PROG: Cannot determine root file system. Assuming /dev/hda1" >&2 + root_device=/dev/hda1 + fi + + echo $root_device +} + +# Usage: convert os_device +# Convert an OS device to the corresponding GRUB drive. +# This part is OS-specific. +convert () { + # First, check if the device file exists. + if test -e "$1"; then + : + else + echo "$1: Not found or not a block device." 1>&2 + exit 1 + fi + + host_os=`uname -s | tr '[A-Z]' '[a-z]'` + + # Break the device name into the disk part and the partition part. + case "$host_os" in + linux*) + tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ + -e 's%\(fd[0-9]*\)$%\1%' \ + -e 's%/part[0-9]*$%/disc%' \ + -e 's%\(c[0-7]d[0-9]*\).*$%\1%'` + tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \ + -e 's%.*/fd[0-9]*$%%' \ + -e 's%.*/floppy/[0-9]*$%%' \ + -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \ + -e 's%.*c[0-7]d[0-9]*p*%%'` + ;; + gnu*) + tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'` + tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;; + freebsd*) + tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \ + | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'` + tmp_part=`echo "$1" \ + | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \ + | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"` + ;; + netbsd*) + tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([sw]d[0-9]*\).*$%r\1d%' \ + | sed 's%r\{0,1\}\(fd[0-9]*\).*$%r\1a%'` + tmp_part=`echo "$1" \ + | sed "s%.*/r\{0,1\}[sw]d[0-9]\([abe-p]\)%\1%"` + ;; + *) + echo "update-grub does not support your OS yet." 1>&2 + exit 1 ;; + esac + + # Get the drive name. + tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk *$" \ + | sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%'` + + # If not found, print an error message and exit. + if test "x$tmp_drive" = x; then + echo "$1 does not have any corresponding BIOS drive." 1>&2 + exit 1 + fi + + if test "x$tmp_part" != x; then + # If a partition is specified, we need to translate it into the + # GRUB's syntax. + case "$host_os" in + linux*) + echo "$tmp_drive" | sed "s%)$%,`expr $tmp_part - 1`)%" ;; + gnu*) + if echo $tmp_part | grep "^s" >/dev/null; then + tmp_pc_slice=`echo $tmp_part \ + | sed "s%s\([0-9]*\)[a-g]*$%\1%"` + tmp_drive=`echo "$tmp_drive" \ + | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"` + fi + if echo $tmp_part | grep "[a-g]$" >/dev/null; then + tmp_bsd_partition=`echo "$tmp_part" \ + | sed "s%[^a-g]*\([a-g]\)$%\1%"` + tmp_drive=`echo "$tmp_drive" \ + | sed "s%)%,$tmp_bsd_partition)%"` + fi + echo "$tmp_drive" ;; + freebsd*) + if echo $tmp_part | grep "^s" >/dev/null; then + tmp_pc_slice=`echo $tmp_part \ + | sed "s%s\([0-9]*\)[a-h]*$%\1%"` + tmp_drive=`echo "$tmp_drive" \ + | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"` + fi + if echo $tmp_part | grep "[a-h]$" >/dev/null; then + tmp_bsd_partition=`echo "$tmp_part" \ + | sed "s%s\{0,1\}[0-9]*\([a-h]\)$%\1%"` + tmp_drive=`echo "$tmp_drive" \ + | sed "s%)%,$tmp_bsd_partition)%"` + fi + echo "$tmp_drive" ;; + netbsd*) + if echo $tmp_part | grep "^[abe-p]$" >/dev/null; then + tmp_bsd_partition=`echo "$tmp_part" \ + | sed "s%\([a-p]\)$%\1%"` + tmp_drive=`echo "$tmp_drive" \ + | sed "s%)%,$tmp_bsd_partition)%"` + fi + echo "$tmp_drive" ;; + esac + else + # If no partition is specified, just print the drive name. + echo "$tmp_drive" + fi +} + + +## Configuration Options +# directory's to look for the grub installation and the menu file +grub_dirs="/boot/grub /boot/boot/grub" + +# The grub installation directory +grub_dir=`find_grub_dir` + +# Full path to the menu.lst +menu_file=$grub_dir/menu.lst + +# if we already have a menu_file we don't need these options +if [ ! -f $menu_file ] ; then + + # The place where to root filesystem is mounted. + root_device=`find_root_device` + + # Full path to the device.map + device_map=$grub_dir/device.map + + # Default kernel options, overidden by the kopt statement in the menufile. + kopt="root=$root_device ro" + + # if we don't have a device.map then we can't use the convert function. + # and for now if /boot is where the root device is mounted also skip this + # bit + if test -f "$device_map" && test ! -d "/boot/boot" ; then + # Drive(in GRUB terms) where the kernel is located. If a seperate + # partition, this would be mounted under /boot, overridden by the kopt statement in menufile + grub_root_device=`convert "$root_device"` + else + grub_root_device="(hd0,0)" + + fi + + # should grub create the alternative boot options in the menu + alternative="true" + + # should grub lock the alternative boot options in the menu + lockalternative="false" + + # options to use with the alternative boot options + altoptions="(recovery mode) single" + + # controls howmany kernels are listed in the menu.lst, + # this does not include the alternative kernels + howmany="all" + + # stores the command line arguments + command_line_arguments=$1 +fi + +# Default options to use in a new menu.lst . This will only be used if menu.lst +# doesn't already exist. Only edit the lines between the two "EOF"s. The others are +# part of the script. +newtemplate=$(tempfile) +cat > "$newtemplate" <&2 + echo "$message" >&2 + echo >&2 + exit 1 +} + +# Extract options from menu.lst +ExtractMenuOpt() +{ + opt=$1 + + sed -ne "/^$start\$/,/^$end\$/ { + /^$startopt\$/,/^$endopt\$/ { + /^# $opt=/ { + s/^# $opt=\(.*\)\$/\1/ + p + } + } + }" $menu +} + +GetMenuOpt() +{ + opt=$1 + value=$2 + + tmp=$(ExtractMenuOpt "$opt") + + [ -z "$tmp" ] || value="$tmp" + + echo $value +} + +# Compares two version strings A and B +# Returns -1 if AB +# This compares version numbers of the form +# 2.4.14-random > 2.4.14-ac10 > 2.4.14 > 2.4.14-pre2 > +# 2.4.14-pre1 > 2.4.13-ac99 +CompareVersions() +{ + # First split the version number and remove any '.' 's or dashes + v1=$(echo $1 | sed -e 's![^0-9]\+! & !g' -e 's![\.\-]!!g') + v2=$(echo $2 | sed -e 's![^0-9]\+! & !g' -e 's![\.\-]!!g') + + # we weight different kernel suffixes here + # ac = 50 + # pre = -50 + # rc = -40 + # others are given 99 + v1=$(echo $v1 | sed -e 's! ac ! 50 !g' -e 's! rc ! -40 !g' -e 's! pre ! -50 !g' -e 's![^-0-9 ]\+!99!g') + v2=$(echo $v2 | sed -e 's! ac ! 50 !g' -e 's! rc ! -40 !g' -e 's! pre ! -50 !g' -e 's![^-0-9 ]\+!99!g') + + result=0; v1finished=0; v2finished=0; + while [ $result -eq 0 -a $v1finished -eq 0 -a $v2finished -eq 0 ]; + do + if [ "$v1" = "" ]; then + v1comp=0; v1finished=1 + else + set -- $v1; v1comp=$1; shift; v1=$* + fi + + if [ "$v2" = "" ]; then + v2comp=0; v2finished=1 + else + set -- $v2; v2comp=$1; shift; v2=$* + fi + + if [ $v1comp -gt $v2comp ]; then result=1 + elif [ $v1comp -lt $v2comp ]; then result=-1 + fi + done + + # finally return the result + echo $result +} + +# looks in the directory specified for an initrd image with the version specified +FindInitrdName() +{ + # strip trailing slashes + directory=$(echo $1 | sed -e 's#/*$##') + version=$2 + + # initrd + # initrd.img + # initrd-lvm + # .*.gz + + initrdName="" + names="initrd initrd.img initrd-lvm" + compressed="gz" + + for n in $names ; do + # make sure we haven't already found it + if [ -z "$initrdName" ] ; then + if [ -f "$directory/$n-$version" ] ; then + initrdName="$n-$version" + break + else + for c in $compressed ; do + if [ -f "$directory/$n-$version.$c" ] ; then + initrdName="$n-$version.$c" + break + fi + done + fi + else + break + fi + done + + # return the result + echo $initrdName +} + + +echo -n "Testing for an existing GRUB menu.list file... " + +# Test if our menu file exists +if [ -f "$menu_file" ] ; then + menu="$menu_file" + unset newtemplate + echo "found: $menu_file ." + cp -f "$menu_file" "$menu_file~" +else + # if not ask user if they want us to create one + menu="$menu_file" + echo + echo + echo -n "Could not find $menu_file file. " + if [ "-y" = "$command_line_arguments" ] ; then + echo + echo "Generating $menu_file" + answer=y + else + echo -n "Would you like $menu_file generated for you? " + echo -n "(y/N) " + read answer + fi + + case "$answer" in + y* | Y*) + cat "$newtemplate" > $menu_file + unset newtemplate + ;; + *) + abort "Not creating $menu_file as you wish" + ;; + esac +fi + +# Extract the kernel options to use +kopt=$(GetMenuOpt "kopt" "$kopt") + +# Extract the grub root +grub_root_device=$(GetMenuOpt "groot" "$grub_root_device") + +# Extract the old recovery value +alternative=$(GetMenuOpt "recovery" "$alternative") + +# Extract the alternative value +alternative=$(GetMenuOpt "alternative" "$alternative") + +# Extract the lockalternative value +lockalternative=$(GetMenuOpt "lockalternative" "$lockalternative") + +# Extract the howmany value +howmany=$(GetMenuOpt "howmany" "$howmany") + +# Generate the menu options we want to insert +buffer=$(tempfile) +echo $start >> $buffer +echo "## lines between the AUTOMAGIC KERNELS LIST markers will be modified" >> $buffer +echo "## by the debian update-grub script except for the default optons below" >> $buffer +echo >> $buffer +echo "## DO NOT UNCOMMENT THEM, Just edit them to your needs" >> $buffer +echo >> $buffer +echo "## ## Start Default Options ##" >> $buffer + +echo "## default kernel options" >> $buffer +echo "## default kernel options for automagic boot options" >> $buffer +echo "## e.g. kopt=root=/dev/hda1 ro" >> $buffer +echo "# kopt=$kopt" >> $buffer +echo >> $buffer + +echo "## default grub root device" >> $buffer +echo "## e.g. groot=(hd0,0)" >> $buffer +echo "# groot=$grub_root_device" >> $buffer +echo >> $buffer + +echo "## should update-grub create alternative automagic boot options" >> $buffer +echo "## e.g. alternative=true" >> $buffer +echo "## alternative=false" >> $buffer +echo "# alternative=$alternative" >> $buffer +echo >> $buffer + +echo "## should update-grub lock alternative automagic boot options" >> $buffer +echo "## e.g. lockalternative=true" >> $buffer +echo "## lockalternative=false" >> $buffer +echo "# lockalternative=$lockalternative" >> $buffer +echo >> $buffer + +echo "## altoption boot targets option" >> $buffer +echo "## multiple altoptions lines are allowed" >> $buffer +echo "## e.g. altoptions=(extra menu suffix) extra boot options" >> $buffer +echo "## altoptions=(recovery mode) single" >> $buffer + +if ! grep -q "^# altoptions" $menu ; then + echo "# altoptions=$altoptions" >> $buffer +else + grep "^# altoptions" $menu >> $buffer +fi +echo >> $buffer + +echo "## controls how many kernels should be put into the menu.lst" >> $buffer +echo "## only counts the first occurence of a kernel, not the" >> $buffer +echo "## alternative kernel options" >> $buffer +echo "## e.g. howmany=all" >> $buffer +echo "## howmany=7" >> $buffer +echo "# howmany=$howmany" >> $buffer +echo >> $buffer + +echo "## ## End Default Options ##" >> $buffer +echo >> $buffer + +sortedKernels="" +for kern in $(/bin/ls -1vr /boot/vmlinuz-*) ; do + # found a kernel + newerKernels="" + for i in $sortedKernels ; do + res=$(CompareVersions "$kern" "$i") + if [ "$kern" != "" -a "$res" -gt 0 ] ; then + newerKernels="$newerKernels $kern $i" + kern="" + else + newerKernels="$newerKernels $i" + fi + done + if [ "$kern" != "" ] ; then + newerKernels="$newerKernels $kern" + fi + sortedKernels="$newerKernels" +done + +counter=0 +for kern in $sortedKernels ; do + counter=$(($counter + 1)) + if test ! x"$howmany" = x"all" ; then + if [ $counter -gt $howmany ] ; then + break + fi + fi + kernelName=$(basename $kern) + kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz-//') + initrdName=$(FindInitrdName "/boot" "$kernelVersion") + + if mount | grep -qs "on /boot " > /dev/null 2>&1 ; then + kernel=/$kernelName + if [ -n "$initrdName" ] ; then + initrd=/$initrdName + fi + else + kernel=/boot/$kernelName + if [ -n "$initrdName" ] ; then + initrd=/boot/$initrdName + fi + fi + + echo "Found kernel: $kernel" + + echo "title Debian GNU/Linux, kernel $kernelVersion" >> $buffer + echo "root $grub_root_device" >> $buffer + echo "kernel $kernel $kopt" >> $buffer + if [ -n "$initrdName" ]; then + echo "initrd $initrd" >> $buffer + fi + echo "savedefault" >> $buffer + echo "boot" >> $buffer + echo >> $buffer + + # insert the alternative boot options + if test ! x"$alternative" = x"false" ; then + # for each altoptions line do this stuff + sed -ne 's/# altoptions=\(.*\)/\1/p' $buffer | while read line; do + descr=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\1/p') + suffix=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\2/p') + echo "title Debian GNU/Linux, kernel $kernelVersion $descr" >> $buffer + # lock the alternative options + if test x"$lockalternative" = x"true" ; then + echo "lock" >> $buffer + fi + echo "root $grub_root_device" >> $buffer + echo "kernel $kernel $kopt $suffix" >> $buffer + if [ -n "$initrdName" ]; then + echo "initrd $initrd" >> $buffer + fi + echo "savedefault" >> $buffer + echo "boot" >> $buffer + echo >> $buffer + done + fi +done + +echo $end >> $buffer + +echo -n "Updating $menu ... " +# Insert the new options into the menu +if ! grep -q "^$start" $menu ; then + cat $buffer >> $menu +else + umask 077 + sed -e "/^$start/,/^$end/{ + /^$start/r $buffer + d + } + " $menu > $menu.new + cat $menu.new > $menu + rm -f $buffer $menu.new +fi +echo "done" +echo --- grub-0.93.orig/debian/control +++ grub-0.93/debian/control @@ -0,0 +1,22 @@ +Source: grub +Section: admin +Priority: optional +Maintainer: leon j. breedt +Build-Depends: debhelper (>> 4.0.0), libncurses5-dev | libncurses-dev +Standards-Version: 3.5.9 + +Package: grub-gfxboot +Architecture: i386 hurd-i386 +Depends: ${shlibs:Depends} +Suggests: grub-doc, gfxboot-theme-debian +Conflicts: grub +Provides: grub +Description: GRand Unified Bootloader with gfxboot support + GRUB is a GPLed bootloader intended to unify bootloading across x86 + operating systems. In addition to loading the Linux kernel, + it implements the Multiboot standard, which allows for flexible loading + of multiple boot images (needed for modular kernels such as the GNU + Hurd). + . + NOTE: This version of GRUB includes the 'gfxboot' support which + allows for graphical boot menus. --- grub-0.93.orig/debian/rules +++ grub-0.93/debian/rules @@ -0,0 +1,93 @@ +#!/usr/bin/make -f +# debian/rules for grub-gfxboot +# copyright (c) 2003 leon j. breedt + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +configure-stamp: + dh_testdir + ./configure \ + --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/ \ + --exec-prefix=/ \ + --mandir=\${prefix}/usr/share/man \ + --infodir=\${prefix}/usr/share/info \ + --datadir=\${prefix}/usr/lib \ + --disable-auto-linux-mem-opt + + touch configure-stamp + +build: patch-stamp configure-stamp build-stamp +build-stamp: + $(MAKE) + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + -$(MAKE) distclean + + dh_clean + +patch: patch-stamp +patch-stamp: + if [ ! -f patch-stamp ]; then \ + debian/patches/apply; \ + fi + touch patch-stamp + +unpatch: + if [ -f patch-stamp ]; then \ + debian/patches/unapply; \ + fi + rm -f patch-stamp + +install: build + dh_testdir + dh_testroot + dh_clean -k -a + dh_installdirs -a + + $(MAKE) DESTDIR=$(CURDIR)/debian/grub-gfxboot install + + # these belong in grub-doc + rm -rf $(CURDIR)/debian/grub-gfxboot/usr/share/info + + # install update-grub + install -m 755 debian/update-grub \ + debian/grub-gfxboot/sbin + + # install grub-floppy + install -m 755 debian/grub-floppy \ + debian/grub-gfxboot/sbin + + # install mkbimage + install -m 755 debian/mkbimage \ + debian/grub-gfxboot/sbin + +binary: install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_shlibdeps + dh_makeshlibs + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +.PHONY: build clean binary install configure --- grub-0.93.orig/debian/update-grub.8 +++ grub-0.93/debian/update-grub.8 @@ -0,0 +1,91 @@ +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.TH "update-grub" "8" "June 18, 2001" "Jason Thomas" +.SH "NAME" +update\-grub \- program to generate GRUB's menu.lst file +.SH "SYNOPSIS" +.B update\-grub [-y] +.SH "OPTIONS" +.TP +\fB-y\fR +Assume 'yes' on all questions. +.SH "DESCRIPTION" +.B \fBupdate\-grub\fR +is a program used to generate the \fImenu.lst\fR file used by the grub bootloader. +It works by looking in \fI/boot\fR for all files which start with "\fIvmlinuz\-\fR". They will be treated as kernels, and grub menu entries will be created for each. It will also create the initial \fImenu.lst\fR if none exists, after prompting the user. +It will also add initrd lines for ramdisk images found with the same version as kernels found. e.g. /boot/vmlinuz-2.4.5 and /boot/initrd-2.4.5 will cause a line of "initrd=/boot/initrd-2.4.5 or simliar to be added for the kernel entry in the menu.lst. + +After \fBupdate\-grub\fR has been run for the first time, the user is required to edit the generated \fBmenu.lst\fR. The user must set the two options \fBupdate\-grub\fR uses. Then re\-run the \fBupdate\-grub\fR script to update the \fImenu.lst\fR file using the default's that have been set. + +These are the options passed to the linux kernel: +.br +# kopt=root=/dev/hda1 ro +.br +Everything after "kopt=" is passed to the kernel as parameters. See bootparam(7) for more information. + +This is the grub device from which grub loads the kernel: +.br +# groot=(hd0,1) +.br +(hd0,1) is a partition in grub notation. See grub(8) for more information. + +This option controls if grub should create the alternative boot options in the menu entries +.br +# alternative=true +.br +# alternative=false + +This option controls if grub should lock the alternative boot options see grub(8) for more information. +.br +# lockalternative=true +.br +# lockalternative=false + +This options controls what is used for the alternative boot options, multiple altoptions lines are allowed. +.br +# altoptions=(some description) some kernel command line options +.br +# altoptions=(recovery option) single +.br +The description is placed in '()' and the kernel command line options follow that. + +The \fBupdate\-grub\fR script can be ran automagically from the \fI/etc/kernel\-img.conf\fR file by adding the following lines: + +postinst_hook = /sbin/update\-grub +.br +postrm_hook = /sbin/update\-grub +.br +do_bootloader = no + +For further information related to \fI/etc/kernel\-img.conf\fR, see the manpage kernel\-img.conf(5). +.SH "SEE ALSO" +.BR grub (8), +.BR grub\-install (8), +.BR kernel\-img.conf (5), +.BR bootparam (7). +.PP +The full documentation for +.B grub +is maintained as a Texinfo manual in the grub-doc package. If the +.B info +and +.B grub +programs are properly installed at your site, the command +.IP +.B info grub +.PP +should give you access to the complete manual. +.SH "AUTHOR" +This manual page was written by Jason Thomas , +for the Debian GNU/Linux system (but may be used by others). +.\" vim:syn=nroff --- grub-0.93.orig/debian/mkbimage +++ grub-0.93/debian/mkbimage @@ -0,0 +1,385 @@ +#!/bin/sh +# MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode +# C) 2001 Thierry Laronde +# C) 2001,2002 Robert Millan for the GNU port. + + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, you can either send email to this +# program's maintainer or write to: The Free Software Foundation, +# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. + +# $Id: mkbimage,v 1.10 2002/01/01 15:24:27 tlaronde Exp $ + +# Global variables +tarfile= +dir= +fs= #file system type +decompress= +image_type= +uname=`uname -s` +# You can set this if you need to use a specially located GRUB. +# This MUST end by a '/'! +GRUB_PATH= + +#----------------------------DON'T CHANGE: INTERNALS + +block_size=512 +cylinders= +heads= +sectors= +cyl_size= +type_option= +geo_option= +image= +bk_120=$((2 * 15 * 80)) +bk_144=$((2 * 18 * 80)) +bk_288=$((2 * 36 * 80)) +bk_160=$((2 * 20 * 80)) +bk_168=$((2 * 21 * 80)) +bk_174=$((2 * 21 * 83)) +lo_options= +device_map= +mkfs_options= +debug= +stage2_os_name= + +# Name by which this script was invoked. +program=`echo "$0" | sed -e 's/[^\/]*\///g'` +mkbimage_version='$Id: mkbimage,v 1.10 2002/01/01 15:24:27 tlaronde Exp $' + +usage=" +Usage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE +Make a Bootable IMAGE using GRUB as a bootloader + +Options: + Actions: + -d DIRECTORY [default CWD] + Directory where the boot.image and the partition subdirectories + are/will be created + -f TAR_FILE + Name of the tar file containing the filesystem to install. Can + be a pure tar file [.tar] or a compressed tar file + [.tar.gz|.tar.bz2] + -s FS_TYPE + Type of the file system to create on the virtual disk. Choices + are: ext2, minix or msdos [default is ext2] + -t TYPE + Type of the image to create. Choices are '1.20', '1.44', '1.60', + '1.68', '1.74', '2.88' or 'hd' [default is hd] + -F + Force to set the set_dpt flag (unnecessary 99% of the time! Be + careful! + Informations: + -D turn Debugging on [xtrace] + -h display this Help and exit + -V display Version information and exit + +Copyright (c) 2001 Thierry Laronde . +Copyright (c) 2001,2002 Robert Millan for the GNU port. +GPLed." + +version="$mkbimage_version +Written by Thierry Laronde. +Port to the GNU system by Robert Millan. + +Copyright (c) 2001 Thierry Laronde . +Copyright (c) 2001,2002 Robert Millan for the GNU port. + +This is free software under the GPL version 2 or later; see the source for +copying conditions. There is NO warranty, not even for MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE." + +# Functions + +error () +{ + case $1 in + bug) echo "This is a bug!"; + echo "$usage";; + option) echo "Unknow option"; echo "$usage";; + missing_argument) echo "You must give an argument to the option!"; + echo "$usage";; + missing_option) echo "You must indicate at least one option!"; + echo "$usage";; + must_be_root) echo "You must be root!";; + unknown_fs) echo "The supported fs are: ext2, minix or msdos!";; + unknown_hurd_fs) echo "The GNU Hurd only supports ext2!";; + unknown_format) echo "The tar file must be .tar|.tar.gz|.tar.bz2!";; + wont_fit) echo "The files won't fit on the selected type of media!";; + wrong_directory) echo "Directory inexistant or not given!"; + echo "$usage";; + wrong_file) echo "File inexistant or empty!"; + echo "$usage";; + wrong_type) echo "The type specified is not a valid one!"; + echo "$usage";; + esac + exit 1 +} + +#********************************************************************** +# MAIN PROGRAM * +#********************************************************************** + +#---------------------- Getting the options + +[ $# -eq 0 ] && error missing_option; + +while [ $# -gt 0 ]; do + case "$1" in + -d) shift; + dir="$1"; + [ ! -d "$1" ] && error wrong_directory;; + -f) shift; + tarfile="$1"; + [ -z "$tarfile" ] && error missing_argument;; + -s) shift; + fs="$1";; + -t) shift; + image_type="$1";; + -F) geo_option="-F";; + -D) debug="-v"; + set -x;; + -h) echo "$usage"; exit 0;; + -V) echo "$version"; exit 0;; + *) error option ;; + esac +shift +done +#---------------------- Must be root +[ ! `id -u` -eq 0 ] && [ $uname != "GNU" ] && error must_be_root; + +#---------------------- Sanity checks +[ ! "$tarfile" ] && error missing_argument; +[ ! -s "$tarfile" ] && error wrong_file; + +if [ ! "$image_type" ]; then + image_type=hd; +elif [ "$image_type" != "1.20" -a "$image_type" != "1.44" \ + -a "$image_type" != "1.60" -a "$image_type" != "1.68" \ + -a "$image_type" != "2.88" -a "$image_type" != "1.74" \ + -a "$image_type" != "hd" -a "$image_type" != "1.60" ] ; then + error wrong_type ; +fi + +[ ! "$fs" ] && fs=ext2 +case "$fs" in + ext2) mkfs_options="-m 0"; ptype="83" ;; + minix) mkfs_options="-v"; ptype="81";; # Minix version 2 + msdos) mkfs_options="-f 1 -F 12"; ptype="1";; # the smallest... + *) error unknown_fs;; +esac + +[ $fs = ext2 ] || [ ! $uname = "GNU" ] || error unknown_hurd_fs + +# What type of tar file has been given ? + +suffix=`echo "$tarfile" | sed -n 's/^.*\.\([targbz2]\{2,3\}\)$/\1/p'` +case "$suffix" in + tar) decompress="cat";; + gz) decompress="gunzip -c";; + bz2) decompress="bunzip2 -c";; + *) error unknown_format;; +esac +#---------------------- Initializations + +[ ! "$dir" ] && dir=`pwd` + +image=$dir/$image_type.image +device_map=$dir/device.map + +# First, find the size of the tar file in block_size. +file_size=`$decompress $tarfile | wc -c | tr -d ' '` +file_size=$(($file_size / $block_size + 1)) + +# Increase in order to be sure that with a fs there will be enough +# room (trying 110%) +file_size=$(($file_size + $file_size / 10)) + +case "$image_type" in + hd) heads=16; + sectors=63; + cyl_size=$((16 * 63)); + # Create the minimum number of cylinders. At the moment, we leave + # some space by rounding everything up by adding 1 cylinder, plus + # another one for MBR + reserved track. + cylinders=$(($file_size / $cyl_size + 2));; + 1.20) [ $file_size -ge $bk_120 ] && error wont_fit; + heads=2; + sectors=15; + cyl_size=$((2 * 15)); + cylinders=80;; + 1.44) [ $file_size -ge $bk_144 ] && error wont_fit; + heads=2; + sectors=18; + cyl_size=$((2 * 18)); + cylinders=80;; + 1.60) [ $file_size -ge $bk_160 ] && error wont_fit; + heads=2; + sectors=20; + cyl_size=$((2 * 20)); + cylinders=80; + geo_option="-F";; + 1.68) [ $file_size -ge $bk_168 ] && error wont_fit; + heads=2; + sectors=21; + cyl_size=$((2 * 21)); + cylinders=80;; + 1.74) [ $file_size -ge $bk_174 ] && error wont_fit; + heads=2; + sectors=21; + cyl_size=$((2 * 21)); + cylinders=83;; + 2.88) [ $file_size -ge $bk_288 ] && error wont_fit; + heads=2; + sectors=36; + cyl_size=$((2 * 36)); + cylinders=80;; + *) error bug;; +esac + +type_option="-t $image_type" + +# We start by creating a virtual disk which size is the number of +# cylinders of $cyl_size mandatory to put the files stocked in the $tarfile +# Create the empty virtual disk +dd if=/dev/zero of=$image bs=$block_size count=$(($cyl_size * $cylinders)) + +# We then format the virtual disk +# NOTE: the El Torito specification wants only one partition. So we +# create the first, and the remaining 3 entries are empty. + +if [ "$image_type" = "hd" ]; then +/sbin/sfdisk -C $cylinders -H $heads -S $sectors -D $image</dev/null + + # and mount the partition + mount -t $fs /dev/loop1 ${image}1 ; + +elif [ $uname = "GNU" ]; then + + /sbin/mkfs.$fs -F $mkfs_options ${image} + + # We then create the node for the first partition + mkdir ${image}1 2>/dev/null + + # and start a translator for the filesystem image + settrans -afg ${image}1 /hurd/ext2fs ${image} ; +fi + +# then untar the files +$decompress $tarfile | tar -C ${image}1 $debug -xf - + +if [ $uname = "Linux" ]; then + # Be sure that everything is written and flushed + sync + umount ${image}1 + /sbin/losetup -d /dev/loop1 + /sbin/losetup -d /dev/loop0 + + # Then remount the up-to-date image + /sbin/losetup /dev/loop0 $image + /sbin/losetup $lo_options /dev/loop1 $image + + # And remount the partition + mount -t $fs /dev/loop1 ${image}1 ; + +elif [ $uname = "GNU" ]; then + # Be sure that everything is written and flushed + sync + settrans -afg ${image}1 + + # Then restart the translator for the up-to-date image + settrans -afg ${image}1 /hurd/ext2fs ${image} ; +fi + +#We verify that the stage2 exists and we search the name +stage2_os_name=`find ${image}1 -name stage2 -type f` + +[ ! $stage2_os_name ] && { echo "I can't find stage2!"; exit 1;} + +#------------------------- GRUB stuff +if [ "$image_type" = "hd" ]; then + device='(hd0)' + root='(hd0,0)' +else + device='(fd0)' + root='(fd0)' +fi + +if [ $uname = "Linux" ]; then loop=/dev/loop0; +elif [ $uname = "GNU" ]; then loop=${image}; +fi + +cat<$device_map +$device $loop +EOT + +${GRUB_PATH}grub --device-map=$device_map --batch<.image of=/dev/fd0[u] bs=512 + +will be more than enough... if you have formated the floppy correctly +using \`superformat' to be found in \`fdutils' package. + +For El Torito floppy emulation : + +mkisofs -b -c boot.catalog -o raw.iso + +And for El Torito Hard Disk emulation: + +mkisofs -b -hard-disk-boot -c boot.catalog -o raw.iso + +Enjoy! +EOF + +exit 0 --- grub-0.93.orig/debian/mkbimage.8 +++ grub-0.93/debian/mkbimage.8 @@ -0,0 +1,58 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.29. +.TH $ID: "1" "February 2003" "$Id: mkbimage,v 1.10 2002/01/01 15:24:27 tlaronde Exp $" "User Commands" +.SH NAME +$Id: \- manual page for $Id: mkbimage,v 1.10 2002/01/01 15:24:27 tlaronde Exp $ +.SH SYNOPSIS +.B mkbimage +[\fI-hVF\fR] [\fI-t TYPE\fR] [\fI-d DIRECTORY\fR] [\fI-s FS_TYPE\fR] \fI-f TAR_FILE\fR +.SH DESCRIPTION +Make a Bootable IMAGE using GRUB as a bootloader +.SH OPTIONS +.IP +Actions: +\fB\-d\fR DIRECTORY [default CWD] +.IP +Directory where the boot.image and the partition subdirectories +are/will be created +.HP +\fB\-f\fR TAR_FILE +.IP +Name of the tar file containing the filesystem to install. Can +be a pure tar file [.tar] or a compressed tar file +[.tar.gz|.tar.bz2] +.HP +\fB\-s\fR FS_TYPE +.IP +Type of the file system to create on the virtual disk. Choices +are: ext2, minix or msdos [default is ext2] +.HP +\fB\-t\fR TYPE +.IP +Type of the image to create. Choices are '1.20', '1.44', '1.60', +\&'1.68', '1.74', '2.88' or 'hd' [default is hd] +.HP +\fB\-F\fR +.IP +Force to set the set_dpt flag (unnecessary 99% of the time! Be +careful! +.IP +Informations: +\fB\-D\fR turn Debugging on [xtrace] +\fB\-h\fR display this Help and exit +\fB\-V\fR display Version information and exit +.SH AUTHOR +Written by Thierry Laronde. +Port to the GNU system by Robert Millan. +.SH COPYRIGHT +Copyright \(co 2001 Thierry Laronde . +.br +Copyright \(co 2001,2002 Robert Millan for the GNU port. +GPLed. +.PP +Copyright \(co 2001 Thierry Laronde . +.br +Copyright \(co 2001,2002 Robert Millan for the GNU port. +.PP +This is free software under the GPL version 2 or later; see the source for +copying conditions. There is NO warranty, not even for MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. --- grub-0.93.orig/debian/grub-gfxboot.manpages +++ grub-0.93/debian/grub-gfxboot.manpages @@ -0,0 +1,3 @@ +debian/update-grub.8 +debian/grub-floppy.8 +debian/mkbimage.8 --- grub-0.93.orig/debian/patches/00-grub-0.93-path-patch +++ grub-0.93/debian/patches/00-grub-0.93-path-patch @@ -0,0 +1,72 @@ +diff -ur grub-0.93/Makefile.am grub-0.93.new/Makefile.am +--- grub-0.93/Makefile.am 2002-07-01 16:15:36.000000000 +0200 ++++ grub-0.93.new/Makefile.am 2003-02-04 13:03:36.000000000 +0100 +@@ -2,3 +2,4 @@ + AUTOMAKE_OPTIONS = 1.5 + SUBDIRS = netboot stage2 stage1 lib grub util docs + EXTRA_DIST = BUGS MAINTENANCE ++pkgdatadir=$(datadir) +Only in grub-0.93.new: Makefile.am.orig +diff -ur grub-0.93/stage1/Makefile.am grub-0.93.new/stage1/Makefile.am +--- grub-0.93/stage1/Makefile.am 2002-09-08 03:58:08.000000000 +0200 ++++ grub-0.93.new/stage1/Makefile.am 2003-02-04 13:03:36.000000000 +0100 +@@ -1,4 +1,4 @@ +-pkgdatadir = $(datadir)/$(PACKAGE)/$(host_cpu)-$(host_vendor) ++pkgdatadir = /usr/lib/grub + nodist_pkgdata_DATA = stage1 + + CLEANFILES = $(nodist_pkgdata_DATA) +diff -ur grub-0.93/stage2/Makefile.am grub-0.93.new/stage2/Makefile.am +--- grub-0.93/stage2/Makefile.am 2002-11-29 19:00:53.000000000 +0100 ++++ grub-0.93.new/stage2/Makefile.am 2003-02-04 13:03:36.000000000 +0100 +@@ -26,7 +26,7 @@ + -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -fwritable-strings + + # Stage 2 and Stage 1.5's. +-pkgdatadir = $(datadir)/$(PACKAGE)/$(host_cpu)-$(host_vendor) ++pkgdatadir = /usr/lib/grub + + EXTRA_PROGRAMS = nbloader.exec pxeloader.exec diskless.exec + +Only in grub-0.93.new/stage2: Makefile.am.orig +diff -ur grub-0.93/util/grub-install.in grub-0.93.new/util/grub-install.in +--- grub-0.93/util/grub-install.in 2002-05-20 13:21:50.000000000 +0200 ++++ grub-0.93.new/util/grub-install.in 2003-02-04 13:03:36.000000000 +0100 +@@ -27,7 +27,7 @@ + host_cpu=@host_cpu@ + host_os=@host_os@ + host_vendor=@host_vendor@ +-pkgdatadir=${datadir}/${PACKAGE}/${host_cpu}-${host_vendor} ++pkgdatadir=${datadir} + + grub_shell=${sbindir}/grub + log_file=/tmp/grub-install.log.$$ +@@ -378,14 +378,19 @@ + exit 1 + fi + +-# Copy the GRUB images to the GRUB directory. +-for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do +- rm -f $file || exit 1 +-done +-for file in \ +- ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do +- cp -f $file ${grubdir} || exit 1 +-done ++# FHS says that /usr/share is used for architecture independent data, ++# so all stage-files are directly installed to /usr/lib/grub. ++# Therefor this part is no longer needed. ++# <--cut_here--> ++## Copy the GRUB images to the GRUB directory. ++#for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do ++# rm -f $file || exit 1 ++#done ++#for file in \ ++# ${pkgdatadir}/stage1 ${pkgdatadir}/stage2 ${pkgdatadir}/*stage1_5; do ++# cp -f $file ${grubdir} || exit 1 ++#done ++# <--uncut--> + + # Make sure that GRUB reads the same images as the host OS. + test -n "$mkimg" && img_file=`$mkimg` +Only in grub-0.93.new/util: grub-install.in.orig --- grub-0.93.orig/debian/patches/05-use_ferror.diff +++ grub-0.93/debian/patches/05-use_ferror.diff @@ -0,0 +1,15 @@ +Fread doesn't return -1 on error, so use ferror(). + +--- util/mbchk.c.old Tue Jan 22 18:36:17 2002 ++++ util/mbchk.c Tue Jan 22 18:28:54 2002 +@@ -59,7 +59,9 @@ check_multiboot (const char *filename, F + int i; + char buf[8192]; + +- if (fread (buf, 1, 8192, fp) < 0) ++ fread (buf, 1, 8192, fp); ++ ++ if (ferror(fp)) + { + fprintf (stderr, "%s: Read error.\n", filename); + return 0; --- grub-0.93.orig/debian/patches/10-configury.diff +++ grub-0.93/debian/patches/10-configury.diff @@ -0,0 +1,162 @@ +diff -ur grub-0.93.orig/acinclude.m4 grub-0.93/acinclude.m4 +--- grub-0.93.orig/acinclude.m4 2001-07-13 10:02:04.000000000 +0200 ++++ grub-0.93/acinclude.m4 2003-02-04 13:07:25.000000000 +0100 +@@ -31,7 +31,7 @@ + + if test "x$grub_cv_asm_uscore" = xyes; then + AC_DEFINE_UNQUOTED([HAVE_ASM_USCORE], $grub_cv_asm_uscore, +- [Define if C symbols get an underscore after compilation]) ++ [Define if C symbols get an underscore after compilation.]) + fi + + AC_MSG_RESULT([$grub_cv_asm_uscore]) +@@ -145,9 +145,9 @@ + fi + + AC_DEFINE_UNQUOTED([ADDR32], $grub_tmp_addr32, +- [Define it to \"addr32\" or \"addr32;\" to make GAS happy]) ++ [Define it to \"addr32\" or \"addr32;\" to make GAS happy.]) + AC_DEFINE_UNQUOTED([DATA32], $grub_tmp_data32, +- [Define it to \"data32\" or \"data32;\" to make GAS happy]) ++ [Define it to \"data32\" or \"data32;\" to make GAS happy.]) + + AC_MSG_RESULT([$grub_cv_asm_prefix_requirement])]) + +@@ -175,7 +175,8 @@ + rm -f conftest*]) + + if test "x$grub_cv_asm_absolute_without_asterisk" = xyes; then +- AC_DEFINE([ABSOLUTE_WITHOUT_ASTERISK]) ++ AC_DEFINE([ABSOLUTE_WITHOUT_ASTERISK],1, ++ [Define if an absolute indirect call/jump must NOT be prefixed with `*'.]) + fi + + AC_MSG_RESULT([$grub_cv_asm_absolute_without_asterisk])]) +@@ -193,7 +194,7 @@ + grub_cv_check_start_symbol=no)]) + + if test "x$grub_cv_check_start_symbol" = xyes; then +- AC_DEFINE([HAVE_START_SYMBOL]) ++ AC_DEFINE([HAVE_START_SYMBOL],1,[Define if start is defined.]) + fi + + AC_MSG_RESULT([$grub_cv_check_start_symbol]) +@@ -212,7 +213,7 @@ + grub_cv_check_uscore_start_symbol=no)]) + + if test "x$grub_cv_check_uscore_start_symbol" = xyes; then +- AC_DEFINE([HAVE_USCORE_START_SYMBOL]) ++ AC_DEFINE([HAVE_USCORE_START_SYMBOL],1,[Define if _start is defined.]) + fi + + AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol]) +@@ -231,7 +232,8 @@ + grub_cv_check_uscore_uscore_bss_start_symbol=no)]) + + if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then +- AC_DEFINE([HAVE_USCORE_USCORE_BSS_START_SYMBOL]) ++ AC_DEFINE([HAVE_USCORE_USCORE_BSS_START_SYMBOL],1, ++ [Define if __bss_start is defined.]) + fi + + AC_MSG_RESULT([$grub_cv_check_uscore_uscore_bss_start_symbol]) +@@ -250,7 +252,7 @@ + grub_cv_check_edata_symbol=no)]) + + if test "x$grub_cv_check_edata_symbol" = xyes; then +- AC_DEFINE([HAVE_EDATA_SYMBOL]) ++ AC_DEFINE([HAVE_EDATA_SYMBOL],1,[Define if edata is defined.]) + fi + + AC_MSG_RESULT([$grub_cv_check_edata_symbol]) +@@ -269,7 +271,7 @@ + grub_cv_check_uscore_edata_symbol=no)]) + + if test "x$grub_cv_check_uscore_edata_symbol" = xyes; then +- AC_DEFINE([HAVE_USCORE_EDATA_SYMBOL]) ++ AC_DEFINE([HAVE_USCORE_EDATA_SYMBOL],1,[Define if _edata is defined.]) + fi + + AC_MSG_RESULT([$grub_cv_check_uscore_edata_symbol]) +@@ -288,7 +290,7 @@ + grub_cv_check_end_symbol=no)]) + + if test "x$grub_cv_check_end_symbol" = xyes; then +- AC_DEFINE([HAVE_END_SYMBOL]) ++ AC_DEFINE([HAVE_END_SYMBOL],1,[Define if end is defined.]) + fi + + AC_MSG_RESULT([$grub_cv_check_end_symbol]) +@@ -307,13 +309,13 @@ + grub_cv_check_uscore_end_symbol=no)]) + + if test "x$grub_cv_check_uscore_end_symbol" = xyes; then +- AC_DEFINE([HAVE_USCORE_END_SYMBOL]) ++ AC_DEFINE([HAVE_USCORE_END_SYMBOL],1,[Define if _end is defined.]) + fi + + AC_MSG_RESULT([$grub_cv_check_uscore_end_symbol]) + ]) + +-dnl grub_DEFINE_FILE(MACRO_NAME, FILE_NAME) ++dnl grub_DEFINE_FILE(MACRO_NAME, FILE_NAME, DESCRIPTION) + dnl grub_DEFINE_FILE defines a macro as the contents of a file safely. + dnl Replace some escape sequences, because autoconf doesn't handle them + dnl gracefully. +@@ -361,6 +363,6 @@ + AC_MSG_ERROR([${CC-cc} failed to produce an executable file]) + fi + +-AC_DEFINE_UNQUOTED([$1], "$grub_tmp_value") ++AC_DEFINE_UNQUOTED([$1], "$grub_tmp_value", [$3]) + rm -f conftest* + ]) +diff -ur grub-0.93.orig/configure.in grub-0.93/configure.in +--- grub-0.93.orig/configure.in 2002-11-29 21:12:08.000000000 +0100 ++++ grub-0.93/configure.in 2003-02-04 13:07:25.000000000 +0100 +@@ -50,6 +50,7 @@ + + AC_CHECK_TOOL(CC, gcc) + AC_PROG_CC ++AM_PROG_AS + # We need this for older versions of Autoconf. + _AM_DEPENDENCIES(CC) + +@@ -181,14 +182,14 @@ + # Get the filename or the whole disk and open it. + # Known to work on NetBSD. + AC_CHECK_LIB(util, opendisk, [GRUB_LIBS="$GRUB_LIBS -lutil" +- AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])]) ++ AC_DEFINE([HAVE_OPENDISK], 1, [Define if opendisk() in -lutil can be used]).]) + + # Unless the user specify --without-curses, check for curses. + if test "x$with_curses" != "xno"; then + AC_CHECK_LIB(ncurses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lncurses" +- AC_DEFINE(HAVE_LIBCURSES)], ++ AC_DEFINE([HAVE_LIBCURSES],1,[Define if you have a curses library (ncurses preferred).])], + [AC_CHECK_LIB(curses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lcurses" +- AC_DEFINE(HAVE_LIBCURSES)])]) ++ AC_DEFINE([HAVE_LIBCURSES],1,[Define if you have a curses library (ncurses preferred).])])]) + fi + + AC_SUBST(GRUB_LIBS) +@@ -591,7 +592,8 @@ + : + else + if test -r $enable_preset_menu; then +- grub_DEFINE_FILE(PRESET_MENU_STRING, [$enable_preset_menu]) ++ grub_DEFINE_FILE(PRESET_MENU_STRING, [$enable_preset_menu], ++ [Define if the user specifies --enable-preset-menu=FILE.]) + else + AC_MSG_ERROR([Cannot read the preset menu file $enable_preset_menu]) + fi +@@ -610,7 +612,7 @@ + if test "x$enable_auto_linux_mem_opt" = xno; then + : + else +- AC_DEFINE(AUTO_LINUX_MEM_OPT) ++ AC_DEFINE([AUTO_LINUX_MEM_OPT],1,[Define if the user specified --enable-auto-linux-mem-opt.]) + fi + + dnl Now substitute the variables. +Only in grub-0.93: configure.in.orig --- grub-0.93.orig/debian/patches/15-ccas_changes.diff +++ grub-0.93/debian/patches/15-ccas_changes.diff @@ -0,0 +1,150 @@ +Only in grub-0.93.orig: Makefile.am.orig +Only in grub-0.93.orig: configure.in.orig +diff -ur grub-0.93.orig/stage1/Makefile.am grub-0.93/stage1/Makefile.am +--- grub-0.93.orig/stage1/Makefile.am 2003-02-04 13:03:36.000000000 +0100 ++++ grub-0.93/stage1/Makefile.am 2003-02-04 13:10:01.000000000 +0100 +@@ -5,6 +5,8 @@ + + # We can't use builtins or standard includes. + AM_ASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc ++AM_CCASFLAGS= $(STAGE1_CFLAGS) -fno-builtin -nostdinc -I. ++ + LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 + + noinst_PROGRAMS = stage1.exec +diff -ur grub-0.93.orig/stage2/Makefile.am grub-0.93/stage2/Makefile.am +--- grub-0.93.orig/stage2/Makefile.am 2003-02-04 13:03:36.000000000 +0100 ++++ grub-0.93/stage2/Makefile.am 2003-02-04 13:10:01.000000000 +0100 +@@ -11,7 +11,7 @@ + EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS) + + # For . +-INCLUDES = -I$(top_srcdir)/stage1 ++INCLUDES = -I$(top_srcdir)/stage1 -I$(top_srcdir) + + # The library for /sbin/grub. + noinst_LIBRARIES = libgrub.a +@@ -75,7 +75,7 @@ + HERCULES_FLAGS = + endif + +-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \ ++STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc $(INCLUDES) -I. \ + $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) + + STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000 +@@ -89,6 +89,7 @@ + smp-imps.c stage2.c terminfo.c tparm.c + pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) + pre_stage2_exec_ASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) ++pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) + pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK) + + if NETBOOT_SUPPORT +@@ -110,6 +111,7 @@ + + start_exec_SOURCES = start.S + start_exec_ASFLAGS = $(STAGE2_COMPILE) ++start_exec_CCASFLAGS = $(STAGE2_COMPILE) + start_exec_LDFLAGS = $(START_LINK) + + # XXX: automake doesn't provide a way to specify dependencies for object +@@ -129,6 +131,8 @@ + -DNO_BLOCK_FILES=1 + e2fs_stage1_5_exec_ASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_EXT2FS=1 \ + -DNO_BLOCK_FILES=1 ++e2fs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_EXT2FS=1 \ ++ -DNO_BLOCK_FILES=1 + e2fs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK) + + # For fat_stage1_5 target. +@@ -138,6 +142,8 @@ + -DNO_BLOCK_FILES=1 + fat_stage1_5_exec_ASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_FAT=1 \ + -DNO_BLOCK_FILES=1 ++fat_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_FAT=1 \ ++ -DNO_BLOCK_FILES=1 + fat_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK) + + # For ffs_stage1_5 target. +@@ -147,6 +153,8 @@ + -DNO_BLOCK_FILES=1 + ffs_stage1_5_exec_ASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_FFS=1 \ + -DNO_BLOCK_FILES=1 ++ffs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_FFS=1 \ ++ -DNO_BLOCK_FILES=1 + ffs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK) + + # For minix_stage1_5 target. +@@ -156,6 +164,8 @@ + -DNO_BLOCK_FILES=1 + minix_stage1_5_exec_ASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_MINIX=1 \ + -DNO_BLOCK_FILES=1 ++minix_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_MINIX=1 \ ++ -DNO_BLOCK_FILES=1 + minix_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK) + + # For reiserfs_stage1_5 target. +@@ -165,6 +175,8 @@ + -DNO_BLOCK_FILES=1 + reiserfs_stage1_5_exec_ASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_REISERFS=1 \ + -DNO_BLOCK_FILES=1 ++reiserfs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_REISERFS=1 \ ++ -DNO_BLOCK_FILES=1 + reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK) + + # For vstafs_stage1_5 target. +@@ -174,6 +186,8 @@ + -DNO_BLOCK_FILES=1 + vstafs_stage1_5_exec_ASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_VSTAFS=1 \ + -DNO_BLOCK_FILES=1 ++vstafs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_VSTAFS=1 \ ++ -DNO_BLOCK_FILES=1 + vstafs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK) + + # For jfs_stage1_5 target. +@@ -183,6 +197,8 @@ + -DNO_BLOCK_FILES=1 + jfs_stage1_5_exec_ASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_JFS=1 \ + -DNO_BLOCK_FILES=1 ++jfs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_JFS=1 \ ++ -DNO_BLOCK_FILES=1 + jfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK) + + # For xfs_stage1_5 target. +@@ -192,6 +208,8 @@ + -DNO_BLOCK_FILES=1 + xfs_stage1_5_exec_ASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_XFS=1 \ + -DNO_BLOCK_FILES=1 ++xfs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_XFS=1 \ ++ -DNO_BLOCK_FILES=1 + xfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK) + + # For diskless target. +@@ -200,6 +218,8 @@ + -DSUPPORT_DISKLESS=1 + diskless_exec_ASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) \ + -DSUPPORT_DISKLESS=1 ++diskless_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) \ ++ -DSUPPORT_DISKLESS=1 + diskless_exec_LDFLAGS = $(PRE_STAGE2_LINK) + diskless_exec_LDADD = ../netboot/libdrivers.a + +@@ -211,6 +231,7 @@ + # For nbloader target. + nbloader_exec_SOURCES = nbloader.S + nbloader_exec_ASFLAGS = $(STAGE2_COMPILE) ++nbloader_exec_CCASFLAGS = $(STAGE2_COMPILE) + nbloader_exec_LDFLAGS = $(NBLOADER_LINK) + + # XXX: See the comment for start_exec-start.o. +@@ -224,6 +245,7 @@ + # For pxeloader target. + pxeloader_exec_SOURCES = pxeloader.S + pxeloader_exec_ASFLAGS = $(STAGE2_COMPILE) ++pxeloader_exec_CCASFLAGS = $(STAGE2_COMPILE) + pxeloader_exec_LDFLAGS = $(PXELOADER_LINK) + + # XXX: See the comment for start_exec-start.o. +Only in grub-0.93.orig/stage2: Makefile.am.orig +Only in grub-0.93.orig/util: grub-install.in.orig --- grub-0.93.orig/debian/patches/20-grub-0.93-graphics.diff +++ grub-0.93/debian/patches/20-grub-0.93-graphics.diff @@ -0,0 +1,828 @@ +diff -ur grub-0.93.orig/docs/grub.texi grub-0.93/docs/grub.texi +--- grub-0.93.orig/docs/grub.texi 2002-12-02 23:35:28.000000000 +0100 ++++ grub-0.93/docs/grub.texi 2003-02-04 13:14:08.000000000 +0100 +@@ -1831,6 +1831,7 @@ + * default:: Set the default entry + * fallback:: Set the fallback entry + * hiddenmenu:: Hide the menu interface ++* gfxmenu:: Use graphical menu interface + * timeout:: Set the timeout + * title:: Start a menu entry + @end menu +@@ -1862,6 +1863,15 @@ + @end deffn + + ++@node gfxmenu ++@subsection gfxmenu ++ ++@deffn Command gfxmenu file ++Use the graphical menu interface. The graphics data are taken from ++@var{file} and must be created using 'mkbootmsg' from the gfxboot package. ++@end deffn ++ ++ + @node hiddenmenu + @subsection hiddenmenu + +diff -ur grub-0.93.orig/grub/asmstub.c grub-0.93/grub/asmstub.c +--- grub-0.93.orig/grub/asmstub.c 2002-12-03 00:20:45.000000000 +0100 ++++ grub-0.93/grub/asmstub.c 2003-02-04 13:14:08.000000000 +0100 +@@ -478,6 +478,32 @@ + return 0; + } + ++/* graphical menu functions . */ ++int ++gfx_init (gfx_data_t *gfx_data) ++{ ++ return 0; ++} ++ ++int ++gfx_done (gfx_data_t *gfx_data) ++{ ++ return 0; ++} ++ ++int ++gfx_input (gfx_data_t *gfx_data, int *menu_entry) ++{ ++ return 0; ++} ++ ++int ++gfx_setup_menu (gfx_data_t *gfx_data) ++{ ++ return 0; ++} ++ ++ + /* low-level timing info */ + int + getrtsecs (void) +diff -ur grub-0.93.orig/stage2/asm.S grub-0.93/stage2/asm.S +--- grub-0.93.orig/stage2/asm.S 2002-12-03 00:18:56.000000000 +0100 ++++ grub-0.93/stage2/asm.S 2003-02-04 13:14:08.000000000 +0100 +@@ -1648,6 +1648,262 @@ + popl %ebp + ret + ++ ++/* ++ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ * ++ * graphical menu functions ++ * ++ */ ++ ++/* ++ * int gfx_init (gfx_data_t *gfx_data) ++ * ++ * init gfx things ++ * ++ * return vales: ++ * 0: ok ++ * 1: failed ++ * sets gfx_data->ok ++ */ ++ ++ENTRY(gfx_init) ++ pushl %ebp ++ movl %esp, %ebp ++ ++ pushl %edi ++ pushl %esi ++ pushl %ebx ++ ++ movl 8(%ebp),%edx ++ movl %edx,%edi ++ andl $0xf,%edi ++ shrl $4,%edx ++ ++ pushl %ebp ++ ++ call EXT_C(prot_to_real) ++ .code16 ++ ++ pushw %ds ++ ++ movw %dx,%ds ++ shll $4,%edx ++ leal gfx_ofs_sys_cfg(%di),%esi ++ movl gfx_ofs_mem_start(%di),%eax ++ movl gfx_ofs_mem_cur(%di),%ebx ++ movl gfx_ofs_mem_max(%di),%ecx ++ movw %ds,%dx ++ ++ lcall *gfx_ofs_jmp_table + 4 * 0 (%di) ++ ++ movl $0,%ebx ++ adcl $0,%ebx ++ ++ popw %ds ++ ++ DATA32 call EXT_C(real_to_prot) ++ .code32 ++ ++ popl %ebp ++ ++ movl %ebx,%eax ++ negl %ebx ++ incl %ebx ++ movl 8(%ebp),%edx ++ movl %ebx,gfx_ofs_ok(%edx) ++ ++ popl %ebx ++ popl %esi ++ popl %edi ++ ++ popl %ebp ++ ret ++ ++ ++/* ++ * int gfx_done (gfx_data_t *gfx_data) ++ * ++ * shut down gfx things ++ * ++ * return vales: ++ * always 0 ++ * sets gfx_data->ok ++ */ ++ ++ENTRY(gfx_done) ++ pushl %ebp ++ movl %esp, %ebp ++ ++ pushl %edi ++ pushl %esi ++ pushl %ebx ++ ++ movl 8(%ebp),%edx ++ movl %edx,%ebx ++ andl $0xf,%ebx ++ shrl $4,%edx ++ ++ pushl %ebp ++ ++ call EXT_C(prot_to_real) ++ .code16 ++ ++ pushw %ds ++ ++ movw %dx,%ds ++ ++ lcall *gfx_ofs_jmp_table + 4 * 1 (%bx) ++ ++ popw %ds ++ ++ DATA32 call EXT_C(real_to_prot) ++ .code32 ++ ++ popl %ebp ++ ++ xorl %eax,%eax ++ movl 8(%ebp),%edx ++ movl %eax,gfx_ofs_ok(%edx) ++ ++ popl %ebx ++ popl %esi ++ popl %edi ++ ++ popl %ebp ++ ret ++ ++ ++/* ++ * int gfx_input (gfx_data_t *gfx_data, int *menu_entry) ++ * ++ * let user enter a command line ++ * ++ * uses gfx_data->cmdline as buffer ++ * ++ * return values: ++ * 1: abort ++ * 2: boot ++ * menu_entry: selected entry ++ */ ++ ++ENTRY(gfx_input) ++ pushl %ebp ++ movl %esp, %ebp ++ ++ pushl %edi ++ pushl %esi ++ pushl %ebx ++ ++ movl 8(%ebp),%edx ++ movl %edx,%ebx ++ andl $0xf,%ebx ++ shrl $4,%edx ++ ++ pushl %ebp ++ ++ call EXT_C(prot_to_real) ++ .code16 ++ ++ pushw %ds ++ ++ movw %dx,%ds ++ shll $4,%edx ++ movl gfx_ofs_cmdline(%bx),%edi ++ subl %edx,%edi ++ movw gfx_ofs_cmdline_len(%bx),%cx ++ movw gfx_ofs_timeout(%bx),%ax ++ imulw $18,%ax ++ ++ pushl %ebp ++ lcall *gfx_ofs_jmp_table + 4 * 2 (%bx) ++ popl %ebp ++ movl %eax,%ecx ++ ++ popw %ds ++ ++ DATA32 call EXT_C(real_to_prot) ++ .code32 ++ ++ popl %ebp ++ ++ movl 12(%ebp),%edx ++ movl %ebx,(%edx) ++ ++ movl %ecx,%eax ++ ++ popl %ebx ++ popl %esi ++ popl %edi ++ ++ popl %ebp ++ ret ++ ++ ++/* ++ * int gfx_setup_menu (gfx_data_t *gfx_data) ++ * ++ * draw boot menu ++ * ++ * return values: ++ * always 0 ++ */ ++ ++ENTRY(gfx_setup_menu) ++ pushl %ebp ++ movl %esp, %ebp ++ ++ pushl %edi ++ pushl %esi ++ pushl %ebx ++ ++ movl 8(%ebp),%edx ++ movl %edx,%ebx ++ andl $0xf,%ebx ++ shrl $4,%edx ++ ++ call EXT_C(prot_to_real) ++ .code16 ++ ++ pushw %ds ++ ++ movw %dx,%ds ++ shll $4,%edx ++ movl gfx_ofs_menu_list(%bx),%edi ++ movl gfx_ofs_menu_default_entry(%bx),%esi ++ movl gfx_ofs_args_list(%bx),%ebp ++ subl %edx,%edi ++ subl %edx,%esi ++ subl %edx,%ebp ++ movl gfx_ofs_menu_entry_len(%bx),%edx ++ movl gfx_ofs_args_entry_len(%bx),%ecx ++ movl gfx_ofs_menu_entries(%bx),%eax ++ ++ xchg %bx,%bp ++ lcall %ds: *gfx_ofs_jmp_table + 4 * 3 (%bp) ++ ++ popw %ds ++ ++ DATA32 call EXT_C(real_to_prot) ++ .code32 ++ ++ xorl %eax,%eax ++ ++ popl %ebx ++ popl %esi ++ popl %edi ++ ++ popl %ebp ++ ret ++ ++ ++/* ++ * ++ * end graphics stuff ++ * ++ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ */ ++ + + /* + * gateA20(int linear) +diff -ur grub-0.93.orig/stage2/builtins.c grub-0.93/stage2/builtins.c +--- grub-0.93.orig/stage2/builtins.c 2002-12-04 05:41:57.000000000 +0100 ++++ grub-0.93/stage2/builtins.c 2003-02-04 13:14:08.000000000 +0100 +@@ -62,6 +62,8 @@ + int fallback_entry = -1; + /* The number of current entry. */ + int current_entryno; ++/* graphics file */ ++char graphics_file[64]; + /* The address for Multiboot command-line buffer. */ + static char *mb_cmdline; + /* The password. */ +@@ -1299,6 +1301,26 @@ + }; + + ++/* graphics */ ++static int ++gfxmenu_func (char *arg, int flags) ++{ ++ memmove(graphics_file, arg, sizeof graphics_file - 1); ++ graphics_file[sizeof graphics_file - 1] = 0; ++ ++ return 0; ++} ++ ++static struct builtin builtin_gfxmenu = ++{ ++ "gfxmenu", ++ gfxmenu_func, ++ BUILTIN_MENU | BUILTIN_HELP_LIST, ++ "gfxmenu FILE", ++ "Use the graphical menu from FILE." ++}; ++ ++ + /* geometry */ + static int + geometry_func (char *arg, int flags) +@@ -4683,6 +4705,7 @@ + &builtin_find, + &builtin_fstest, + &builtin_geometry, ++ &builtin_gfxmenu, + &builtin_halt, + &builtin_help, + &builtin_hiddenmenu, +diff -ur grub-0.93.orig/stage2/shared.h grub-0.93/stage2/shared.h +--- grub-0.93.orig/stage2/shared.h 2002-12-03 00:15:12.000000000 +0100 ++++ grub-0.93/stage2/shared.h 2003-02-04 13:14:08.000000000 +0100 +@@ -363,6 +363,25 @@ + #endif /* WITHOUT_LIBC_STUBS */ + + ++/* see typedef gfx_data_t below */ ++#define gfx_ofs_ok 0x00 ++#define gfx_ofs_mem_start 0x04 ++#define gfx_ofs_mem_cur 0x08 ++#define gfx_ofs_mem_max 0x0c ++#define gfx_ofs_code_seg 0x10 ++#define gfx_ofs_jmp_table 0x14 ++#define gfx_ofs_sys_cfg 0x44 ++#define gfx_ofs_cmdline 0x48 ++#define gfx_ofs_cmdline_len 0x4c ++#define gfx_ofs_menu_list 0x50 ++#define gfx_ofs_menu_default_entry 0x54 ++#define gfx_ofs_menu_entries 0x58 ++#define gfx_ofs_menu_entry_len 0x5c ++#define gfx_ofs_args_list 0x60 ++#define gfx_ofs_args_entry_len 0x64 ++#define gfx_ofs_timeout 0x68 ++ ++ + #ifndef ASM_FILE + /* + * Below this should be ONLY defines and other constructs for C code. +@@ -581,6 +600,39 @@ + extern int default_entry; + extern int current_entryno; + ++ ++/* ++ * graphics menu stuff ++ * ++ * Note: gfx_data and all data referred to in it must lie within a 64k area. ++ */ ++typedef struct { ++ unsigned ok; /* set while we're in graphics mode */ ++ unsigned mem_start, mem_cur, mem_max; ++ unsigned code_seg; /* code segment of binary graphics code */ ++ unsigned jmp_table[12]; /* link to graphics functions */ ++ unsigned char sys_cfg[4]; /* sys_cfg[3]: identifies boot loader (grub == 2) */ ++ char *cmdline; /* command line returned by gfx_input() */ ++ unsigned cmdline_len; /* length of the above */ ++ char *menu_list; /* list of menu entries, each of fixed length (menu_entry_len) */ ++ char *menu_default_entry; /* the default entry */ ++ unsigned menu_entries; /* number of entries in menu_list */ ++ unsigned menu_entry_len; /* one entry */ ++ char *args_list; /* same structure as menu_list, menu_entries entries */ ++ unsigned args_entry_len; /* one entry */ ++ unsigned timeout; /* in seconds (0: no timeout) */ ++} __attribute__ ((packed)) gfx_data_t; ++ ++extern gfx_data_t *graphics_data; ++ ++/* pointer to graphics image data */ ++extern char graphics_file[64]; ++ ++int gfx_init(gfx_data_t *gfx_data); ++int gfx_done(gfx_data_t *gfx_data); ++int gfx_input(gfx_data_t *gfx_data, int *menu_entry); ++int gfx_setup_menu(gfx_data_t *gfx_data); ++ + /* The constants for password types. */ + typedef enum + { +diff -ur grub-0.93.orig/stage2/stage2.c grub-0.93/stage2/stage2.c +--- grub-0.93.orig/stage2/stage2.c 2002-12-04 01:54:23.000000000 +0100 ++++ grub-0.93/stage2/stage2.c 2003-02-04 13:14:23.000000000 +0100 +@@ -22,6 +22,8 @@ + + grub_jmp_buf restart_env; + ++gfx_data_t *graphics_data; ++ + #if defined(PRESET_MENU_STRING) || defined(SUPPORT_DISKLESS) + + # if defined(PRESET_MENU_STRING) +@@ -310,6 +312,12 @@ + + if (! auth && password) + { ++ if (*graphics_file) ++ { ++ printf ("\ ++ WARNING: graphical menu doesn\'t work\ ++ in conjunction with the password feature\n" ); ++ } + printf ("\ + Press enter to boot the selected OS or \'p\' to enter a\n\ + password to unlock the next set of features."); +@@ -750,6 +758,341 @@ + } + + ++ ++/* for debugging */ ++static void hexdump(unsigned char *buf, unsigned len) ++{ ++ int i, j = 0; ++ char s[17]; ++ unsigned addr = (unsigned) buf; ++ ++ s[16] = 0; ++ while(len--) { ++ i = buf[j]; ++ i = i & 0xff; ++ s[j & 15] = (i >= 0x20 && i <= 0x7e) ? i : '.'; ++ if(!(j & 15)) { ++ printf("%x ", j + addr); ++ } ++ if(!(j & 7) && (j & 15)) printf(" "); ++ /* stupid grub_printf */ ++ printf("%x", (i >> 4) & 0x0f); ++ printf("%x ", i & 0x0f); ++ if(!(++j & 15)) { ++ printf(" %s\n", s); ++ } ++ } ++ ++ if(j & 15) { ++ s[j & 15] = 0; ++ if(!(j & 8)) printf(" "); ++ i = 1 + 3 * (16 - (j & 15)); ++ while(i--) printf(" "); ++ printf("%s\n", s); ++ } ++} ++ ++ ++/* ++ * Go through config entry and find kernel args, if any. ++ */ ++static char *get_kernel_args(char *cfg) ++{ ++ int j; ++ char *s, *t = ""; ++ ++ for(j = 0; ; j++) { ++ s = get_entry(cfg, j, 0); ++ if(!*s) break; ++ if(!memcmp(s, "kernel", 6) && (s[6] == ' ' || s[6] == '\t')) { ++ t = skip_to(0, s); ++ if(*t) t = skip_to(0, t); ++ break; ++ } ++ } ++ ++ return t; ++} ++ ++ ++/* ++ * Leave that much space on the heap. Everything else goes to the graphics ++ * functions. ++ * ++ * 0x2000 is _not_ enough ++ */ ++#define MIN_HEAP_SIZE 0x4000 ++ ++/* gfx code needs at least this much free memory */ ++#define MIN_GFX_FREE 0x4000 ++ ++/* ++ * Does normally not return. ++ */ ++static void ++run_graphics_menu (char *menu_entries, char *config_entries, int num_entries, ++ char *heap, int entryno) ++{ ++ unsigned char *buf; ++ unsigned buf_size, code_start; ++ char *s, *t, *cfg, *new_config; ++ char *saved_heap; ++ int i, j, max_len; ++ int selected_entry; ++ gfx_data_t *gfx_data; ++ ++ /* ++ * check gfx_data_t struct offsets for consistency; gcc will optimize away ++ * the whole block ++ */ ++ ++ /* dummy function to make ld fail */ ++ { ++ extern void wrong_struct_size(void); ++ #define gfx_ofs_check(a) if(gfx_ofs_##a != (char *) &gfx_data->##a - (char *) gfx_data) wrong_struct_size(); ++ gfx_ofs_check(ok); ++ gfx_ofs_check(mem_start); ++ gfx_ofs_check(mem_cur); ++ gfx_ofs_check(mem_max); ++ gfx_ofs_check(code_seg); ++ gfx_ofs_check(jmp_table); ++ gfx_ofs_check(sys_cfg); ++ gfx_ofs_check(cmdline); ++ gfx_ofs_check(cmdline_len); ++ gfx_ofs_check(menu_list); ++ gfx_ofs_check(menu_default_entry); ++ gfx_ofs_check(menu_entries); ++ gfx_ofs_check(menu_entry_len); ++ gfx_ofs_check(args_list); ++ gfx_ofs_check(args_entry_len); ++ gfx_ofs_check(timeout); ++ #undef gfx_ofs_check ++ } ++ ++ if(!num_entries) return; ++ ++ graphics_data = gfx_data = (gfx_data_t *) heap; ++ heap += sizeof *gfx_data; ++ memset(gfx_data, 0, sizeof *gfx_data); ++ ++ gfx_data->sys_cfg[2] = 2; /* bootloader: grub */ ++ gfx_data->timeout = grub_timeout >= 0 ? grub_timeout : 0; ++ ++ ++ /* setup command line edit buffer */ ++ ++ gfx_data->cmdline_len = 256; ++ ++ gfx_data->cmdline = heap; ++ heap += gfx_data->cmdline_len; ++ memset(gfx_data->cmdline, 0, gfx_data->cmdline_len); ++ ++ ++ /* setup menu entries */ ++ ++ for(i = max_len = 0; i < num_entries; i++) { ++ j = strlen(get_entry(menu_entries, i, 0)); ++ if(j > max_len) max_len = j; ++ } ++ ++ if(!max_len) return; ++ ++ gfx_data->menu_entry_len = max_len + 1; ++ gfx_data->menu_entries = num_entries; ++ ++ gfx_data->menu_list = heap; ++ heap += gfx_data->menu_entry_len * gfx_data->menu_entries; ++ ++ memset(gfx_data->menu_list, 0, gfx_data->menu_entry_len * gfx_data->menu_entries); ++ ++ for(i = 0; i < gfx_data->menu_entries; i++) { ++ strcpy(gfx_data->menu_list + i * gfx_data->menu_entry_len, get_entry(menu_entries, i, 0)); ++ } ++ ++ gfx_data->menu_default_entry = gfx_data->menu_list + entryno * gfx_data->menu_entry_len; ++ ++ ++ /* setup list of kernel args */ ++ ++ for(i = max_len = 0; i < num_entries; i++) { ++ s = get_kernel_args(get_entry(config_entries, i, 1)); ++ j = strlen(s); ++ if(j > max_len) max_len = j; ++ } ++ ++ gfx_data->args_entry_len = max_len + 1; ++ ++ gfx_data->args_list = heap; ++ heap += gfx_data->args_entry_len * gfx_data->menu_entries; ++ ++ memset(gfx_data->args_list, 0, gfx_data->args_entry_len * gfx_data->menu_entries); ++ ++ for(i = 0; i < gfx_data->menu_entries; i++) { ++ strcpy(gfx_data->args_list + i* gfx_data->args_entry_len, get_kernel_args(get_entry(config_entries, i, 1))); ++ } ++ ++ ++ /* go back here when we no longer need the graphics data */ ++ saved_heap = heap; ++ ++ ++ /* get memory area to be used by graphics functions */ ++ ++ buf = (unsigned char *) (((unsigned) heap + 0xf) & ~0xf); ++ ++ buf_size = (unsigned char *) &buf - buf - MIN_HEAP_SIZE; ++ buf_size &= ~0xf; ++ ++ /* too small */ ++ if(buf_size < 0x10000) return; ++ ++ gfx_data->mem_start = (unsigned) buf; ++ gfx_data->mem_max = gfx_data->mem_start + buf_size; ++ ++#if 0 ++ printf("graphics menu\n"); ++ printf( ++ "heap = 0x%x, buf = 0x%x (0x%x bytes), graphics_file = %s\n", ++ heap, gfx_data->mem_start, buf_size, graphics_file ++ ); ++ getkey(); ++#endif ++ ++ heap += buf_size; ++ ++ ++ /* read the file */ ++ ++ if(!grub_open(graphics_file)) { ++ printf("graphics file \"%s\" missing, press a key to continue...\n", graphics_file); ++ getkey(); ++ return; ++ } ++ ++ i = grub_read(buf, buf_size); ++ ++ grub_close(); ++ ++ if(i <= 0) { ++ printf("error reading \"%s\", press a key to continue...\n", graphics_file); ++ getkey(); ++ return; ++ } ++ ++ /* besides the file, we need some working memory, too */ ++ if(i + MIN_GFX_FREE >= buf_size) { ++ printf("file \"%s\" too large, press a key to continue...\n", graphics_file); ++ getkey(); ++ return; ++ } ++ ++ gfx_data->mem_cur = gfx_data->mem_start + ((i + 3) & ~3); /* align it */ ++ ++ // printf("image: %d bytes (%d bytes left)\n", i, gfx_data->mem_max - gfx_data->mem_cur); ++ // getkey(); ++ ++ if( ++ *(unsigned *) buf != 0x0b2d97f00 || /* magic id */ ++ buf[4] != 3 || /* version 3 */ ++ !(code_start = *(unsigned *) (buf + 8)) || ++ (code_start & 0xf) /* check alignment */ ++ ) { ++ printf("\"%s\" has wrong format, press a key to continue...\n", graphics_file); ++ getkey(); ++ return; ++ } ++ ++ ++ /* init interface to graphics functions */ ++ ++ code_start += gfx_data->mem_start; ++ ++ gfx_data->code_seg = code_start >> 4; ++ ++ // printf("code start = 0x%x, code_seg = 0x%x\n", code_start, gfx_data->code_seg); ++ ++ for(i = 0; i < sizeof gfx_data->jmp_table / sizeof *gfx_data->jmp_table; i++) { ++ gfx_data->jmp_table[i] = (gfx_data->code_seg << 16) + ((unsigned short *) code_start)[i]; ++ } ++ ++#if 0 ++ for(i = 0; i < 12; i++) { ++ printf("%d: 0x%x\n", i, gfx_data->jmp_table[i]); ++ } ++ ++ for(i = 0; i < gfx_data->menu_entries; i++) { ++ printf(">%s< - >%s<\n", ++ gfx_data->menu_list + i * gfx_data->menu_entry_len, ++ gfx_data->args_list + i * gfx_data->args_entry_len ++ ); ++ } ++ ++ printf("def: >%s<\n", gfx_data->menu_default_entry); ++#endif ++ ++ ++ /* switch to graphics mode */ ++ ++ if(gfx_init(gfx_data)) return; ++ ++ gfx_setup_menu(gfx_data); ++ ++ i = gfx_input(gfx_data, &selected_entry); ++ ++ /* ESC -> show text menu */ ++ if(i == 1) { ++ gfx_done(gfx_data); ++ grub_timeout = -1; ++ ++ return; ++ } ++ ++ gfx_done(gfx_data); ++ ++ heap = saved_heap; /* free most of the graphics data */ ++ ++ // printf("cmdline: >%s<, entry = %d\n", gfx_data->cmdline, selected_entry); ++ ++ if(selected_entry < 0 || selected_entry > num_entries) return; ++ ++ ++ /* create new config with modified kernel option */ ++ ++ cfg = get_entry(config_entries, selected_entry, 1); ++ ++ new_config = heap; ++ ++ for(i = 0; ; i++) { ++ s = get_entry(cfg, i, 0); ++ if(!*s) { ++ if(!i) *heap++ = 0; ++ *heap++ = 0; ++ break; ++ } ++ if(!memcmp(s, "kernel", 6) && (s[6] == ' ' || s[6] == '\t')) { ++ t = skip_to(0, s); ++ if(*t) t = skip_to(0, t); ++ memmove(heap, s, t - s); ++ heap += t - s; ++ *heap++ = ' '; ++ strcpy(heap, gfx_data->cmdline); ++ heap += strlen(gfx_data->cmdline) + 1; ++ } ++ else { ++ strcpy(heap, s); ++ heap += strlen(s) + 1; ++ } ++ } ++ ++ *heap++ = 0; ++ ++ // hexdump(new_config, heap - new_config); ++ // getkey(); ++ ++ run_script(new_config, heap); ++} ++ ++ + static int + get_line_from_config (char *cmdline, int maxlen, int read_from_file) + { +@@ -998,9 +1341,12 @@ + } + else + { +- /* Run menu interface. */ +- run_menu (menu_entries, config_entries, num_entries, +- menu_entries + menu_len, default_entry); ++ if (*graphics_file && !password) ++ { ++ run_graphics_menu(menu_entries, config_entries, num_entries,menu_entries + menu_len, default_entry); ++ } ++ /* Run menu interface. */ ++ run_menu (menu_entries, config_entries, num_entries, menu_entries + menu_len, default_entry); + } + } + } --- grub-0.93.orig/debian/patches/25-x86_64.diff +++ grub-0.93/debian/patches/25-x86_64.diff @@ -0,0 +1,10 @@ +--- configure.in.ORG 2002-08-21 10:21:55.000000000 +0200 ++++ configure.in 2002-08-21 10:26:16.000000000 +0200 +@@ -21,6 +21,7 @@ + + case "$host_cpu" in + i[[3456]]86) host_cpu=i386 ;; ++x86_64) host_cpu=x86_64 ;; + *) AC_MSG_ERROR([unsupported CPU type]) ;; + esac + --- grub-0.93.orig/debian/patches/30-grub-R +++ grub-0.93/debian/patches/30-grub-R @@ -0,0 +1,223 @@ +diff -ur grub-0.93.orig/stage2/builtins.c grub-0.93/stage2/builtins.c +--- grub-0.93.orig/stage2/builtins.c 2003-02-04 13:15:40.000000000 +0100 ++++ grub-0.93/stage2/builtins.c 2003-02-04 13:16:59.000000000 +0100 +@@ -762,6 +762,17 @@ + default_func (char *arg, int flags) + { + #ifndef SUPPORT_DISKLESS ++#ifndef GRUB_UTIL ++ /* Has a forced once-only default been specified? */ ++ static int savedefault_helper(int); ++ if ((saved_entryno & STAGE2_ONCEONLY_ENTRY) != 0) ++ { ++ grub_timeout = 0; ++ default_entry = saved_entryno & ~STAGE2_ONCEONLY_ENTRY; ++ savedefault_helper(0); ++ return 0; ++ } ++#endif + if (grub_strcmp (arg, "saved") == 0) + { + default_entry = saved_entryno; +@@ -3196,22 +3207,15 @@ + }; + + +-/* savedefault */ ++ ++#if !defined(SUPPORT_DISKLESS) && !defined(GRUB_UTIL) ++/* Write specified default entry number into stage2 file. */ + static int +-savedefault_func (char *arg, int flags) ++savedefault_helper(int new_default) + { +-#if !defined(SUPPORT_DISKLESS) && !defined(GRUB_UTIL) + char buffer[512]; + int *entryno_ptr; +- +- /* This command is only useful when you boot an entry from the menu +- interface. */ +- if (! (flags & BUILTIN_SCRIPT)) +- { +- errnum = ERR_UNRECOGNIZED; +- return 1; +- } +- ++ + /* Get the geometry of the boot drive (i.e. the disk which contains + this stage2). */ + if (get_diskinfo (boot_drive, &buf_geom)) +@@ -3237,10 +3241,10 @@ + entryno_ptr = (int *) (buffer + STAGE2_SAVED_ENTRYNO); + + /* Check if the saved entry number differs from current entry number. */ +- if (*entryno_ptr != current_entryno) ++ if (*entryno_ptr != new_default) + { + /* Overwrite the saved entry number. */ +- *entryno_ptr = current_entryno; ++ *entryno_ptr = new_default; + + /* Save the image in the disk. */ + if (! rawwrite (boot_drive, install_second_sector, buffer)) +@@ -3251,6 +3255,117 @@ + } + + return 0; ++} ++#endif ++ ++#if !defined(SUPPORT_DISKLESS) && defined(GRUB_UTIL) ++/* ++ * Full implementation of new `savedefault' for GRUB shell. ++ * XXX This needs fixing for stage2 files which aren't accessible ++ * through a mounted filesystem. ++ */ ++static int ++savedefault_shell(char *arg, int flags) ++{ ++ char *stage2_os_file = "/boot/grub/stage2"; /* Default filename */ ++ FILE *fp; ++ char buffer[512]; ++ int *entryno_ptr; ++ int new_default = 0; ++ ++ while (1) ++ { ++ if (grub_memcmp ("--stage2=", arg, sizeof ("--stage2=") - 1) == 0) ++ { ++ stage2_os_file = arg + sizeof ("--stage2=") - 1; ++ arg = skip_to (0, arg); ++ nul_terminate (stage2_os_file); ++ } ++ else if (grub_memcmp ("--default=", arg, sizeof ("--default=") - 1) == 0) ++ { ++ char *p = arg + sizeof ("--default=") - 1; ++ if (! safe_parse_maxint (&p, &new_default)) ++ return 1; ++ arg = skip_to (0, arg); ++ } ++ else if (grub_memcmp ("--once", arg, sizeof ("--once") - 1) == 0) ++ { ++ new_default |= STAGE2_ONCEONLY_ENTRY; ++ arg = skip_to (0, arg); ++ } ++ else ++ break; ++ } ++ ++ if (! (fp = fopen(stage2_os_file, "r+"))) ++ { ++ errnum = ERR_FILE_NOT_FOUND; ++ return 1; ++ } ++ ++ if (fseek (fp, SECTOR_SIZE, SEEK_SET) != 0) ++ { ++ fclose (fp); ++ errnum = ERR_BAD_VERSION; ++ return 1; ++ } ++ ++ if (fread (buffer, 1, SECTOR_SIZE, fp) != SECTOR_SIZE) ++ { ++ fclose (fp); ++ errnum = ERR_READ; ++ return 1; ++ } ++ ++ /* Sanity check. */ ++ if (buffer[STAGE2_STAGE2_ID] != STAGE2_ID_STAGE2 ++ || *((short *) (buffer + STAGE2_VER_MAJ_OFFS)) != COMPAT_VERSION) ++ { ++ errnum = ERR_BAD_VERSION; ++ return 1; ++ } ++ ++ entryno_ptr = (int *) (buffer + STAGE2_SAVED_ENTRYNO); ++ *entryno_ptr = new_default; ++ ++ if (fseek (fp, SECTOR_SIZE, SEEK_SET) != 0) ++ { ++ fclose (fp); ++ errnum = ERR_BAD_VERSION; ++ return 1; ++ } ++ ++ if (fwrite (buffer, 1, SECTOR_SIZE, fp) != SECTOR_SIZE) ++ { ++ fclose (fp); ++ errnum = ERR_WRITE; ++ return 1; ++ } ++ ++ (void)fflush (fp); ++ fclose (fp); ++ return 0; ++} ++#endif ++ ++/* savedefault */ ++static int ++savedefault_func (char *arg, int flags) ++{ ++#if !defined(SUPPORT_DISKLESS) ++#if !defined(GRUB_UTIL) ++ /* This command is only useful when you boot an entry from the menu ++ interface. */ ++ if (! (flags & BUILTIN_SCRIPT)) ++ { ++ errnum = ERR_UNRECOGNIZED; ++ return 1; ++ } ++ ++ return savedefault_helper(current_entryno); ++#else /* defined(GRUB_UTIL) */ ++ return savedefault_shell(arg, flags); ++#endif + #else /* ! SUPPORT_DISKLESS && ! GRUB_UTIL */ + errnum = ERR_UNRECOGNIZED; + return 1; +@@ -3262,8 +3377,14 @@ + "savedefault", + savedefault_func, + BUILTIN_CMDLINE, ++#ifdef GRUB_UTIL ++ "savedefault [--stage2=STAGE2_FILE] [--default=DEFAULT] [--once]", ++ "Save DEFAULT as the default boot entry in STAGE2_FILE. If '--once'" ++ " is specified, the default is reset after the next reboot." ++#else + "savedefault", + "Save the current entry as the default boot entry." ++#endif + }; + + +@@ -4480,6 +4601,15 @@ + static int + timeout_func (char *arg, int flags) + { ++ /* One-shot default shenanigans -- don't piss around with the menu! */ ++ if (grub_timeout != -1) ++ return 0; ++ if ((saved_entryno & STAGE2_ONCEONLY_ENTRY) != 0) ++ { ++ grub_timeout = 0; ++ return 0; ++ } ++ + if (! safe_parse_maxint (&arg, &grub_timeout)) + return 1; + +diff -ur grub-0.93.orig/stage2/shared.h grub-0.93/stage2/shared.h +--- grub-0.93.orig/stage2/shared.h 2003-02-04 13:15:40.000000000 +0100 ++++ grub-0.93/stage2/shared.h 2003-02-04 13:16:59.000000000 +0100 +@@ -195,6 +195,8 @@ + #define STAGE2_FORCE_LBA 0x11 + #define STAGE2_VER_STR_OFFS 0x12 + ++#define STAGE2_ONCEONLY_ENTRY 0x10000 ++ + /* Stage 2 identifiers */ + #define STAGE2_ID_STAGE2 0 + #define STAGE2_ID_FFS_STAGE1_5 1 --- grub-0.93.orig/debian/patches/35-grub-0.93-devicemap.diff +++ grub-0.93/debian/patches/35-grub-0.93-devicemap.diff @@ -0,0 +1,80 @@ +diff -ur grub-0.93.orig/grub/main.c grub-0.93/grub/main.c +--- grub-0.93.orig/grub/main.c 2002-06-10 18:20:38.000000000 +0200 ++++ grub-0.93/grub/main.c 2003-02-04 13:18:14.000000000 +0100 +@@ -44,7 +44,7 @@ + int verbose = 0; + int read_only = 0; + int floppy_disks = 1; +-char *device_map_file = 0; ++char *device_map_file = "/boot/grub/device.map"; + static int default_boot_drive; + static int default_install_partition; + static char *default_config_file; +diff -ur grub-0.93.orig/lib/device.c grub-0.93/lib/device.c +--- grub-0.93.orig/lib/device.c 2002-05-20 11:53:46.000000000 +0200 ++++ grub-0.93/lib/device.c 2003-02-04 13:18:14.000000000 +0100 +@@ -382,6 +382,7 @@ + probing devices. */ + char buf[1024]; /* XXX */ + int line_number = 0; ++ int retval = 0; /* default to failure */ + + while (fgets (buf, sizeof (buf), fp)) + { +@@ -408,14 +409,14 @@ + if (*ptr != '(') + { + show_error (line_number, "No open parenthesis found"); +- return 0; ++ continue; + } + + ptr++; + if ((*ptr != 'f' && *ptr != 'h') || *(ptr + 1) != 'd') + { + show_error (line_number, "Bad drive name"); +- return 0; ++ continue; + } + + if (*ptr == 'f') +@@ -426,7 +427,7 @@ + if (drive < 0 || drive > 8) + { + show_error (line_number, "Bad device number"); +- return 0; ++ continue; + } + + if (! is_floppy) +@@ -435,7 +436,7 @@ + if (*ptr != ')') + { + show_error (line_number, "No close parenthesis found"); +- return 0; ++ continue; + } + + ptr++; +@@ -446,7 +447,7 @@ + if (! *ptr) + { + show_error (line_number, "No filename found"); +- return 0; ++ continue; + } + + /* Terminate the filename. */ +@@ -464,9 +465,11 @@ + + map[drive] = strdup (ptr); + assert (map[drive]); ++ ++ retval = 1; /* at least 1 drive configured successfully */ + } + +- return 1; ++ return retval; + } + + /* Initialize the device map MAP. *MAP will be allocated from the heap --- grub-0.93.orig/debian/patches/40-grub-0.93-prep.diff +++ grub-0.93/debian/patches/40-grub-0.93-prep.diff @@ -0,0 +1,12 @@ +diff -ur grub-0.93.orig/stage2/stage2.c grub-0.93/stage2/stage2.c +--- grub-0.93.orig/stage2/stage2.c 2003-02-04 13:15:40.000000000 +0100 ++++ grub-0.93/stage2/stage2.c 2003-02-04 13:20:24.000000000 +0100 +@@ -849,7 +849,7 @@ + /* dummy function to make ld fail */ + { + extern void wrong_struct_size(void); +- #define gfx_ofs_check(a) if(gfx_ofs_##a != (char *) &gfx_data->##a - (char *) gfx_data) wrong_struct_size(); ++ #define gfx_ofs_check(a) if(gfx_ofs_##a != (char *) &gfx_data->a - (char *) gfx_data) wrong_struct_size(); + gfx_ofs_check(ok); + gfx_ofs_check(mem_start); + gfx_ofs_check(mem_cur); --- grub-0.93.orig/debian/patches/45-grub-0.93-compile-fix +++ grub-0.93/debian/patches/45-grub-0.93-compile-fix @@ -0,0 +1,53 @@ +diff -ur grub-0.93.orig/configure.in grub-0.93/configure.in +--- grub-0.93.orig/configure.in 2003-02-04 13:16:12.000000000 +0100 ++++ grub-0.93/configure.in 2003-02-04 13:25:01.000000000 +0100 +@@ -110,21 +110,9 @@ + CPPFLAGS="$saved_CPPFLAGS" + ]) + +-# The options `-falign-*' are supported by gcc 3.0 or later. +-# Probably it is sufficient to only check for -falign-loops. +-AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [ +- saved_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="-falign-loops=1" +- AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no]) +- CPPFLAGS="$saved_CPPFLAGS" +-]) ++# save space. ++CPPFLAGS="$CPPFLAGS -O2 -Os" + +-# Force no alignment to save space. +-if test "x$falign_loop_flag" = xyes; then +- CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" +-else +- CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" +-fi + + if test "x$undef_flag" = xyes; then + CPPFLAGS="$CPPFLAGS -Wundef" +diff -ur grub-0.93.orig/stage2/fsys_jfs.c grub-0.93/stage2/fsys_jfs.c +--- grub-0.93.orig/stage2/fsys_jfs.c 2002-02-08 00:28:47.000000000 +0100 ++++ grub-0.93/stage2/fsys_jfs.c 2003-02-04 13:28:08.000000000 +0100 +@@ -53,8 +53,8 @@ + #define dtroot ((dtroot_t *)(&inode->di_btroot)) + + static ldtentry_t de_always[2] = { +- {1, -1, 2, {'.', '.'}}, +- {1, -1, 1, {'.'}} ++ {1, -1, 2, {'.', '.'}, 0}, ++ {1, -1, 1, {'.'}, 0} + }; + + static int +diff -ur grub-0.93.orig/stage2/fsys_reiserfs.c grub-0.93/stage2/fsys_reiserfs.c +--- grub-0.93.orig/stage2/fsys_reiserfs.c 2002-11-29 18:46:01.000000000 +0100 ++++ grub-0.93/stage2/fsys_reiserfs.c 2003-02-04 13:28:08.000000000 +0100 +@@ -112,7 +112,7 @@ + /* offset in the log of where to start replay after a crash */ + __u32 j_first_unflushed_offset; + /* mount id to detect very old transactions */ +- __u32 long j_mount_id; ++ __u32 j_mount_id; + }; + + /* magic string to find desc blocks in the journal */ --- grub-0.93.orig/debian/patches/50-force-LBA-off.diff +++ grub-0.93/debian/patches/50-force-LBA-off.diff @@ -0,0 +1,143 @@ +diff -ur grub-0.93~/docs/grub.texi grub-0.93/docs/grub.texi +--- grub-0.93~/docs/grub.texi 2003-02-06 12:30:12.000000000 +0100 ++++ grub-0.93/docs/grub.texi 2003-02-06 14:15:30.000000000 +0100 +@@ -2632,7 +2632,7 @@ + @node install + @subsection install + +-@deffn Command install [@option{--force-lba}] [@option{--stage2=os_stage2_file}] stage1_file [@option{d}] dest_dev stage2_file [addr] [@option{p}] [config_file] [real_config_file] ++@deffn Command install [@option{--force-lba[=off]}] [@option{--stage2=os_stage2_file}] stage1_file [@option{d}] dest_dev stage2_file [addr] [@option{p}] [config_file] [real_config_file] + This command is fairly complex, and you should not use this command + unless you are familiar with GRUB. Use @command{setup} (@pxref{setup}) + instead. +@@ -2679,6 +2679,13 @@ + bitmap even if they do have the support. So GRUB provides a solution to + ignore the wrong bitmap, that is, the option @option{--force-lba}. Don't + use this option if you know that your BIOS doesn't have LBA support. ++On the other hand there is at least one known BIOS that does the opposite, ++it claims to support LBA and then fails to provide it. Iff you have an ++Adaptec 2940 with BIOS revision 1.21 ( newer ones just work and older ones ++don't make the false claim ), or otherwise experience grub hanging ++after stage1, you can try to use the option @option{--force-lba=off}, ++as long as all disk blocks involved in booting reside ++within the first 1024 cylinders. + + @strong{Caution3:} You must specify the option @option{--stage2} in the + grub shell, if you cannot unmount the filesystem where your stage2 file +diff -ur grub-0.93~/stage1/stage1.S grub-0.93/stage1/stage1.S +--- grub-0.93~/stage1/stage1.S 2002-09-08 03:58:08.000000000 +0200 ++++ grub-0.93/stage1/stage1.S 2003-02-06 13:19:50.000000000 +0100 +@@ -163,7 +163,11 @@ + /* check if AH=0x42 is supported if FORCE_LBA is zero */ + MOV_MEM_TO_AL(ABS(force_lba)) /* movb ABS(force_lba), %al */ + testb %al, %al ++ /* check if LBA is forced OFF 0x80 <= %al <= 0xff */ ++ js chs_mode ++ /* or forced ON 0x01 <= %al <= 0x7f */ + jnz lba_mode ++ /* otherwise trust BIOS int's result */ + andw $1, %cx + jz chs_mode + +diff -ur grub-0.93~/stage2/asm.S grub-0.93/stage2/asm.S +--- grub-0.93~/stage2/asm.S 2003-02-06 12:30:12.000000000 +0100 ++++ grub-0.93/stage2/asm.S 2003-02-06 13:35:32.000000000 +0100 +@@ -1083,7 +1083,11 @@ + /* check if AH=0x42 is supported if FORCE_LBA is zero */ + movb EXT_C(force_lba), %al + testb %al, %al ++ /* check if LBA is forced OFF 0x80 <= %al <= 0xff */ ++ js 1f ++ /* or forced ON 0x01 <= %al <= 0x7f */ + jnz 2f ++ /* otherwise trust BIOS int's result */ + andw $1, %cx + jnz 2f + +diff -ur grub-0.93~/stage2/builtins.c grub-0.93/stage2/builtins.c +--- grub-0.93~/stage2/builtins.c 2003-02-06 12:30:12.000000000 +0100 ++++ grub-0.93/stage2/builtins.c 2003-02-06 13:56:01.000000000 +0100 +@@ -1832,7 +1832,12 @@ + /* First, check the GNU-style long option. */ + while (1) + { +- if (grub_memcmp ("--force-lba", arg, sizeof ("--force-lba") - 1) == 0) ++ if (grub_memcmp ("--force-lba=off", arg, sizeof ("--force-lba=off") - 1) == 0) ++ { ++ is_force_lba = 0xff; ++ arg = skip_to (0, arg); ++ } ++ else if (grub_memcmp ("--force-lba", arg, sizeof ("--force-lba") - 1) == 0) + { + is_force_lba = 1; + arg = skip_to (0, arg); +@@ -2253,7 +2258,7 @@ + "install", + install_func, + BUILTIN_CMDLINE, +- "install [--stage2=STAGE2_FILE] [--force-lba] STAGE1 [d] DEVICE STAGE2 [ADDR] [p] [CONFIG_FILE] [REAL_CONFIG_FILE]", ++ "install [--stage2=STAGE2_FILE] [--force-lba[=off]] STAGE1 [d] DEVICE STAGE2 [ADDR] [p] [CONFIG_FILE] [REAL_CONFIG_FILE]", + "Install STAGE1 on DEVICE, and install a blocklist for loading STAGE2" + " as a Stage 2. If the option `d' is present, the Stage 1 will always" + " look for the disk where STAGE2 was installed, rather than using" +@@ -2266,8 +2271,9 @@ + " 1.5 and REAL_CONFIG_FILE is present, then the Stage 2 CONFIG_FILE is" + " patched with the configuration filename REAL_CONFIG_FILE." + " If the option `--force-lba' is specified, disable some sanity checks" +- " for LBA mode. If the option `--stage2' is specified, rewrite the Stage" +- " 2 via your OS's filesystem instead of the raw device." ++ " for LBA mode, `--force-lba=off' will disable it completely. If the" ++ " option `--stage2' is specified, rewrite the Stage 2 via your OS's" ++ " filesystem instead of the raw device." + }; + + +@@ -3898,7 +3904,12 @@ + /* Check if the user specifies --force-lba. */ + while (1) + { +- if (grub_memcmp ("--force-lba", arg, sizeof ("--force-lba") - 1) == 0) ++ if (grub_memcmp ("--force-lba=off", arg, sizeof ("--force-lba=off") - 1) == 0) ++ { ++ is_force_lba = 0xff; ++ arg = skip_to (0, arg); ++ } ++ else if (grub_memcmp ("--force-lba", arg, sizeof ("--force-lba") - 1) == 0) + { + is_force_lba = 1; + arg = skip_to (0, arg); +@@ -4026,7 +4037,9 @@ + #if 1 + /* Don't embed a drive number unnecessarily. */ + grub_sprintf (cmd_arg, "%s%s%s%s %s%s %s p %s %s", +- is_force_lba? "--force-lba " : "", ++ is_force_lba ? ++ (is_force_lba == 0xff ? "--force-lba=off " : "--force-lba ") ++ : "", + stage2_arg? stage2_arg : "", + stage2_arg? " " : "", + stage1, +@@ -4079,17 +4092,18 @@ + "setup", + setup_func, + BUILTIN_CMDLINE | BUILTIN_HELP_LIST, +- "setup [--prefix=DIR] [--stage2=STAGE2_FILE] [--force-lba] INSTALL_DEVICE [IMAGE_DEVICE]", ++ "setup [--prefix=DIR] [--stage2=STAGE2_FILE] [--force-lba[=off]] INSTALL_DEVICE [IMAGE_DEVICE]", + "Set up the installation of GRUB automatically. This command uses" + " the more flexible command \"install\" in the backend and installs" + " GRUB into the device INSTALL_DEVICE. If IMAGE_DEVICE is specified," + " then find the GRUB images in the device IMAGE_DEVICE, otherwise" + " use the current \"root device\", which can be set by the command" + " \"root\". If you know that your BIOS should support LBA but GRUB" +- " doesn't work in LBA mode, specify the option `--force-lba'." +- " If you install GRUB under the grub shell and you cannot unmount the" +- " partition where GRUB images reside, specify the option `--stage2'" +- " to tell GRUB the file name under your OS." ++ " doesn't work in LBA mode, specify the option `--force-lba'. If the" ++ " BIOS claims to support LBA mode but really doesn't, use" ++ " `--force-lba=off'. If you install GRUB under the grub shell and" ++ " you cannot unmount the partition where GRUB images reside, specify" ++ " the option `--stage2' to tell GRUB the file name under your OS." + }; + + --- grub-0.93.orig/debian/patches/55-grub-0.93-graphics2.diff +++ grub-0.93/debian/patches/55-grub-0.93-graphics2.diff @@ -0,0 +1,135 @@ +--- stage2/asm.S 2003-02-10 15:41:05.000000000 +0100 ++++ stage2/asm.S 2003-02-10 17:07:39.000000000 +0100 +@@ -1853,6 +1853,15 @@ + * always 0 + */ + ++/* menu entry descriptor */ ++#define menu_entries 0 ++#define menu_default 2 /* seg:ofs */ ++#define menu_ent_list 6 /* seg:ofs */ ++#define menu_ent_size 10 ++#define menu_arg_list 12 /* seg:ofs */ ++#define menu_arg_size 16 ++#define sizeof_menu_desc 18 ++ + ENTRY(gfx_setup_menu) + pushl %ebp + movl %esp, %ebp +@@ -1873,18 +1882,41 @@ + + movw %dx,%ds + shll $4,%edx +- movl gfx_ofs_menu_list(%bx),%edi +- movl gfx_ofs_menu_default_entry(%bx),%esi +- movl gfx_ofs_args_list(%bx),%ebp +- subl %edx,%edi +- subl %edx,%esi +- subl %edx,%ebp +- movl gfx_ofs_menu_entry_len(%bx),%edx +- movl gfx_ofs_args_entry_len(%bx),%ecx ++ ++ subw $sizeof_menu_desc,%sp ++ movw %sp,%bp ++ + movl gfx_ofs_menu_entries(%bx),%eax ++ movw %ax,menu_entries(%bp) ++ ++ movl gfx_ofs_menu_default_entry(%bx),%eax ++ subl %edx,%eax ++ movw %ax,menu_default(%bp) ++ movw %ds,menu_default+2(%bp) ++ ++ movl gfx_ofs_menu_list(%bx),%eax ++ subl %edx,%eax ++ movw %ax,menu_ent_list(%bp) ++ movw %ds,menu_ent_list+2(%bp) ++ ++ movl gfx_ofs_menu_entry_len(%bx),%eax ++ movw %ax,menu_ent_size(%bp) ++ ++ movl gfx_ofs_args_list(%bx),%eax ++ subl %edx,%eax ++ movw %ax,menu_arg_list(%bp) ++ movw %ds,menu_arg_list+2(%bp) ++ ++ movl gfx_ofs_args_entry_len(%bx),%eax ++ movw %ax,menu_arg_size(%bp) ++ ++ movw %bp,%si ++ pushw %ss ++ popw %es ++ ++ lcall %ds: *gfx_ofs_jmp_table + 4 * 3 (%bx) + +- xchg %bx,%bp +- lcall %ds: *gfx_ofs_jmp_table + 4 * 3 (%bp) ++ addw $sizeof_menu_desc,%sp + + popw %ds + +--- stage2/shared.h 2003-02-10 16:03:44.000000000 +0100 ++++ stage2/shared.h 2003-02-10 16:37:07.000000000 +0100 +@@ -373,15 +373,15 @@ + #define gfx_ofs_code_seg 0x10 + #define gfx_ofs_jmp_table 0x14 + #define gfx_ofs_sys_cfg 0x44 +-#define gfx_ofs_cmdline 0x48 +-#define gfx_ofs_cmdline_len 0x4c +-#define gfx_ofs_menu_list 0x50 +-#define gfx_ofs_menu_default_entry 0x54 +-#define gfx_ofs_menu_entries 0x58 +-#define gfx_ofs_menu_entry_len 0x5c +-#define gfx_ofs_args_list 0x60 +-#define gfx_ofs_args_entry_len 0x64 +-#define gfx_ofs_timeout 0x68 ++#define gfx_ofs_cmdline 0x4c ++#define gfx_ofs_cmdline_len 0x50 ++#define gfx_ofs_menu_list 0x54 ++#define gfx_ofs_menu_default_entry 0x58 ++#define gfx_ofs_menu_entries 0x5c ++#define gfx_ofs_menu_entry_len 0x60 ++#define gfx_ofs_args_list 0x64 ++#define gfx_ofs_args_entry_len 0x68 ++#define gfx_ofs_timeout 0x6c + + + #ifndef ASM_FILE +@@ -613,7 +613,7 @@ + unsigned mem_start, mem_cur, mem_max; + unsigned code_seg; /* code segment of binary graphics code */ + unsigned jmp_table[12]; /* link to graphics functions */ +- unsigned char sys_cfg[4]; /* sys_cfg[3]: identifies boot loader (grub == 2) */ ++ unsigned char sys_cfg[8]; /* sys_cfg[0]: identifies boot loader (grub == 2) */ + char *cmdline; /* command line returned by gfx_input() */ + unsigned cmdline_len; /* length of the above */ + char *menu_list; /* list of menu entries, each of fixed length (menu_entry_len) */ +--- stage2/stage2.c 2003-02-10 16:03:44.000000000 +0100 ++++ stage2/stage2.c 2003-02-10 17:16:34.000000000 +0100 +@@ -824,7 +824,7 @@ + #define MIN_HEAP_SIZE 0x4000 + + /* gfx code needs at least this much free memory */ +-#define MIN_GFX_FREE 0x4000 ++#define MIN_GFX_FREE 0xc000 + + /* + * Does normally not return. +@@ -875,7 +875,7 @@ + heap += sizeof *gfx_data; + memset(gfx_data, 0, sizeof *gfx_data); + +- gfx_data->sys_cfg[2] = 2; /* bootloader: grub */ ++ gfx_data->sys_cfg[0] = 2; /* bootloader: grub */ + gfx_data->timeout = grub_timeout >= 0 ? grub_timeout : 0; + + +@@ -993,7 +993,7 @@ + + if( + *(unsigned *) buf != 0x0b2d97f00 || /* magic id */ +- buf[4] != 3 || /* version 3 */ ++ buf[4] != 4 || /* version 4 */ + !(code_start = *(unsigned *) (buf + 8)) || + (code_start & 0xf) /* check alignment */ + ) { --- grub-0.93.orig/debian/patches/60-grub-0.93-graphics3.diff +++ grub-0.93/debian/patches/60-grub-0.93-graphics3.diff @@ -0,0 +1,11 @@ +--- stage2/stage2.c 2003-03-08 12:29:21.000000000 +0100 ++++ stage2/stage2.c 2003-03-08 12:29:01.000000000 +0100 +@@ -1341,7 +1341,7 @@ + } + else + { +- if (*graphics_file && !password) ++ if (*graphics_file && !password && show_menu) + { + run_graphics_menu(menu_entries, config_entries, num_entries,menu_entries + menu_len, default_entry); + } --- grub-0.93.orig/debian/patches/apply +++ grub-0.93/debian/patches/apply @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +PATCHDIR=`(cd \`dirname $0\` && pwd)` + +patch -p1 -E < $PATCHDIR/00-grub-0.93-path-patch +patch -p0 < $PATCHDIR/05-use_ferror.diff +patch -p1 < $PATCHDIR/10-configury.diff +patch -p1 < $PATCHDIR/15-ccas_changes.diff +patch -p1 < $PATCHDIR/20-grub-0.93-graphics.diff +patch -p0 < $PATCHDIR/25-x86_64.diff +patch -p1 < $PATCHDIR/30-grub-R +patch -p1 < $PATCHDIR/35-grub-0.93-devicemap.diff +patch -p1 < $PATCHDIR/40-grub-0.93-prep.diff +patch -p1 < $PATCHDIR/45-grub-0.93-compile-fix +patch -p1 < $PATCHDIR/50-force-LBA-off.diff +patch -p0 < $PATCHDIR/55-grub-0.93-graphics2.diff +patch -p0 < $PATCHDIR/60-grub-0.93-graphics3.diff --- grub-0.93.orig/debian/patches/configure +++ grub-0.93/debian/patches/configure @@ -0,0 +1,14 @@ +#!/bin/sh + +DEB_HOST_GNU_TYPE=`dpkg-architecture -qDEB_HOST_GNU_TYPE` +DEB_BUILD_GNU_TYPE=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` + +./configure \ +--host=$DEB_HOST_GNU_TYPE \ +--build=$DEB_BUILD_GNU_TYPE \ +--prefix=/ \ +--exec-prefix=/ \ +--mandir=\${prefix}/usr/share/man \ +--infodir=\${prefix}/usr/share/info \ +--datadir=\${prefix}/usr/lib \ +--disable-auto-linux-mem-opt --- grub-0.93.orig/debian/patches/unapply +++ grub-0.93/debian/patches/unapply @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +PATCHDIR=`(cd \`dirname $0\` && pwd)` + +# this must also happen in reverse order, remember that +# when adding patches +patch -R -p0 < $PATCHDIR/60-grub-0.93-graphics3.diff +patch -R -p0 < $PATCHDIR/55-grub-0.93-graphics2.diff +patch -R -p1 < $PATCHDIR/50-force-LBA-off.diff +patch -R -p1 < $PATCHDIR/45-grub-0.93-compile-fix +patch -R -p1 < $PATCHDIR/40-grub-0.93-prep.diff +patch -R -p1 < $PATCHDIR/35-grub-0.93-devicemap.diff +patch -R -p1 < $PATCHDIR/30-grub-R +patch -R -p0 < $PATCHDIR/25-x86_64.diff +patch -R -p1 < $PATCHDIR/20-grub-0.93-graphics.diff +patch -R -p1 < $PATCHDIR/15-ccas_changes.diff +patch -R -p1 < $PATCHDIR/10-configury.diff +patch -R -p0 < $PATCHDIR/05-use_ferror.diff +patch -R -p1 -E < $PATCHDIR/00-grub-0.93-path-patch --- grub-0.93.orig/debian/grub-gfxboot.docs +++ grub-0.93/debian/grub-gfxboot.docs @@ -0,0 +1,6 @@ +AUTHORS +BUGS +NEWS +README +THANKS +TODO --- grub-0.93.orig/debian/grub-gfxboot.examples +++ grub-0.93/debian/grub-gfxboot.examples @@ -0,0 +1 @@ +docs/menu.lst --- grub-0.93.orig/debian/copyright +++ grub-0.93/debian/copyright @@ -0,0 +1,75 @@ +This package was re-debianized by Jason Thomas on +Mon, 28 May 2001 14:29:03 +1000. + +It was downloaded from ftp://alpha.gnu.org/gnu/grub/ + +SuSE patches for gfxboot support were obtained from +ftp://ftp.suse.com/pub/suse/i386/8.2/suse/src/gfxboot-2.1-20.src.rpm + +Upstream Authors: + + SuSE added support for 'gfxmenu'. + + Erich Boleyn originally designed and implemented GRUB. + + VaX#n8 (real name unknown) wrote shared_src/fsys_ext2fs.c. + + Heiko Schroeder rewrote shared_src/stage1.S to be more readable. + + The following authors assigned copyright on their work to the Free + Software Foundation: + + Gordon Matzigkeit adopted GRUB into the GNU Project. He fixed several + bugs, added symbolic link support to shared_src/fsys_ext2fs.c, and + began the implementation of /sbin/grub. + + OKUJI Yoshinori contributed many bugfixes and new features, such as + working LBA support, /sbin/grub support for configuration files, the + script /sbin/grub-install, the utility /bin/mbchk, the new engine for + builtin commands, disk swapping support, keyboard configuration support, + network support, online help support, command-line history support, + hidden menu support, the new Linux loader, serial terminal support, + single-line editing support, the utility /sbin/grub-md5-crypt, the new + GRUB manual, and several new commands. + + Peter Astrand added support for a color menu. + + Pavel Roskin contributed many bugfixes and new features, such as FreeBSD + support for the grub shell, and configure process cleanups. + + Klaus Reichl wrote stage2/fsys_minix.c. + + Per Lundberg added graphics support to the Multiboot Specification. + + Jochen Hoenicke rewrote stage2/fsys_fat.c and wrote + stage2/fsys_reiserfs.c and stage2/md5.c. + + Christoph Plattner added support for Net Boot Image Proposal. + + Stefan Ondrejicka added the commands "partnew" and "parttype". + + Frank Mehnert added support for hercules console. + + +Copyright: + + Copyright (C) 1996 Erich Boleyn + Copyright (C) 1999-2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +On Debian GNU systems, the complete text of the GNU General Public +License can be found in `/usr/share/common-licenses/GPL'. --- grub-0.93.orig/debian/grub-floppy +++ grub-0.93/debian/grub-floppy @@ -0,0 +1,112 @@ +#!/bin/sh + +# Create GRUB boot floppy. +# Copyright (C) 2001 Jason Thomas +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + +# Initialize some variables. +dd=/bin/dd +pkgdatadir=/usr/lib/grub/i386-pc +stage1=$pkgdatadir/stage1 +stage2=$pkgdatadir/stage2 + +# I like functions. + +abort() +{ + echo -e "\n$@\n" >&2 + exit 1 +} + +checkfiles() +{ + [ -x "$dd" ] || abort "Can't find $dd, aborting" + [ -f "$stage1" ] || abort "Can't find $stage1, aborting" + [ -f "$stage2" ] || abort "Can't find $stage2, aborting" +} + +usage() +{ + cat < +Create GRUB boot floppy. + +options: + -h, --help print this message and exit + +EOF + exit 1 +} + +checkdevice() +{ + [ -z "$1" ] && abort "checkdevice() takes block device as parameter" + + [ -b "$1" ] || abort "$1 is not a block device, aborting" + [ -w "$1" ] || abort "$1 is not a writeable block device, aborting" +} + +questiondevice() +{ + [ -z "$1" ] && abort "questiondevice() takes block device as parameter" + + echo "You are about to overwrite the boot sector of the following device:" + echo "$1" + echo -n "Are you sure you want to take this action (y/N) " + read answer + case "$answer" in + y* | Y*) + # let this fall through to the next function + ;; + *) + abort "Not continuing as you wish" + ;; + esac +} + +createfloppy() +{ + [ -z "$1" ] && abort "createfloppy() takes block device as parameter" + + echo -e "Creating grub boot floppy now, please be patient ...\n" + + # heres where we actually create the floppy :-p + $dd if="$stage1" of="$1" bs="512" count="1" + $dd if="$stage2" of="$1" bs="512" seek="1" + + echo -e "\nThat's All Folks!" +} + +# test we have the necessary files first +checkfiles + +case "$1" in + -h | --help) + usage + ;; + + *) + if [ -z "$1" ] ; then + usage + else + checkdevice "$1" + questiondevice "$1" + createfloppy "$1" + fi + ;; +esac + +exit 0 --- grub-0.93.orig/debian/grub-floppy.8 +++ grub-0.93/debian/grub-floppy.8 @@ -0,0 +1,52 @@ +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.TH "grub-floppy" "8" "August 17, 2001" "Jason Thomas" +.SH NAME +grub\-floppy \- program to do build a generic grub boot disc +.SH SYNOPSIS +.B grub\-floppy +.RI [ options ] " " ... +.SH DESCRIPTION +.B \fBgrub\-floppy\fR +is a program to build a generic grub boot disc. The boot disc when booted provides the grub command line (also referred to as the grub shell). +.PP +For more information on using the grub command line, see \fBinfo grub\fR +.PP +.SH OPTIONS +This program follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.SH NOTE +It is possible to create a grub boot disc using grub-install, although the boot disc created will be specific to the computer it is created on. Using grub-floppy will create a more generic floppy only limted by architecture. +.SH SEE ALSO +.BR grub (8), +.BR grub-install (8). +.PP +The full documentation for +.B grub +is maintained as a Texinfo manual. If the +.B info +and +.B grub +programs are properly installed at your site, the command +.IP +.B info grub +.PP +should give you access to the complete manual. +.SH AUTHOR +This manual page was written by Jason Thomas , +for the Debian GNU/Linux system (but may be used by others). +.\" vim:syn=nroff