| 1 |
diff -uprN grub-0.97/acinclude.m4 grub/acinclude.m4 |
| 2 |
--- grub-0.97/acinclude.m4 2004-04-27 21:48:06.000000000 +0100 |
| 3 |
+++ grub/acinclude.m4 2007-11-05 01:29:46.000000000 +0000 |
| 4 |
@@ -57,7 +57,7 @@ else |
| 5 |
fi |
| 6 |
grub_cv_prog_objcopy_absolute=yes |
| 7 |
for link_addr in 2000 8000 7C00; do |
| 8 |
- if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then : |
| 9 |
+ if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then : |
| 10 |
else |
| 11 |
AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr]) |
| 12 |
fi |
| 13 |
diff -uprN grub-0.97/ChangeLog grub/ChangeLog |
| 14 |
--- grub-0.97/ChangeLog 2005-05-08 03:47:02.000000000 +0100 |
| 15 |
+++ grub/ChangeLog 2008-05-20 12:04:18.000000000 +0100 |
| 16 |
@@ -1,3 +1,127 @@ |
| 17 |
+2008-05-20 Robert Millan <[email protected]> |
| 18 |
+ |
| 19 |
+ * netboot/cs89x0.c: Fix license violation. |
| 20 |
+ * netboot/cs89x0.h: Likewise. |
| 21 |
+ |
| 22 |
+2008-04-10 Pavel Roskin <[email protected]> |
| 23 |
+ |
| 24 |
+ * configure.ac: Always use "_cv_" in cache variables for |
| 25 |
+ compatibility with Autoconf 2.62. |
| 26 |
+ |
| 27 |
+2008-03-28 Robert Millan <[email protected]> |
| 28 |
+ |
| 29 |
+ Surpass 1 TiB disk addressing limit. Note: there are no plans to handle |
| 30 |
+ the 2 TiB disk limit in GRUB Legacy, since that would need considerable |
| 31 |
+ rework. If you have >2TiB disks, use GRUB 2 instead. |
| 32 |
+ |
| 33 |
+ * grub/asmstub.c (biosdisk): Add unsigned qualifier to `sector'. |
| 34 |
+ * stage2/bios.c (biosdisk): Likewise. |
| 35 |
+ * stage2/disk_io.c (rawread, devread, rawwrite, devwrite): Likewise. |
| 36 |
+ * stage2/shared.h (rawread, devread, rawwrite, devwrite): Likewise. |
| 37 |
+ * lib/device.c (get_drive_geometry): Replace BLKGETSIZE with |
| 38 |
+ BLKGETSIZE64. |
| 39 |
+ |
| 40 |
+2007-10-29 Pavel Roskin <[email protected]> |
| 41 |
+ |
| 42 |
+ * configure.ac: Test if '--build-id=none' is supported by the |
| 43 |
+ linker and add it to LDFLAGS if possible. Build ID causes |
| 44 |
+ objcopy to generate huge binary files. |
| 45 |
+ * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when |
| 46 |
+ linking, so that build ID doesn't break the test. |
| 47 |
+ * stage1/Makefile.am: Preserve LDFLAGS, use stage1_exec_LDFLAGS. |
| 48 |
+ |
| 49 |
+2007-02-22 Pavel Roskin <[email protected]> |
| 50 |
+ |
| 51 |
+ * stage2/iso9660.h: Remove unnecessary packed attributes. |
| 52 |
+ |
| 53 |
+2007-02-22 Robert Millan <[email protected]> |
| 54 |
+ |
| 55 |
+ * util/mkbimage: Update my email address, and remove my name from |
| 56 |
+ some places where unnecessary credit is given. |
| 57 |
+ |
| 58 |
+2006-09-10 Pavel Roskin <[email protected]> |
| 59 |
+ |
| 60 |
+ * netboot/natsemi.c: Fix compile error with gcc 4.1.1. Cast |
| 61 |
+ cannot make a variable volatile - it should be declared as such. |
| 62 |
+ * netboot/sis900.c: Likewise. |
| 63 |
+ |
| 64 |
+2006-09-08 Pavel Roskin <[email protected]> |
| 65 |
+ |
| 66 |
+ * netboot/etherboot.h: Remove incorrect extern declarations of |
| 67 |
+ the variables later declared static. Move BOOTP_DATA_ADDR ... |
| 68 |
+ * netboot/main.c: ... here. Eliminate end_of_rfc1533 - it's |
| 69 |
+ write-only. |
| 70 |
+ |
| 71 |
+2006-06-24 Yoshinori K. Okuji <[email protected]> |
| 72 |
+ |
| 73 |
+ * docs/grub.texi: Changed the license term to the GNU Free |
| 74 |
+ Documentation License 1.2. |
| 75 |
+ |
| 76 |
+ * docs/multiboot.texi: Reformatted to show the license term |
| 77 |
+ and the version number explicitly. |
| 78 |
+ |
| 79 |
+ * docs/fdl.texi: New file. |
| 80 |
+ |
| 81 |
+ * docs/Makefile.am (grub_TEXINFOS): Added fdl.texi. |
| 82 |
+ |
| 83 |
+2006-06-24 Robert Millan <[email protected]> |
| 84 |
+ |
| 85 |
+ * lib/device.c (write_to_partition): /dev/ataraid/ and /dev/rd/ |
| 86 |
+ partitions have a "p" prefix. Add it. |
| 87 |
+ |
| 88 |
+2006-06-24 Robert Millan <[email protected]> |
| 89 |
+ |
| 90 |
+ * lib/device.c (get_i2o_disk_name): New function. |
| 91 |
+ (init_device_map) [__linux__]: Add support for I2O devices. |
| 92 |
+ |
| 93 |
+2006-05-02 Pavel Roskin <[email protected]> |
| 94 |
+ |
| 95 |
+ * stage2/stage2.c (run_menu): Fix "savedefault" to save only top |
| 96 |
+ level menu positions. Remember current position when calling a |
| 97 |
+ submenu. Don't recalculate it when booting from a submenu. |
| 98 |
+ |
| 99 |
+ * grub/main.c (main): Make sure the boot drive number doesn't |
| 100 |
+ exceed 255. |
| 101 |
+ |
| 102 |
+2006-05-02 Vesa Jaaskelainen <[email protected]> |
| 103 |
+ |
| 104 |
+ * stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2 |
| 105 |
+ to GRUB Legacy. Problem reported by Gerardo Richarte. |
| 106 |
+ |
| 107 |
+2006-04-23 Robert Millan <[email protected]> |
| 108 |
+ |
| 109 |
+ * grub/asmstub.c (get_diskinfo): Optimize sysctl routine. |
| 110 |
+ |
| 111 |
+2006-04-20 Robert Millan <[email protected]> |
| 112 |
+ |
| 113 |
+ Fixes for kernel of FreeBSD: |
| 114 |
+ * grub/asmstub.c (get_diskinfo): Toggle "kern.geom.debugflags" sysctl |
| 115 |
+ before opening a device for writing. |
| 116 |
+ * util/grub-install.in: Devices don't have this "r" prefix anymore. |
| 117 |
+ |
| 118 |
+2006-04-16 Yoshinori K. Okuji <[email protected]> |
| 119 |
+ |
| 120 |
+ * docs/multiboot.texi: Correct the offset of address |
| 121 |
+ fields. Reported by Jeroen Dekkers. |
| 122 |
+ |
| 123 |
+2006-03-21 Yoshinori K. Okuji <[email protected]> |
| 124 |
+ |
| 125 |
+ * stage2/builtins.c (setup_func): Specify the size of DEVICE to |
| 126 |
+ grub_strncat instead of a strange number 256. Reported by Vitaly |
| 127 |
+ Fertman <[email protected]>. |
| 128 |
+ |
| 129 |
+2005-09-29 Yoshinori K. Okuji <[email protected]> |
| 130 |
+ |
| 131 |
+ * docs/multiboot.texi: Fix a bug in the byte order of |
| 132 |
+ boot_device. I hope this won't affect any OS image. |
| 133 |
+ Increased the version number to 0.6.94. |
| 134 |
+ |
| 135 |
+2005-09-28 Yoshinori K. Okuji <[email protected]> |
| 136 |
+ |
| 137 |
+ * stage2/boot.c (load_image): Even if an OS image is an ELF |
| 138 |
+ object, use the a.out kludge if MULTIBOOT_AOUT_KLUDGE is |
| 139 |
+ specified. |
| 140 |
+ |
| 141 |
2005-05-08 Yoshinori K. Okuji <[email protected]> |
| 142 |
|
| 143 |
* configure.ac (AC_INIT): Upgraded to 0.97. |
| 144 |
diff -uprN grub-0.97/configure grub/configure |
| 145 |
--- grub-0.97/configure 2005-05-08 03:48:12.000000000 +0100 |
| 146 |
+++ grub/configure 2007-11-05 01:29:46.000000000 +0000 |
| 147 |
@@ -3694,6 +3694,64 @@ if test "x$undef_flag" = xyes; then |
| 148 |
CPPFLAGS="$CPPFLAGS -Wundef" |
| 149 |
fi |
| 150 |
|
| 151 |
+# Check if build ID can be disabled in the linker |
| 152 |
+echo "$as_me:$LINENO: checking whether linker accepts \`--build-id=none'" >&5 |
| 153 |
+echo $ECHO_N "checking whether linker accepts \`--build-id=none'... $ECHO_C" >&6 |
| 154 |
+save_LDFLAGS="$LDFLAGS" |
| 155 |
+LDFLAGS="$LDFLAGS -Wl,--build-id=none" |
| 156 |
+cat >conftest.$ac_ext <<_ACEOF |
| 157 |
+/* confdefs.h. */ |
| 158 |
+_ACEOF |
| 159 |
+cat confdefs.h >>conftest.$ac_ext |
| 160 |
+cat >>conftest.$ac_ext <<_ACEOF |
| 161 |
+/* end confdefs.h. */ |
| 162 |
+ |
| 163 |
+int |
| 164 |
+main () |
| 165 |
+{ |
| 166 |
+ |
| 167 |
+ ; |
| 168 |
+ return 0; |
| 169 |
+} |
| 170 |
+_ACEOF |
| 171 |
+rm -f conftest.$ac_objext conftest$ac_exeext |
| 172 |
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 |
| 173 |
+ (eval $ac_link) 2>conftest.er1 |
| 174 |
+ ac_status=$? |
| 175 |
+ grep -v '^ *+' conftest.er1 >conftest.err |
| 176 |
+ rm -f conftest.er1 |
| 177 |
+ cat conftest.err >&5 |
| 178 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
| 179 |
+ (exit $ac_status); } && |
| 180 |
+ { ac_try='test -z "$ac_c_werror_flag" |
| 181 |
+ || test ! -s conftest.err' |
| 182 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
| 183 |
+ (eval $ac_try) 2>&5 |
| 184 |
+ ac_status=$? |
| 185 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
| 186 |
+ (exit $ac_status); }; } && |
| 187 |
+ { ac_try='test -s conftest$ac_exeext' |
| 188 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
| 189 |
+ (eval $ac_try) 2>&5 |
| 190 |
+ ac_status=$? |
| 191 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
| 192 |
+ (exit $ac_status); }; }; then |
| 193 |
+ build_id_flag=yes |
| 194 |
+else |
| 195 |
+ echo "$as_me: failed program was:" >&5 |
| 196 |
+sed 's/^/| /' conftest.$ac_ext >&5 |
| 197 |
+ |
| 198 |
+build_id_flag=no |
| 199 |
+fi |
| 200 |
+rm -f conftest.err conftest.$ac_objext \ |
| 201 |
+ conftest$ac_exeext conftest.$ac_ext |
| 202 |
+echo "$as_me:$LINENO: result: $build_id_flag" >&5 |
| 203 |
+echo "${ECHO_T}$build_id_flag" >&6 |
| 204 |
+LDFLAGS="$save_LDFLAGS" |
| 205 |
+if test "x$build_id_flag" = xyes; then |
| 206 |
+ LDFLAGS="$LDFLAGS -Wl,--build-id=none" |
| 207 |
+fi |
| 208 |
+ |
| 209 |
if test "x$with_binutils" != x; then |
| 210 |
# Extract the first word of "objcopy", so it can be a program name with args. |
| 211 |
set dummy objcopy; ac_word=$2 |
| 212 |
@@ -3892,7 +3950,7 @@ echo "$as_me: error: ${CC-cc} cannot com |
| 213 |
fi |
| 214 |
grub_cv_prog_objcopy_absolute=yes |
| 215 |
for link_addr in 2000 8000 7C00; do |
| 216 |
- if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec' |
| 217 |
+ if { ac_try='${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec' |
| 218 |
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
| 219 |
(eval $ac_try) 2>&5 |
| 220 |
ac_status=$? |
| 221 |
diff -uprN grub-0.97/configure.ac grub/configure.ac |
| 222 |
--- grub-0.97/configure.ac 2005-05-08 03:36:03.000000000 +0100 |
| 223 |
+++ grub/configure.ac 2008-04-10 23:26:50.000000000 +0100 |
| 224 |
@@ -86,13 +86,13 @@ if test "x$ac_cv_prog_gcc" = xyes; then |
| 225 |
fi |
| 226 |
STAGE1_CFLAGS="-O2" |
| 227 |
GRUB_CFLAGS="-O2" |
| 228 |
- AC_CACHE_CHECK([whether optimization for size works], size_flag, [ |
| 229 |
+ AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [ |
| 230 |
saved_CFLAGS=$CFLAGS |
| 231 |
CFLAGS="-Os -g" |
| 232 |
- AC_TRY_COMPILE(, , size_flag=yes, size_flag=no) |
| 233 |
+ AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no) |
| 234 |
CFLAGS=$saved_CFLAGS |
| 235 |
]) |
| 236 |
- if test "x$size_flag" = xyes; then |
| 237 |
+ if test "x$grub_cv_cc_Os" = xyes; then |
| 238 |
STAGE2_CFLAGS="-Os" |
| 239 |
else |
| 240 |
STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops" |
| 241 |
@@ -100,16 +100,16 @@ if test "x$ac_cv_prog_gcc" = xyes; then |
| 242 |
# OpenBSD has a GCC extension for protecting applications from |
| 243 |
# stack smashing attacks, but GRUB doesn't want this feature. |
| 244 |
AC_CACHE_CHECK([whether gcc has -fno-stack-protector], |
| 245 |
- no_stack_protector_flag, [ |
| 246 |
+ grub_cv_cc_no_stack_protector, [ |
| 247 |
saved_CFLAGS=$CFLAGS |
| 248 |
CFLAGS="-fno-stack-protector" |
| 249 |
AC_TRY_COMPILE(, |
| 250 |
, |
| 251 |
- no_stack_protector_flag=yes, |
| 252 |
- no_stack_protector_flag=no) |
| 253 |
+ grub_cv_cc_no_stack_protector=yes, |
| 254 |
+ grub_cv_cc_no_stack_protector=no) |
| 255 |
CFLAGS=$saved_CFLAGS |
| 256 |
]) |
| 257 |
- if test "x$no_stack_protector_flag" = xyes; then |
| 258 |
+ if test "x$grub_cv_cc_no_stack_protector" = xyes; then |
| 259 |
STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector" |
| 260 |
fi |
| 261 |
fi |
| 262 |
@@ -123,33 +123,44 @@ AC_SUBST(GRUB_CFLAGS) |
| 263 |
CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow" |
| 264 |
CPPFLAGS="$CPPFLAGS -Wpointer-arith" |
| 265 |
|
| 266 |
-AC_CACHE_CHECK([whether -Wundef works], undef_flag, [ |
| 267 |
+AC_CACHE_CHECK([whether -Wundef works], grub_cv_cc_Wundef, [ |
| 268 |
saved_CPPFLAGS="$CPPFLAGS" |
| 269 |
CPPFLAGS="-Wundef" |
| 270 |
- AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no) |
| 271 |
+ AC_TRY_COMPILE(, , grub_cv_cc_Wundef=yes, grub_cv_cc_Wundef=no) |
| 272 |
CPPFLAGS="$saved_CPPFLAGS" |
| 273 |
]) |
| 274 |
|
| 275 |
# The options `-falign-*' are supported by gcc 3.0 or later. |
| 276 |
# Probably it is sufficient to only check for -falign-loops. |
| 277 |
-AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [ |
| 278 |
+AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ |
| 279 |
saved_CPPFLAGS="$CPPFLAGS" |
| 280 |
CPPFLAGS="-falign-loops=1" |
| 281 |
- AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no]) |
| 282 |
+ AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no]) |
| 283 |
CPPFLAGS="$saved_CPPFLAGS" |
| 284 |
]) |
| 285 |
|
| 286 |
# Force no alignment to save space. |
| 287 |
-if test "x$falign_loop_flag" = xyes; then |
| 288 |
+if test "x$grub_cv_cc_falign_loop" = xyes; then |
| 289 |
CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" |
| 290 |
else |
| 291 |
CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" |
| 292 |
fi |
| 293 |
|
| 294 |
-if test "x$undef_flag" = xyes; then |
| 295 |
+if test "x$grub_cv_cc_Wundef" = xyes; then |
| 296 |
CPPFLAGS="$CPPFLAGS -Wundef" |
| 297 |
fi |
| 298 |
|
| 299 |
+# Check if build ID can be disabled in the linker |
| 300 |
+AC_MSG_CHECKING([whether linker accepts `--build-id=none']) |
| 301 |
+save_LDFLAGS="$LDFLAGS" |
| 302 |
+LDFLAGS="$LDFLAGS -Wl,--build-id=none" |
| 303 |
+AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no) |
| 304 |
+AC_MSG_RESULT([$build_id_flag]) |
| 305 |
+LDFLAGS="$save_LDFLAGS" |
| 306 |
+if test "x$build_id_flag" = xyes; then |
| 307 |
+ LDFLAGS="$LDFLAGS -Wl,--build-id=none" |
| 308 |
+fi |
| 309 |
+ |
| 310 |
if test "x$with_binutils" != x; then |
| 311 |
dnl AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH") |
| 312 |
AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH") |
| 313 |
diff -uprN grub-0.97/grub/asmstub.c grub/grub/asmstub.c |
| 314 |
--- grub-0.97/grub/asmstub.c 2005-02-16 20:45:14.000000000 +0000 |
| 315 |
+++ grub/grub/asmstub.c 2008-03-28 13:22:28.000000000 +0000 |
| 316 |
@@ -55,6 +55,10 @@ int grub_stage2 (void); |
| 317 |
# endif /* ! BLKFLSBUF */ |
| 318 |
#endif /* __linux__ */ |
| 319 |
|
| 320 |
+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) |
| 321 |
+# include <sys/sysctl.h> |
| 322 |
+#endif |
| 323 |
+ |
| 324 |
/* We want to prevent any circularararity in our stubs, as well as |
| 325 |
libc name clashes. */ |
| 326 |
#define WITHOUT_LIBC_STUBS 1 |
| 327 |
@@ -777,7 +781,39 @@ get_diskinfo (int drive, struct geometry |
| 328 |
|
| 329 |
/* Open read/write, or read-only if that failed. */ |
| 330 |
if (! read_only) |
| 331 |
- disks[drive].flags = open (devname, O_RDWR); |
| 332 |
+ { |
| 333 |
+/* By default, kernel of FreeBSD does not allow overwriting MBR */ |
| 334 |
+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) |
| 335 |
+#define GEOM_SYSCTL "kern.geom.debugflags" |
| 336 |
+ int old_flags, flags; |
| 337 |
+ size_t sizeof_int = sizeof (int); |
| 338 |
+ |
| 339 |
+ if (sysctlbyname (GEOM_SYSCTL, &old_flags, &sizeof_int, NULL, 0) != 0) |
| 340 |
+ grub_printf ("failed to get " GEOM_SYSCTL "sysctl: %s\n", strerror (errno)); |
| 341 |
+ |
| 342 |
+ if ((old_flags & 0x10) == 0) |
| 343 |
+ { |
| 344 |
+ /* "allow foot shooting", see geom(4) */ |
| 345 |
+ flags = old_flags | 0x10; |
| 346 |
+ |
| 347 |
+ if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int)) != 0) |
| 348 |
+ { |
| 349 |
+ flags = old_flags; |
| 350 |
+ grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno)); |
| 351 |
+ } |
| 352 |
+ } |
| 353 |
+ else |
| 354 |
+ flags = old_flags; |
| 355 |
+#endif |
| 356 |
+ disks[drive].flags = open (devname, O_RDWR); |
| 357 |
+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) |
| 358 |
+ if (flags != old_flags) |
| 359 |
+ { |
| 360 |
+ if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &old_flags, sizeof (int)) != 0) |
| 361 |
+ grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno)); |
| 362 |
+ } |
| 363 |
+#endif |
| 364 |
+ } |
| 365 |
|
| 366 |
if (disks[drive].flags == -1) |
| 367 |
{ |
| 368 |
@@ -926,7 +962,7 @@ hex_dump (void *buf, size_t size) |
| 369 |
|
| 370 |
int |
| 371 |
biosdisk (int subfunc, int drive, struct geometry *geometry, |
| 372 |
- int sector, int nsec, int segment) |
| 373 |
+ unsigned int sector, int nsec, int segment) |
| 374 |
{ |
| 375 |
char *buf; |
| 376 |
int fd = geometry->flags; |
| 377 |
diff -uprN grub-0.97/grub/main.c grub/grub/main.c |
| 378 |
--- grub-0.97/grub/main.c 2003-07-09 12:45:36.000000000 +0100 |
| 379 |
+++ grub/grub/main.c 2006-05-05 22:43:46.000000000 +0100 |
| 380 |
@@ -32,6 +32,7 @@ int grub_stage2 (void); |
| 381 |
#define WITHOUT_LIBC_STUBS 1 |
| 382 |
#include <shared.h> |
| 383 |
#include <term.h> |
| 384 |
+#include <device.h> |
| 385 |
|
| 386 |
char *program_name = 0; |
| 387 |
int use_config_file = 1; |
| 388 |
@@ -192,6 +193,12 @@ main (int argc, char **argv) |
| 389 |
perror ("strtoul"); |
| 390 |
exit (1); |
| 391 |
} |
| 392 |
+ if (boot_drive >= NUM_DISKS) |
| 393 |
+ { |
| 394 |
+ fprintf (stderr, "boot_drive should be from 0 to %d\n", |
| 395 |
+ NUM_DISKS - 1); |
| 396 |
+ exit (1); |
| 397 |
+ } |
| 398 |
break; |
| 399 |
|
| 400 |
case OPT_NO_CONFIG_FILE: |
| 401 |
diff -uprN grub-0.97/lib/device.c grub/lib/device.c |
| 402 |
--- grub-0.97/lib/device.c 2005-03-28 00:14:25.000000000 +0100 |
| 403 |
+++ grub/lib/device.c 2008-03-28 13:22:28.000000000 +0000 |
| 404 |
@@ -69,9 +69,9 @@ struct hd_geometry |
| 405 |
# ifndef CDROM_GET_CAPABILITY |
| 406 |
# define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ |
| 407 |
# endif /* ! CDROM_GET_CAPABILITY */ |
| 408 |
-# ifndef BLKGETSIZE |
| 409 |
-# define BLKGETSIZE _IO(0x12,96) /* return device size */ |
| 410 |
-# endif /* ! BLKGETSIZE */ |
| 411 |
+# ifndef BLKGETSIZE64 |
| 412 |
+# define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size */ |
| 413 |
+# endif /* ! BLKGETSIZE64 */ |
| 414 |
#endif /* __linux__ */ |
| 415 |
|
| 416 |
/* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with |
| 417 |
@@ -152,19 +152,19 @@ get_drive_geometry (struct geometry *geo |
| 418 |
/* Linux */ |
| 419 |
{ |
| 420 |
struct hd_geometry hdg; |
| 421 |
- unsigned long nr; |
| 422 |
+ unsigned long long nr; |
| 423 |
|
| 424 |
if (ioctl (fd, HDIO_GETGEO, &hdg)) |
| 425 |
goto fail; |
| 426 |
|
| 427 |
- if (ioctl (fd, BLKGETSIZE, &nr)) |
| 428 |
+ if (ioctl (fd, BLKGETSIZE64, &nr)) |
| 429 |
goto fail; |
| 430 |
|
| 431 |
/* Got the geometry, so save it. */ |
| 432 |
geom->cylinders = hdg.cylinders; |
| 433 |
geom->heads = hdg.heads; |
| 434 |
geom->sectors = hdg.sectors; |
| 435 |
- geom->total_sectors = nr; |
| 436 |
+ geom->total_sectors = nr / 512; |
| 437 |
|
| 438 |
goto success; |
| 439 |
} |
| 440 |
@@ -407,6 +407,12 @@ get_ataraid_disk_name (char *name, int u |
| 441 |
{ |
| 442 |
sprintf (name, "/dev/ataraid/d%c", unit + '0'); |
| 443 |
} |
| 444 |
+ |
| 445 |
+static void |
| 446 |
+get_i2o_disk_name (char *name, char unit) |
| 447 |
+{ |
| 448 |
+ sprintf (name, "/dev/i2o/hd%c", unit); |
| 449 |
+} |
| 450 |
#endif |
| 451 |
|
| 452 |
/* Check if DEVICE can be read. If an error occurs, return zero, |
| 453 |
@@ -801,6 +807,29 @@ init_device_map (char ***map, const char |
| 454 |
} |
| 455 |
} |
| 456 |
} |
| 457 |
+ |
| 458 |
+ /* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */ |
| 459 |
+ { |
| 460 |
+ int unit; |
| 461 |
+ |
| 462 |
+ for (unit = 'a'; unit < 'f'; unit++) |
| 463 |
+ { |
| 464 |
+ char name[24]; |
| 465 |
+ |
| 466 |
+ get_i2o_disk_name (name, unit); |
| 467 |
+ if (check_device (name)) |
| 468 |
+ { |
| 469 |
+ (*map)[num_hd + 0x80] = strdup (name); |
| 470 |
+ assert ((*map)[num_hd + 0x80]); |
| 471 |
+ |
| 472 |
+ /* If the device map file is opened, write the map. */ |
| 473 |
+ if (fp) |
| 474 |
+ fprintf (fp, "(hd%d)\t%s\n", num_hd, name); |
| 475 |
+ |
| 476 |
+ num_hd++; |
| 477 |
+ } |
| 478 |
+ } |
| 479 |
+ } |
| 480 |
#endif /* __linux__ */ |
| 481 |
|
| 482 |
/* OK, close the device map file if opened. */ |
| 483 |
@@ -861,6 +890,12 @@ write_to_partition (char **map, int driv |
| 484 |
if (strcmp (dev + strlen(dev) - 5, "/disc") == 0) |
| 485 |
strcpy (dev + strlen(dev) - 5, "/part"); |
| 486 |
} |
| 487 |
+ else |
| 488 |
+ { |
| 489 |
+ if ((strncmp (dev, "/dev/ataraid/", 13) == 0) || |
| 490 |
+ (strncmp (dev, "/dev/rd/", 8) == 0)) |
| 491 |
+ strcpy (dev + strlen(dev), "p"); |
| 492 |
+ } |
| 493 |
sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1); |
| 494 |
|
| 495 |
/* Open the partition. */ |
| 496 |
diff -uprN grub-0.97/netboot/3c509.c grub/netboot/3c509.c |
| 497 |
--- grub-0.97/netboot/3c509.c 2003-07-09 12:45:37.000000000 +0100 |
| 498 |
+++ grub/netboot/3c509.c 2002-01-02 21:56:40.000000000 +0000 |
| 499 |
@@ -18,7 +18,7 @@ Author: Martin Renters. |
| 500 |
|
| 501 |
3c509 support added by Serge Babkin ([email protected]) |
| 502 |
|
| 503 |
-$Id: 3c509.c,v 1.4 2002/01/02 21:56:40 okuji Exp $ |
| 504 |
+$Id: 3c509.c 609 2002-01-02 21:56:40Z okuji $ |
| 505 |
|
| 506 |
***************************************************************************/ |
| 507 |
|
| 508 |
diff -uprN grub-0.97/netboot/cs89x0.c grub/netboot/cs89x0.c |
| 509 |
--- grub-0.97/netboot/cs89x0.c 2003-07-09 12:45:37.000000000 +0100 |
| 510 |
+++ grub/netboot/cs89x0.c 2008-05-20 12:04:18.000000000 +0100 |
| 511 |
@@ -1,3 +1,21 @@ |
| 512 |
+/** |
| 513 |
+ Per an email message from Russ Nelson <[email protected]> on |
| 514 |
+ 18 March 2008 this file is now licensed under GPL Version 2. |
| 515 |
+ |
| 516 |
+ From: Russ Nelson <[email protected]> |
| 517 |
+ Date: Tue, 18 Mar 2008 12:42:00 -0400 |
| 518 |
+ Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot |
| 519 |
+ -- quote from email |
| 520 |
+ As copyright holder, if I say it doesn't conflict with the GPL, |
| 521 |
+ then it doesn't conflict with the GPL. |
| 522 |
+ |
| 523 |
+ However, there's no point in causing people's brains to overheat, |
| 524 |
+ so yes, I grant permission for the code to be relicensed under the |
| 525 |
+ GPLv2. Please make sure that this change in licensing makes its |
| 526 |
+ way upstream. -russ |
| 527 |
+ -- quote from email |
| 528 |
+**/ |
| 529 |
+ |
| 530 |
/* cs89x0.c: A Crystal Semiconductor CS89[02]0 driver for etherboot. */ |
| 531 |
/* |
| 532 |
Permission is granted to distribute the enclosed cs89x0.[ch] driver |
| 533 |
diff -uprN grub-0.97/netboot/cs89x0.h grub/netboot/cs89x0.h |
| 534 |
--- grub-0.97/netboot/cs89x0.h 2003-07-09 12:45:37.000000000 +0100 |
| 535 |
+++ grub/netboot/cs89x0.h 2008-05-20 12:04:18.000000000 +0100 |
| 536 |
@@ -1,3 +1,21 @@ |
| 537 |
+/** |
| 538 |
+ Per an email message from Russ Nelson <[email protected]> on |
| 539 |
+ 18 March 2008 this file is now licensed under GPL Version 2. |
| 540 |
+ |
| 541 |
+ From: Russ Nelson <[email protected]> |
| 542 |
+ Date: Tue, 18 Mar 2008 12:42:00 -0400 |
| 543 |
+ Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot |
| 544 |
+ -- quote from email |
| 545 |
+ As copyright holder, if I say it doesn't conflict with the GPL, |
| 546 |
+ then it doesn't conflict with the GPL. |
| 547 |
+ |
| 548 |
+ However, there's no point in causing people's brains to overheat, |
| 549 |
+ so yes, I grant permission for the code to be relicensed under the |
| 550 |
+ GPLv2. Please make sure that this change in licensing makes its |
| 551 |
+ way upstream. -russ |
| 552 |
+ -- quote from email |
| 553 |
+**/ |
| 554 |
+ |
| 555 |
/* Copyright, 1988-1992, Russell Nelson, Crynwr Software |
| 556 |
|
| 557 |
This program is free software; you can redistribute it and/or modify |
| 558 |
diff -uprN grub-0.97/netboot/etherboot.h grub/netboot/etherboot.h |
| 559 |
--- grub-0.97/netboot/etherboot.h 2003-07-09 12:45:37.000000000 +0100 |
| 560 |
+++ grub/netboot/etherboot.h 2006-09-08 13:56:22.000000000 +0100 |
| 561 |
@@ -531,9 +531,6 @@ extern int ip_abort; |
| 562 |
extern int network_ready; |
| 563 |
extern struct rom_info rom; |
| 564 |
extern struct arptable_t arptable[MAX_ARP]; |
| 565 |
-extern struct bootpd_t bootp_data; |
| 566 |
-#define BOOTP_DATA_ADDR (&bootp_data) |
| 567 |
-extern unsigned char *end_of_rfc1533; |
| 568 |
|
| 569 |
/* config.c */ |
| 570 |
extern struct nic nic; |
| 571 |
diff -uprN grub-0.97/netboot/main.c grub/netboot/main.c |
| 572 |
--- grub-0.97/netboot/main.c 2004-05-20 23:19:33.000000000 +0100 |
| 573 |
+++ grub/netboot/main.c 2006-09-08 13:56:22.000000000 +0100 |
| 574 |
@@ -56,7 +56,8 @@ static int vendorext_isvalid; |
| 575 |
static unsigned long netmask; |
| 576 |
static struct bootpd_t bootp_data; |
| 577 |
static unsigned long xid; |
| 578 |
-static unsigned char *end_of_rfc1533 = NULL; |
| 579 |
+ |
| 580 |
+#define BOOTP_DATA_ADDR (&bootp_data) |
| 581 |
|
| 582 |
#ifndef NO_DHCP_SUPPORT |
| 583 |
#endif /* NO_DHCP_SUPPORT */ |
| 584 |
@@ -967,7 +968,6 @@ decode_rfc1533 (unsigned char *p, int bl |
| 585 |
|
| 586 |
if (block == 0) |
| 587 |
{ |
| 588 |
- end_of_rfc1533 = NULL; |
| 589 |
vendorext_isvalid = 0; |
| 590 |
|
| 591 |
if (grub_memcmp (p, rfc1533_cookie, 4)) |
| 592 |
@@ -1021,7 +1021,7 @@ decode_rfc1533 (unsigned char *p, int bl |
| 593 |
} |
| 594 |
else if (c == RFC1533_END) |
| 595 |
{ |
| 596 |
- end_of_rfc1533 = endp = p; |
| 597 |
+ endp = p; |
| 598 |
continue; |
| 599 |
} |
| 600 |
else if (c == RFC1533_NETMASK) |
| 601 |
diff -uprN grub-0.97/netboot/natsemi.c grub/netboot/natsemi.c |
| 602 |
--- grub-0.97/netboot/natsemi.c 2003-07-09 12:45:38.000000000 +0100 |
| 603 |
+++ grub/netboot/natsemi.c 2006-09-10 08:26:10.000000000 +0100 |
| 604 |
@@ -608,7 +608,7 @@ natsemi_transmit(struct nic *nic, |
| 605 |
const char *p) /* Packet */ |
| 606 |
{ |
| 607 |
u32 status, to, nstype; |
| 608 |
- u32 tx_status; |
| 609 |
+ volatile u32 tx_status; |
| 610 |
|
| 611 |
/* Stop the transmitter */ |
| 612 |
outl(TxOff, ioaddr + ChipCmd); |
| 613 |
@@ -647,7 +647,7 @@ natsemi_transmit(struct nic *nic, |
| 614 |
|
| 615 |
to = currticks() + TX_TIMEOUT; |
| 616 |
|
| 617 |
- while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to)) |
| 618 |
+ while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to)) |
| 619 |
/* wait */ ; |
| 620 |
|
| 621 |
if (currticks() >= to) { |
| 622 |
diff -uprN grub-0.97/netboot/sis900.c grub/netboot/sis900.c |
| 623 |
--- grub-0.97/netboot/sis900.c 2003-07-09 12:45:38.000000000 +0100 |
| 624 |
+++ grub/netboot/sis900.c 2006-09-10 08:26:10.000000000 +0100 |
| 625 |
@@ -901,7 +901,7 @@ sis900_transmit(struct nic *nic, |
| 626 |
const char *p) /* Packet */ |
| 627 |
{ |
| 628 |
u32 status, to, nstype; |
| 629 |
- u32 tx_status; |
| 630 |
+ volatile u32 tx_status; |
| 631 |
|
| 632 |
/* Stop the transmitter */ |
| 633 |
outl(TxDIS, ioaddr + cr); |
| 634 |
@@ -940,7 +940,7 @@ sis900_transmit(struct nic *nic, |
| 635 |
|
| 636 |
to = currticks() + TX_TIMEOUT; |
| 637 |
|
| 638 |
- while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to)) |
| 639 |
+ while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to)) |
| 640 |
/* wait */ ; |
| 641 |
|
| 642 |
if (currticks() >= to) { |
| 643 |
diff -uprN grub-0.97/netboot/sk_g16.c grub/netboot/sk_g16.c |
| 644 |
--- grub-0.97/netboot/sk_g16.c 2003-07-09 12:45:38.000000000 +0100 |
| 645 |
+++ grub/netboot/sk_g16.c 2002-01-02 21:56:40.000000000 +0000 |
| 646 |
@@ -13,12 +13,12 @@ Changes to make it work with Etherboot b |
| 647 |
* |
| 648 |
* Module : sk_g16.c |
| 649 |
* |
| 650 |
- * Version : $Revision: 1.4 $ |
| 651 |
+ * Version : $Revision: 609 $ |
| 652 |
* |
| 653 |
* Author : Patrick J.D. Weichmann |
| 654 |
* |
| 655 |
* Date Created : 94/05/26 |
| 656 |
- * Last Updated : $Date: 2002/01/02 21:56:40 $ |
| 657 |
+ * Last Updated : $Date: 2002-01-02 21:56:40 +0000 (mer 02 jan 2002) $ |
| 658 |
* |
| 659 |
* Description : Schneider & Koch G16 Ethernet Device Driver for |
| 660 |
* Linux Kernel >= 1.1.22 |
| 661 |
diff -uprN grub-0.97/netboot/sk_g16.h grub/netboot/sk_g16.h |
| 662 |
--- grub-0.97/netboot/sk_g16.h 2003-07-09 12:45:38.000000000 +0100 |
| 663 |
+++ grub/netboot/sk_g16.h 2000-07-29 20:22:54.000000000 +0100 |
| 664 |
@@ -4,7 +4,7 @@ |
| 665 |
* of the GNU Public License, incorporated herein by reference. |
| 666 |
* |
| 667 |
* Module : sk_g16.h |
| 668 |
- * Version : $Revision: 1.3 $ |
| 669 |
+ * Version : $Revision: 388 $ |
| 670 |
* |
| 671 |
* Author : M.Hipp ([email protected]) |
| 672 |
* changes by : Patrick J.D. Weichmann |
| 673 |
@@ -15,8 +15,8 @@ |
| 674 |
* the am7990 (LANCE) chip used for writing a |
| 675 |
* network device driver which uses this chip |
| 676 |
* |
| 677 |
- * $Log: sk_g16.h,v $ |
| 678 |
- * Revision 1.3 2000/07/29 19:22:54 okuji |
| 679 |
+ * $Log$ |
| 680 |
+ * Revision 1.3 2000-07-29 19:22:54 okuji |
| 681 |
* update the network support to etherboot-4.6.4. |
| 682 |
* |
| 683 |
-*/ |
| 684 |
diff -uprN grub-0.97/stage1/Makefile.am grub/stage1/Makefile.am |
| 685 |
--- grub-0.97/stage1/Makefile.am 2004-07-16 12:44:56.000000000 +0100 |
| 686 |
+++ grub/stage1/Makefile.am 2007-11-05 01:29:46.000000000 +0000 |
| 687 |
@@ -5,7 +5,7 @@ CLEANFILES = $(nodist_pkglib_DATA) |
| 688 |
|
| 689 |
# We can't use builtins or standard includes. |
| 690 |
AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc |
| 691 |
-LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 |
| 692 |
+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 |
| 693 |
|
| 694 |
noinst_PROGRAMS = stage1.exec |
| 695 |
stage1_exec_SOURCES = stage1.S stage1.h |
| 696 |
diff -uprN grub-0.97/stage1/Makefile.in grub/stage1/Makefile.in |
| 697 |
--- grub-0.97/stage1/Makefile.in 2005-05-08 03:42:36.000000000 +0100 |
| 698 |
+++ grub/stage1/Makefile.in 2007-11-05 01:29:46.000000000 +0000 |
| 699 |
@@ -110,7 +110,7 @@ INSTALL_DATA = @INSTALL_DATA@ |
| 700 |
INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
| 701 |
INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
| 702 |
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
| 703 |
-LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 |
| 704 |
+LDFLAGS = @LDFLAGS@ |
| 705 |
LIBOBJS = @LIBOBJS@ |
| 706 |
LIBS = @LIBS@ |
| 707 |
LTLIBOBJS = @LTLIBOBJS@ |
| 708 |
@@ -188,6 +188,7 @@ CLEANFILES = $(nodist_pkglib_DATA) |
| 709 |
|
| 710 |
# We can't use builtins or standard includes. |
| 711 |
AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc |
| 712 |
+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 |
| 713 |
stage1_exec_SOURCES = stage1.S stage1.h |
| 714 |
SUFFIXES = .exec |
| 715 |
all: all-am |
| 716 |
diff -uprN grub-0.97/stage2/bios.c grub/stage2/bios.c |
| 717 |
--- grub-0.97/stage2/bios.c 2004-03-27 16:34:04.000000000 +0000 |
| 718 |
+++ grub/stage2/bios.c 2008-03-28 13:22:28.000000000 +0000 |
| 719 |
@@ -47,7 +47,7 @@ extern int get_diskinfo_floppy (int driv |
| 720 |
return the error number. Otherwise, return 0. */ |
| 721 |
int |
| 722 |
biosdisk (int read, int drive, struct geometry *geometry, |
| 723 |
- int sector, int nsec, int segment) |
| 724 |
+ unsigned int sector, int nsec, int segment) |
| 725 |
{ |
| 726 |
int err; |
| 727 |
|
| 728 |
diff -uprN grub-0.97/stage2/boot.c grub/stage2/boot.c |
| 729 |
--- grub-0.97/stage2/boot.c 2004-03-30 12:44:08.000000000 +0100 |
| 730 |
+++ grub/stage2/boot.c 2005-09-28 22:47:55.000000000 +0100 |
| 731 |
@@ -1,7 +1,7 @@ |
| 732 |
/* boot.c - load and bootstrap a kernel */ |
| 733 |
/* |
| 734 |
* GRUB -- GRand Unified Bootloader |
| 735 |
- * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. |
| 736 |
+ * Copyright (C) 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc. |
| 737 |
* |
| 738 |
* This program is free software; you can redistribute it and/or modify |
| 739 |
* it under the terms of the GNU General Public License as published by |
| 740 |
@@ -96,7 +96,7 @@ load_image (char *kernel, char *arg, ker |
| 741 |
lh = (struct linux_kernel_header *) buffer; |
| 742 |
|
| 743 |
/* ELF loading supported if multiboot, FreeBSD and NetBSD. */ |
| 744 |
- if ((type == KERNEL_TYPE_MULTIBOOT |
| 745 |
+ if (((type == KERNEL_TYPE_MULTIBOOT && ! (flags & MULTIBOOT_AOUT_KLUDGE)) |
| 746 |
|| pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD |
| 747 |
|| grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0 |
| 748 |
|| suggested_type == KERNEL_TYPE_NETBSD) |
| 749 |
diff -uprN grub-0.97/stage2/builtins.c grub/stage2/builtins.c |
| 750 |
--- grub-0.97/stage2/builtins.c 2005-02-15 21:58:23.000000000 +0000 |
| 751 |
+++ grub/stage2/builtins.c 2006-03-21 20:51:58.000000000 +0000 |
| 752 |
@@ -3830,15 +3830,15 @@ setup_func (char *arg, int flags) |
| 753 |
{ |
| 754 |
char tmp[16]; |
| 755 |
grub_sprintf (tmp, ",%d", (partition >> 16) & 0xFF); |
| 756 |
- grub_strncat (device, tmp, 256); |
| 757 |
+ grub_strncat (device, tmp, sizeof (device)); |
| 758 |
} |
| 759 |
if ((partition & 0x00FF00) != 0x00FF00) |
| 760 |
{ |
| 761 |
char tmp[16]; |
| 762 |
grub_sprintf (tmp, ",%c", 'a' + ((partition >> 8) & 0xFF)); |
| 763 |
- grub_strncat (device, tmp, 256); |
| 764 |
+ grub_strncat (device, tmp, sizeof (device)); |
| 765 |
} |
| 766 |
- grub_strncat (device, ")", 256); |
| 767 |
+ grub_strncat (device, ")", sizeof (device)); |
| 768 |
} |
| 769 |
|
| 770 |
int embed_stage1_5 (char *stage1_5, int drive, int partition) |
| 771 |
diff -uprN grub-0.97/stage2/disk_io.c grub/stage2/disk_io.c |
| 772 |
--- grub-0.97/stage2/disk_io.c 2004-05-23 17:35:24.000000000 +0100 |
| 773 |
+++ grub/stage2/disk_io.c 2008-03-28 13:22:28.000000000 +0000 |
| 774 |
@@ -137,7 +137,7 @@ log2 (unsigned long word) |
| 775 |
} |
| 776 |
|
| 777 |
int |
| 778 |
-rawread (int drive, int sector, int byte_offset, int byte_len, char *buf) |
| 779 |
+rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf) |
| 780 |
{ |
| 781 |
int slen, sectors_per_vtrack; |
| 782 |
int sector_size_bits = log2 (buf_geom.sector_size); |
| 783 |
@@ -261,7 +261,7 @@ rawread (int drive, int sector, int byte |
| 784 |
*/ |
| 785 |
if (disk_read_func) |
| 786 |
{ |
| 787 |
- int sector_num = sector; |
| 788 |
+ unsigned int sector_num = sector; |
| 789 |
int length = buf_geom.sector_size - byte_offset; |
| 790 |
if (length > size) |
| 791 |
length = size; |
| 792 |
@@ -291,7 +291,7 @@ rawread (int drive, int sector, int byte |
| 793 |
|
| 794 |
|
| 795 |
int |
| 796 |
-devread (int sector, int byte_offset, int byte_len, char *buf) |
| 797 |
+devread (unsigned int sector, int byte_offset, int byte_len, char *buf) |
| 798 |
{ |
| 799 |
/* |
| 800 |
* Check partition boundaries |
| 801 |
@@ -330,7 +330,7 @@ devread (int sector, int byte_offset, in |
| 802 |
|
| 803 |
#ifndef STAGE1_5 |
| 804 |
int |
| 805 |
-rawwrite (int drive, int sector, char *buf) |
| 806 |
+rawwrite (int drive, unsigned int sector, char *buf) |
| 807 |
{ |
| 808 |
if (sector == 0) |
| 809 |
{ |
| 810 |
@@ -363,7 +363,7 @@ rawwrite (int drive, int sector, char *b |
| 811 |
} |
| 812 |
|
| 813 |
int |
| 814 |
-devwrite (int sector, int sector_count, char *buf) |
| 815 |
+devwrite (unsigned int sector, int sector_count, char *buf) |
| 816 |
{ |
| 817 |
#if defined(GRUB_UTIL) && defined(__linux__) |
| 818 |
if (current_partition != 0xFFFFFF |
| 819 |
diff -uprN grub-0.97/stage2/fsys_ffs.c grub/stage2/fsys_ffs.c |
| 820 |
--- grub-0.97/stage2/fsys_ffs.c 2003-07-09 12:45:52.000000000 +0100 |
| 821 |
+++ grub/stage2/fsys_ffs.c 2001-11-12 06:57:29.000000000 +0000 |
| 822 |
@@ -50,7 +50,7 @@ |
| 823 |
* the rights to redistribute these changes. |
| 824 |
* |
| 825 |
* from: Mach, Revision 2.2 92/04/04 11:35:49 rpd |
| 826 |
- * $Id: fsys_ffs.c,v 1.10 2001/11/12 06:57:29 okuji Exp $ |
| 827 |
+ * $Id: fsys_ffs.c 594 2001-11-12 06:57:29Z okuji $ |
| 828 |
*/ |
| 829 |
|
| 830 |
#ifdef FSYS_FFS |
| 831 |
diff -uprN grub-0.97/stage2/fsys_ufs2.c grub/stage2/fsys_ufs2.c |
| 832 |
--- grub-0.97/stage2/fsys_ufs2.c 2004-06-19 13:17:52.000000000 +0100 |
| 833 |
+++ grub/stage2/fsys_ufs2.c 2004-06-19 13:17:52.000000000 +0100 |
| 834 |
@@ -51,7 +51,7 @@ |
| 835 |
* the rights to redistribute these changes. |
| 836 |
* |
| 837 |
* from: Mach, Revision 2.2 92/04/04 11:35:49 rpd |
| 838 |
- * $Id: fsys_ufs2.c,v 1.2 2004/06/19 12:17:52 okuji Exp $ |
| 839 |
+ * $Id: fsys_ufs2.c 841 2004-06-19 12:17:52Z okuji $ |
| 840 |
*/ |
| 841 |
|
| 842 |
#ifdef FSYS_UFS2 |
| 843 |
diff -uprN grub-0.97/stage2/imgact_aout.h grub/stage2/imgact_aout.h |
| 844 |
--- grub-0.97/stage2/imgact_aout.h 2003-07-09 12:45:53.000000000 +0100 |
| 845 |
+++ grub/stage2/imgact_aout.h 1999-06-24 01:03:29.000000000 +0100 |
| 846 |
@@ -32,7 +32,7 @@ |
| 847 |
* SUCH DAMAGE. |
| 848 |
* |
| 849 |
* from: @(#)exec.h 8.1 (Berkeley) 6/11/93 |
| 850 |
- * $Id: imgact_aout.h,v 1.1 1999/06/24 00:03:22 okuji Exp $ |
| 851 |
+ * $Id: imgact_aout.h 98 1999-06-24 00:03:29Z okuji $ |
| 852 |
*/ |
| 853 |
/* |
| 854 |
* 11/23/95 - Kludge to get "ntohl" null macro added. -- ESB |
| 855 |
diff -uprN grub-0.97/stage2/iso9660.h grub/stage2/iso9660.h |
| 856 |
--- grub-0.97/stage2/iso9660.h 2004-03-27 16:02:38.000000000 +0000 |
| 857 |
+++ grub/stage2/iso9660.h 2007-02-22 23:40:25.000000000 +0000 |
| 858 |
@@ -73,11 +73,11 @@ typedef union { |
| 859 |
|
| 860 |
typedef struct __iso_16bit { |
| 861 |
u_int16_t l, b; |
| 862 |
-} iso_16bit_t __attribute__ ((packed)); |
| 863 |
+} iso_16bit_t; |
| 864 |
|
| 865 |
typedef struct __iso_32bit { |
| 866 |
u_int32_t l, b; |
| 867 |
-} iso_32bit_t __attribute__ ((packed)); |
| 868 |
+} iso_32bit_t; |
| 869 |
|
| 870 |
typedef u_int8_t iso_date_t[7]; |
| 871 |
|
| 872 |
diff -uprN grub-0.97/stage2/shared.h grub/stage2/shared.h |
| 873 |
--- grub-0.97/stage2/shared.h 2004-06-19 17:40:09.000000000 +0100 |
| 874 |
+++ grub/stage2/shared.h 2008-03-28 13:22:28.000000000 +0000 |
| 875 |
@@ -499,7 +499,11 @@ struct vbe_mode |
| 876 |
unsigned char linear_reserved_field_position; |
| 877 |
unsigned long max_pixel_clock; |
| 878 |
|
| 879 |
- unsigned char reserved3[189]; |
| 880 |
+ /* Reserved field to make structure to be 256 bytes long, VESA BIOS |
| 881 |
+ Extension 3.0 Specification says to reserve 189 bytes here but |
| 882 |
+ that doesn't make structure to be 256 bytes. So additional one is |
| 883 |
+ added here. */ |
| 884 |
+ unsigned char reserved3[189 + 1]; |
| 885 |
} __attribute__ ((packed)); |
| 886 |
|
| 887 |
|
| 888 |
@@ -807,7 +811,7 @@ int checkkey (void); |
| 889 |
/* Low-level disk I/O */ |
| 890 |
int get_diskinfo (int drive, struct geometry *geometry); |
| 891 |
int biosdisk (int subfunc, int drive, struct geometry *geometry, |
| 892 |
- int sector, int nsec, int segment); |
| 893 |
+ unsigned int sector, int nsec, int segment); |
| 894 |
void stop_floppy (void); |
| 895 |
|
| 896 |
/* Command-line interface functions. */ |
| 897 |
@@ -920,10 +924,10 @@ int gunzip_test_header (void); |
| 898 |
int gunzip_read (char *buf, int len); |
| 899 |
#endif /* NO_DECOMPRESSION */ |
| 900 |
|
| 901 |
-int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf); |
| 902 |
-int devread (int sector, int byte_offset, int byte_len, char *buf); |
| 903 |
-int rawwrite (int drive, int sector, char *buf); |
| 904 |
-int devwrite (int sector, int sector_len, char *buf); |
| 905 |
+int rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf); |
| 906 |
+int devread (unsigned int sector, int byte_offset, int byte_len, char *buf); |
| 907 |
+int rawwrite (int drive, unsigned int sector, char *buf); |
| 908 |
+int devwrite (unsigned int sector, int sector_len, char *buf); |
| 909 |
|
| 910 |
/* Parse a device string and initialize the global parameters. */ |
| 911 |
char *set_device (char *device); |
| 912 |
diff -uprN grub-0.97/stage2/stage2.c grub/stage2/stage2.c |
| 913 |
--- grub-0.97/stage2/stage2.c 2005-03-19 17:51:57.000000000 +0000 |
| 914 |
+++ grub/stage2/stage2.c 2006-05-05 23:06:31.000000000 +0100 |
| 915 |
@@ -651,7 +651,10 @@ restart: |
| 916 |
*(new_heap++) = 0; |
| 917 |
|
| 918 |
if (config_entries) |
| 919 |
- run_menu (heap, NULL, new_num_entries, new_heap, 0); |
| 920 |
+ { |
| 921 |
+ current_entryno = first_entry + entryno; |
| 922 |
+ run_menu (heap, NULL, new_num_entries, new_heap, 0); |
| 923 |
+ } |
| 924 |
else |
| 925 |
{ |
| 926 |
cls (); |
| 927 |
@@ -727,7 +730,8 @@ restart: |
| 928 |
cur_entry = get_entry (config_entries, first_entry + entryno, 1); |
| 929 |
|
| 930 |
/* Set CURRENT_ENTRYNO for the command "savedefault". */ |
| 931 |
- current_entryno = first_entry + entryno; |
| 932 |
+ if (config_entries) |
| 933 |
+ current_entryno = first_entry + entryno; |
| 934 |
|
| 935 |
if (run_script (cur_entry, heap)) |
| 936 |
{ |
| 937 |
diff -uprN grub-0.97/stage2/tparm.c grub/stage2/tparm.c |
| 938 |
--- grub-0.97/stage2/tparm.c 2003-07-09 12:45:53.000000000 +0100 |
| 939 |
+++ grub/stage2/tparm.c 2002-11-29 20:39:24.000000000 +0000 |
| 940 |
@@ -63,7 +63,7 @@ typedef char grub_bool; |
| 941 |
#define MAX_FORMAT_LEN 256 |
| 942 |
#define max(a,b) ((a) > (b) ? (a) : (b)) |
| 943 |
|
| 944 |
-//MODULE_ID("$Id: tparm.c,v 1.1 2002/11/29 20:39:24 okuji Exp $") |
| 945 |
+//MODULE_ID("$Id: tparm.c 708 2002-11-29 20:39:24Z okuji $") |
| 946 |
|
| 947 |
/* |
| 948 |
* char * |
| 949 |
diff -uprN grub-0.97/stamp-h.in grub/stamp-h.in |
| 950 |
--- grub-0.97/stamp-h.in 1970-01-01 01:00:00.000000000 +0100 |
| 951 |
+++ grub/stamp-h.in 1999-09-13 14:32:31.000000000 +0100 |
| 952 |
@@ -0,0 +1 @@ |
| 953 |
+timestamp |
| 954 |
diff -uprN grub-0.97/THANKS grub/THANKS |
| 955 |
--- grub-0.97/THANKS 2005-05-08 03:17:43.000000000 +0100 |
| 956 |
+++ grub/THANKS 2006-03-21 20:51:58.000000000 +0000 |
| 957 |
@@ -121,3 +121,4 @@ Vesa Jaaskelainen <jaaskela@tietomyrsky. |
| 958 |
Yedidyah Bar-David <[email protected]> |
| 959 |
Yury V. Umanets <[email protected]> |
| 960 |
Yuri Zaporogets <[email protected]> |
| 961 |
+Vitaly Fertman <[email protected]> |
| 962 |
diff -uprN grub-0.97/util/grub-install.in grub/util/grub-install.in |
| 963 |
--- grub-0.97/util/grub-install.in 2004-07-24 19:57:31.000000000 +0100 |
| 964 |
+++ grub/util/grub-install.in 2006-04-20 14:46:46.000000000 +0100 |
| 965 |
@@ -112,8 +112,8 @@ convert () { |
| 966 |
tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'` |
| 967 |
tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;; |
| 968 |
freebsd* | kfreebsd*-gnu) |
| 969 |
- tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \ |
| 970 |
- | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'` |
| 971 |
+ tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \ |
| 972 |
+ | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'` |
| 973 |
tmp_part=`echo "$1" \ |
| 974 |
| sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \ |
| 975 |
| sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"` |
| 976 |
diff -uprN grub-0.97/util/mkbimage grub/util/mkbimage |
| 977 |
--- grub-0.97/util/mkbimage 2004-07-24 19:57:31.000000000 +0100 |
| 978 |
+++ grub/util/mkbimage 2007-02-22 16:01:03.000000000 +0000 |
| 979 |
@@ -1,7 +1,7 @@ |
| 980 |
#!/bin/sh |
| 981 |
# MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode |
| 982 |
# C) 2001,2002,2003 Thierry Laronde <[email protected]> |
| 983 |
-# C) 2001,2002,2003 Robert Millan <[email protected]> |
| 984 |
+# C) 2001,2002,2003 Robert Millan <[email protected]> |
| 985 |
|
| 986 |
|
| 987 |
# This program is free software; you can redistribute it and/or modify |
| 988 |
@@ -19,7 +19,7 @@ |
| 989 |
# program's maintainer or write to: The Free Software Foundation, |
| 990 |
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. |
| 991 |
|
| 992 |
-# $Id: mkbimage,v 1.19 2004/07/21 14:43:04 robertmh Exp $ |
| 993 |
+# $Id: mkbimage 1233 2007-02-22 16:01:03Z robertmh $ |
| 994 |
|
| 995 |
# Global variables |
| 996 |
tarfile= |
| 997 |
@@ -58,7 +58,7 @@ stage2_os_name= |
| 998 |
|
| 999 |
# Name by which this script was invoked. |
| 1000 |
program=`echo "$0" | sed -e 's/[^\/]*\///g'` |
| 1001 |
-version_number='$Revision: 1.19 $' |
| 1002 |
+version_number='$Revision: 1233 $' |
| 1003 |
|
| 1004 |
usage=" |
| 1005 |
Usage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE |
| 1006 |
@@ -94,15 +94,13 @@ Options: |
| 1007 |
display Version information and exit |
| 1008 |
|
| 1009 |
Copyright (c) 2001,2002,2003 Thierry Laronde <[email protected]>. |
| 1010 |
-Copyright (c) 2001,2002 Robert Millan <[email protected]>. |
| 1011 |
GPLed." |
| 1012 |
|
| 1013 |
version="mkbimage $version_number |
| 1014 |
|
| 1015 |
-Written by Thierry Laronde and Robert Millan. |
| 1016 |
+Written by Thierry Laronde. |
| 1017 |
|
| 1018 |
Copyright (c) 2001,2002,2003 Thierry Laronde <[email protected]>. |
| 1019 |
-Copyright (c) 2001,2002,2003 Robert Millan <[email protected]>. |
| 1020 |
|
| 1021 |
This is free software under the GPL version 2 or later; see the source for |
| 1022 |
copying conditions. There is NO warranty, not even for MERCHANTABILITY or |