ia64/xen-unstable

changeset 18078:6f82840f173b

PV-GRUB: use the 0.97 snapshot + patch instead of checking out from cvs

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jul 17 15:33:15 2008 +0100 (2008-07-17)
parents 23208dc42cfe
children a8603b2fb786
files stubdom/Makefile stubdom/grub.patches/00cvs stubdom/grub/Makefile
line diff
     1.1 --- a/stubdom/Makefile	Thu Jul 17 13:21:37 2008 +0100
     1.2 +++ b/stubdom/Makefile	Thu Jul 17 15:33:15 2008 +0100
     1.3 @@ -14,7 +14,7 @@ ZLIB_VERSION=1.2.3
     1.4  LIBPCI_VERSION=2.2.9
     1.5  NEWLIB_VERSION=1.16.0
     1.6  LWIP_DATE=2008-06-01
     1.7 -GRUB_DATE=2008-06-01
     1.8 +GRUB_VERSION=0.97
     1.9  
    1.10  WGET=wget -c
    1.11  
    1.12 @@ -75,7 +75,7 @@ endif
    1.13  ##############
    1.14  
    1.15  newlib-$(NEWLIB_VERSION).tar.gz:
    1.16 -	$(WGET) ftp://sources.redhat.com/pub/newlib/newlib-$(NEWLIB_VERSION).tar.gz
    1.17 +	$(WGET) ftp://sources.redhat.com/pub/newlib/$@
    1.18  
    1.19  newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
    1.20  	tar xzf $<
    1.21 @@ -97,7 +97,7 @@ cross-newlib: $(NEWLIB_STAMPFILE)
    1.22  ############
    1.23  
    1.24  zlib-$(ZLIB_VERSION).tar.gz:
    1.25 -	$(WGET) http://www.zlib.net/zlib-$(ZLIB_VERSION).tar.gz
    1.26 +	$(WGET) http://www.zlib.net/$@
    1.27  
    1.28  ZLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libz.a
    1.29  .PHONY: cross-zlib
    1.30 @@ -114,7 +114,7 @@ cross-zlib: $(ZLIB_STAMPFILE)
    1.31  ##############
    1.32  
    1.33  pciutils-$(LIBPCI_VERSION).tar.bz2:
    1.34 -	$(WGET) http://www.kernel.org/pub/software/utils/pciutils/pciutils-$(LIBPCI_VERSION).tar.bz2
    1.35 +	$(WGET) http://www.kernel.org/pub/software/utils/pciutils/$@
    1.36  
    1.37  pciutils-$(LIBPCI_VERSION): pciutils-$(LIBPCI_VERSION).tar.bz2
    1.38  	tar xjf $<
    1.39 @@ -241,14 +241,18 @@ c: cross-newlib mk-headers
    1.40  # Grub
    1.41  ######
    1.42  
    1.43 -grub-cvs:
    1.44 -	cvs -z 9 -d :pserver:anonymous@cvs.sv.gnu.org:/sources/grub co -D $(GRUB_DATE) -d $@ grub
    1.45 +grub-$(GRUB_VERSION).tar.gz:
    1.46 +	$(WGET) ftp://alpha.gnu.org/gnu/grub/$@
    1.47 +
    1.48 +grub-upstream: grub-$(GRUB_VERSION).tar.gz
    1.49 +	tar xzf $<
    1.50 +	mv grub-$(GRUB_VERSION) $@
    1.51  	for i in grub.patches/* ; do \
    1.52  		patch -d $@ -p1 < $$i ; \
    1.53  	done
    1.54  
    1.55  .PHONY: grub
    1.56 -grub: grub-cvs cross-newlib mk-headers
    1.57 +grub: grub-upstream cross-newlib mk-headers
    1.58  	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
    1.59  
    1.60  ########
    1.61 @@ -325,7 +329,7 @@ crossclean: clean
    1.62  patchclean: crossclean
    1.63  	rm -fr newlib-$(NEWLIB_VERSION)
    1.64  	rm -fr lwip-cvs
    1.65 -	rm -fr grub-cvs
    1.66 +	rm -fr grub-upstream
    1.67  
    1.68  # clean downloads
    1.69  .PHONY: downloadclean
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/stubdom/grub.patches/00cvs	Thu Jul 17 15:33:15 2008 +0100
     2.3 @@ -0,0 +1,1382 @@
     2.4 +diff -uprN grub-0.97/acinclude.m4 grub/acinclude.m4
     2.5 +--- grub-0.97/acinclude.m4	2004-04-27 21:48:06.000000000 +0100
     2.6 ++++ grub/acinclude.m4	2007-11-05 01:29:46.000000000 +0000
     2.7 +@@ -57,7 +57,7 @@ else
     2.8 + fi
     2.9 + grub_cv_prog_objcopy_absolute=yes
    2.10 + for link_addr in 2000 8000 7C00; do
    2.11 +-  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
    2.12 ++  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
    2.13 +   else
    2.14 +     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
    2.15 +   fi
    2.16 +diff -uprN grub-0.97/ChangeLog grub/ChangeLog
    2.17 +--- grub-0.97/ChangeLog	2005-05-08 03:47:02.000000000 +0100
    2.18 ++++ grub/ChangeLog	2008-05-20 12:04:18.000000000 +0100
    2.19 +@@ -1,3 +1,127 @@
    2.20 ++2008-05-20  Robert Millan  <rmh@aybabtu.com>
    2.21 ++
    2.22 ++	* netboot/cs89x0.c: Fix license violation.
    2.23 ++	* netboot/cs89x0.h: Likewise.
    2.24 ++
    2.25 ++2008-04-10  Pavel Roskin  <proski@gnu.org>
    2.26 ++
    2.27 ++	* configure.ac: Always use "_cv_" in cache variables for
    2.28 ++	compatibility with Autoconf 2.62.
    2.29 ++
    2.30 ++2008-03-28  Robert Millan  <rmh@aybabtu.com>
    2.31 ++
    2.32 ++	Surpass 1 TiB disk addressing limit.  Note: there are no plans to handle
    2.33 ++	the 2 TiB disk limit in GRUB Legacy, since that would need considerable
    2.34 ++	rework.  If you have >2TiB disks, use GRUB 2 instead.
    2.35 ++
    2.36 ++	* grub/asmstub.c (biosdisk): Add unsigned qualifier to `sector'.
    2.37 ++	* stage2/bios.c (biosdisk): Likewise.
    2.38 ++	* stage2/disk_io.c (rawread, devread, rawwrite, devwrite): Likewise.
    2.39 ++	* stage2/shared.h (rawread, devread, rawwrite, devwrite): Likewise.
    2.40 ++	* lib/device.c (get_drive_geometry): Replace BLKGETSIZE with
    2.41 ++	BLKGETSIZE64.
    2.42 ++
    2.43 ++2007-10-29  Pavel Roskin  <proski@gnu.org>
    2.44 ++
    2.45 ++	* configure.ac: Test if '--build-id=none' is supported by the
    2.46 ++	linker and add it to LDFLAGS if possible.  Build ID causes
    2.47 ++	objcopy to generate huge binary files.
    2.48 ++	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
    2.49 ++	linking, so that build ID doesn't break the test.
    2.50 ++	* stage1/Makefile.am: Preserve LDFLAGS, use stage1_exec_LDFLAGS.
    2.51 ++
    2.52 ++2007-02-22  Pavel Roskin  <proski@gnu.org>
    2.53 ++
    2.54 ++	* stage2/iso9660.h: Remove unnecessary packed attributes.
    2.55 ++
    2.56 ++2007-02-22  Robert Millan  <rmh@aybabtu.com>
    2.57 ++
    2.58 ++	* util/mkbimage: Update my email address, and remove my name from
    2.59 ++	some places where unnecessary credit is given.
    2.60 ++
    2.61 ++2006-09-10  Pavel Roskin  <proski@gnu.org>
    2.62 ++
    2.63 ++	* netboot/natsemi.c: Fix compile error with gcc 4.1.1.  Cast
    2.64 ++	cannot make a variable volatile - it should be declared as such.
    2.65 ++	* netboot/sis900.c: Likewise.
    2.66 ++
    2.67 ++2006-09-08  Pavel Roskin  <proski@gnu.org>
    2.68 ++
    2.69 ++	* netboot/etherboot.h: Remove incorrect extern declarations of
    2.70 ++	the variables later declared static.  Move BOOTP_DATA_ADDR ...
    2.71 ++	* netboot/main.c: ... here.  Eliminate end_of_rfc1533 - it's
    2.72 ++	write-only.
    2.73 ++
    2.74 ++2006-06-24  Yoshinori K. Okuji  <okuji@enbug.org>
    2.75 ++
    2.76 ++	* docs/grub.texi: Changed the license term to the GNU Free
    2.77 ++	Documentation License 1.2.
    2.78 ++
    2.79 ++	* docs/multiboot.texi: Reformatted to show the license term
    2.80 ++	and the version number explicitly.
    2.81 ++	
    2.82 ++	* docs/fdl.texi: New file.
    2.83 ++	
    2.84 ++	* docs/Makefile.am (grub_TEXINFOS): Added fdl.texi.
    2.85 ++
    2.86 ++2006-06-24  Robert Millan  <robertmh@gnu.org>
    2.87 ++
    2.88 ++	* lib/device.c (write_to_partition): /dev/ataraid/ and /dev/rd/
    2.89 ++	partitions have a "p" prefix.  Add it.
    2.90 ++
    2.91 ++2006-06-24  Robert Millan  <robertmh@gnu.org>
    2.92 ++
    2.93 ++	* lib/device.c (get_i2o_disk_name): New function.
    2.94 ++	(init_device_map) [__linux__]: Add support for I2O devices.
    2.95 ++
    2.96 ++2006-05-02  Pavel Roskin  <proski@gnu.org>
    2.97 ++
    2.98 ++	* stage2/stage2.c (run_menu): Fix "savedefault" to save only top
    2.99 ++	level menu positions.  Remember current position when calling a
   2.100 ++	submenu.  Don't recalculate it when booting from a submenu.
   2.101 ++
   2.102 ++	* grub/main.c (main): Make sure the boot drive number doesn't
   2.103 ++	exceed 255.
   2.104 ++
   2.105 ++2006-05-02  Vesa Jaaskelainen  <chaac@nic.fi>
   2.106 ++
   2.107 ++	* stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2
   2.108 ++	to GRUB Legacy.  Problem reported by Gerardo Richarte.
   2.109 ++
   2.110 ++2006-04-23  Robert Millan  <robertmh@gnu.org>
   2.111 ++
   2.112 ++	* grub/asmstub.c (get_diskinfo): Optimize sysctl routine.
   2.113 ++
   2.114 ++2006-04-20  Robert Millan  <robertmh@gnu.org>
   2.115 ++
   2.116 ++	Fixes for kernel of FreeBSD:
   2.117 ++	* grub/asmstub.c (get_diskinfo): Toggle "kern.geom.debugflags" sysctl
   2.118 ++	before opening a device for writing.
   2.119 ++	* util/grub-install.in: Devices don't have this "r" prefix anymore.
   2.120 ++
   2.121 ++2006-04-16  Yoshinori K. Okuji  <okuji@enbug.org>
   2.122 ++
   2.123 ++	* docs/multiboot.texi: Correct the offset of address
   2.124 ++	fields. Reported by Jeroen Dekkers.
   2.125 ++
   2.126 ++2006-03-21  Yoshinori K. Okuji  <okuji@enbug.org>
   2.127 ++
   2.128 ++	* stage2/builtins.c (setup_func): Specify the size of DEVICE to
   2.129 ++	grub_strncat instead of a strange number 256. Reported by Vitaly
   2.130 ++	Fertman <vitaly@namesys.com>.
   2.131 ++
   2.132 ++2005-09-29  Yoshinori K. Okuji  <okuji@enbug.org>
   2.133 ++
   2.134 ++	* docs/multiboot.texi: Fix a bug in the byte order of
   2.135 ++	boot_device. I hope this won't affect any OS image.
   2.136 ++	Increased the version number to 0.6.94.
   2.137 ++
   2.138 ++2005-09-28  Yoshinori K. Okuji  <okuji@enbug.org>
   2.139 ++
   2.140 ++	* stage2/boot.c (load_image): Even if an OS image is an ELF
   2.141 ++	object, use the a.out kludge if MULTIBOOT_AOUT_KLUDGE is
   2.142 ++	specified.
   2.143 ++
   2.144 + 2005-05-08  Yoshinori K. Okuji  <okuji@enbug.org>
   2.145 + 
   2.146 + 	* configure.ac (AC_INIT): Upgraded to 0.97.
   2.147 +diff -uprN grub-0.97/configure grub/configure
   2.148 +--- grub-0.97/configure	2005-05-08 03:48:12.000000000 +0100
   2.149 ++++ grub/configure	2007-11-05 01:29:46.000000000 +0000
   2.150 +@@ -3694,6 +3694,64 @@ if test "x$undef_flag" = xyes; then
   2.151 +   CPPFLAGS="$CPPFLAGS -Wundef"
   2.152 + fi
   2.153 + 
   2.154 ++# Check if build ID can be disabled in the linker
   2.155 ++echo "$as_me:$LINENO: checking whether linker accepts \`--build-id=none'" >&5
   2.156 ++echo $ECHO_N "checking whether linker accepts \`--build-id=none'... $ECHO_C" >&6
   2.157 ++save_LDFLAGS="$LDFLAGS"
   2.158 ++LDFLAGS="$LDFLAGS -Wl,--build-id=none"
   2.159 ++cat >conftest.$ac_ext <<_ACEOF
   2.160 ++/* confdefs.h.  */
   2.161 ++_ACEOF
   2.162 ++cat confdefs.h >>conftest.$ac_ext
   2.163 ++cat >>conftest.$ac_ext <<_ACEOF
   2.164 ++/* end confdefs.h.  */
   2.165 ++
   2.166 ++int
   2.167 ++main ()
   2.168 ++{
   2.169 ++
   2.170 ++  ;
   2.171 ++  return 0;
   2.172 ++}
   2.173 ++_ACEOF
   2.174 ++rm -f conftest.$ac_objext conftest$ac_exeext
   2.175 ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   2.176 ++  (eval $ac_link) 2>conftest.er1
   2.177 ++  ac_status=$?
   2.178 ++  grep -v '^ *+' conftest.er1 >conftest.err
   2.179 ++  rm -f conftest.er1
   2.180 ++  cat conftest.err >&5
   2.181 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   2.182 ++  (exit $ac_status); } &&
   2.183 ++	 { ac_try='test -z "$ac_c_werror_flag"
   2.184 ++			 || test ! -s conftest.err'
   2.185 ++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   2.186 ++  (eval $ac_try) 2>&5
   2.187 ++  ac_status=$?
   2.188 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   2.189 ++  (exit $ac_status); }; } &&
   2.190 ++	 { ac_try='test -s conftest$ac_exeext'
   2.191 ++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   2.192 ++  (eval $ac_try) 2>&5
   2.193 ++  ac_status=$?
   2.194 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   2.195 ++  (exit $ac_status); }; }; then
   2.196 ++  build_id_flag=yes
   2.197 ++else
   2.198 ++  echo "$as_me: failed program was:" >&5
   2.199 ++sed 's/^/| /' conftest.$ac_ext >&5
   2.200 ++
   2.201 ++build_id_flag=no
   2.202 ++fi
   2.203 ++rm -f conftest.err conftest.$ac_objext \
   2.204 ++      conftest$ac_exeext conftest.$ac_ext
   2.205 ++echo "$as_me:$LINENO: result: $build_id_flag" >&5
   2.206 ++echo "${ECHO_T}$build_id_flag" >&6
   2.207 ++LDFLAGS="$save_LDFLAGS"
   2.208 ++if test "x$build_id_flag" = xyes; then
   2.209 ++  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
   2.210 ++fi
   2.211 ++
   2.212 + if test "x$with_binutils" != x; then
   2.213 +   # Extract the first word of "objcopy", so it can be a program name with args.
   2.214 + set dummy objcopy; ac_word=$2
   2.215 +@@ -3892,7 +3950,7 @@ echo "$as_me: error: ${CC-cc} cannot com
   2.216 + fi
   2.217 + grub_cv_prog_objcopy_absolute=yes
   2.218 + for link_addr in 2000 8000 7C00; do
   2.219 +-  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
   2.220 ++  if { ac_try='${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
   2.221 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   2.222 +   (eval $ac_try) 2>&5
   2.223 +   ac_status=$?
   2.224 +diff -uprN grub-0.97/configure.ac grub/configure.ac
   2.225 +--- grub-0.97/configure.ac	2005-05-08 03:36:03.000000000 +0100
   2.226 ++++ grub/configure.ac	2008-04-10 23:26:50.000000000 +0100
   2.227 +@@ -86,13 +86,13 @@ if test "x$ac_cv_prog_gcc" = xyes; then
   2.228 +     fi
   2.229 +     STAGE1_CFLAGS="-O2"
   2.230 +     GRUB_CFLAGS="-O2"
   2.231 +-    AC_CACHE_CHECK([whether optimization for size works], size_flag, [
   2.232 ++    AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
   2.233 +       saved_CFLAGS=$CFLAGS
   2.234 +       CFLAGS="-Os -g"
   2.235 +-      AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
   2.236 ++      AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no)
   2.237 +       CFLAGS=$saved_CFLAGS
   2.238 +     ])
   2.239 +-    if test "x$size_flag" = xyes; then
   2.240 ++    if test "x$grub_cv_cc_Os" = xyes; then
   2.241 +       STAGE2_CFLAGS="-Os"
   2.242 +     else
   2.243 +       STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
   2.244 +@@ -100,16 +100,16 @@ if test "x$ac_cv_prog_gcc" = xyes; then
   2.245 +     # OpenBSD has a GCC extension for protecting applications from
   2.246 +     # stack smashing attacks, but GRUB doesn't want this feature.
   2.247 +     AC_CACHE_CHECK([whether gcc has -fno-stack-protector],
   2.248 +-		   no_stack_protector_flag, [
   2.249 ++		   grub_cv_cc_no_stack_protector, [
   2.250 +       saved_CFLAGS=$CFLAGS
   2.251 +       CFLAGS="-fno-stack-protector"
   2.252 +       AC_TRY_COMPILE(,
   2.253 + 		     ,
   2.254 +-		     no_stack_protector_flag=yes,
   2.255 +-		     no_stack_protector_flag=no)
   2.256 ++		     grub_cv_cc_no_stack_protector=yes,
   2.257 ++		     grub_cv_cc_no_stack_protector=no)
   2.258 +       CFLAGS=$saved_CFLAGS
   2.259 +     ])
   2.260 +-    if test "x$no_stack_protector_flag" = xyes; then
   2.261 ++    if test "x$grub_cv_cc_no_stack_protector" = xyes; then
   2.262 +       STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
   2.263 +     fi
   2.264 +   fi
   2.265 +@@ -123,33 +123,44 @@ AC_SUBST(GRUB_CFLAGS)
   2.266 + CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow"
   2.267 + CPPFLAGS="$CPPFLAGS -Wpointer-arith"
   2.268 + 
   2.269 +-AC_CACHE_CHECK([whether -Wundef works], undef_flag, [
   2.270 ++AC_CACHE_CHECK([whether -Wundef works], grub_cv_cc_Wundef, [
   2.271 +   saved_CPPFLAGS="$CPPFLAGS"
   2.272 +   CPPFLAGS="-Wundef"
   2.273 +-  AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no)
   2.274 ++  AC_TRY_COMPILE(, , grub_cv_cc_Wundef=yes, grub_cv_cc_Wundef=no)
   2.275 +   CPPFLAGS="$saved_CPPFLAGS"
   2.276 + ])
   2.277 + 
   2.278 + # The options `-falign-*' are supported by gcc 3.0 or later.
   2.279 + # Probably it is sufficient to only check for -falign-loops.
   2.280 +-AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
   2.281 ++AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
   2.282 +   saved_CPPFLAGS="$CPPFLAGS"
   2.283 +   CPPFLAGS="-falign-loops=1"
   2.284 +-  AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
   2.285 ++  AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no])
   2.286 +   CPPFLAGS="$saved_CPPFLAGS"
   2.287 + ])
   2.288 + 
   2.289 + # Force no alignment to save space.
   2.290 +-if test "x$falign_loop_flag" = xyes; then
   2.291 ++if test "x$grub_cv_cc_falign_loop" = xyes; then
   2.292 +   CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
   2.293 + else
   2.294 +   CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
   2.295 + fi
   2.296 + 
   2.297 +-if test "x$undef_flag" = xyes; then
   2.298 ++if test "x$grub_cv_cc_Wundef" = xyes; then
   2.299 +   CPPFLAGS="$CPPFLAGS -Wundef"
   2.300 + fi
   2.301 + 
   2.302 ++# Check if build ID can be disabled in the linker
   2.303 ++AC_MSG_CHECKING([whether linker accepts `--build-id=none'])
   2.304 ++save_LDFLAGS="$LDFLAGS"
   2.305 ++LDFLAGS="$LDFLAGS -Wl,--build-id=none"
   2.306 ++AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
   2.307 ++AC_MSG_RESULT([$build_id_flag])
   2.308 ++LDFLAGS="$save_LDFLAGS"
   2.309 ++if test "x$build_id_flag" = xyes; then
   2.310 ++  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
   2.311 ++fi
   2.312 ++
   2.313 + if test "x$with_binutils" != x; then
   2.314 + dnl  AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
   2.315 +   AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH")
   2.316 +diff -uprN grub-0.97/docs/grub.8 grub/docs/grub.8
   2.317 +--- grub-0.97/docs/grub.8	2005-05-08 03:48:56.000000000 +0100
   2.318 ++++ grub/docs/grub.8	2006-06-24 15:40:02.000000000 +0100
   2.319 +@@ -1,5 +1,5 @@
   2.320 + .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
   2.321 +-.TH GRUB "8" "May 2005" "grub (GNU GRUB 0.97)" FSF
   2.322 ++.TH GRUB "8" "June 2006" "grub (GNU GRUB 0.97)" FSF
   2.323 + .SH NAME
   2.324 + grub \- the grub shell
   2.325 + .SH SYNOPSIS
   2.326 +diff -uprN grub-0.97/docs/grub-install.8 grub/docs/grub-install.8
   2.327 +--- grub-0.97/docs/grub-install.8	2005-05-08 03:48:56.000000000 +0100
   2.328 ++++ grub/docs/grub-install.8	2006-06-24 15:40:02.000000000 +0100
   2.329 +@@ -1,5 +1,5 @@
   2.330 + .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
   2.331 +-.TH GRUB-INSTALL "8" "May 2005" "grub-install (GNU GRUB 0.97)" FSF
   2.332 ++.TH GRUB-INSTALL "8" "June 2006" "grub-install (GNU GRUB 0.97)" FSF
   2.333 + .SH NAME
   2.334 + grub-install \- install GRUB on your drive
   2.335 + .SH SYNOPSIS
   2.336 +diff -uprN grub-0.97/docs/grub-md5-crypt.8 grub/docs/grub-md5-crypt.8
   2.337 +--- grub-0.97/docs/grub-md5-crypt.8	2005-05-08 03:48:56.000000000 +0100
   2.338 ++++ grub/docs/grub-md5-crypt.8	2006-06-24 15:40:02.000000000 +0100
   2.339 +@@ -1,5 +1,5 @@
   2.340 + .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
   2.341 +-.TH GRUB-MD5-CRYPT "8" "May 2005" "grub-md5-crypt (GNU GRUB )" FSF
   2.342 ++.TH GRUB-MD5-CRYPT "8" "June 2006" "grub-md5-crypt (GNU GRUB )" FSF
   2.343 + .SH NAME
   2.344 + grub-md5-crypt \- Encrypt a password in MD5 format
   2.345 + .SH SYNOPSIS
   2.346 +diff -uprN grub-0.97/docs/grub-terminfo.8 grub/docs/grub-terminfo.8
   2.347 +--- grub-0.97/docs/grub-terminfo.8	2005-05-08 03:48:56.000000000 +0100
   2.348 ++++ grub/docs/grub-terminfo.8	2006-06-24 15:40:02.000000000 +0100
   2.349 +@@ -1,5 +1,5 @@
   2.350 + .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
   2.351 +-.TH GRUB-TERMINFO "8" "May 2005" "grub-terminfo (GNU GRUB 0.97)" FSF
   2.352 ++.TH GRUB-TERMINFO "8" "June 2006" "grub-terminfo (GNU GRUB 0.97)" FSF
   2.353 + .SH NAME
   2.354 + grub-terminfo \- Generate a terminfo command from a terminfo name
   2.355 + .SH SYNOPSIS
   2.356 +diff -uprN grub-0.97/docs/grub.texi grub/docs/grub.texi
   2.357 +--- grub-0.97/docs/grub.texi	2005-05-08 03:59:59.000000000 +0100
   2.358 ++++ grub/docs/grub.texi	2006-06-24 15:40:02.000000000 +0100
   2.359 +@@ -2,22 +2,41 @@
   2.360 + @c -*-texinfo-*-
   2.361 + @c %**start of header
   2.362 + @setfilename grub.info
   2.363 +-@settitle GRUB Manual
   2.364 +-@c %**end of header
   2.365 +-
   2.366 + @include version.texi
   2.367 +-
   2.368 ++@settitle GNU GRUB Manual @value{VERSION}
   2.369 + @c Unify all our little indices for now.
   2.370 + @syncodeindex fn cp
   2.371 + @syncodeindex vr cp
   2.372 + @syncodeindex ky cp
   2.373 + @syncodeindex pg cp
   2.374 + @syncodeindex tp cp
   2.375 ++@c %**end of header
   2.376 + 
   2.377 + @footnotestyle separate
   2.378 + @paragraphindent 3
   2.379 + @finalout
   2.380 + 
   2.381 ++@copying
   2.382 ++This manual is for GNU GRUB (version @value{VERSION},
   2.383 ++@value{UPDATED}).
   2.384 ++
   2.385 ++Copyright @copyright{} 1999,2000,2001,2002,2004,2006 Free Software Foundation, Inc.
   2.386 ++
   2.387 ++@quotation
   2.388 ++Permission is granted to copy, distribute and/or modify this document
   2.389 ++under the terms of the GNU Free Documentation License, Version 1.2 or
   2.390 ++any later version published by the Free Software Foundation; with no
   2.391 ++Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
   2.392 ++and with the Back-Cover Texts as in (a) below.  A copy of the
   2.393 ++license is included in the section entitled ``GNU Free Documentation
   2.394 ++License.''
   2.395 ++
   2.396 ++(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
   2.397 ++this GNU Manual, like GNU software.  Copies published by the Free
   2.398 ++Software Foundation raise funds for GNU development.''
   2.399 ++@end quotation
   2.400 ++@end copying
   2.401 ++
   2.402 + @dircategory Kernel
   2.403 + @direntry
   2.404 + * GRUB: (grub).                 The GRand Unified Bootloader
   2.405 +@@ -34,53 +53,16 @@
   2.406 + 
   2.407 + @setchapternewpage odd
   2.408 + 
   2.409 +-@ifinfo
   2.410 +-Copyright @copyright{} 1999,2000,2001,2002,2004 Free Software Foundation, Inc.
   2.411 +-
   2.412 +-Permission is granted to make and distribute verbatim copies of
   2.413 +-this manual provided the copyright notice and this permission notice
   2.414 +-are preserved on all copies.
   2.415 +-
   2.416 +-@ignore
   2.417 +-Permission is granted to process this file through TeX and print the
   2.418 +-results, provided the printed document carries a copying permission
   2.419 +-notice identical to this one except for the removal of this paragraph
   2.420 +-(this paragraph not being relevant to the printed manual).
   2.421 +-
   2.422 +-@end ignore
   2.423 +-
   2.424 +-Permission is granted to copy and distribute modified versions of this
   2.425 +-manual under the conditions for verbatim copying, provided also that
   2.426 +-the entire resulting derived work is distributed under the terms of a
   2.427 +-permission notice identical to this one.
   2.428 +-
   2.429 +-Permission is granted to copy and distribute translations of this manual
   2.430 +-into another language, under the above conditions for modified versions.
   2.431 +-@end ifinfo
   2.432 +-
   2.433 + @titlepage
   2.434 + @sp 10
   2.435 +-@title the GRUB manual
   2.436 ++@title the GNU GRUB manual
   2.437 + @subtitle The GRand Unified Bootloader, version @value{VERSION}, @value{UPDATED}.
   2.438 + @author Gordon Matzigkeit
   2.439 + @author Yoshinori K. Okuji
   2.440 + @c The following two commands start the copyright page.
   2.441 + @page
   2.442 + @vskip 0pt plus 1filll
   2.443 +-Copyright @copyright{} 1999,2000,2001,2002,2004 Free Software Foundation, Inc.
   2.444 +-
   2.445 +-Permission is granted to make and distribute verbatim copies of
   2.446 +-this manual provided the copyright notice and this permission notice
   2.447 +-are preserved on all copies.
   2.448 +-Permission is granted to copy and distribute modified versions of this
   2.449 +-manual under the conditions for verbatim copying, provided that the entire
   2.450 +-resulting derived work is distributed under the terms of a permission
   2.451 +-notice identical to this one.
   2.452 +-
   2.453 +-Permission is granted to copy and distribute translations of this manual
   2.454 +-into another language, under the above conditions for modified versions,
   2.455 +-except that this permission notice may be stated in a translation approved
   2.456 +-by Free Software Foundation.
   2.457 ++@insertcopying
   2.458 + @end titlepage
   2.459 + 
   2.460 + @c Output the table of contents at the beginning.
   2.461 +@@ -91,12 +73,14 @@ by Free Software Foundation.
   2.462 + 
   2.463 + @ifnottex
   2.464 + @node Top
   2.465 +-@top GRUB manual
   2.466 ++@top GNU GRUB manual
   2.467 + 
   2.468 + This is the documentation of GNU GRUB, the GRand Unified Bootloader,
   2.469 + a flexible and powerful boot loader program for @sc{pc}s.
   2.470 + 
   2.471 + This edition documents version @value{VERSION}.
   2.472 ++
   2.473 ++@insertcopying
   2.474 + @end ifnottex
   2.475 + 
   2.476 + @menu
   2.477 +@@ -124,6 +108,7 @@ This edition documents version @value{VE
   2.478 + * Reporting bugs::              Where you should send a bug report
   2.479 + * Future::                      Some future plans on GRUB
   2.480 + * Internals::                   Hacking GRUB
   2.481 ++* Copying This Manual::         Copying This Manual
   2.482 + * Index::
   2.483 + @end menu
   2.484 + 
   2.485 +@@ -3965,6 +3950,16 @@ homepage}.
   2.486 + @include internals.texi
   2.487 + 
   2.488 + 
   2.489 ++@node Copying This Manual
   2.490 ++@appendix Copying This Manual
   2.491 ++
   2.492 ++@menu
   2.493 ++* GNU Free Documentation License::  License for copying this manual.
   2.494 ++@end menu
   2.495 ++
   2.496 ++@include fdl.texi
   2.497 ++
   2.498 ++
   2.499 + @node Index
   2.500 + @unnumbered Index
   2.501 + 
   2.502 +diff -uprN grub-0.97/docs/Makefile.am grub/docs/Makefile.am
   2.503 +--- grub-0.97/docs/Makefile.am	2003-07-09 12:45:35.000000000 +0100
   2.504 ++++ grub/docs/Makefile.am	2006-06-24 15:40:02.000000000 +0100
   2.505 +@@ -1,5 +1,5 @@
   2.506 + info_TEXINFOS = grub.texi multiboot.texi
   2.507 +-grub_TEXINFOS = internals.texi
   2.508 ++grub_TEXINFOS = internals.texi fdl.texi
   2.509 + EXAMPLES = boot.S kernel.c multiboot.h
   2.510 + multiboot_TEXINFOS = boot.S.texi kernel.c.texi multiboot.h.texi
   2.511 + man_MANS = grub.8 mbchk.1 grub-install.8 grub-md5-crypt.8 grub-terminfo.8
   2.512 +diff -uprN grub-0.97/docs/Makefile.in grub/docs/Makefile.in
   2.513 +--- grub-0.97/docs/Makefile.in	2005-05-08 03:42:34.000000000 +0100
   2.514 ++++ grub/docs/Makefile.in	2006-06-24 15:40:02.000000000 +0100
   2.515 +@@ -202,7 +202,7 @@ sharedstatedir = @sharedstatedir@
   2.516 + sysconfdir = @sysconfdir@
   2.517 + target_alias = @target_alias@
   2.518 + info_TEXINFOS = grub.texi multiboot.texi
   2.519 +-grub_TEXINFOS = internals.texi
   2.520 ++grub_TEXINFOS = internals.texi fdl.texi
   2.521 + EXAMPLES = boot.S kernel.c multiboot.h
   2.522 + multiboot_TEXINFOS = boot.S.texi kernel.c.texi multiboot.h.texi
   2.523 + man_MANS = grub.8 mbchk.1 grub-install.8 grub-md5-crypt.8 grub-terminfo.8
   2.524 +diff -uprN grub-0.97/docs/mbchk.1 grub/docs/mbchk.1
   2.525 +--- grub-0.97/docs/mbchk.1	2005-05-08 03:48:56.000000000 +0100
   2.526 ++++ grub/docs/mbchk.1	2006-06-24 15:40:02.000000000 +0100
   2.527 +@@ -1,5 +1,5 @@
   2.528 + .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
   2.529 +-.TH MBCHK "1" "May 2005" "mbchk (GNU GRUB 0.97)" FSF
   2.530 ++.TH MBCHK "1" "June 2006" "mbchk (GNU GRUB 0.97)" FSF
   2.531 + .SH NAME
   2.532 + mbchk \- check the format of a Multiboot kernel
   2.533 + .SH SYNOPSIS
   2.534 +diff -uprN grub-0.97/docs/multiboot.texi grub/docs/multiboot.texi
   2.535 +--- grub-0.97/docs/multiboot.texi	2003-07-09 12:45:36.000000000 +0100
   2.536 ++++ grub/docs/multiboot.texi	2006-06-24 15:40:02.000000000 +0100
   2.537 +@@ -1,32 +1,28 @@
   2.538 + \input texinfo @c -*-texinfo-*-
   2.539 +-@c -*-texinfo-*-
   2.540 + @c %**start of header
   2.541 + @setfilename multiboot.info
   2.542 +-@settitle Multiboot Specification
   2.543 +-@c %**end of header
   2.544 +-
   2.545 ++@set VERSION 0.6.95
   2.546 ++@settitle Multiboot Specification version @value{VERSION}
   2.547 + @c Unify all our little indices for now.
   2.548 + @syncodeindex fn cp
   2.549 + @syncodeindex vr cp
   2.550 + @syncodeindex ky cp
   2.551 + @syncodeindex pg cp
   2.552 + @syncodeindex tp cp
   2.553 ++@c %**end of header
   2.554 + 
   2.555 + @footnotestyle separate
   2.556 + @paragraphindent 3
   2.557 + @finalout
   2.558 + 
   2.559 ++@copying
   2.560 ++Copyright @copyright{} 1995,96 Bryan Ford <baford@@cs.utah.edu>
   2.561 + 
   2.562 +-@dircategory Kernel
   2.563 +-@direntry
   2.564 +-* Multiboot Specification: (multiboot).		Multiboot Specification.
   2.565 +-@end direntry
   2.566 ++Copyright @copyright{} 1995,96 Erich Stefan Boleyn <erich@@uruk.org>
   2.567 + 
   2.568 +-@ifinfo
   2.569 +-Copyright @copyright{} 1995, 96 Bryan Ford <baford@@cs.utah.edu>
   2.570 +-Copyright @copyright{} 1995, 96 Erich Stefan Boleyn <erich@@uruk.org>
   2.571 +-Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
   2.572 ++Copyright @copyright{} 1999,2000,2001,2002,2005,2006 Free Software Foundation, Inc.
   2.573 + 
   2.574 ++@quotation
   2.575 + Permission is granted to make and distribute verbatim copies of
   2.576 + this manual provided the copyright notice and this permission notice
   2.577 + are preserved on all copies.
   2.578 +@@ -36,7 +32,6 @@ Permission is granted to process this fi
   2.579 + results, provided the printed document carries a copying permission
   2.580 + notice identical to this one except for the removal of this paragraph
   2.581 + (this paragraph not being relevant to the printed manual).
   2.582 +-
   2.583 + @end ignore
   2.584 + 
   2.585 + Permission is granted to copy and distribute modified versions of this
   2.586 +@@ -45,31 +40,23 @@ the entire resulting derived work is dis
   2.587 + permission notice identical to this one.
   2.588 + 
   2.589 + Permission is granted to copy and distribute translations of this manual
   2.590 +-into another language, under the above conditions for modified versions.
   2.591 +-@end ifinfo
   2.592 ++into another language, under the above conditions for modified
   2.593 ++versions.
   2.594 ++@end quotation
   2.595 ++@end copying
   2.596 ++
   2.597 ++@dircategory Kernel
   2.598 ++@direntry
   2.599 ++* Multiboot Specification: (multiboot).		Multiboot Specification.
   2.600 ++@end direntry
   2.601 + 
   2.602 + @titlepage
   2.603 + @sp 10
   2.604 +-@title The Multiboot Specification
   2.605 ++@title The Multiboot Specification version @value{VERSION}
   2.606 + @author Yoshinori K. Okuji, Bryan Ford, Erich Stefan Boleyn, Kunihiro Ishiguro
   2.607 + @page
   2.608 +-
   2.609 + @vskip 0pt plus 1filll
   2.610 +-Copyright @copyright{} 1995, 96 Bryan Ford <baford@@cs.utah.edu>
   2.611 +-Copyright @copyright{} 1995, 96 Erich Stefan Boleyn <erich@@uruk.org>
   2.612 +-Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
   2.613 +-
   2.614 +-Permission is granted to make and distribute verbatim copies of
   2.615 +-this manual provided the copyright notice and this permission notice
   2.616 +-are preserved on all copies.
   2.617 +-
   2.618 +-Permission is granted to copy and distribute modified versions of this
   2.619 +-manual under the conditions for verbatim copying, provided also that
   2.620 +-the entire resulting derived work is distributed under the terms of a
   2.621 +-permission notice identical to this one.
   2.622 +-
   2.623 +-Permission is granted to copy and distribute translations of this manual
   2.624 +-into another language, under the above conditions for modified versions.
   2.625 ++@insertcopying
   2.626 + @end titlepage
   2.627 + 
   2.628 + @finalout
   2.629 +@@ -80,7 +67,9 @@ into another language, under the above c
   2.630 + @top Multiboot Specification
   2.631 + 
   2.632 + This file documents Multiboot Specification, the proposal for the boot
   2.633 +-sequence standard. This edition documents version 0.6.93.
   2.634 ++sequence standard. This edition documents version @value{VERSION}.
   2.635 ++
   2.636 ++@insertcopying
   2.637 + @end ifnottex
   2.638 + 
   2.639 + @menu
   2.640 +@@ -426,7 +415,7 @@ mode table (@pxref{Boot information form
   2.641 + kernel.
   2.642 + 
   2.643 + If bit 16 in the @samp{flags} word is set, then the fields at offsets
   2.644 +-8-24 in the Multiboot header are valid, and the boot loader should use
   2.645 ++12-28 in the Multiboot header are valid, and the boot loader should use
   2.646 + them instead of the fields in the actual executable header to calculate
   2.647 + where to load the OS image. This information does not need to be
   2.648 + provided if the kernel image is in @sc{elf} format, but it @emph{must}
   2.649 +@@ -677,7 +666,7 @@ follows:
   2.650 + @example
   2.651 + @group
   2.652 + +-------+-------+-------+-------+
   2.653 +-| drive | part1 | part2 | part3 |
   2.654 ++| part3 | part2 | part1 | drive |
   2.655 + +-------+-------+-------+-------+
   2.656 + @end group
   2.657 + @end example
   2.658 +@@ -1197,6 +1186,17 @@ Rewritten, using more strict words.
   2.659 + @item
   2.660 + The maintainer changes to the GNU GRUB maintainer team
   2.661 + @email{bug-grub@@gnu.org}, from Bryan Ford and Erich Stefan Boleyn.
   2.662 ++
   2.663 ++@item
   2.664 ++The byte order of the @samp{boot_device} in Multiboot information is
   2.665 ++reversed. This was a mistake.
   2.666 ++
   2.667 ++@item
   2.668 ++The offset of the address fields were wrong.
   2.669 ++
   2.670 ++@item
   2.671 ++The format is adapted to a newer Texinfo, and the version number is
   2.672 ++specified more explicitly in the title.
   2.673 + @end itemize
   2.674 + 
   2.675 + @item 0.6
   2.676 +diff -uprN grub-0.97/grub/asmstub.c grub/grub/asmstub.c
   2.677 +--- grub-0.97/grub/asmstub.c	2005-02-16 20:45:14.000000000 +0000
   2.678 ++++ grub/grub/asmstub.c	2008-03-28 13:22:28.000000000 +0000
   2.679 +@@ -55,6 +55,10 @@ int grub_stage2 (void);
   2.680 + # endif /* ! BLKFLSBUF */
   2.681 + #endif /* __linux__ */
   2.682 + 
   2.683 ++#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
   2.684 ++# include <sys/sysctl.h>
   2.685 ++#endif
   2.686 ++
   2.687 + /* We want to prevent any circularararity in our stubs, as well as
   2.688 +    libc name clashes. */
   2.689 + #define WITHOUT_LIBC_STUBS 1
   2.690 +@@ -777,7 +781,39 @@ get_diskinfo (int drive, struct geometry
   2.691 + 
   2.692 +       /* Open read/write, or read-only if that failed. */
   2.693 +       if (! read_only)
   2.694 +-	disks[drive].flags = open (devname, O_RDWR);
   2.695 ++	{
   2.696 ++/* By default, kernel of FreeBSD does not allow overwriting MBR */
   2.697 ++#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
   2.698 ++#define GEOM_SYSCTL	"kern.geom.debugflags"
   2.699 ++	  int old_flags, flags;
   2.700 ++	  size_t sizeof_int = sizeof (int);
   2.701 ++
   2.702 ++	  if (sysctlbyname (GEOM_SYSCTL, &old_flags, &sizeof_int, NULL, 0) != 0)
   2.703 ++	    grub_printf ("failed to get " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
   2.704 ++
   2.705 ++	  if ((old_flags & 0x10) == 0)
   2.706 ++	    {
   2.707 ++	      /* "allow foot shooting", see geom(4) */
   2.708 ++	      flags = old_flags | 0x10;
   2.709 ++
   2.710 ++	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int)) != 0)
   2.711 ++		{
   2.712 ++		  flags = old_flags;
   2.713 ++		  grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
   2.714 ++		}
   2.715 ++	    }
   2.716 ++	  else
   2.717 ++	    flags = old_flags;
   2.718 ++#endif
   2.719 ++	  disks[drive].flags = open (devname, O_RDWR);
   2.720 ++#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
   2.721 ++	  if (flags != old_flags)
   2.722 ++	    {
   2.723 ++	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &old_flags, sizeof (int)) != 0)
   2.724 ++	        grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
   2.725 ++	    }
   2.726 ++#endif
   2.727 ++	}
   2.728 + 
   2.729 +       if (disks[drive].flags == -1)
   2.730 + 	{
   2.731 +@@ -926,7 +962,7 @@ hex_dump (void *buf, size_t size)
   2.732 + 
   2.733 + int
   2.734 + biosdisk (int subfunc, int drive, struct geometry *geometry,
   2.735 +-	  int sector, int nsec, int segment)
   2.736 ++	  unsigned int sector, int nsec, int segment)
   2.737 + {
   2.738 +   char *buf;
   2.739 +   int fd = geometry->flags;
   2.740 +diff -uprN grub-0.97/grub/main.c grub/grub/main.c
   2.741 +--- grub-0.97/grub/main.c	2003-07-09 12:45:36.000000000 +0100
   2.742 ++++ grub/grub/main.c	2006-05-05 22:43:46.000000000 +0100
   2.743 +@@ -32,6 +32,7 @@ int grub_stage2 (void);
   2.744 + #define WITHOUT_LIBC_STUBS 1
   2.745 + #include <shared.h>
   2.746 + #include <term.h>
   2.747 ++#include <device.h>
   2.748 + 
   2.749 + char *program_name = 0;
   2.750 + int use_config_file = 1;
   2.751 +@@ -192,6 +193,12 @@ main (int argc, char **argv)
   2.752 + 	      perror ("strtoul");
   2.753 + 	      exit (1);
   2.754 + 	    }
   2.755 ++	  if (boot_drive >= NUM_DISKS)
   2.756 ++	    {
   2.757 ++	      fprintf (stderr, "boot_drive should be from 0 to %d\n",
   2.758 ++		       NUM_DISKS - 1);
   2.759 ++	      exit (1);
   2.760 ++	    }
   2.761 + 	  break;
   2.762 + 
   2.763 + 	case OPT_NO_CONFIG_FILE:
   2.764 +diff -uprN grub-0.97/lib/device.c grub/lib/device.c
   2.765 +--- grub-0.97/lib/device.c	2005-03-28 00:14:25.000000000 +0100
   2.766 ++++ grub/lib/device.c	2008-03-28 13:22:28.000000000 +0000
   2.767 +@@ -69,9 +69,9 @@ struct hd_geometry
   2.768 + # ifndef CDROM_GET_CAPABILITY
   2.769 + #  define CDROM_GET_CAPABILITY	0x5331	/* get capabilities */
   2.770 + # endif /* ! CDROM_GET_CAPABILITY */
   2.771 +-# ifndef BLKGETSIZE
   2.772 +-#  define BLKGETSIZE	_IO(0x12,96)	/* return device size */
   2.773 +-# endif /* ! BLKGETSIZE */
   2.774 ++# ifndef BLKGETSIZE64
   2.775 ++#  define BLKGETSIZE64	_IOR(0x12,114,size_t)	/* return device size */
   2.776 ++# endif /* ! BLKGETSIZE64 */
   2.777 + #endif /* __linux__ */
   2.778 + 
   2.779 + /* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with
   2.780 +@@ -152,19 +152,19 @@ get_drive_geometry (struct geometry *geo
   2.781 +   /* Linux */
   2.782 +   {
   2.783 +     struct hd_geometry hdg;
   2.784 +-    unsigned long nr;
   2.785 ++    unsigned long long nr;
   2.786 +     
   2.787 +     if (ioctl (fd, HDIO_GETGEO, &hdg))
   2.788 +       goto fail;
   2.789 + 
   2.790 +-    if (ioctl (fd, BLKGETSIZE, &nr))
   2.791 ++    if (ioctl (fd, BLKGETSIZE64, &nr))
   2.792 +       goto fail;
   2.793 +     
   2.794 +     /* Got the geometry, so save it. */
   2.795 +     geom->cylinders = hdg.cylinders;
   2.796 +     geom->heads = hdg.heads;
   2.797 +     geom->sectors = hdg.sectors;
   2.798 +-    geom->total_sectors = nr;
   2.799 ++    geom->total_sectors = nr / 512;
   2.800 +     
   2.801 +     goto success;
   2.802 +   }
   2.803 +@@ -407,6 +407,12 @@ get_ataraid_disk_name (char *name, int u
   2.804 + {
   2.805 +   sprintf (name, "/dev/ataraid/d%c", unit + '0');
   2.806 + }
   2.807 ++
   2.808 ++static void
   2.809 ++get_i2o_disk_name (char *name, char unit)
   2.810 ++{
   2.811 ++  sprintf (name, "/dev/i2o/hd%c", unit);
   2.812 ++}
   2.813 + #endif
   2.814 + 
   2.815 + /* Check if DEVICE can be read. If an error occurs, return zero,
   2.816 +@@ -801,6 +807,29 @@ init_device_map (char ***map, const char
   2.817 + 	  }
   2.818 +       }
   2.819 +   }
   2.820 ++    
   2.821 ++  /* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */
   2.822 ++  {
   2.823 ++    int unit;
   2.824 ++
   2.825 ++    for (unit = 'a'; unit < 'f'; unit++)
   2.826 ++      {
   2.827 ++        char name[24];
   2.828 ++    
   2.829 ++        get_i2o_disk_name (name, unit);
   2.830 ++        if (check_device (name))
   2.831 ++          {
   2.832 ++              (*map)[num_hd + 0x80] = strdup (name);
   2.833 ++                  assert ((*map)[num_hd + 0x80]);
   2.834 ++                  
   2.835 ++	    /* If the device map file is opened, write the map.  */
   2.836 ++               if (fp)
   2.837 ++                     fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
   2.838 ++                     
   2.839 ++	    num_hd++;
   2.840 ++          }
   2.841 ++      }
   2.842 ++  }
   2.843 + #endif /* __linux__ */
   2.844 +   
   2.845 +   /* OK, close the device map file if opened.  */
   2.846 +@@ -861,6 +890,12 @@ write_to_partition (char **map, int driv
   2.847 +       if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
   2.848 + 	strcpy (dev + strlen(dev) - 5, "/part");
   2.849 +     }
   2.850 ++  else
   2.851 ++    {
   2.852 ++      if ((strncmp (dev, "/dev/ataraid/", 13) == 0) ||
   2.853 ++         (strncmp (dev, "/dev/rd/", 8) == 0))
   2.854 ++        strcpy (dev + strlen(dev), "p");
   2.855 ++    }
   2.856 +   sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
   2.857 +   
   2.858 +   /* Open the partition.  */
   2.859 +diff -uprN grub-0.97/netboot/3c509.c grub/netboot/3c509.c
   2.860 +--- grub-0.97/netboot/3c509.c	2003-07-09 12:45:37.000000000 +0100
   2.861 ++++ grub/netboot/3c509.c	2002-01-02 21:56:40.000000000 +0000
   2.862 +@@ -18,7 +18,7 @@ Author: Martin Renters.
   2.863 + 
   2.864 + 3c509 support added by Serge Babkin (babkin@hq.icb.chel.su)
   2.865 + 
   2.866 +-$Id: 3c509.c,v 1.4 2002/01/02 21:56:40 okuji Exp $
   2.867 ++$Id: 3c509.c 609 2002-01-02 21:56:40Z okuji $
   2.868 + 
   2.869 + ***************************************************************************/
   2.870 + 
   2.871 +diff -uprN grub-0.97/netboot/cs89x0.c grub/netboot/cs89x0.c
   2.872 +--- grub-0.97/netboot/cs89x0.c	2003-07-09 12:45:37.000000000 +0100
   2.873 ++++ grub/netboot/cs89x0.c	2008-05-20 12:04:18.000000000 +0100
   2.874 +@@ -1,3 +1,21 @@
   2.875 ++/**
   2.876 ++   Per an email message from Russ Nelson <nelson@crynwr.com> on
   2.877 ++   18 March 2008 this file is now licensed under GPL Version 2.
   2.878 ++
   2.879 ++   From: Russ Nelson <nelson@crynwr.com>
   2.880 ++   Date: Tue, 18 Mar 2008 12:42:00 -0400
   2.881 ++   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
   2.882 ++   -- quote from email
   2.883 ++   As copyright holder, if I say it doesn't conflict with the GPL,
   2.884 ++   then it doesn't conflict with the GPL.
   2.885 ++
   2.886 ++   However, there's no point in causing people's brains to overheat,
   2.887 ++   so yes, I grant permission for the code to be relicensed under the
   2.888 ++   GPLv2.  Please make sure that this change in licensing makes its
   2.889 ++   way upstream.  -russ
   2.890 ++   -- quote from email
   2.891 ++**/
   2.892 ++
   2.893 + /* cs89x0.c: A Crystal Semiconductor CS89[02]0 driver for etherboot. */
   2.894 + /*
   2.895 +   Permission is granted to distribute the enclosed cs89x0.[ch] driver
   2.896 +diff -uprN grub-0.97/netboot/cs89x0.h grub/netboot/cs89x0.h
   2.897 +--- grub-0.97/netboot/cs89x0.h	2003-07-09 12:45:37.000000000 +0100
   2.898 ++++ grub/netboot/cs89x0.h	2008-05-20 12:04:18.000000000 +0100
   2.899 +@@ -1,3 +1,21 @@
   2.900 ++/**
   2.901 ++   Per an email message from Russ Nelson <nelson@crynwr.com> on
   2.902 ++   18 March 2008 this file is now licensed under GPL Version 2.
   2.903 ++
   2.904 ++   From: Russ Nelson <nelson@crynwr.com>
   2.905 ++   Date: Tue, 18 Mar 2008 12:42:00 -0400
   2.906 ++   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
   2.907 ++   -- quote from email
   2.908 ++   As copyright holder, if I say it doesn't conflict with the GPL,
   2.909 ++   then it doesn't conflict with the GPL.
   2.910 ++
   2.911 ++   However, there's no point in causing people's brains to overheat,
   2.912 ++   so yes, I grant permission for the code to be relicensed under the
   2.913 ++   GPLv2.  Please make sure that this change in licensing makes its
   2.914 ++   way upstream.  -russ
   2.915 ++   -- quote from email
   2.916 ++**/
   2.917 ++
   2.918 + /*  Copyright, 1988-1992, Russell Nelson, Crynwr Software
   2.919 + 
   2.920 +    This program is free software; you can redistribute it and/or modify
   2.921 +diff -uprN grub-0.97/netboot/etherboot.h grub/netboot/etherboot.h
   2.922 +--- grub-0.97/netboot/etherboot.h	2003-07-09 12:45:37.000000000 +0100
   2.923 ++++ grub/netboot/etherboot.h	2006-09-08 13:56:22.000000000 +0100
   2.924 +@@ -531,9 +531,6 @@ extern int ip_abort;
   2.925 + extern int network_ready;
   2.926 + extern struct rom_info rom;
   2.927 + extern struct arptable_t arptable[MAX_ARP];
   2.928 +-extern struct bootpd_t bootp_data;
   2.929 +-#define	BOOTP_DATA_ADDR	(&bootp_data)
   2.930 +-extern unsigned char *end_of_rfc1533;
   2.931 + 
   2.932 + /* config.c */
   2.933 + extern struct nic nic;
   2.934 +diff -uprN grub-0.97/netboot/main.c grub/netboot/main.c
   2.935 +--- grub-0.97/netboot/main.c	2004-05-20 23:19:33.000000000 +0100
   2.936 ++++ grub/netboot/main.c	2006-09-08 13:56:22.000000000 +0100
   2.937 +@@ -56,7 +56,8 @@ static int vendorext_isvalid;
   2.938 + static unsigned long netmask;
   2.939 + static struct bootpd_t bootp_data;
   2.940 + static unsigned long xid;
   2.941 +-static unsigned char *end_of_rfc1533 = NULL;
   2.942 ++
   2.943 ++#define	BOOTP_DATA_ADDR	(&bootp_data)
   2.944 + 
   2.945 + #ifndef	NO_DHCP_SUPPORT
   2.946 + #endif /* NO_DHCP_SUPPORT */
   2.947 +@@ -967,7 +968,6 @@ decode_rfc1533 (unsigned char *p, int bl
   2.948 +   
   2.949 +   if (block == 0)
   2.950 +     {
   2.951 +-      end_of_rfc1533 = NULL;
   2.952 +       vendorext_isvalid = 0;
   2.953 +       
   2.954 +       if (grub_memcmp (p, rfc1533_cookie, 4))
   2.955 +@@ -1021,7 +1021,7 @@ decode_rfc1533 (unsigned char *p, int bl
   2.956 + 	}
   2.957 +       else if (c == RFC1533_END)
   2.958 + 	{
   2.959 +-	  end_of_rfc1533 = endp = p;
   2.960 ++	  endp = p;
   2.961 + 	  continue;
   2.962 + 	}
   2.963 +       else if (c == RFC1533_NETMASK)
   2.964 +diff -uprN grub-0.97/netboot/natsemi.c grub/netboot/natsemi.c
   2.965 +--- grub-0.97/netboot/natsemi.c	2003-07-09 12:45:38.000000000 +0100
   2.966 ++++ grub/netboot/natsemi.c	2006-09-10 08:26:10.000000000 +0100
   2.967 +@@ -608,7 +608,7 @@ natsemi_transmit(struct nic  *nic,
   2.968 + 		 const char  *p)     /* Packet */
   2.969 + {
   2.970 +     u32 status, to, nstype;
   2.971 +-    u32 tx_status;
   2.972 ++    volatile u32 tx_status;
   2.973 +     
   2.974 +     /* Stop the transmitter */
   2.975 +     outl(TxOff, ioaddr + ChipCmd);
   2.976 +@@ -647,7 +647,7 @@ natsemi_transmit(struct nic  *nic,
   2.977 + 
   2.978 +     to = currticks() + TX_TIMEOUT;
   2.979 + 
   2.980 +-    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
   2.981 ++    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
   2.982 +         /* wait */ ;
   2.983 + 
   2.984 +     if (currticks() >= to) {
   2.985 +diff -uprN grub-0.97/netboot/sis900.c grub/netboot/sis900.c
   2.986 +--- grub-0.97/netboot/sis900.c	2003-07-09 12:45:38.000000000 +0100
   2.987 ++++ grub/netboot/sis900.c	2006-09-10 08:26:10.000000000 +0100
   2.988 +@@ -901,7 +901,7 @@ sis900_transmit(struct nic  *nic,
   2.989 +                 const char  *p)     /* Packet */
   2.990 + {
   2.991 +     u32 status, to, nstype;
   2.992 +-    u32 tx_status;
   2.993 ++    volatile u32 tx_status;
   2.994 +     
   2.995 +     /* Stop the transmitter */
   2.996 +     outl(TxDIS, ioaddr + cr);
   2.997 +@@ -940,7 +940,7 @@ sis900_transmit(struct nic  *nic,
   2.998 + 
   2.999 +     to = currticks() + TX_TIMEOUT;
  2.1000 + 
  2.1001 +-    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
  2.1002 ++    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
  2.1003 +         /* wait */ ;
  2.1004 + 
  2.1005 +     if (currticks() >= to) {
  2.1006 +diff -uprN grub-0.97/netboot/sk_g16.c grub/netboot/sk_g16.c
  2.1007 +--- grub-0.97/netboot/sk_g16.c	2003-07-09 12:45:38.000000000 +0100
  2.1008 ++++ grub/netboot/sk_g16.c	2002-01-02 21:56:40.000000000 +0000
  2.1009 +@@ -13,12 +13,12 @@ Changes to make it work with Etherboot b
  2.1010 +  *
  2.1011 +  * Module         : sk_g16.c
  2.1012 +  *
  2.1013 +- * Version        : $Revision: 1.4 $
  2.1014 ++ * Version        : $Revision: 609 $
  2.1015 +  *
  2.1016 +  * Author         : Patrick J.D. Weichmann
  2.1017 +  *
  2.1018 +  * Date Created   : 94/05/26
  2.1019 +- * Last Updated   : $Date: 2002/01/02 21:56:40 $
  2.1020 ++ * Last Updated   : $Date: 2002-01-02 21:56:40 +0000 (mer 02 jan 2002) $
  2.1021 +  *
  2.1022 +  * Description    : Schneider & Koch G16 Ethernet Device Driver for
  2.1023 +  *                  Linux Kernel >= 1.1.22
  2.1024 +diff -uprN grub-0.97/netboot/sk_g16.h grub/netboot/sk_g16.h
  2.1025 +--- grub-0.97/netboot/sk_g16.h	2003-07-09 12:45:38.000000000 +0100
  2.1026 ++++ grub/netboot/sk_g16.h	2000-07-29 20:22:54.000000000 +0100
  2.1027 +@@ -4,7 +4,7 @@
  2.1028 +  * of the GNU Public License, incorporated herein by reference.
  2.1029 +  *
  2.1030 +  * Module         : sk_g16.h
  2.1031 +- * Version        : $Revision: 1.3 $
  2.1032 ++ * Version        : $Revision: 388 $
  2.1033 +  *
  2.1034 +  * Author         : M.Hipp (mhipp@student.uni-tuebingen.de)
  2.1035 +  * changes by     : Patrick J.D. Weichmann
  2.1036 +@@ -15,8 +15,8 @@
  2.1037 +  *                  the am7990 (LANCE) chip used for writing a
  2.1038 +  *                  network device driver which uses this chip
  2.1039 +  *
  2.1040 +- * $Log: sk_g16.h,v $
  2.1041 +- * Revision 1.3  2000/07/29 19:22:54  okuji
  2.1042 ++ * $Log$
  2.1043 ++ * Revision 1.3  2000-07-29 19:22:54  okuji
  2.1044 +  * update the network support to etherboot-4.6.4.
  2.1045 +  *
  2.1046 + -*/
  2.1047 +diff -uprN grub-0.97/stage1/Makefile.am grub/stage1/Makefile.am
  2.1048 +--- grub-0.97/stage1/Makefile.am	2004-07-16 12:44:56.000000000 +0100
  2.1049 ++++ grub/stage1/Makefile.am	2007-11-05 01:29:46.000000000 +0000
  2.1050 +@@ -5,7 +5,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
  2.1051 + 
  2.1052 + # We can't use builtins or standard includes.
  2.1053 + AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
  2.1054 +-LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
  2.1055 ++stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
  2.1056 + 
  2.1057 + noinst_PROGRAMS = stage1.exec
  2.1058 + stage1_exec_SOURCES = stage1.S stage1.h
  2.1059 +diff -uprN grub-0.97/stage1/Makefile.in grub/stage1/Makefile.in
  2.1060 +--- grub-0.97/stage1/Makefile.in	2005-05-08 03:42:36.000000000 +0100
  2.1061 ++++ grub/stage1/Makefile.in	2007-11-05 01:29:46.000000000 +0000
  2.1062 +@@ -110,7 +110,7 @@ INSTALL_DATA = @INSTALL_DATA@
  2.1063 + INSTALL_PROGRAM = @INSTALL_PROGRAM@
  2.1064 + INSTALL_SCRIPT = @INSTALL_SCRIPT@
  2.1065 + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  2.1066 +-LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
  2.1067 ++LDFLAGS = @LDFLAGS@
  2.1068 + LIBOBJS = @LIBOBJS@
  2.1069 + LIBS = @LIBS@
  2.1070 + LTLIBOBJS = @LTLIBOBJS@
  2.1071 +@@ -188,6 +188,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
  2.1072 + 
  2.1073 + # We can't use builtins or standard includes.
  2.1074 + AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
  2.1075 ++stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
  2.1076 + stage1_exec_SOURCES = stage1.S stage1.h
  2.1077 + SUFFIXES = .exec
  2.1078 + all: all-am
  2.1079 +diff -uprN grub-0.97/stage2/bios.c grub/stage2/bios.c
  2.1080 +--- grub-0.97/stage2/bios.c	2004-03-27 16:34:04.000000000 +0000
  2.1081 ++++ grub/stage2/bios.c	2008-03-28 13:22:28.000000000 +0000
  2.1082 +@@ -47,7 +47,7 @@ extern int get_diskinfo_floppy (int driv
  2.1083 +    return the error number. Otherwise, return 0.  */
  2.1084 + int
  2.1085 + biosdisk (int read, int drive, struct geometry *geometry,
  2.1086 +-	  int sector, int nsec, int segment)
  2.1087 ++	  unsigned int sector, int nsec, int segment)
  2.1088 + {
  2.1089 +   int err;
  2.1090 +   
  2.1091 +diff -uprN grub-0.97/stage2/boot.c grub/stage2/boot.c
  2.1092 +--- grub-0.97/stage2/boot.c	2004-03-30 12:44:08.000000000 +0100
  2.1093 ++++ grub/stage2/boot.c	2005-09-28 22:47:55.000000000 +0100
  2.1094 +@@ -1,7 +1,7 @@
  2.1095 + /* boot.c - load and bootstrap a kernel */
  2.1096 + /*
  2.1097 +  *  GRUB  --  GRand Unified Bootloader
  2.1098 +- *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
  2.1099 ++ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005  Free Software Foundation, Inc.
  2.1100 +  *
  2.1101 +  *  This program is free software; you can redistribute it and/or modify
  2.1102 +  *  it under the terms of the GNU General Public License as published by
  2.1103 +@@ -96,7 +96,7 @@ load_image (char *kernel, char *arg, ker
  2.1104 +   lh = (struct linux_kernel_header *) buffer;
  2.1105 +   
  2.1106 +   /* ELF loading supported if multiboot, FreeBSD and NetBSD.  */
  2.1107 +-  if ((type == KERNEL_TYPE_MULTIBOOT
  2.1108 ++  if (((type == KERNEL_TYPE_MULTIBOOT && ! (flags & MULTIBOOT_AOUT_KLUDGE))
  2.1109 +        || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD
  2.1110 +        || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0
  2.1111 +        || suggested_type == KERNEL_TYPE_NETBSD)
  2.1112 +diff -uprN grub-0.97/stage2/builtins.c grub/stage2/builtins.c
  2.1113 +--- grub-0.97/stage2/builtins.c	2005-02-15 21:58:23.000000000 +0000
  2.1114 ++++ grub/stage2/builtins.c	2006-03-21 20:51:58.000000000 +0000
  2.1115 +@@ -3830,15 +3830,15 @@ setup_func (char *arg, int flags)
  2.1116 + 	{
  2.1117 + 	  char tmp[16];
  2.1118 + 	  grub_sprintf (tmp, ",%d", (partition >> 16) & 0xFF);
  2.1119 +-	  grub_strncat (device, tmp, 256);
  2.1120 ++	  grub_strncat (device, tmp, sizeof (device));
  2.1121 + 	}
  2.1122 +       if ((partition & 0x00FF00) != 0x00FF00)
  2.1123 + 	{
  2.1124 + 	  char tmp[16];
  2.1125 + 	  grub_sprintf (tmp, ",%c", 'a' + ((partition >> 8) & 0xFF));
  2.1126 +-	  grub_strncat (device, tmp, 256);
  2.1127 ++	  grub_strncat (device, tmp, sizeof (device));
  2.1128 + 	}
  2.1129 +-      grub_strncat (device, ")", 256);
  2.1130 ++      grub_strncat (device, ")", sizeof (device));
  2.1131 +     }
  2.1132 +   
  2.1133 +   int embed_stage1_5 (char *stage1_5, int drive, int partition)
  2.1134 +diff -uprN grub-0.97/stage2/disk_io.c grub/stage2/disk_io.c
  2.1135 +--- grub-0.97/stage2/disk_io.c	2004-05-23 17:35:24.000000000 +0100
  2.1136 ++++ grub/stage2/disk_io.c	2008-03-28 13:22:28.000000000 +0000
  2.1137 +@@ -137,7 +137,7 @@ log2 (unsigned long word)
  2.1138 + }
  2.1139 + 
  2.1140 + int
  2.1141 +-rawread (int drive, int sector, int byte_offset, int byte_len, char *buf)
  2.1142 ++rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf)
  2.1143 + {
  2.1144 +   int slen, sectors_per_vtrack;
  2.1145 +   int sector_size_bits = log2 (buf_geom.sector_size);
  2.1146 +@@ -261,7 +261,7 @@ rawread (int drive, int sector, int byte
  2.1147 +        */
  2.1148 +       if (disk_read_func)
  2.1149 + 	{
  2.1150 +-	  int sector_num = sector;
  2.1151 ++	  unsigned int sector_num = sector;
  2.1152 + 	  int length = buf_geom.sector_size - byte_offset;
  2.1153 + 	  if (length > size)
  2.1154 + 	    length = size;
  2.1155 +@@ -291,7 +291,7 @@ rawread (int drive, int sector, int byte
  2.1156 + 
  2.1157 + 
  2.1158 + int
  2.1159 +-devread (int sector, int byte_offset, int byte_len, char *buf)
  2.1160 ++devread (unsigned int sector, int byte_offset, int byte_len, char *buf)
  2.1161 + {
  2.1162 +   /*
  2.1163 +    *  Check partition boundaries
  2.1164 +@@ -330,7 +330,7 @@ devread (int sector, int byte_offset, in
  2.1165 + 
  2.1166 + #ifndef STAGE1_5
  2.1167 + int
  2.1168 +-rawwrite (int drive, int sector, char *buf)
  2.1169 ++rawwrite (int drive, unsigned int sector, char *buf)
  2.1170 + {
  2.1171 +   if (sector == 0)
  2.1172 +     {
  2.1173 +@@ -363,7 +363,7 @@ rawwrite (int drive, int sector, char *b
  2.1174 + }
  2.1175 + 
  2.1176 + int
  2.1177 +-devwrite (int sector, int sector_count, char *buf)
  2.1178 ++devwrite (unsigned int sector, int sector_count, char *buf)
  2.1179 + {
  2.1180 + #if defined(GRUB_UTIL) && defined(__linux__)
  2.1181 +   if (current_partition != 0xFFFFFF
  2.1182 +diff -uprN grub-0.97/stage2/fsys_ffs.c grub/stage2/fsys_ffs.c
  2.1183 +--- grub-0.97/stage2/fsys_ffs.c	2003-07-09 12:45:52.000000000 +0100
  2.1184 ++++ grub/stage2/fsys_ffs.c	2001-11-12 06:57:29.000000000 +0000
  2.1185 +@@ -50,7 +50,7 @@
  2.1186 +  * the rights to redistribute these changes.
  2.1187 +  *
  2.1188 +  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
  2.1189 +- *	$Id: fsys_ffs.c,v 1.10 2001/11/12 06:57:29 okuji Exp $
  2.1190 ++ *	$Id: fsys_ffs.c 594 2001-11-12 06:57:29Z okuji $
  2.1191 +  */
  2.1192 + 
  2.1193 + #ifdef FSYS_FFS
  2.1194 +diff -uprN grub-0.97/stage2/fsys_ufs2.c grub/stage2/fsys_ufs2.c
  2.1195 +--- grub-0.97/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
  2.1196 ++++ grub/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
  2.1197 +@@ -51,7 +51,7 @@
  2.1198 +  * the rights to redistribute these changes.
  2.1199 +  *
  2.1200 +  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
  2.1201 +- *	$Id: fsys_ufs2.c,v 1.2 2004/06/19 12:17:52 okuji Exp $
  2.1202 ++ *	$Id: fsys_ufs2.c 841 2004-06-19 12:17:52Z okuji $
  2.1203 +  */
  2.1204 + 
  2.1205 + #ifdef FSYS_UFS2
  2.1206 +diff -uprN grub-0.97/stage2/imgact_aout.h grub/stage2/imgact_aout.h
  2.1207 +--- grub-0.97/stage2/imgact_aout.h	2003-07-09 12:45:53.000000000 +0100
  2.1208 ++++ grub/stage2/imgact_aout.h	1999-06-24 01:03:29.000000000 +0100
  2.1209 +@@ -32,7 +32,7 @@
  2.1210 +  * SUCH DAMAGE.
  2.1211 +  *
  2.1212 +  *	from: @(#)exec.h	8.1 (Berkeley) 6/11/93
  2.1213 +- *	$Id: imgact_aout.h,v 1.1 1999/06/24 00:03:22 okuji Exp $
  2.1214 ++ *	$Id: imgact_aout.h 98 1999-06-24 00:03:29Z okuji $
  2.1215 +  */
  2.1216 + /*
  2.1217 +  *  11/23/95 - Kludge to get "ntohl" null macro added.  -- ESB
  2.1218 +diff -uprN grub-0.97/stage2/iso9660.h grub/stage2/iso9660.h
  2.1219 +--- grub-0.97/stage2/iso9660.h	2004-03-27 16:02:38.000000000 +0000
  2.1220 ++++ grub/stage2/iso9660.h	2007-02-22 23:40:25.000000000 +0000
  2.1221 +@@ -73,11 +73,11 @@ typedef	union {
  2.1222 + 
  2.1223 + typedef	struct __iso_16bit {
  2.1224 +   u_int16_t l, b;
  2.1225 +-} iso_16bit_t __attribute__ ((packed));
  2.1226 ++} iso_16bit_t;
  2.1227 + 
  2.1228 + typedef	struct __iso_32bit {
  2.1229 +   u_int32_t l, b;
  2.1230 +-} iso_32bit_t __attribute__ ((packed));
  2.1231 ++} iso_32bit_t;
  2.1232 + 
  2.1233 + typedef u_int8_t		iso_date_t[7];
  2.1234 + 
  2.1235 +diff -uprN grub-0.97/stage2/shared.h grub/stage2/shared.h
  2.1236 +--- grub-0.97/stage2/shared.h	2004-06-19 17:40:09.000000000 +0100
  2.1237 ++++ grub/stage2/shared.h	2008-03-28 13:22:28.000000000 +0000
  2.1238 +@@ -499,7 +499,11 @@ struct vbe_mode
  2.1239 +   unsigned char linear_reserved_field_position;
  2.1240 +   unsigned long max_pixel_clock;
  2.1241 + 
  2.1242 +-  unsigned char reserved3[189];
  2.1243 ++  /* Reserved field to make structure to be 256 bytes long, VESA BIOS 
  2.1244 ++     Extension 3.0 Specification says to reserve 189 bytes here but 
  2.1245 ++     that doesn't make structure to be 256 bytes.  So additional one is 
  2.1246 ++     added here.  */
  2.1247 ++  unsigned char reserved3[189 + 1];
  2.1248 + } __attribute__ ((packed));
  2.1249 + 
  2.1250 + 
  2.1251 +@@ -807,7 +811,7 @@ int checkkey (void);
  2.1252 + /* Low-level disk I/O */
  2.1253 + int get_diskinfo (int drive, struct geometry *geometry);
  2.1254 + int biosdisk (int subfunc, int drive, struct geometry *geometry,
  2.1255 +-	      int sector, int nsec, int segment);
  2.1256 ++	      unsigned int sector, int nsec, int segment);
  2.1257 + void stop_floppy (void);
  2.1258 + 
  2.1259 + /* Command-line interface functions. */
  2.1260 +@@ -920,10 +924,10 @@ int gunzip_test_header (void);
  2.1261 + int gunzip_read (char *buf, int len);
  2.1262 + #endif /* NO_DECOMPRESSION */
  2.1263 + 
  2.1264 +-int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf);
  2.1265 +-int devread (int sector, int byte_offset, int byte_len, char *buf);
  2.1266 +-int rawwrite (int drive, int sector, char *buf);
  2.1267 +-int devwrite (int sector, int sector_len, char *buf);
  2.1268 ++int rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf);
  2.1269 ++int devread (unsigned int sector, int byte_offset, int byte_len, char *buf);
  2.1270 ++int rawwrite (int drive, unsigned int sector, char *buf);
  2.1271 ++int devwrite (unsigned int sector, int sector_len, char *buf);
  2.1272 + 
  2.1273 + /* Parse a device string and initialize the global parameters. */
  2.1274 + char *set_device (char *device);
  2.1275 +diff -uprN grub-0.97/stage2/stage2.c grub/stage2/stage2.c
  2.1276 +--- grub-0.97/stage2/stage2.c	2005-03-19 17:51:57.000000000 +0000
  2.1277 ++++ grub/stage2/stage2.c	2006-05-05 23:06:31.000000000 +0100
  2.1278 +@@ -651,7 +651,10 @@ restart:
  2.1279 + 		  *(new_heap++) = 0;
  2.1280 + 
  2.1281 + 		  if (config_entries)
  2.1282 +-		    run_menu (heap, NULL, new_num_entries, new_heap, 0);
  2.1283 ++		    {
  2.1284 ++		      current_entryno = first_entry + entryno;
  2.1285 ++		      run_menu (heap, NULL, new_num_entries, new_heap, 0);
  2.1286 ++		    }
  2.1287 + 		  else
  2.1288 + 		    {
  2.1289 + 		      cls ();
  2.1290 +@@ -727,7 +730,8 @@ restart:
  2.1291 + 	cur_entry = get_entry (config_entries, first_entry + entryno, 1);
  2.1292 + 
  2.1293 +       /* Set CURRENT_ENTRYNO for the command "savedefault".  */
  2.1294 +-      current_entryno = first_entry + entryno;
  2.1295 ++      if (config_entries)
  2.1296 ++	current_entryno = first_entry + entryno;
  2.1297 +       
  2.1298 +       if (run_script (cur_entry, heap))
  2.1299 + 	{
  2.1300 +diff -uprN grub-0.97/stage2/tparm.c grub/stage2/tparm.c
  2.1301 +--- grub-0.97/stage2/tparm.c	2003-07-09 12:45:53.000000000 +0100
  2.1302 ++++ grub/stage2/tparm.c	2002-11-29 20:39:24.000000000 +0000
  2.1303 +@@ -63,7 +63,7 @@ typedef char grub_bool;
  2.1304 + #define MAX_FORMAT_LEN 256
  2.1305 + #define max(a,b) ((a) > (b) ? (a) : (b))
  2.1306 + 
  2.1307 +-//MODULE_ID("$Id: tparm.c,v 1.1 2002/11/29 20:39:24 okuji Exp $")
  2.1308 ++//MODULE_ID("$Id: tparm.c 708 2002-11-29 20:39:24Z okuji $")
  2.1309 + 
  2.1310 + /*
  2.1311 +  *	char *
  2.1312 +diff -uprN grub-0.97/stamp-h.in grub/stamp-h.in
  2.1313 +--- grub-0.97/stamp-h.in	1970-01-01 01:00:00.000000000 +0100
  2.1314 ++++ grub/stamp-h.in	1999-09-13 14:32:31.000000000 +0100
  2.1315 +@@ -0,0 +1 @@
  2.1316 ++timestamp
  2.1317 +diff -uprN grub-0.97/THANKS grub/THANKS
  2.1318 +--- grub-0.97/THANKS	2005-05-08 03:17:43.000000000 +0100
  2.1319 ++++ grub/THANKS	2006-03-21 20:51:58.000000000 +0000
  2.1320 +@@ -121,3 +121,4 @@ Vesa Jaaskelainen <jaaskela@tietomyrsky.
  2.1321 + Yedidyah Bar-David <didi@post.tau.ac.il>
  2.1322 + Yury V. Umanets <umka@namesys.com>
  2.1323 + Yuri Zaporogets <yuriz@ukr.net>
  2.1324 ++Vitaly Fertman <vitaly@namesys.com>
  2.1325 +diff -uprN grub-0.97/util/grub-install.in grub/util/grub-install.in
  2.1326 +--- grub-0.97/util/grub-install.in	2004-07-24 19:57:31.000000000 +0100
  2.1327 ++++ grub/util/grub-install.in	2006-04-20 14:46:46.000000000 +0100
  2.1328 +@@ -112,8 +112,8 @@ convert () {
  2.1329 + 	tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
  2.1330 + 	tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
  2.1331 +     freebsd* | kfreebsd*-gnu)
  2.1332 +-	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \
  2.1333 +-			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'`
  2.1334 ++	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \
  2.1335 ++			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'`
  2.1336 + 	tmp_part=`echo "$1" \
  2.1337 + 	    | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \
  2.1338 +        	    | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"`
  2.1339 +diff -uprN grub-0.97/util/mkbimage grub/util/mkbimage
  2.1340 +--- grub-0.97/util/mkbimage	2004-07-24 19:57:31.000000000 +0100
  2.1341 ++++ grub/util/mkbimage	2007-02-22 16:01:03.000000000 +0000
  2.1342 +@@ -1,7 +1,7 @@
  2.1343 + #!/bin/sh
  2.1344 + # MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode
  2.1345 + # C) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>
  2.1346 +-# C) 2001,2002,2003 Robert Millan <robertmh@gnu.org>
  2.1347 ++# C) 2001,2002,2003 Robert Millan <rmh@aybabtu.com>
  2.1348 + 
  2.1349 + 
  2.1350 + # This program is free software; you can redistribute it and/or modify
  2.1351 +@@ -19,7 +19,7 @@
  2.1352 + # program's maintainer or write to: The Free Software Foundation,
  2.1353 + # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
  2.1354 + 
  2.1355 +-# $Id: mkbimage,v 1.19 2004/07/21 14:43:04 robertmh Exp $
  2.1356 ++# $Id: mkbimage 1233 2007-02-22 16:01:03Z robertmh $
  2.1357 + 
  2.1358 + # Global variables
  2.1359 + tarfile=
  2.1360 +@@ -58,7 +58,7 @@ stage2_os_name=
  2.1361 + 
  2.1362 + # Name by which this script was invoked.
  2.1363 + program=`echo "$0" | sed -e 's/[^\/]*\///g'`
  2.1364 +-version_number='$Revision: 1.19 $'
  2.1365 ++version_number='$Revision: 1233 $'
  2.1366 + 
  2.1367 + usage="
  2.1368 + Usage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE
  2.1369 +@@ -94,15 +94,13 @@ Options:
  2.1370 + 	    display Version information and exit
  2.1371 + 
  2.1372 + Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>. 
  2.1373 +-Copyright (c) 2001,2002 Robert Millan <zeratul2@wanadoo.es>.
  2.1374 + GPLed."
  2.1375 + 
  2.1376 + version="mkbimage $version_number
  2.1377 + 
  2.1378 +-Written by Thierry Laronde and Robert Millan.
  2.1379 ++Written by Thierry Laronde.
  2.1380 + 
  2.1381 + Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>.
  2.1382 +-Copyright (c) 2001,2002,2003 Robert Millan <zeratul2@wanadoo.es>.
  2.1383 + 
  2.1384 + This is free software under the GPL version 2 or later; see the source for 
  2.1385 + copying conditions.  There is NO warranty, not even for MERCHANTABILITY or 
     3.1 --- a/stubdom/grub/Makefile	Thu Jul 17 13:21:37 2008 +0100
     3.2 +++ b/stubdom/grub/Makefile	Thu Jul 17 15:33:15 2008 +0100
     3.3 @@ -1,14 +1,14 @@
     3.4  XEN_ROOT = ../..
     3.5  
     3.6  include $(XEN_ROOT)/Config.mk
     3.7 -vpath %.c ../grub-cvs
     3.8 +vpath %.c ../grub-upstream
     3.9  
    3.10  BOOT=boot-$(XEN_TARGET_ARCH).o
    3.11  
    3.12  DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc -I$(XEN_ROOT)/tools/include -I.
    3.13 -DEF_CPPFLAGS += -I../grub-cvs/stage1
    3.14 -DEF_CPPFLAGS += -I../grub-cvs/stage2
    3.15 -DEF_CPPFLAGS += -I../grub-cvs/netboot
    3.16 +DEF_CPPFLAGS += -I../grub-upstream/stage1
    3.17 +DEF_CPPFLAGS += -I../grub-upstream/stage2
    3.18 +DEF_CPPFLAGS += -I../grub-upstream/netboot
    3.19  DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/firmware/vgabios
    3.20  DEF_CPPFLAGS += -DWITHOUT_LIBC_STUBS
    3.21  DEF_CPPFLAGS += -DSUPPORT_NETBOOT