--- grub-0.97.orig/ChangeLog +++ grub-0.97/ChangeLog @@ -1,3 +1,139 @@ +2009-07-02 Pavel Roskin + + * docs/boot.S: Fix missing newline at the end. + * docs/boot.S.texi: Regenerate. + +2008-09-03 Felix Zielcke + + Based on patch from Ville Skyttä + * docs/multiboot.texi: Fix some spelling. + * docs/internals.texi: Likewise. + * docs/grub.texi: Likewise. + +2008-05-20 Robert Millan + + * netboot/cs89x0.c: Fix license violation. + * netboot/cs89x0.h: Likewise. + +2008-04-10 Pavel Roskin + + * configure.ac: Always use "_cv_" in cache variables for + compatibility with Autoconf 2.62. + +2008-03-28 Robert Millan + + Surpass 1 TiB disk addressing limit. Note: there are no plans to handle + the 2 TiB disk limit in GRUB Legacy, since that would need considerable + rework. If you have >2TiB disks, use GRUB 2 instead. + + * grub/asmstub.c (biosdisk): Add unsigned qualifier to `sector'. + * stage2/bios.c (biosdisk): Likewise. + * stage2/disk_io.c (rawread, devread, rawwrite, devwrite): Likewise. + * stage2/shared.h (rawread, devread, rawwrite, devwrite): Likewise. + * lib/device.c (get_drive_geometry): Replace BLKGETSIZE with + BLKGETSIZE64. + +2007-10-29 Pavel Roskin + + * configure.ac: Test if '--build-id=none' is supported by the + linker and add it to LDFLAGS if possible. Build ID causes + objcopy to generate huge binary files. + * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when + linking, so that build ID doesn't break the test. + * stage1/Makefile.am: Preserve LDFLAGS, use stage1_exec_LDFLAGS. + +2007-02-22 Pavel Roskin + + * stage2/iso9660.h: Remove unnecessary packed attributes. + +2007-02-22 Robert Millan + + * util/mkbimage: Update my email address, and remove my name from + some places where unnecessary credit is given. + +2006-09-10 Pavel Roskin + + * netboot/natsemi.c: Fix compile error with gcc 4.1.1. Cast + cannot make a variable volatile - it should be declared as such. + * netboot/sis900.c: Likewise. + +2006-09-08 Pavel Roskin + + * netboot/etherboot.h: Remove incorrect extern declarations of + the variables later declared static. Move BOOTP_DATA_ADDR ... + * netboot/main.c: ... here. Eliminate end_of_rfc1533 - it's + write-only. + +2006-06-24 Yoshinori K. Okuji + + * docs/grub.texi: Changed the license term to the GNU Free + Documentation License 1.2. + + * docs/multiboot.texi: Reformatted to show the license term + and the version number explicitly. + + * docs/fdl.texi: New file. + + * docs/Makefile.am (grub_TEXINFOS): Added fdl.texi. + +2006-06-24 Robert Millan + + * lib/device.c (write_to_partition): /dev/ataraid/ and /dev/rd/ + partitions have a "p" prefix. Add it. + +2006-06-24 Robert Millan + + * lib/device.c (get_i2o_disk_name): New function. + (init_device_map) [__linux__]: Add support for I2O devices. + +2006-05-02 Pavel Roskin + + * stage2/stage2.c (run_menu): Fix "savedefault" to save only top + level menu positions. Remember current position when calling a + submenu. Don't recalculate it when booting from a submenu. + + * grub/main.c (main): Make sure the boot drive number doesn't + exceed 255. + +2006-05-02 Vesa Jaaskelainen + + * stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2 + to GRUB Legacy. Problem reported by Gerardo Richarte. + +2006-04-23 Robert Millan + + * grub/asmstub.c (get_diskinfo): Optimize sysctl routine. + +2006-04-20 Robert Millan + + Fixes for kernel of FreeBSD: + * grub/asmstub.c (get_diskinfo): Toggle "kern.geom.debugflags" sysctl + before opening a device for writing. + * util/grub-install.in: Devices don't have this "r" prefix anymore. + +2006-04-16 Yoshinori K. Okuji + + * docs/multiboot.texi: Correct the offset of address + fields. Reported by Jeroen Dekkers. + +2006-03-21 Yoshinori K. Okuji + + * stage2/builtins.c (setup_func): Specify the size of DEVICE to + grub_strncat instead of a strange number 256. Reported by Vitaly + Fertman . + +2005-09-29 Yoshinori K. Okuji + + * docs/multiboot.texi: Fix a bug in the byte order of + boot_device. I hope this won't affect any OS image. + Increased the version number to 0.6.94. + +2005-09-28 Yoshinori K. Okuji + + * stage2/boot.c (load_image): Even if an OS image is an ELF + object, use the a.out kludge if MULTIBOOT_AOUT_KLUDGE is + specified. + 2005-05-08 Yoshinori K. Okuji * configure.ac (AC_INIT): Upgraded to 0.97. --- grub-0.97.orig/THANKS +++ grub-0.97/THANKS @@ -92,7 +92,7 @@ Neal H Walfield Neelkanth Natu OKUJI Yoshinori -Pavel Roskin +Pavel Roskin Per Lundberg Peter Astrand Ralf Medow @@ -121,3 +121,4 @@ Yedidyah Bar-David Yury V. Umanets Yuri Zaporogets +Vitaly Fertman --- grub-0.97.orig/acinclude.m4 +++ grub-0.97/acinclude.m4 @@ -57,7 +57,7 @@ fi grub_cv_prog_objcopy_absolute=yes for link_addr in 2000 8000 7C00; do - if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then : + if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then : else AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr]) fi --- grub-0.97.orig/configure.ac +++ grub-0.97/configure.ac @@ -86,13 +86,13 @@ fi STAGE1_CFLAGS="-O2" GRUB_CFLAGS="-O2" - AC_CACHE_CHECK([whether optimization for size works], size_flag, [ + AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [ saved_CFLAGS=$CFLAGS CFLAGS="-Os -g" - AC_TRY_COMPILE(, , size_flag=yes, size_flag=no) + AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no) CFLAGS=$saved_CFLAGS ]) - if test "x$size_flag" = xyes; then + if test "x$grub_cv_cc_Os" = xyes; then STAGE2_CFLAGS="-Os" else STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops" @@ -100,16 +100,16 @@ # OpenBSD has a GCC extension for protecting applications from # stack smashing attacks, but GRUB doesn't want this feature. AC_CACHE_CHECK([whether gcc has -fno-stack-protector], - no_stack_protector_flag, [ + grub_cv_cc_no_stack_protector, [ saved_CFLAGS=$CFLAGS CFLAGS="-fno-stack-protector" AC_TRY_COMPILE(, , - no_stack_protector_flag=yes, - no_stack_protector_flag=no) + grub_cv_cc_no_stack_protector=yes, + grub_cv_cc_no_stack_protector=no) CFLAGS=$saved_CFLAGS ]) - if test "x$no_stack_protector_flag" = xyes; then + if test "x$grub_cv_cc_no_stack_protector" = xyes; then STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector" fi fi @@ -123,33 +123,44 @@ CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow" CPPFLAGS="$CPPFLAGS -Wpointer-arith" -AC_CACHE_CHECK([whether -Wundef works], undef_flag, [ +AC_CACHE_CHECK([whether -Wundef works], grub_cv_cc_Wundef, [ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-Wundef" - AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no) + AC_TRY_COMPILE(, , grub_cv_cc_Wundef=yes, grub_cv_cc_Wundef=no) CPPFLAGS="$saved_CPPFLAGS" ]) # The options `-falign-*' are supported by gcc 3.0 or later. # Probably it is sufficient to only check for -falign-loops. -AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [ +AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-falign-loops=1" - AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no]) + AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no]) CPPFLAGS="$saved_CPPFLAGS" ]) # Force no alignment to save space. -if test "x$falign_loop_flag" = xyes; then +if test "x$grub_cv_cc_falign_loop" = xyes; then CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" else CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" fi -if test "x$undef_flag" = xyes; then +if test "x$grub_cv_cc_Wundef" = xyes; then CPPFLAGS="$CPPFLAGS -Wundef" fi +# Check if build ID can be disabled in the linker +AC_MSG_CHECKING([whether linker accepts `--build-id=none']) +save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -Wl,--build-id=none" +AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no) +AC_MSG_RESULT([$build_id_flag]) +LDFLAGS="$save_LDFLAGS" +if test "x$build_id_flag" = xyes; then + LDFLAGS="$LDFLAGS -Wl,--build-id=none" +fi + if test "x$with_binutils" != x; then dnl AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH") AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH") --- grub-0.97.orig/debian/NEWS +++ grub-0.97/debian/NEWS @@ -0,0 +1,49 @@ +grub (0.97-44) unstable; urgency=low + + Versions of the kernel Linux newer than 2.6.23, like the ones included in + Debian Lenny, are known to differ slightly in their binary format, in a way + that very old versions of GRUB are unable to boot. + + If you're upgrading GRUB in a system that was installed before Debian Etch, + and you have never manually updated your GRUB install, it is possible that + your system stops booting. + + In order to prevent that, it is recommended that you install the latest GRUB + by issuing (as root) the following command after upgrading the grub package: + + grub-install "(hd0)" + + (assuming hd0 is mapped in /boot/grub/device.map to the disk used by your + BIOS to boot; in a multi-disk environment you might need to use a different + parameter) + + Note: even if your setup is not affected by this problem, it is always a + good idea to keep your GRUB install up-to-date, so if in doubt it's best + that you update it anyway. + + -- Robert Millan Mon, 28 Jul 2008 20:19:52 +0200 + +grub (0.97-16) unstable; urgency=low + + grub-install and update-grub has changed location. + + There's a wrapper available in /sbin to keep backward compatibility but + it'll be removed once Etch is release as stable. You _must_ edit your + /etc/kernel-img.conf and change the paths to /usr/sbin/update-grub. + For example: + + ,----[ /etc/kernel-img.conf ] + | ... + | postinst_hook = /sbin/update-grub + | postrm_hook = /sbin/update-grub + `---- + + Should be change to: + + ,----[ /etc/kernel-img.conf ] + | ... + | postinst_hook = update-grub + | postrm_hook = update-grub + `---- + + -- Otavio Salvador Thu, 14 Sep 2006 23:25:36 -0300 --- grub-0.97.orig/debian/README.Debian +++ grub-0.97/debian/README.Debian @@ -0,0 +1,131 @@ +grub for Debian +--------------- + +GRUB is a GPLed bootloader intended to unify bootloading across x86 +operating systems. In addition to loading Linux and FreeBSD, it +implements the Multiboot standard, which allows for flexible loading +of multiple boot images (needed for modular kernels such as the GNU +Hurd). + +One unique feature of GRUB is that it can understand filesystems at +boot time, rather than just simple blocklists. Hence, you can load +any kernel in the file system from the boot prompt without having to +edit configuration files or rerun a special installation program. + +GRUB also automatically detects BIOS lba block addressing. To force +lba mode see the GRUB `setup` command. Lilo's install and map +directives are fulfilled by GRUB's `root` and `setup` commands. To +reinstall GRUB, the installation location is either determined at +runtime by the `grub-install` script or given as an option to the +`setup` command. + +more documentation +------------------ +the full grub documentation is available in the grub-legacy-doc package. + +quick setup +----------- + +after installing the package: + +1) grub-install "(hd0)" + or if /boot is a separate partition + grub-install --root-directory=/boot "(hd0)" + + using in place of "(hd0)" the device that you boot from + +2) update-grub which will create a menu.lst for you if one does not exist + or manually create one, and skip to step 4 + +3) edit /boot/grub/menu.lst + or if /boot is a separate partition + edit /boot/boot/grub/menu.lst + + and change groot, and kopt to whatever settings you need. + modify anything else in the menu.lst you want, + + re-run update-grub to update the lines for each kernel to those + that you specified with groot and kopt + +4) thats it, making sure you have a rescue disk or some other way to boot + your machine attempt to reboot using grub! + + to create a grub boot floppy: + + cat /boot/grub/stage1 /boot/grub/stage2 > /dev/fd0 + + using in place of /dev/fd0 the device that is for your floppy drive. + + note: that you need to run grub-install each time a new grub package + is installed, this script updates the grub images in /boot/grub + or /boot/boot/grub and installs grub into the boot sector. + +for more detailed information see the info documentation or manpages + +update-grub +----------- +This script is a debian specific addon used to generate a menu.lst for you +either intially, and/or automatically everytime you install a new kernel. + +To setup automatic updates add these lines to your /etc/kernel-img.conf: + +postinst_hook = update-grub +postrm_hook = update-grub +do_bootloader = no + +For further information see the manpage kernel-img.conf(5) or update-grub(8) + +Unlike Lilo, it is not necessary to re-run or re-install the boot loader +after every change to /boot/grub/menu.lst. menu.lst is automatically +found on GRUB's root disk and read during GRUB's boot process. + +splashimage support +------------------- +The use of graphics is an unofficial extension to Grub that has not yet been +included by the developers in the official software. The patch +was first proposed on the bug-grub mail list late in 2001. This feature will +not be supported by upstream until after the 1.0 version of Grub is released. + +However, this Debian package has been patched and supports splash images. +This is how you can add a splash image to your grub configuration: + +1) Be sure to run grub-install, or you will still be running the old + (unpatched) version + +2) Create your image, and transform it into a XPM file, 640x480, with + 14 colors: + + $ convert my-nice-image.jpg -colors 14 -geometry 640x480! my-nice-image.xpm + + gzip it: + + $ gzip my-nice-image.xpm + +3) Change your menu.lst file to include the new commands: + +# Set colors for foreground and background: +# (RRGGBB, in hex) +# +# These are optional it will still work without them +# +foreground = ffffff +background = 000000 + +# The splash image location (doesn't need to be the root partition, BTW, +# since grub can read your filesystem): +# +splashimage=(hd0,5)/boot/grub/my-nice-image.xpm.gz + +4) Reboot, and see your splash image. You may want to fine tune the colors used + for the text + +Note if the path to the splashimage file happens to be wrong you will get a really messed up looking screen. + +There is a grub splashimage howto here: +http://ruslug.rutgers.edu/~mcgrof/grub-images/ + +netbsd/freebsd/*bsd +------------------- + +Loading kernels from *BSD systems is supported in GRUB 2. You can upgrade to +GRUB 2 by installing the `grub-pc' package. --- grub-0.97.orig/debian/changelog +++ grub-0.97/debian/changelog @@ -0,0 +1,1934 @@ +grub (0.97-68) unstable; urgency=low + + * Update Vcs-* fields for Bazaar (closes: #628651). + * Use 'set -e' rather than '#!/bin/bash -e' in various scripts. + * Port to modern Automake versions and use dh-autoreconf (closes: + #724383). + + -- Colin Watson Thu, 24 Jul 2014 00:31:36 +0100 + +grub (0.97-67) unstable; urgency=low + + * Fix typo in grub-set-default calls when generating /boot/grub/default + from scratch (closes: #560417). + + -- Colin Watson Tue, 29 Jan 2013 16:13:56 +0000 + +grub (0.97-66.1) unstable; urgency=low + + * Non-maintainer upload. + * Drop the grub dummy package (closes: #686182). + * rules: Update lintian-overrides for statically-linked-binary. + + -- David Prévot Mon, 03 Dec 2012 17:05:45 -0400 + +grub (0.97-66) unstable; urgency=low + + [ Colin Watson ] + * Build stage2 with -fno-reorder-functions to prevent + unlikely-to-be-executed functions being reordered before _start with GCC + 4.6 (LP: #837815). + + [ Didier Raboud ] + * Build with the default gcc (closes: #594283). + + -- Colin Watson Sat, 19 Nov 2011 01:54:49 +0000 + +grub (0.97-65) unstable; urgency=low + + * Fix grub/migrate_from_legacy title to not end with a full stop. + * Fix update-grub(8) groff typo (".bar" instead of ".br"). + * Adjust doc-base file to account for renaming of grub.info to + grub-legacy.info. + * Compare -trunk kernels earlier than numeric ABIs (thanks, Aaron M. Ucko + and Andreas Beckmann; closes: #570318). + * Convert from home-grown patch system to quilt. + + -- Colin Watson Thu, 17 Mar 2011 13:34:14 +0000 + +grub (0.97-64) unstable; urgency=low + + * Exit silently from zz-update-grub kernel hook if update-grub does not + exist (e.g. if grub has been removed but not purged; closes: #606377). + + -- Colin Watson Wed, 08 Dec 2010 21:08:19 +0000 + +grub (0.97-63) unstable; urgency=low + + * Make /etc/kernel/postrm.d/zz-update-grub a real file rather than a + symlink (closes: #592105). + * Restrict watch file to match only GRUB Legacy versions. + * Escape single quotes when removing them from $mode in zz-update-grub, so + that this works when /bin/sh is bash (thanks, Will Dyson). + * Run update-grub from kernel hooks if DEB_MAINT_PARAMS is unset, for + compatibility with old kernel packages. This may produce duplicate runs + of update-grub, but that's better than not running it at all. + * Adjust Maintainer field capitalisation to be consistent with grub2. + + -- Colin Watson Fri, 03 Sep 2010 15:38:42 +0100 + +grub (0.97-62) unstable; urgency=low + + * Lower priority to extra (also done in archive overrides). + * Add kernel hook scripts and remove any uses of update-grub as a + postinst_hook or postrm_hook in /etc/kernel-img.conf (closes: #587266). + Thanks to Ben Hutchings for advice and to Harald Braumann for an early + implementation. + + -- Colin Watson Fri, 06 Aug 2010 17:47:25 +0100 + +grub (0.97-61) unstable; urgency=low + + * Build-depend on gcc-4.3 (closes: #564451). + * Add myself to Uploaders. + + -- Colin Watson Mon, 19 Apr 2010 10:52:38 +0100 + +grub (0.97-60) unstable; urgency=low + + [ Robert Millan ] + * Turn multiboot-doc into a dummy transitional package. + * Keep building with GCC 4.3. We didn't test GRUB Legacy with GCC 4.4, + and it's not worth the risk since it's being replaced by GRUB 2. + * Remove patches/cvs-sync.patch. We use Bazaar branching now. + * Fix FTBFS due to texi2html change in default output directory. + + -- Felix Zielcke Sun, 03 Jan 2010 20:49:21 +0100 + +grub (0.97-59) unstable; urgency=low + + [ Felix Zielcke ] + * Use /usr/lib/grub-legacy/grub-set-default if it exists in + update-grub, in preparation for GRUB 2's grub-set-default. + + [ Robert Millan ] + * Rename grub.info to grub-legacy.info to avoid conflict with upcoming + GRUB 2 manual. + + -- Robert Millan Fri, 02 Oct 2009 19:37:55 +0200 + +grub (0.97-58) unstable; urgency=low + + * Upgrade path is now GRUB 2. + + -- Robert Millan Fri, 04 Sep 2009 15:20:16 +0200 + +grub (0.97-57) unstable; urgency=low + + * Remove the /sbin/grub-install and update-grub wrapper. + * Edit /etc/kernel-img.conf with sed in grub-legacy.postinst if it + still uses /sbin/update-grub. According to Colin Watson policy seems + to allow this. + * Add to all packages. + * Add a depency on `dpkg (>= 1.15.4) | install-info' for grub-legacy- + doc. + * Fix the 2 statically-linked-binary lintian overrides. + * Update Standards-Version to 3.8.3. + * Build depend on lib32ncurses5-dev on amd64. (Closes: #423273) + * Change the grub/migrate_from_legacy template a bit to fix the + lintian warnings for it. + * Add #DEBHELPER# token to grub.postinst. + + -- Felix Zielcke Thu, 03 Sep 2009 19:56:01 +0200 + +grub (0.97-56) unstable; urgency=low + + [ Felix Zielcke ] + * Really add DM-Upload-Allowed: yes. + + [ Robert Millan ] + * Remove GNU/kFreeBSD support, since it can't be used without an external + loader that is not in Debian. GNU/kFreeBSD users should upgrade to + GRUB 2. + + -- Robert Millan Thu, 13 Aug 2009 00:05:21 +0200 + +grub (0.97-55) unstable; urgency=low + + * Add a Provides: grub to grub-legacy. + * Update Standards version to 3.8.2. No changes needed. + * patches/xfs_freeze.diff: Fix "/usr/sbin/grub-install: line 374: [: + =: unary operator expected". (Closes: #513216) + * Add myself to Uploaders and set DM-Upload-Allowed: yes. + * Remove Jason and Otavio from Uploaders with their permission. + * Fix a spelling error in grub/migrate_from_legacy template + (s/untill/until). (Closes: #537815) + * Rename XS-X-Vcs-Svn flag to Vcs-Svn. + * Don't ignore make distclean errors + * Fix a spelling error in the description of grub-legacy + (s/maintainance/maintenance/). + * Bump to debhelper compat level 5. + + -- Felix Zielcke Tue, 21 Jul 2009 09:35:58 +0200 + +grub (0.97-54) unstable; urgency=low + + * Rename grub to grub-legacy. + * Add a debconf note explaining that GRUB Legacy is now deprecated. + + -- Robert Millan Sat, 11 Jul 2009 21:54:44 +0200 + +grub (0.97-53) unstable; urgency=low + + * Update my email address. + * Upload to unstable. + + -- Robert Millan Mon, 06 Apr 2009 17:57:36 +0200 + +grub (0.97-52) experimental; urgency=low + + * update-grub: Try to regenerate device.map when grub-probe fails (and + inform the user about it). Thanks Raphaël Hertzog. (Closes: #501306) + * update-grub: Do not attempt to detect CONFIG_PARAVIRT Xen images. + Thanks Raphaël Hertzog et al. (Closes: #500336) + * patches/xfs_freeze.diff: Replace with a new patch, which thaws XFS + inmediately after freezing it. (Closes: #239111, #243835, #246111, + #309218, #425367) hopefully for good this time. Thanks everyone + who sent their feedback, too many to list them here. + + -- Robert Millan Fri, 16 Jan 2009 22:23:50 +0100 + +grub (0.97-51) experimental; urgency=low + + * Move example kernel to examples/ directory. + + -- Robert Millan Thu, 11 Sep 2008 23:45:14 +0200 + +grub (0.97-50) experimental; urgency=low + + * Remove multiboot-example-kernel package, as it was rejected by + ftp-masters. Install the example kernel as part of the multiboot-doc + package instead. + + -- Robert Millan Thu, 11 Sep 2008 22:49:28 +0200 + +grub (0.97-49) experimental; urgency=low + + * Fix multiboot-example-kernel install path. + + -- Robert Millan Tue, 9 Sep 2008 18:39:26 +0200 + +grub (0.97-48) experimental; urgency=low + + * Add `multiboot-example-kernel' package, containing the example Multiboot + kernel image provided by upstream (in docs/kernel). + + -- Robert Millan Tue, 9 Sep 2008 17:35:29 +0200 + +grub (0.97-47) unstable; urgency=high + + * update-grub: Send grub-probe stderr output to /dev/null. (Closes: #495909) + + -- Robert Millan Sun, 31 Aug 2008 20:03:11 +0200 + +grub (0.97-46) unstable; urgency=high + + * Bring the rc/pre/etc exceptions back again when comparing versions. + (Closes: #493389) + + -- Robert Millan Sat, 9 Aug 2008 21:07:20 +0200 + +grub (0.97-45) unstable; urgency=high + + * use dpkg --compare-versions in update-grub. (Closes: #493389) + + -- Felix Zielcke Thu, 07 Aug 2008 15:57:02 +0200 + +grub (0.97-44) unstable; urgency=low + + * Ignore -y option. When menu.lst doesn't exist, it's always generated. + (Closes: #492213) + * NEWS: Add note recommending that users update their GRUB installs. + (Closes: #451701) + + -- Robert Millan Mon, 28 Jul 2008 21:00:09 +0200 + +grub (0.97-43) unstable; urgency=high + + [ Felix Zielcke ] + * debian/rules: changed cvs rules to svn + * Update Standards version to 3.8.0. No changes need. + * add 2 overrides to make lintian happy + + [ Robert Millan ] + * Fix regression in patches/ext3_256byte_inode.diff, thanks Eric Sandeen + . (Closes: #491076) + + -- Robert Millan Fri, 25 Jul 2008 14:36:15 +0200 + +grub (0.97-42) unstable; urgency=high + + * Avoid passing UUIDs to Linux when "/dev/disk/by-uuid/${root_uuid}" does + not exist + * control (grub): Add a note in description pointing at GRUB 2. + (Closes: #488304) + * patches/use_grub-probe_in_grub-install.diff: Use grub-mkdevicemap when + device.map needs to be regenerated (this brings in Virtio support, and + probably others). + (Closes: #491745) + + -- Robert Millan Wed, 23 Jul 2008 01:19:36 +0200 + +grub (0.97-41) unstable; urgency=low + + * Fix problem with root= argument generation in loop-AES. Reported by + Max Vozeler. (Closes: #488016) + * update-grub: Only special-case Xen detection for older Linux images + without CONFIG_PARAVIRT. Thanks Ian Campbell. (Closes: #468824) + + -- Robert Millan Wed, 25 Jun 2008 23:09:27 +0200 + +grub (0.97-40) unstable; urgency=low + + * Remove obsolete note about initrd size. (Closes: #482611) + * update-grub: Use filesystem UUIDs when available. + + -- Robert Millan Tue, 10 Jun 2008 16:40:44 +0200 + +grub (0.97-39) unstable; urgency=low + + * New upstream snapshot. + - Fixes license violation. (Closes: #479623) + - patches/1tib_disk_limit.diff: Merged. + - patches/geometry-26kernel.diff: Resync. + * Adjust make_system_path_relative_to_its_root() not to print trailing + slashes. (Closes: #479169) + * Handle relative paths for splash images. Thanks Petter + Reinholdtsen. (Closes: #477791) + * Support for Xen style xvd[a-z] devices. Thanks Ian Campbell. + (Closes: #456776) + * Document that grub-set-default counts entries starting with 0. + (Closes: #451709) + + -- Robert Millan Tue, 20 May 2008 14:16:58 +0200 + +grub (0.97-38) unstable; urgency=high + + * patches/use_grub-probe_in_grub-install.diff: Reinstate RAID1 hack. + Based on patch from Goswin Brederlow . + (Closes: #478547, #464146) + + -- Robert Millan Wed, 30 Apr 2008 22:51:42 +0200 + +grub (0.97-37) unstable; urgency=high + + * update-grub: Fix detection of /dev/md/X RAID. Thanks Stephen Kitt. + (Closes: #477998) + * update-grub/grub-install: Pass --device-map to grub-probe. Thanks + segmentation@ntlworld.com. (Closes: #476833) + * script: Fix use of uninitialised $i. + * update-grub: Make relative path resolution more robust. (Closes: #478006) + + -- Robert Millan Sat, 26 Apr 2008 19:37:58 +0200 + +grub (0.97-36) unstable; urgency=low + + * Add debian/script. + * Set grub-reboot interpreter to /bin/bash. (Closes: #473685) + * update-grub: Create device.map if it doesn't exist. (Closes: #473889) + + -- Robert Millan Mon, 7 Apr 2008 17:49:48 +0200 + +grub (0.97-35) unstable; urgency=low + + * Upload to unstable. + + -- Robert Millan Fri, 28 Mar 2008 14:27:07 +0100 + +grub (0.97-34) experimental; urgency=low + + * patches/128gib_disk_limit.diff: Extend disk addressing up to 2 TiB. + (Closes: #450951) + + -- Robert Millan Thu, 20 Mar 2008 02:52:07 +0100 + +grub (0.97-33) experimental; urgency=low + + * control (grub): Suggest multiboot-doc. + * update-grub: Rewrite find_device() and convert() using grub-probe from + grub-common package. (Closes: #435708, #443897, #463274, #301373, #284790) + * patches/use_grub-probe_in_grub-install.diff: Do the same for grub-install. + (Closes: #441080) + + -- Robert Millan Fri, 29 Feb 2008 20:31:41 +0100 + +grub (0.97-32) unstable; urgency=low + + * Split grub-doc in multiboot-doc and grub-legacy-doc. + + -- Robert Millan Thu, 28 Feb 2008 12:16:06 +0100 + +grub (0.97-31) unstable; urgency=low + + * README.Debian, NEWS.Debian: Recommend that users invoke update-grub + directly without hardcoding its path. (Closes: #465235) + * savedefault command is now issued when enabled via menu.lst variable + of the same name, when user accepts the implications (note, that in + the default configuration it was already disabled). + (Closes: #393079, #462701) + * Restrict license in debian/copyright to GPLv2-only. (Closes: #438177) + + -- Robert Millan Mon, 11 Feb 2008 17:32:57 +0100 + +grub (0.97-30) unstable; urgency=low + + * update-grub: + - Update Marc Haber's address. (Closes: #432700) + - Make it more friendly to its GRUB 2 compatibiliy fork. + * control (Build-Depends-Indep): Remove e2tools and mkisofs. + * patches/ext3_256byte_inode.diff: New. Support 256-byte inodes in ext3. + Thanks Stefan Lippers-Hollmann. (Closes: #463236) + + -- Robert Millan Sun, 3 Feb 2008 01:19:47 +0100 + +grub (0.97-29) unstable; urgency=low + + [ Otavio Salvador ] + * update-grub: Improve sorting with mixed numeric and non-numeric + characters. Thanks dann frazier for the + patch. Closes: #422759 + + [ Robert Millan ] + * Add myself to Uploaders. + * update-grub: Remove core.img handling. It was becoming meaningless + without presence of the grub-pc package. + * control (Architecture): Replace any-* arches with the old, boring, + hardcoded list. (Closes: #424510) + * Get rid of grub-disk, mkbimage and grub-floppy. They're deprecated + in favour of grub-rescue-pc now. (Closes: #399168, #250938, #429576, + #352731) + + -- Robert Millan Tue, 26 Jun 2007 07:48:57 +0200 + +grub (0.97-28) unstable; urgency=low + + * Remove second /sbin/update-grub warning. Apparently, it is + impossible to detect /etc/kernel-img.conf syntax by checking $0. + (Closes: #421321) + * update-grub.8: Don't recommend /sbin/update-grub anymore. (Closes: #418064) + * control (Build-Depends): s/libc6-dev-i386/gcc-multilib/g. + * update-grub: When GRUB 2 core.img is detected, set it as first option + (note that first doesn't imply default). + + -- Robert Millan Mon, 7 May 2007 20:58:31 +0200 + +grub (0.97-27) unstable; urgency=high + + * When counting the number of kernels, do not count invalid xen + ones. Thanks to "Jon H. Davis" by investigate + and produce the patch for it. Closes: #411908 + + -- Otavio Salvador Fri, 30 Mar 2007 02:38:31 -0300 + +grub (0.97-26) unstable; urgency=high + + * Brown bag release! + * Fix two stupid mistakes on previous changes. Thanks to Steve Langasek + by identify them. + + -- Otavio Salvador Fri, 23 Mar 2007 08:34:00 -0300 + +grub (0.97-25) unstable; urgency=high + + * Fix grub-install regexp to work when providing the whole device as in + /dev/cciss/c0d0. Thanks to Jason Cormie by + the patch. Closes: #414161 + + -- Otavio Salvador Thu, 22 Mar 2007 23:04:13 -0300 + +grub (0.97-24) unstable; urgency=high + + [ Leandro Dorileo ] + * Changed grub-set-default to search for grub dir if rootdir is not + informed. Closes: #411109, #412334 + * Applied changes from Friedemann Baitinger + to savedefault-once. closes: #254475 + + -- Otavio Salvador Tue, 20 Mar 2007 23:37:46 -0300 + +grub (0.97-23) unstable; urgency=high + + [ Tomas Pospisek ] + * Cross-referenced grub-install(8), grub(8) and update-grub(8) with + each other. Closes: #267998, + * Mention in the manpages that the info documentation comes with + the grub-doc package. Closes: #160337, #345655 + * Note in the referring manpage, that kernel-img.conf comes with the + kernel-package package. Closes: #398419 + + [ Otavio Salvador ] + * Applied patch from Jason Rhinelander to fix + kernel ordering on menu.lst generated file. Closes: #374371, #410464 + + -- Otavio Salvador Tue, 13 Feb 2007 14:48:40 -0200 + +grub (0.97-22) unstable; urgency=high + + * Applied patch from Chip Salzenberg to avoid to write + to stdout. Fix kernel postrm calls. Closes: #409190. + * Applied patch from Joey Hess to put xen kernels + when running inside of a domU. Closes: #404536. + + -- Otavio Salvador Wed, 31 Jan 2007 21:49:14 -0200 + +grub (0.97-21) unstable; urgency=medium + + [ Leandro Dorileo ] + * Changed update-grub to call grub-set-default 0, and a warning a message + telling the user that the default file was regeneraged. Closes: #406068. + * Added some missing savedefault_func return in stage2.c and how the read + default buf was being handled. Thanks Len Sorensen + by the suggestions. Closes: #403763. + + -- Otavio Salvador Sun, 14 Jan 2007 23:20:48 -0200 + +grub (0.97-20) unstable; urgency=low + + * Add manpage for grub-set-default. Thanks for Patrick Schönfeld + by the patch. Closes: #399699 + * Write grub-install wrapper messages on stderr instead of stdout. + Closes: #390038, #388696, #395359. + * Write update-grub wrapper messages on stderr instead of stdout. + + -- Otavio Salvador Wed, 6 Dec 2006 11:01:44 -0200 + +grub (0.97-19) unstable; urgency=low + + [ Leandro Dorileo ] + * Changed how grub handles the saved default entry in the savedefault(once) + patch in stage2/stage2.c cmain function, changed grub-reboot to print + the warning already being printed in grub-set-default to default file. + Closes: #367889, #397021. + + [ Otavio Salvador ] + * Applied patch from "Christian Eckerle" to not + always prepend /boot in front of the kernel line for xen if /boot is + on its on partition. Closes: #393488. + * Applied patch from Mike Kasick to fix the + handle of null options. Closes: #395275. + * Applied patch from Markus Schulz to fix xen kernel + name detection. Closes: #397775. + * Fix grub-install and update-grub mess. Closes: #394020. + * Applied patch from "A. Costa" to fix a typo on + update-grub.8. Closes: #396315. + + -- Otavio Salvador Thu, 9 Nov 2006 11:15:39 -0200 + +grub (0.97-18) unstable; urgency=low + + [ Otavio Salvador ] + * Fix clean target to remove generated files. Thanks to Joey Hess + for the patch. Closes: #385980 + * Fix grub-install.wrapper to check for /usr/sbin/grub-install.real + otherwise grub-install will never be run. Thanks to Pier Luigi Pau + by noticed it. Closes: #387729 + + [ Robert Millan ] + * grub-floppy: Update old /lib path. (Closes: #390167) + + -- Otavio Salvador Tue, 3 Oct 2006 14:03:35 -0300 + +grub (0.97-17) unstable; urgency=low + + [ Petter Reinholdtsen ] + * Install grub-install.wrapper as /sbin/grub-install, not + /usr/sbin/grub-install. (Closes: #387500, #387729) + + [ Leandro Dorileo ] + * Changed few mistakes in NEWS. Closes: #387700 + * Install grub-install as /usr/sbin/grub-install.real and changed its wrapper. + * Corrected few english mistakes in grub-install.wrapper and + update-grub.wrapper. + * Changed the wrappers to call the real script with "$@" instead of $*. + Closes: #388277 + + [ Robert Millan ] + * update-grub: Detect GRUB 2 core image (and add title to chainload it). + * Get rid of type-handling. + - control.in: Remove. + - rules: Drop control generation target. + - control: Staticalise the dynamicaly generated tags. + * control (Suggests): Remove grubconf (Closes: #389094). + * Add a big warning to bug reporters, explaining that GRUB Legacy is feature + frozen. + - presubj: New. Install it in every package. + + [ Otavio Salvador ] + * Add XS-X-Vcs-Svn on control file and point it to our current svn + repository. + + -- Otavio Salvador Mon, 2 Oct 2006 11:42:58 -0300 + +grub (0.97-16) unstable; urgency=high + + ### High urgency since it solve a installation problem on beta3 of d-i ### + + [ Bastian Blank ] + * Add selection of xen hypervisors. + + [ Robert Millan ] + * rules: Install grub-disk iso uncompressed (tradeoff is reasonable, unlike + the ext2fs image). + + [ Otavio Salvador ] + * Add grub-install wrapper forgotten in transition handle. Closes: #387500 + * Edited NEWS.Debian following Manoj Srivastava + suggestion to avoid brokeness when removing old kernels. Closes: #387325 + * Fix README.Debian to cite the new scripts place. + + -- Otavio Salvador Fri, 15 Sep 2006 09:50:32 -0300 + +grub (0.97-15) unstable; urgency=low + + * Remove bashism from update-grub wrapper. + + -- Otavio Salvador Sat, 2 Sep 2006 08:53:20 -0300 + +grub (0.97-14) unstable; urgency=low + + [ Robert Millan ] + * Make update-grub more $menu_file agnostic to ease code sharing with grub2 + (which uses grub.cfg). Also remove explicit "boot" command that has never + been required, and would break grub2. + * Fix FHS-me-harder headache. (Closes: #361929) + - rules: --prefix=/usr. + - grub.install: Move the stuff to /usr. + * update-grub: Set interpreter to /bin/bash to cope with non-POSIX + extensions. (also mentioned in #361929) + + [ Otavio Salvador ] + * Remove convert_kernel26 usage since it's not necessary anymore and due + initramfs-tools changes it's bug too. + * Add a NEWS file describing how to upgrade the system regarting to + grub-install and update-grub moving. + * Change the way we handle FHS headache: + - debian/wrappers: New. Provide a wrapper to old locations. + - debian/rules: install the wrappers. + - grub.dirs: New. Create /sbin. + + -- Otavio Salvador Wed, 30 Aug 2006 12:24:48 -0300 + +grub (0.97-13) unstable; urgency=low + + [ Otavio Salvador ] + * Use automake1.9 instead of automake1.8; + * Added build-depends of autotools-dev since it uses autoconf; + * Applied patch to add support to Xen hypervisor kernel handling. Thanks + to Alastair McKinstry and Thomas Schwinge + for the patch. (Closes: #343076) + * Remove all autogenerated files before make the package diff so we + reduce the delta size between us and upstream a lot. + * Applied patch to add support to AoE devices. Thanks to James Harper + for the patch. (Closes: #377005) + * Add mdadm as suggested since it's need to support RAID installations. + (Closes: #299751) + + -- Otavio Salvador Mon, 24 Jul 2006 10:43:07 -0300 + +grub (0.97-12) unstable; urgency=HIGH + + [ Otavio Salvador ] + * Bump Standards-Version to 3.7.2.1 (no changes); + + [ Robert Millan ] + * New snapshot. (Closes: #374952) + patches: + - cvs-sync.patch: Update manualy to latest version _before_ GFDL change. + - grub-special_device_names.diff: Resync. + + [ Otavio Salvador ] + * Applied patch from Michael Biebl to fix failure to + catch the right root device when using RAID and new mdadm + packages. (Closes: #375927) + * Set urgency as 'high' due the mdadm issue that can break installations + on Etch. + + -- Otavio Salvador Mon, 3 Jul 2006 20:25:36 -0300 + +grub (0.97-11) unstable; urgency=low + + * Don't use /dev/ida!cXdYpZ format since ida RAID controllers aren't + using that format in newer kernels. Current code already skip + /dev/cciss devices. Closes: #362095 + * Applied patch from Matt Taggart to fix a + regression in update-grub code when using memtest86 enabled. + Closes: #371196, #372648 + + -- Otavio Salvador Thu, 15 Jun 2006 08:53:14 -0300 + +grub (0.97-10) unstable; urgency=low + + * Fix build-depends for amd64. Closes: #369452, #369723. + * Apply patch from Tino Keitel to allow grub to + work in Apple Intel based machines. Closes: #369655. + * Fix problem registering documentation in doc-base. Closes: #369578. + * Add doc-base as suggestion for grub-doc package. + * Replace the alternative boot images from recovery mode to single-user + mode. Closes: 370110. + * Apply patch from Martin F. Krafft to implement + the lockold feature, which allows older kernel stanzas to be + automatically locked (pasword-protected). His work is based on a patch + by Dominic Hargreaves Closes: #120125. + + -- Otavio Salvador Mon, 5 Jun 2006 12:26:47 -0300 + +grub (0.97-9) unstable; urgency=low + + * Revert move of files to /usr/sbin 'cause it broke d-i. (reopen: #361929) + + -- Otavio Salvador Mon, 29 May 2006 15:21:56 -0300 + +grub (0.97-8) unstable; urgency=low + + [ Otavio Salvador ] + * Sync with CVS due to 20060529. + * Ack NMU: + - Regenerate control file. (closes: #360987) + * Use POSIX regexp to support more locales. Thanks to Hasso Tepper + for the patch. (closes: #361438, #352670) + * Fix doc-base files. Thanks to Russ Allbery for the + patch. (closes: #362993) + * Fix regexp to allow partitions later of hdg to work. Thanks to Andreas + John . (closes: #362658) + * Move update-grub and grub-install to /usr/sbin since they are intent + to be only in full system. (closes: #361929) + * Apply patch from Robert Millan to fix kFreeBSD issues. + (closes: #363698) + * Apply patch from Luca Capello to improve update-grub + output regarding to splash images. (closes: #368097) + + [ Leandro Dorileo ] + * Fix a typo in mkbimage.8. (closes: #277039) + + -- Otavio Salvador Mon, 29 May 2006 13:45:06 -0300 + +grub (0.97-7) unstable; urgency=low + + [ Kristian Edlund ] + * Added the feature of letting update-grub update the default entry when + a new kernel is installed. Done partly by applying a patch from Thomas + Braun (closes: #233966, #276477, #330083) + * Applied a patch from Vince Busam sort suffixes on + the kernel more detailed. (closes: #355790) + + [ Leandro Dorileo ] + * Changed grub-reboot to handle /boot in other partition. + (closes: #360041) + + -- Otavio Salvador Sat, 1 Apr 2006 09:43:24 -0300 + +grub (0.97-6) unstable; urgency=low + + [ Otavio Salvador ] + * Applied patch from Colin Watson to fix segfaults + in hardware that has NX bit available (amd64, for example). + (closes: #293722) + * Remove comment from grub-reboot since we'll have savedefault --once + back :-D + * Applied patch from Frans Pop to invert + convert_kernel26 logic. (closes: #353725) + * Change build-dependencie for amd64. (closes: #357287, #357286) + + [ Leandro Dorileo ] + * Reimplementation of savedefault --once. Now it reads and writes to + /boot/grub/default. + (closes: #254475, #341106, #341995, #353691, #355870, #342590) + + -- Otavio Salvador Tue, 28 Mar 2006 23:12:45 -0300 + +grub (0.97-5) unstable; urgency=HIGH + + [ Urgency set to HIGH since it broke LVM installations ] + + [ Otavio Salvador ] + * Applied patch from David Golombek to handle + DEB_BUILD_GNU_SYSTEM definition while building in sarge. + (closes: #351822, #350168) + * Fix device handling allowing LVM installation. (closes: #352654) + + -- Otavio Salvador Mon, 13 Feb 2006 21:19:09 -0200 + +grub (0.97-4) unstable; urgency=low + + [ Kristian Edlund ] + * Solved problems in update-grub so running the script will sort + the kernels the same way using dash or bash. (closes: #346544) + * Applied patch provided by Ole Janssen + to fix a problem when /boot is on an extra partion (closes: #346596) + * Fixed the problem with multiple splashimage lines, if there is a + splashimage outside the autoupdated part of the file. (closes: #341538, + #318706, #345208, #283308, #345346) + * Corrected the README.Debian to contain the right path if /boot + is on another partion. (closes: #281051) + + [ Otavio Salvador ] + * Don't convert /dev/mapper to new kernel 2.6 device scheme. + (closes: #347482) + + -- Otavio Salvador Thu, 19 Jan 2006 07:02:55 -0200 + +grub (0.97-3) unstable; urgency=low + + * Replace automake1.9 build-dependencie with automake1.8 to fix a FTBFS + issue. (closes: #344739, #346080) + * Redirect output to stderr. Thanks Bastian Blank for + a better solution. (closes: #344767, #346327) + * Add print_func.diff patch to beep in menu.lst. Useful for blind + people. Really thank up Osvaldo La rosa for the + patch. (closes: #314210) + * Applied patch provided by Kristian Edlund to fix + ordering kernel issues. (closes: #264312, #342221) + * Applied patch provided by Michal Cihar to allow + update-grub to run with dash. (closes: #346127) + + -- Otavio Salvador Mon, 9 Jan 2006 13:37:41 -0200 + +grub (0.97-2) unstable; urgency=low + + * Update debian/control. This caused the wrong NMU identification :( + * Disable fix_amd64_compile.diff since it broke amd64 building. (closes: #340849) + * Add message to show that grub-reboot isn't supported in this release anymore. + * Drop odirect.diff since it broke RAID disk detection. (closes: #341888) + * Applied patch from Piotr Roszatycki to + fix grub-install detection of RAID root device. (closes: #302359) + * Applied patch from Sven Joachim to fix some + typos on grub-floppy manpage. (closes: #342259) + + -- Otavio Salvador Thu, 22 Dec 2005 15:57:17 -0200 + +grub (0.97-1) unstable; urgency=low + + * New upstream release: (closes: #303967) + Patches: + - 2gb_limit.diff: resync; + - kfbsd_chainload.diff: dropped; not needed; + - fwritable-strings_remove.diff: dropped, merged upstream; + - console_current_color.diff: dropped, merged upstream; + - xsi_mkbimage.diff: dropped, merged upstream; + - smp-imps.diff: dropped, not needed; + - revert_grub-set-default.diff: dropped, not needed; + - savedefault.diff: disabled, don't apply anymore; (reopen: #195833) + - static_subfunc.diff: dropped, not needed; + Fixes: + - Fallback to a sane console if fail to set graphical mode; (closes: #267224) + * Doesn't output a error when no kernel is installed. (closes: #336730) + * Make update-grub output consistent. (closes: #336729) + * Applied patch from Antonio Kanouras + to remove bashism from update-grub and allow it to run with + dash. (closes: #337145) + * Add a watch file to be easier to identify upstream releases + * debian/patches/fix_amd64_compile.diff: Added. Ensure that we build in + 64bit mode in x86_64 arch. (closes: #337288) + * Start to use automake1.9 when building. + * Applied patch from Marco Amadori to + document, in menu.lst, to avoid _default saved_ option in case of + being use dmraid. + * Applied patch from Jason Thomas to give a example + how to use kernel options to specific kernel version. (closes: #338371) + * Applied patches from Andrew Stribblehill and Tony + Mancill to fix grub-floppy to don't falsely + reports "stage1" as missing. (closes: #288678) + * Applied patch from Free Ekanayaka to allow custom + title name in menu.lst. (closes: #298110, #138318) + * Applied patch from Georg Wittenburg to + allow specific options to default entry. (closes: #266101) + * Fix documentation installing. (closes: #339687) + * Clean the source code. (closes: #340656) + * Patches stolen from other vendors: + - [SuSE] initrd_max_address.diff: added. This change the max address + to host initrd image and add a safe default value in case of failure; + - [Fedora] splashimage_help.diff: added. Add documentation about + splashimage option; (closes: #200269) + - [Fedora] grub-install_addsyncs.diff: added. Ensure that filesystem + caches are flushed; + - [Fedora] geometry-26kernel.diff: added. Add geometry detection since + kernel 2.6 doesn't do that anymore, for IDE devices; + - [Fedora] odirect.diff: added. Use O_DIRECT to avoid cache issues. + - [Mandriva] graphics.diff: updated; + + -- Otavio Salvador Thu, 24 Nov 2005 22:52:31 -0200 + +grub (0.95+cvs20040624-19) unstable; urgency=low + + * Applied patch to fix a typo on update-grub script. (closes: #336573) + + -- Otavio Salvador Mon, 31 Oct 2005 18:54:39 -0200 + +grub (0.95+cvs20040624-18) unstable; urgency=low + + * Fix update-grub to handle the case when /boot is in another partition + then /. (closes: #280086, #261936) + * Fix update-grub to don't fail when called from /usr/bin. (closes: #321072) + * Applied patch from Martin Michlmayr to not generate + trailing white space. (closes: #310030) + * Applied patch from Y Giridhar Appaji Nag to fix + FTBFS due invalid storage class for function. (closes: #318539) + * Remove code to use gcc-3.4 in case of x86-64 architecture since we now + use gcc-4.0 as default compiler. + * fwritable-strings_remove.diff: New. Remove -fwritable-strings from + Makefiles to allow the build with GCC 4.0. + * Change code to handle architectures to be compatible with new dpkg + versions but maintaining it backward compatible to make easier to + backport it to stable. (closes: #335038) + * Clean up doc directory in clean targe of rules. + * Bump Standards-Version to 3.6.2.1 (no changes need). + * Add myself in Uploaders field. + * Remove Robert Millan from Uploaders field as + requested by him. + * Applied patch from Jason Thomas to remove the use + of awk. (closes: #266243) + * Applied patch from Jens Kubieziel to fix a typo in + update-grub script. (closes: #333181, #306255) + * Add gen-control target in rules and remove the control update from + clean target since it isn't allowed in Debian Police anymore. + * Update FSF address in copyright file. + + -- Otavio Salvador Sat, 29 Oct 2005 14:14:27 -0200 + +grub (0.95+cvs20040624-17) unstable; urgency=low + + * update-grub: fix sort order of new 4 digit kernel versions. + (closes: #304841) + + -- Jason Thomas Tue, 19 Apr 2005 09:38:07 +1000 + +grub (0.95+cvs20040624-16) unstable; urgency=low + + * update-grub: fix kopt parsing to handle + signs in kernel versions + (closes: #299528) + * update-grub: fix variable parsing in get_kernel_opt function. + (closes: #296724) + * update-grub: don't add savedefault entry to memtest86 entries. + (closes: #291733) + * update-grub: fixed spelling mistake + (closes: #283072) + * update-grub: remove temp files + (closes: #284731) + * grub-floppy: fixed shell expansion + finally a nice patch from "Clement 'nodens' Hermann" + (closes: #278529) + + -- Jason Thomas Sun, 20 Mar 2005 10:25:41 +1100 + +grub (0.95+cvs20040624-15) unstable; urgency=low + + * update-grub: fix kopt parsing to support -anything kernel versions. + (closes: #295749) + + -- Jason Thomas Fri, 18 Feb 2005 10:20:31 +1100 + +grub (0.95+cvs20040624-14) unstable; urgency=low + + * update-grub: add support for raid1 + (closes: #292274) + + -- Jason Thomas Fri, 4 Feb 2005 13:28:53 +1100 + +grub (0.95+cvs20040624-13) unstable; urgency=high + + * patches/grub-special_device_names.diff: add support for special devices. + (closes: #290098) + + -- Jason Thomas Mon, 17 Jan 2005 09:29:18 +1100 + +grub (0.95+cvs20040624-12) unstable; urgency=low + + * update-grub should look for memtest86 in /boot + (closes: #229649) + * Add support for memtest86+ to update-grub + (closes: #282530) + + -- Jason Thomas Tue, 23 Nov 2004 10:07:30 +1100 + +grub (0.95+cvs20040624-11) unstable; urgency=low + + * Added support for LABEL/UUID to update-grub. + (Closes: #211096, #215116) + * Added support for 4 digit kernel version to update-grub. + (Closes: #266049) + * Added support for memtest86 to update-grub. + (Closes: #229649) + * Fixed update-grub to detect default and previous kernels correctly. + (Closes: #230136, #240599, #250545, #268141) + * Update-grub now ignores .dpkg-* + (Closes: #265915) + * Added support for fat_stage1_5 to linux build. + (Closes: #281652) + * Removed e2fsprogs from Build-Depends-Indep as it is an Essential package. + + -- Jason Thomas Fri, 19 Nov 2004 09:40:53 +1100 + +grub (0.95+cvs20040624-10) unstable; urgency=medium + + * Fixes to build on x86_64 cpus. Thanks Andreas Jochens. (Closes: #250225) + - control.in (Build-Depends): Add ia32-libs [@x86_64@], gcc-3.4 [@x86_64@] + - rules + * update-grub: detect and handle splash images. Thanks Nathaniel McCallum. + (Closes: #261936) + * patches/raid_cciss.diff: Add analogous support for IDA devices. + Thanks Piotr Roszatycki. (Closes: #265027) + + -- Robert Millan Thu, 14 Oct 2004 02:18:15 +0200 + +grub (0.95+cvs20040624-9) unstable; urgency=low + + * patches/kfreebsd.diff: New. Support for direct loading of kFreeBSD. + Thanks Guillem Jover. + + -- Robert Millan Fri, 1 Oct 2004 21:45:13 +0200 + +grub (0.95+cvs20040624-8) unstable; urgency=low + + * patches/2gb_limit.diff: New. Fix problem with systems with more than + 2 GB memory (notably, x86_64-based systems). Thanks Goswin Brederlow. + + -- Robert Millan Sat, 14 Aug 2004 19:29:55 +0200 + +grub (0.95+cvs20040624-7) unstable; urgency=low + + * patches/xfs_freeze.diff: New. Fix grub-install for XFS. (Closes: #239111) + * update-grub: s/local tmp//g. Thanks again, David. (Closes: #261570) + * patches/raid_cciss.diff: New. Support for CCISS devices. (Closes: #261447) + * Use type-handling to auto-generate dpkg archlist for i386 cpus. + - control.in: New. Set 'Architecture: @i386@' and add type-handling to + Build-Depends. + - rules: Auto-generate debian/control in clean target. + + -- Robert Millan Mon, 26 Jul 2004 23:39:43 +0200 + +grub (0.95+cvs20040624-6) unstable; urgency=low + + * Fix XSI-isms in update-grub and mkbimage. Thanks David Weinehall. + (Closes: #256100) + - patches/xsi_mkbimage.diff: New. Fix util/mkbimage. + - update-grub + * rules: Select only filesystems supported natively in Debian for installing + ${fs}_stage1_5 files (non-native filesystems are supported in stage2). + * Fix syntax error introduced in previous upload. + - patches/raid.diff + - update-grub + + -- Robert Millan Fri, 23 Jul 2004 00:49:10 +0200 + +grub (0.95+cvs20040624-5) unstable; urgency=low + + * Fix update-grub and grub-install for d-i installs on RAID hardware. + Thanks Charles Steinkuehler. (Closes: #259238) + - patches/raid.diff: New. Fix util/grub-install.in. + - update-grub + + -- Robert Millan Wed, 21 Jul 2004 01:03:34 +0200 + +grub (0.95+cvs20040624-4) unstable; urgency=low + + * rules: + - Make build not depend on build-indep. (Closes: #258643) + - Use stage2_eltorito for building cdrom image. + * control: + - Make grub suggest grubconf. + - Merge Build-Depends in a single line to keep lintian happy. + - s/Grub-Devel/Grub Maintainers/g with the same goal. + + -- Robert Millan Mon, 12 Jul 2004 14:09:29 +0200 + +grub (0.95+cvs20040624-3) unstable; urgency=low + + * rules: Nuke --exec-prefix and replace the install target prefix overrides + with DESTDIR override, in order to fix grub-install breakage. + As a side effect, this moves /usr/lib/grub to /lib/grub (which happens + to fix FHS compliance ;) + * grub-floppy: Cope with that. + + -- Robert Millan Sat, 26 Jun 2004 04:07:39 +0200 + +grub (0.95+cvs20040624-2) unstable; urgency=low + + * update-grub: Really apply Kiko's patch. (Realy closes: #224441) + + -- Robert Millan Sat, 26 Jun 2004 02:15:06 +0200 + +grub (0.95+cvs20040624-1) unstable; urgency=low + + * New upstream snapshot. (Closes: #254433) + - Fixes FTBFS in UFS2 code. (Closes: #253945) + - Resync all patches. + - patches/revert_grub-set-default.diff: New. Revert to old interface in + setdefault, untill we implement --once with the new one. + * FHS compliance for stage files. + - rules: Unset --datadir. + - rules: s|/usr/lib/grub|/lib/grub|g. + - grub-floppy: Likewise. + - patches/02grub-doco-path.patch: Nuked. Merged in upstream. + * update-grub: Fix ordering by Linux version for test/rc/ac/pre. + Gràcis Kiko Piris. (Closes: #224441) + * update-grub: Minor k*bsd-related portability fixes. + + -- Robert Millan Thu, 24 Jun 2004 16:56:19 +0200 + +grub (0.94+cvs20040511-1) unstable; urgency=low + + * New upstream snapshot. + * patches/ufs2.diff: New. Add UFS2 support. (Closes: #212340) + - patches/graphics.diff: Resync. + * control (Build-Depends): Moved e2tools, e2fsprogs and mkisofs to + Build-Depends-Indep (they are only needed for grub-disk). + * control (Build-Depends): Bump debhelper dependency to >= 4. + + -- Robert Millan Tue, 11 May 2004 22:13:15 +0200 + +grub (0.94+cvs20040429-1) unstable; urgency=low + + * New upstream snapshot. (Closes: #245350) + - patches/*.diff: Resync. + - Syntax fixes in mkbimage. Thanks Yann Dirson. (Closes: #239066, #242319) + - Includes CDROM support (at last!). (Closes: #154534) + - Fixes for kernel of FreeBSD 5.x. (Closes: #216875) + * Migrating to automake 1.8. + - control (Build-Depends): s/1.7/1.8/g + - rules: Ditto. + + -- Robert Millan Thu, 29 Apr 2004 21:15:59 +0200 + +grub (0.93+cvs20031021-8) unstable; urgency=high + + * debian/update-grub: Fix initrd entry generation. Thanks Jean Charles + Delepine. (Closes: #224853). + * Set Maintainer to mailing list. + - debian/control (Maintainer): Set to pkg-grub-devel@lists.alioth.d.o. + - debian/control (Uploaders): Add Jason. + + -- Robert Millan Tue, 6 Jan 2004 21:34:29 +0100 + +grub (0.93+cvs20031021-7) unstable; urgency=low + + * debian/update-grub: more missing quotes in get_kernel_opt func + + -- Jason Thomas Thu, 11 Dec 2003 11:26:51 +1100 + +grub (0.93+cvs20031021-6) unstable; urgency=low + + * debian/update-grub: was generating mangled menu.lst due to missing quotes + around arguments to function. + (closes: #222411, #222738, #222789, #222800) + + -- Jason Thomas Wed, 10 Dec 2003 10:01:40 +1100 + +grub (0.93+cvs20031021-5) unstable; urgency=low + + * debian/update-grub: fixed to handle seperate /boot partition. + (closes: #219833) + + -- Jason Thomas Thu, 20 Nov 2003 11:52:02 +1100 + +grub (0.93+cvs20031021-4) unstable; urgency=low + + * debian/update-grub: fixed bug introduced by patch below. + (closes: #221395) + * patches/00list: disabled update-grub-linux2.6.diff as it is now permanetly + applied. will delete it later. + * debian/grub-reboot: add --version parameter + * created manpage for grub-reboot. + * debian/rules: moved compat version to debian/compat and made version 4 + * debian/rules: moved multiple install lines to grub.install for use by + dh_install + * debian/rules: updated to closely match what dh_make produces for multi + binary packages. so added binary-common target and install-arch targets. + * debian/control: updated standards-version to 3.6.1.0 + + -- Jason Thomas Tue, 18 Nov 2003 14:04:01 +1100 + +grub (0.93+cvs20031021-3) unstable; urgency=low + + * Provide an iso9660 CD image with grub-disk + - control (Build-Depends): Add mkisofs. + - rules: Uncomment and misc fixes in mkisofs commands. + + -- Robert Millan Sat, 15 Nov 2003 19:53:46 +0100 + +grub (0.93+cvs20031021-2) unstable; urgency=low + + * Added "one-time savedefault" feature, thanks to Keir Freser for his + patch. (Closes: #195833) + - patches/savedefault.diff: New. + - patches/00list: Add it. + * Wrote script for "lilo -R" like functionality, using the feature above). + (Closes: #155807) + - grub-reboot: New. + - rules: Install grub-reboot. + * rules: Move mkbimage to /bin since non-root may also use it now. + + -- Robert Millan Wed, 5 Nov 2003 13:20:03 +0100 + +grub (0.93+cvs20031021-1) unstable; urgency=low + + * New upstream snapshot. + - patches/automake.diff: Nuked. + - patches/graphics.diff: Update. + * patches/menu.lst_gnu-hurd.diff: New. Clarify GNU/Hurd entry. + * patches/update-grub_linux2.6.diff: New. Support different options for + Linux 2.6. Thanks Michal Cihar. (Closes: #208051) + * rules (clean): Remove config.log. + + -- Robert Millan Tue, 21 Oct 2003 14:41:08 +0000 + +grub (0.93+cvs20031008-1) unstable; urgency=low + + * New upstream snapshot. + - mkbimage: Nuked. + - rules: install mkbimage from util/mkbimage. + - patches/04ext2_msdos.patch: Nuked. + - patches/00list: Update. + * Update autotools. (Closes: #212092) + - patches/automake.patch: New. + - patches/00list: Add it. + - control: Build-Depend on automake1.7 and autoconf (2.5x). + - rules: Use automake1.7 and autoconf (2.5x). + * Chainload fix for KFreeBSD. (Closes: #201760) + - patches/07kfbsd_chainload.patch: Rename to.. + - patches/kfbsd_chainload.diff: This. + - patches/00list: Enable it. + * grub-doc.install: Add '\n'. + * patches/01misc_doc.patch: Commented. + + -- Robert Millan Wed, 8 Oct 2003 20:49:58 +0000 + +grub (0.93+cvs20030905-2) unstable; urgency=low + + * rules (clean): Get rid of config.{log,status} hack. + * Reapplied graphics patch. (Closes: #209068) + - patches/graphics.diff: New. + - patches/00list: Add graphics.diff. + * Generate autotools stuff dynamicaly (for graphics.diff to take effect). + - control (Build-Depends): Add automake1.5 and autoconf2.13. + - rules (configure): Run aclocal-1.5 && automake-1.5 && autoconf2.13. + + -- Robert Millan Tue, 9 Sep 2003 17:31:06 +0000 + +grub (0.93+cvs20030905-1) unstable; urgency=low + + * New upstream snapshot. + - debian/patches/06bsd_menu.lst.patch: Nuked (merged in upstream). + * build-indep split. + - debian/rules: Split build-indep stuff into build-indep target. + - debian/control: Move texi2html to Build-Depends-Indep. + - debian/rules: Moved grub-doc html install to grub-doc.install. + - debian/grub-doc.install: New. + * debian/grub-floppy: Use /bin/echo which supports -e. (Closes: #208216) + * debian/patches/01misc_doc.patch: New. Extracted from debian diff.gz. + What is it? :) + * debian/patches/04ext2_msdos.patch: New. Fix ext2fs detected as msdos, + patch from upstream. (Closes: #175358) + * Add 00list support in patch system; patches are now selectable. + - debian/patches/00list: New. + - debian/rules (patch): Use 00list for patch selection. + * debian/patches/00list: Disable 07kfbsd_chainload.patch, since it's causing + FTBFS. Will ask for a review. (Reopens: #201760) + * debian/rules (clean): Remove config.{log,status} to fix possible FTBFS in + autobuilders. Should be fixed in upstream Makefiles. + + -- Robert Millan Fri, 5 Sep 2003 03:05:56 +0000 + +grub (0.93+cvs20030813-4) unstable; urgency=low + + * update-grub: abort function is called from find_grub_dir so needs to be + declared above this. + (closes: #206134) + * removed resolve_symlink function in favour of the readlink from the + coreutils package. Thanks to Steven Barker + (closes: #205726) + + -- Jason Thomas Tue, 19 Aug 2003 10:24:54 +1000 + +grub (0.93+cvs20030813-3) unstable; urgency=low + + * added patch to make chainloading FreeBSD work when using the graphic mode. + thanks to Carlos Liu + (closes: #201760) + + -- Jason Thomas Thu, 14 Aug 2003 10:53:33 +1000 + +grub (0.93+cvs20030813-2) unstable; urgency=low + + * update-grub: we need to have initial values for menu.lst in case they + where accidentally removed from the menu.lst + (closes: #188084) + + -- Jason Thomas Wed, 13 Aug 2003 14:41:24 +1000 + +grub (0.93+cvs20030813-1) unstable; urgency=low + + * New CVS snapshot + - resolves symlinks for devices + (closes: #204991, #189815, #181243) + - support for --no-floppy with grub-install + (closes: #199470) + + * update-grub: added function to resolve symlinks. + other places in the script that were doing this now use this function. + default/previous now handle absolute symlinks. + + -- Jason Thomas Wed, 13 Aug 2003 12:44:17 +1000 + +grub (0.93+cvs20030624-6) unstable; urgency=low + + * update-grub was using '==' for comparsion in some places which is wrong. + (closes: #189253, #204331) + * update-grub now resolves root device if its a symlink + * update-grub now resolves symlinks for default/previous kernels and put in + the verison number. + + -- Jason Thomas Tue, 12 Aug 2003 14:34:25 +1000 + +grub (0.93+cvs20030624-5) unstable; urgency=low + + * added new package grub-disk which provides a 1.44meg bootable image. + (closes: #190392) + * debian/update-grub: added patch to fix sorting of kernels + (closes: #187006) + * debian/control: added Robert Millan to Uploaders + + -- Jason Thomas Fri, 1 Aug 2003 12:44:50 +1000 + +grub (0.93+cvs20030624-4) unstable; urgency=low + + * updated update-grub, to support a default and previous kernel image. + using /boot/vmlinuz and /boot/vmlinuz.old. + + -- Jason Thomas Fri, 1 Aug 2003 10:57:43 +1000 + +grub (0.93+cvs20030624-3) unstable; urgency=low + + * Updated mkbimage, from upstream plus patch from Robert Millan + (closes: #200282) + + -- Jason Thomas Mon, 7 Jul 2003 14:03:21 +1000 + +grub (0.93+cvs20030624-2) unstable; urgency=low + + * debian/control: added freebsd and netbsd arches + * docs/menu.lst: added patch to update this with examples for freebsd and + netbsd. + (closes: #199301) + + -- Jason Thomas Mon, 30 Jun 2003 07:46:21 +1000 + +grub (0.93+cvs20030624-1) unstable; urgency=low + + * New CVS snapshot. + * Fixes FTBFS with gcc-3.3 + (closes: #195234) + + -- Jason Thomas Tue, 24 Jun 2003 07:35:30 +1000 + +grub (0.93+cvs20030224-2) unstable; urgency=low + + * applied patch to mkbimage which fixes it for other filesystems types, + thanks to Carlo Contavalli. + (closes: #182646) + * update-grub should not go looking for a root device and friends if we + already have a menu.lst file as it will have all the info we need in it. + * update-grub does not try to calculate the grub root device if we don't + have a device.map file or if /boot is the root dir + (closes: #182504) + + -- Jason Thomas Thu, 27 Feb 2003 12:13:46 +1100 + +grub (0.93+cvs20030224-1) unstable; urgency=low + + * New CVS snapshot. + - upstream fixed a bug in grub-install caused by new sed. + (closes: #182071) + + -- Jason Thomas Mon, 24 Feb 2003 12:58:53 +1100 + +grub (0.93+cvs20030217-1) unstable; urgency=low + + * New CVS snapshot. + * Allow mkbimage to be installed into different dir on gnu systems, thanks + to Robert Millan. + (closes: #160912) + * Fixed error in mkbimage script, thanks to Bruce Edge. + (closes: #176607) + * This could bite me in that ass later, but update-grub now figures out the + root_device and grub_device. + (closes: #110431) + * update-grub now prints each kernel that it finds. + * more info about splashimages in README.Debian, thanks to Jeronimo + Pellegrini + (closes: #176055) + * update-grub can now run can now be run noninteractively. + (closes: #158485) + * forgot to close a bunch of bugs todo with splashimage last upload. + (closes: #121083, #116965, #118701) + + -- Jason Thomas Mon, 17 Feb 2003 11:45:45 +1100 + +grub (0.93+cvs20030102-1) unstable; urgency=low + + * New CVS snapshot + automake patch + splashimage patch + * It was necessary to apply the automake and splashimage patches before + creating the tarball, so I would not need to run automake and autoconf + from the build scripts. + + -- Jason Thomas Thu, 9 Jan 2003 14:26:20 +1100 + +grub (0.92+cvs20021128-1) unstable; urgency=low + + * New CVS snapshot. + * removed 01force-lba.patch which is no longer needed + + -- Jason Thomas Mon, 28 Oct 2002 12:52:42 +1100 + +grub (0.92+cvs20020923-1) unstable; urgency=low + + * CVS snapshot, fixes: + - /dev/root problem with devfs. + - kernel to big for memory problem. + - -no-curses option causes bad output. + (closes: #154543, #153978, #136766) + * remove patch 04device.map_dup.patch, not needed now! + + -- Jason Thomas Fri, 23 Aug 2002 10:40:09 +1000 + +grub (0.92-4) unstable; urgency=low + + * update-grub now handles rc kernels thanks to Decklin Foster. + (closes: #155455) + + -- Jason Thomas Sat, 17 Aug 2002 09:55:26 +1000 + +grub (0.92-3) unstable; urgency=low + + * added 01force-lba.patch to fix grub install when --force-lba is specified + (closes: #152420) + * added 04device.map_dup.patch which checks for duplicates in the device.map + (closes: #147109) + * update-grub now writes the implied boot line to menu.lst + (closes: #150570) + * fixed typo in README.Debian, fdo should be fd0 + (closes: #151476) + + -- Jason Thomas Wed, 10 Jul 2002 10:22:58 +1000 + +grub (0.92-2) unstable; urgency=low + + * added 05hurd-boot.patch again, which was still needed. + (closes: #145673) + * fixed typo in update-grub manpage. + (closes: #146318) + * added info about splashimage to README.Debian + (closes: #145418) + + -- Jason Thomas Thu, 9 May 2002 10:36:47 +1000 + +grub (0.92-1) unstable; urgency=low + + * New upstream release + * removed the following unneeded patches: + 04xfs_md5_serial.patch + 05hurd-boot.patch + 06xfs_savedefault.patch + + -- Jason Thomas Wed, 1 May 2002 15:17:56 +1000 + +grub (0.91-6) unstable; urgency=low + + * patch from upstream for xfs and jfs savedefault. Thanks to Ian Cumming. + + -- Jason Thomas Tue, 23 Apr 2002 11:33:51 +1000 + +grub (0.91-5) unstable; urgency=low + + * update-grub now adds more comments to the generated menu.lst file. + error messages are more verbose. + makes a back up copy of the existing menu.lst + (closes: #142961) + * some updates to README.Debian thanks to Grant Bowman. + (closes: #142959) + * correct example menu.lst patch for booting the hurd + (closes: #142362) + + -- Jason Thomas Thu, 18 Apr 2002 08:57:23 +1000 + +grub (0.91-4) unstable; urgency=low + + * fix to make mkbimage create a node directory, from Robert Millan + (closes: #142211) + + -- Jason Thomas Thu, 11 Apr 2002 08:26:20 +1000 + +grub (0.91-3) unstable; urgency=low + + * removed special mention of xfs and jfs from README.debian since they are + now in upstream tarball. also fixed small typo + (closes: #130526) + * updated the example menu.lst to have current boot method for GNU/Hurd + (closes: #141048) + * added mkbimage + (closes: #121640) + + -- Jason Thomas Thu, 4 Apr 2002 16:29:21 +1000 + +grub (0.91-2) unstable; urgency=low + + * added patch from upstream which fixes a typo in the makefile that broke + xfs support, md5crypt, serial support and hercules support + + -- Jason Thomas Mon, 4 Feb 2002 15:35:01 +1100 + +grub (0.91-1) unstable; urgency=low + + * New upstream release + (closes: #130272) + * removed the following unneeded patches: + 00grub-dac960.patch + 01grub-devfs-floppy.patch + 04grub-jfs+xfs-0.9-build.patch + 05grub-jfs+xfs-0.9-core.patch + 06grub-hide-unhide.patch + 07grub-md5-crypt.patch + 08grub-mkreiserfs.patch + 09grub-sigwinch.patch + * added info about *bsd's to README.Debian + * removed mention of bsd from the description for now as they are not + properly supported. + + -- Jason Thomas Wed, 23 Jan 2002 13:02:44 +1100 + +grub (0.90-19) unstable; urgency=low + + * typo in update-grub which caused an syntax error with ash. + (closes: #126174) + + -- Jason Thomas Wed, 2 Jan 2002 09:02:42 +1100 + +grub (0.90-18) unstable; urgency=low + + * add patch from upstream to ignore SIGWINCH. + (closes: #122905) + * update-grub now allows you to control howmany kernels will be added + to the menu.lst + (closes: #123038) + + -- Jason Thomas Mon, 10 Dec 2001 10:15:42 +1100 + +grub (0.90-17) unstable; urgency=low + + * kernel sorting function in update-grub now handles other kernel suffixes + it doesn't know about properly + (closes: #122013) + * fixed blank line that had a 'tab' in it, in the rules file + (closes: #121955) + * only look for update-grub configuration options between the magic markers. + (closes: #121320) + + -- Jason Thomas Sat, 8 Dec 2001 16:32:28 +1100 + +grub (0.90-16) unstable; urgency=low + + * added new function to update-grub which looks for the various formats of + initrd images, looks like we have a new name initrd.img. this currently + supports 'initrd', 'initrd.img', 'initrd-lvm' and those three with .gz. + (closes: #116153, #121084) + + -- Jason Thomas Mon, 26 Nov 2001 09:19:25 +1100 + +grub (0.90-15) unstable; urgency=low + + * fixed a cosmetic error message in the update-grubs new function to sort + the kernels + * added a y to Crispins last name in the changelog below. Sorry! + * initrd line in update-grub was missing the version string. + (closes: #120196) + + -- Jason Thomas Tue, 20 Nov 2001 08:01:53 +1100 + +grub (0.90-14) unstable; urgency=low + + * I broke update-grub on /boot partitions + "sed -e" is not the same as "sed -ne" + changed it to use basename instead of sed, a few variable name changes + (closes: #119453, #119455) + * added suport allow multiple alternative boot options + * added 'lockalternatives' to support locking of alternative boot options + so no we have 'alternatives', 'lockalternatives' and 'altoptions' + * updated the man page to reflect the above changes + * added a function from Crispin Flowerday which sorts the kernels properly + by weighting the kernels by their suffix, being 'ac', 'pre' or nothing. + (closes: #103437) + + -- Jason Thomas Fri, 16 Nov 2001 15:19:06 +1100 + +grub (0.90-13) unstable; urgency=low + + * 0.90-11 closes the wrong bug should have been 113460 not 114360. + (closes: #113460) + * new option for update-grub to allow alternative boot options, rather than + just the recovery option, Thanks to Marc Haber. + * added some examples to the menu.lst output by update-grub. + * updated update-grub man page to reflect the above change. + * added initrd info about ramdisk size to README.Debian. + (closes: #117252) + * added support to update-grub for saveddefault, see grub doc. + * added more explanation about default to update-grub generated menu.lst + * added support to update-grub to lock for the alternative boot option, see + grub doc. + (closes: #116988) + * updated update-grub man page to reflect the above change. + + -- Jason Thomas Fri, 9 Nov 2001 10:05:09 +1100 + +grub (0.90-12) unstable; urgency=low + + * changed naming scheme for debian/patchs/* so they can be applied and + reversed safely. + * added patch to fsys_reiserfs.c which enables booting on newer reiserfs + partitions. + + -- Jason Thomas Sun, 21 Oct 2001 11:27:02 +1000 + +grub (0.90-11) unstable; urgency=low + + * fixed update-grub to sort kernels better. Thanks to Matthew Mueller + (closes: #113460) + * added a mention about grub-doc package in README.Debian (closes: #116095) + + -- Jason Thomas Fri, 19 Oct 2001 07:51:53 +1000 + +grub (0.90-10) unstable; urgency=low + + * added --disable-auto-mem-opt to configure options in debian/rules + this option stops grub from automatically adding a mem= option to + the kernel command line. From discussions on the grub mailing list + adding this option should not cause any problems. + (closes: #110793) + * added a quick setup section to README.Debian + * debian/rules commented out dh_installman in binary-indep + * debian/rules commented out dh_installinfo in binary-dep + * update-grub should work on systems that have the grub directory + mounted under /boot (closes: #113380) + + -- Jason Thomas Tue, 25 Sep 2001 08:59:25 +1000 + +grub (0.90-9) unstable; urgency=low + + * more patches + * patch to support DAC960 raid controller (closes: #104558) + * patch to support hide and unhide of logical partitions + * updated devfs-floppy.patch to not conflict with DAC960 patch + + -- Jason Thomas Fri, 31 Aug 2001 10:46:55 +1000 + +grub (0.90-8) unstable; urgency=low + + * okay i fixed up authors in debian/copyright to be less ugly. + * added patches to support jfs and xfs, + http://tzukanov.narod.ru/grub-jfs_xfs/ + * added info about theses patches to debian/README.debian + * updated md5-crypt patch to work with the jfs/xfs patches + + -- Jason Thomas Wed, 29 Aug 2001 16:38:45 +1000 + +grub (0.90-7) unstable; urgency=low + + * added support to debian/rules to handle appling patches to upstream + source + * added debian/patches directory which is used to hold the patches + * modified update-grub to output more comments to the menu.lst and + modified util/grub-install.in to output more info on what it does in + the usage, which will inturn be added to the grub-install.8 manpage + (closes: #110152) + * updated standards-version to 3.5.6 + * changed dashes to underscores in changelog for + emacs add_log_mailing_address to remove lintian warning + * added to debian/rules generation of manpages, + grub.8, grub-install.8, grub-md5-crypt.8 and mbchk.1. + * some tidying up in debian/rules file + * changed "Upstream Author(s)" to "Author(s)" in debian/copyright + to remove lintian error. + * changed debian/README.Debian to mention update-grub manpage + * changed debian/rules so clean does not nuke texinfo.tex from doc dir + + -- Jason Thomas Mon, 27 Aug 2001 15:35:34 +1000 + +grub (0.90-6) unstable; urgency=low + + * added a shell script (grub-floppy) for creating a grub boot floppy + * added a manpage for the above script. + + -- Jason Thomas Fri, 17 Aug 2001 10:38:49 +1000 + +grub (0.90-5) unstable; urgency=low + + * patched stage2/Makefile.am to build md5cyrpt support, from upstream + cvs (closes: #106407) + + -- Jason Thomas Thu, 2 Aug 2001 16:32:52 +1000 + +grub (0.90-4) unstable; urgency=low + + * patched update-grub to correctly generate the initrd line (closes: #106807) + + -- Jason Thomas Sat, 28 Jul 2001 00:10:59 +1000 + +grub (0.90-3) unstable; urgency=low + + * updated grub doc to show correct location of arch specific files + thanks to Carlos Valdivia Yague + * add Build-Depends on libncurses5-dev | libncurses-dev (closes: #105557) + * added recovery option to update-grub, if recovery=false is set in + menu.lst update-grub will not create the recovery lines in menu.lst + * updated update-grub man page to reflect above. + + -- Jason Thomas Mon, 23 Jul 2001 18:07:30 +1000 + +grub (0.90-2) unstable; urgency=low + + * patched grub-install to handle devfs when making a boot floppy. + thanks to upstream OKUJI Yoshinori + + -- Jason Thomas Fri, 13 Jul 2001 21:30:33 +1000 + +grub (0.90-1) unstable; urgency=low + + * New upstream release + * removed mention of version from doc-base files so there is no + need to update with each new release + + -- Jason Thomas Fri, 13 Jul 2001 09:20:59 +1000 + +grub (0.5.96.1.cvs20010530-7) unstable; urgency=low + + * patched update-grub to detect /boot on seperate partition + thanks to Aaron Schrab (closes: #103082, #103662) + * patched update-grub to support loading of ramdisks, + thanks to Francis J. Lacoste (closes: #103498) + + -- Jason Thomas Tue, 10 Jul 2001 12:53:19 +1000 + +grub (0.5.96.1.cvs20010530-6) unstable; urgency=low + + * add postrm_hook to README.debian + * corrected bad grammar and other stuff in the manpage, + thanks to David B. Harris + + -- Jason Thomas Tue, 19 Jun 2001 13:23:35 +1000 + +grub (0.5.96.1.cvs20010530-5) unstable; urgency=low + + * fixed bashism in update-grub, "echo -e". (closes: #101378) + + -- Jason Thomas Tue, 19 Jun 2001 12:06:08 +1000 + +grub (0.5.96.1.cvs20010530-4) unstable; urgency=low + + * fixed the doc-base stuff. (closes: #101305) + + -- Jason Thomas Mon, 18 Jun 2001 19:05:27 +1000 + +grub (0.5.96.1.cvs20010530-3) unstable; urgency=low + + * moved grub binaries and scripts to /sbin from /usr/sbin (closes: #100854) + * added update-grub script which generates menu.lst. + * removed gen-menu.sh example, now we have update-grub + * added manpage for update-grub. + * added instructions for adding update-grub to kernel-img.conf in + README.Debian + + -- Jason Thomas Mon, 18 Jun 2001 14:21:55 +1000 + +grub (0.5.96.1.cvs20010530-2) unstable; urgency=low + + * moved html doco in grub-doc from /usr/share/doc/grub-doc/ to + /usr/share/doc/grub-doc/html/ + * added support for doc-base + * moved the info files from grub to grub-doc. + * use dh_installinfo so that info files are registered (closes: #100484) + * added example menu generation script, thanks to + Wichert Akkerman (closes: #86750) + * removed add_log_mailing_address from bottom of changelog + * updated standards version + + -- Jason Thomas Tue, 12 Jun 2001 12:50:40 +1000 + +grub (0.5.96.1.cvs20010530-1) unstable; urgency=low + + * New cvs snapshot + * Upstream has removed the debian specific files from cvs. + * Corrected the Sections in the Control file for each package. + * Corrected documentation to reflect change of directory for arch + specific files. (closes #99429) + + -- Jason Thomas Fri, 1 Jun 2001 12:03:41 +1000 + +grub (0.5.96.1.cvs20010528-1) unstable; urgency=low + + * New Maintainer (closes: #80394) + * updated standards version. + * changed to use debhelper. + * move html doco into a seperate grub-doc package. + * Took a cvs snapshot to help close a bunch of bugs. + * cvs snapshot fixes grub-install (closes: #75333, #80276, #98750) + * cvs snapshot should fix "Error 22: No such partition" (closes: #80241) + * cvs snapshot should fix symlink problem (closes: #95594) + * grub supports /boot as seperate partition (closes: #78471) + * grub supports devfs already (closes: #72346) + * Changed dir of architecture specific files to /usr/lib (closes: #72311) + * texi2html problem fixed in previous NMU (closes: #80422) + * kernel-package supports kernel images in /boot (closes: #74429) + * the current method for a temporary modification of a menu option is + to press 'e' for edit. I think this is satisfactory. (closes: #35849) + * update-grub is in the progeny package of grub + please contact them (closes: #92269) + + -- Jason Thomas Mon, 28 May 2001 17:04:44 +1000 + +grub (0.5.96.1-0.1) unstable; urgency=low + + * Non Maintainer Update by Ralf Treinen + * added build-dependencies: texi2html (bug #80394) + * applied patch of bug report # 80394: insert blank after "-I" option + to texi2html in rules file (thanks to Matt Zimmerman ) + + -- Ralf Treinen Sat, 24 Feb 2001 23:09:55 +0100 + +grub (0.5.96.1) unstable; urgency=low + + * We lied: this release is to fix some important bugs before 1.0. + * Open devices with O_RDWR in the grub shell. (closes:bug#73654) + * Stricter Linux kernel command line passing. (closes:bug#74618) + * Linux devfs support added to the grub shell. (closes:bug#74740) + + -- Gordon Matzigkeit Mon, 16 Oct 2000 12:43:30 -0600 + +grub (0.5.96) unstable; urgency=low + + * Many, many new features and bugfixes. This is the final test release; + the next release will be version 1.0. + * Install HTML documentation in addition to Info pages. + (closes:bug#42242,bug#42273) + * Fix documentation to refer to /usr/sbin/grub as well as + /sbin/grub. (closes:bug#67132) + * Be more verbose about missing setup files. (closes:bug#71661) + + -- Gordon Matzigkeit Wed, 4 Oct 2000 10:44:42 -0600 + +grub (0.5.95) unstable; urgency=low + + * ReiserFS support from Jochen Hoenicke. + * `--disable-lba-support-bitmap-check' is now a runtime option, + `--force-lba', which works with `install', `setup', and + `grub-install.' (closes:bug#61513) + * Fixed a bug in LBA support checking. Please let us know if you + need to use `--force-lba' for Grub to work. + * NetBSD ELF kernel support is added. + + -- Gordon Matzigkeit Tue, 27 Jun 2000 09:44:41 -0600 + +grub (0.5.94) unstable; urgency=low + + * Fix /usr/doc symlink. (closes:bug#50932) + * Better testing for BIOS LBA support. (closes:bug#53507) + * New installation script. (closes:bug#48755) + + -- Gordon Matzigkeit Fri, 10 Mar 2000 14:55:02 -0600 + +grub (0.5.93.1) unstable; urgency=low + + * Update to Standards-Version: 3.0.1, mainly for FHS support. + * Fix definition of ext2_dir_entry. (closes:bug#49017) + * Fix rules for cross-compiling. (closes:bug#49034) + * Update synopsis for grub(8). (closes:bug#48991) + * Don't clear the line when hitting enter in the GRUB shell. + (closes:bug#48989) + + -- Gordon Matzigkeit Fri, 5 Nov 1999 22:31:30 -0600 + +grub (0.5.93) unstable; urgency=low + + * Updated example configurations. (closes:bug#42136) + * Highlight color set correctly when editing. (closes:bug#42549) + * dpkg-shlibdeps called on /usr/sbin/grub. (closes:bug#42704) + * Properly install Texinfo documentation. (closes:bug#42705,bug#42919) + (closes:bug#43080,bug#45150) + * Update file locations in README.debian. (closes:bug#42834) + * Upstream fixes for new binutils assembler syntax. (closes:bug#47946) + * FAT32 support. (closes:bug#47970) + * Password option fixed. (closes:bug#43798) + * Sample menu.lst included in doc directory. (closes:bug#47181) + + -- Gordon Matzigkeit Sat, 30 Oct 1999 09:59:09 -0600 + +grub (0.5.92) unstable; urgency=low + + * Data files are now in /usr/lib/grub/$(HWARCH). + * Unix boot utility available as /usr/sbin/grub. + * Full Texinfo documentation. + + -- GRUB Maintainers Mon, 26 Jul 1999 12:46:37 -0600 + +grub (0.5.91) unstable; urgency=low + + * Added support for LBA mode and preliminary AWARD/AMI hard disk BIOS + extensions. + * GRUB data now installed in /share/grub/$(host_cpu)-$(host_vendor). + * Preliminary Texinfo documentation. + + -- Gordon Matzigkeit Sun, 14 Mar 1999 20:23:04 -0600 + +grub (0.5.90) unstable; urgency=low + + * Beta-testing release. + * GRUB is now officially part of the GNU Project, and the Debian package + is maintained by its upstream maintainers. + * LS-120 IDE floppy support should work now (fixes: #33720). + + -- Gordon Matzigkeit Mon, 1 Mar 1999 12:59:06 -0600 + +grub (0.5-3) unstable; urgency=low + + * GRUB now understands symbolic links (fixes: #17306). + + -- Gordon Matzigkeit Sun, 21 Feb 1999 05:13:25 -0600 + +grub (0.5-2) unstable; urgency=low + + * Assembly source cleanups. + + -- Gordon Matzigkeit Sun, 14 Feb 1999 20:33:39 -0600 + +grub (0.5-1) unstable; urgency=low + + * Put everything in /lib/grub (not /boot/grub) and don't install during + postinst so that we can't accidentally wreck a working system. This + means the package needn't be experimental anymore. + * Get rid of grubinst because it doesn't work with 0.5, and I'd rather + improve GRUB's builtin installation process. + * Use `e' rather than enter to edit. + * Minor bug fixes. + + -- Gordon Matzigkeit Sun, 31 Jan 1998 14:11:32 -0600 + +grub (0.4-2) experimental; urgency=low + + * Make postinstall script + * Create manpage for grubinst + * Make grubinst more flexible + * Address bugs 15227 and 15163 (packaging and clue endowment) + + -- Steve Dunham Thu, 1 Jan 1998 00:38:22 -0500 + +grub (0.4-2) experimental; urgency=low + + * Make postinstall script + * Create manpage for grubinst + * Make grubinst more flexible + * Address bugs 15227 and 15163 (packaging and clue endowment) + + -- Steve Dunham Thu, 1 Jan 1998 00:38:22 -0500 + +grub (0.4-1) unstable; urgency=low + + * Initial Release. + + -- Steve Dunham Wed, 19 Nov 1997 23:42:47 -0500 --- grub-0.97.orig/debian/compat +++ grub-0.97/debian/compat @@ -0,0 +1 @@ +5 --- grub-0.97.orig/debian/control +++ grub-0.97/debian/control @@ -0,0 +1,69 @@ +Source: grub +Section: admin +Priority: extra +Maintainer: GRUB Maintainers +Uploaders: Robert Millan , Felix Zielcke , Colin Watson +DM-Upload-Allowed: yes +Build-Depends: debhelper (>= 5), + quilt (>= 0.46-7), + dh-autoreconf, + texinfo, + libncurses5-dev | libncurses-dev, + lib32ncurses5-dev [amd64], + gcc-multilib [amd64] +Build-Depends-Indep: texi2html +Standards-Version: 3.8.3 +Vcs-Bzr: http://anonscm.debian.org/bzr/pkg-grub/trunk/grub-legacy/ +Vcs-Browser: http://anonscm.debian.org/loggerhead/pkg-grub/trunk/grub-legacy/ + +Package: grub-legacy +Architecture: i386 hurd-i386 amd64 +Depends: ${shlibs:Depends}, grub-common, ${misc:Depends} +Provides: grub +Suggests: grub-legacy-doc, multiboot, mdadm +Replaces: grub (<< 0.97-54) +Description: GRand Unified Bootloader (Legacy version) + GRUB is a GPLed bootloader intended to unify bootloading across x86 + operating systems. In addition to loading the Linux kernel, + it implements the Multiboot standard, which allows for flexible loading + of multiple boot images (needed for modular kernels such as the GNU Hurd). + . + Please note that GRUB Legacy is in maintanance mode and new features are + only accepted in GRUB 2 (grub-pc package). + +Package: grub-disk +Architecture: all +Depends: grub-rescue-pc, ${misc:Depends} +Description: GRUB bootable disk image (dummy package) + This is a dummy transitional package to handle upgrades. It can be + safely removed. + +Package: grub-doc +Section: doc +Architecture: all +Depends: grub-legacy-doc, multiboot, ${misc:Depends} +Description: Documentation for GRand Unified Bootloader (dummy package) + This is a dummy transitional package to handle upgrades. It can be + safely removed. + +Package: grub-legacy-doc +Section: doc +Depends: ${misc:Depends}, dpkg (>= 1.15.4) | install-info +Suggests: doc-base +Replaces: grub-doc +Architecture: all +Description: Documentation for GRUB Legacy + GRUB is a GPLed bootloader intended to unify bootloading across x86 + operating systems. In addition to loading the Linux kernel, + it implements the Multiboot standard, which allows for flexible loading + of multiple boot images (needed for modular kernels such as the GNU Hurd). + +Package: multiboot-doc +Section: doc +Depends: ${misc:Depends}, multiboot +Suggests: doc-base +Replaces: grub-doc +Architecture: all +Description: The Multiboot specification (dummy package) + This is a dummy transitional package to handle upgrades. It can be + safely removed. --- grub-0.97.orig/debian/copyright +++ grub-0.97/debian/copyright @@ -0,0 +1,69 @@ +This package was re-debianized by Jason Thomas on +Mon, 28 May 2001 14:29:03 +1000. + +It was downloaded from ftp://alpha.gnu.org/gnu/grub/ + +Upstream Authors: + + Erich Boleyn originally designed and implemented GRUB. + + VaX#n8 (real name unknown) wrote shared_src/fsys_ext2fs.c. + + Heiko Schroeder rewrote shared_src/stage1.S to be more readable. + + The following authors assigned copyright on their work to the Free + Software Foundation: + + Gordon Matzigkeit adopted GRUB into the GNU Project. He fixed several + bugs, added symbolic link support to shared_src/fsys_ext2fs.c, and + began the implementation of /sbin/grub. + + OKUJI Yoshinori contributed many bugfixes and new features, such as + working LBA support, /sbin/grub support for configuration files, the + script /sbin/grub-install, the utility /bin/mbchk, the new engine for + builtin commands, disk swapping support, keyboard configuration support, + network support, online help support, command-line history support, + hidden menu support, the new Linux loader, serial terminal support, + single-line editing support, the utility /sbin/grub-md5-crypt, the new + GRUB manual, and several new commands. + + Peter Astrand added support for a color menu. + + Pavel Roskin contributed many bugfixes and new features, such as FreeBSD + support for the grub shell, and configure process cleanups. + + Klaus Reichl wrote stage2/fsys_minix.c. + + Per Lundberg added graphics support to the Multiboot Specification. + + Jochen Hoenicke rewrote stage2/fsys_fat.c and wrote + stage2/fsys_reiserfs.c and stage2/md5.c. + + Christoph Plattner added support for Net Boot Image Proposal. + + Stefan Ondrejicka added the commands "partnew" and "parttype". + + Frank Mehnert added support for hercules console. + + +Copyright: + + Copyright (C) 1996 Erich Boleyn + Copyright (C) 1999-2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +On Debian GNU systems, the complete text of the GNU General Public +License can be found in `/usr/share/common-licenses/GPL-2'. --- grub-0.97.orig/debian/grub-floppy +++ grub-0.97/debian/grub-floppy @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +cat << EOF +This program is broken, unsupported upstream, and has been deprecated in favour +of grub-mkrescue (grub-pc package). +EOF +exit 0 --- grub-0.97.orig/debian/grub-legacy-doc.dirs +++ grub-0.97/debian/grub-legacy-doc.dirs @@ -0,0 +1,2 @@ +usr/share/doc/grub-legacy-doc/html +usr/share/bug/grub-legacy-doc --- grub-0.97.orig/debian/grub-legacy-doc.doc-base.grub +++ grub-0.97/debian/grub-legacy-doc.doc-base.grub @@ -0,0 +1,14 @@ +Document: grub +Title: Grub Manual +Author: OKUJI Yoshinori +Abstract: This is the documentation of GNU GRUB, the GRand Unified Bootloader, + a flexible and powerful boot loader program for PCs. +Section: admin + +Format: HTML +Index: /usr/share/doc/grub-legacy-doc/html/grub.html +Files: /usr/share/doc/grub-legacy-doc/html/grub_*.html + +Format: info +Index: /usr/share/info/grub-legacy.info.gz +Files: /usr/share/info/grub-legacy.info.gz --- grub-0.97.orig/debian/grub-legacy-doc.info +++ grub-0.97/debian/grub-legacy-doc.info @@ -0,0 +1 @@ +docs/grub-legacy.info --- grub-0.97.orig/debian/grub-legacy-doc.install +++ grub-0.97/debian/grub-legacy-doc.install @@ -0,0 +1,2 @@ +docs/grub/*.html usr/share/doc/grub-legacy-doc/html +debian/presubj usr/share/bug/grub-legacy-doc --- grub-0.97.orig/debian/grub-legacy.dirs +++ grub-0.97/debian/grub-legacy.dirs @@ -0,0 +1 @@ +usr/share/bug/grub --- grub-0.97.orig/debian/grub-legacy.docs +++ grub-0.97/debian/grub-legacy.docs @@ -0,0 +1,6 @@ +AUTHORS +BUGS +NEWS +README +THANKS +TODO --- grub-0.97.orig/debian/grub-legacy.examples +++ grub-0.97/debian/grub-legacy.examples @@ -0,0 +1 @@ +docs/menu.lst --- grub-0.97.orig/debian/grub-legacy.install +++ grub-0.97/debian/grub-legacy.install @@ -0,0 +1,8 @@ +debian/update-grub usr/sbin +debian/grub-floppy usr/sbin +debian/grub-reboot usr/sbin +debian/mkbimage usr/bin +debian/presubj usr/share/bug/grub +debian/script usr/share/bug/grub +debian/kernel/zz-update-grub etc/kernel/postinst.d +debian/kernel/zz-update-grub etc/kernel/postrm.d --- grub-0.97.orig/debian/grub-legacy.manpages +++ grub-0.97/debian/grub-legacy.manpages @@ -0,0 +1,3 @@ +debian/update-grub.8 +debian/grub-reboot.8 +debian/grub-set-default.1 --- grub-0.97.orig/debian/grub-legacy.postinst +++ grub-0.97/debian/grub-legacy.postinst @@ -0,0 +1,24 @@ +#!/bin/bash +set -e +case "$1" in + configure) + if egrep -q '^[[:space:]]*post(inst|rm)_hook[[:space:]]*=[[:space:]]*(/sbin/|/usr/sbin/)?update-grub' /etc/kernel-img.conf 2>/dev/null; then + echo 'Removing update-grub hooks from /etc/kernel-img.conf in favour of' >&2 + echo '/etc/kernel/ hooks.' >&2 + sed -ri /etc/kernel-img.conf -e '\%^[[:space:]]*post(inst|rm)_hook[[:space:]]*=[[:space:]]*(/sbin/|/usr/sbin/)?update-grub%d' + fi + ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- grub-0.97.orig/debian/grub-legacy.preinst +++ grub-0.97/debian/grub-legacy.preinst @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +case "$1" in + install|upgrade) + if dpkg --compare-versions "$2" lt 0.97-63 && \ + test -h /etc/kernel/postrm.d/zz-update-grub; then + rm -f /etc/kernel/postrm.d/zz-update-grub + fi + ;; +esac + +#DEBHELPER# + +exit 0 --- grub-0.97.orig/debian/grub-reboot +++ grub-0.97/debian/grub-reboot @@ -0,0 +1,91 @@ +#!/bin/bash +set -e + +NAME=grub-reboot +VERSION=0.01 + +if ! test -n "$1" || test "$1" = "-h" || test "$1" = "--help" ; then + echo $NAME + echo + echo "Reboots into the specified OS entry in menu.lst" + echo + echo "Usage: $0 entry [options to grub]" + echo " (where \"entry\" is the entry number in menu.lst)" + echo + exit +fi + +if test "$1" = "-v" || test "$1" = "--version" ; then + echo $NAME $VERSION + exit +fi + +if test "`whoami`" != "root" ; then + echo "You must be root" + exit +fi + +abort() { + message=$@ + + echo >&2 + echo -e "$message" >&2 + echo >&2 + exit 1 +} + +find_grub_dir () +{ + echo -n "Searching for GRUB installation directory ... " >&2 + + for d in $grub_dirs ; do + if [ -d "$d" ] ; then + grub_dir="$d" + break + fi + done + + if [ -z "$grub_dir" ] ; then + abort "No GRUB directory found.\n###" + else + echo "found: $grub_dir" >&2 + fi + + echo $grub_dir +} + +grub_dirs="/boot/grub /boot/boot/grub" + +grub_dir=$(find_grub_dir) + +config_file=$grub_dir/menu.lst + +default_file=$grub_dir/default + +default="$1" ; shift +grub --batch --config-file=$config_file $@ <> $default_file + +echo +echo -n "Do you want to reboot now? [y/N] " +read REBOOT +case $REBOOT in + y*|Y*) reboot ;; +esac --- grub-0.97.orig/debian/grub-reboot.8 +++ grub-0.97/debian/grub-reboot.8 @@ -0,0 +1,13 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.33. +.TH GRUB-REBOOT "8" "November 2003" "grub-reboot 0.01" "System Administration Utilities" +.SH NAME +grub-reboot \- manual page for grub-reboot 0.01 +.SH SYNOPSIS +.B grub-reboot +\fIentry \fR[\fIoptions to grub\fR] +.SH DESCRIPTION +grub-reboot +.PP +Reboots into the specified OS entry in menu.lst +.IP +(where "entry" is the entry number in menu.lst) --- grub-0.97.orig/debian/grub-set-default.1 +++ grub-0.97/debian/grub-set-default.1 @@ -0,0 +1,35 @@ +.\" In .TH, FOO should be all caps, SECTION should be 1-8, maybe w/ subsection +.\" other parms are allowed: see man(7), man(1) +.\" +.\" This template provided by Tom Christiansen . +.\" +.TH GRUB-SET-DEFAULT 1 "November 2006" +.SH NAME +grub-set-default \- Set the default boot entry for GRUB +.SH SYNOPSIS +.PP +.B grub-set-default +[\fIOPTION\fR] +entry +.SH DESCRIPTION +Set the default boot entry for GRUB. +.TP +\fB\-h, \-\-help +print this message and exit +.TP +\fB\-v, \-\-version\fR +print the version information and exit +.TP +\fB\-\-root-directory=DIR\fR +Use the directory DIR instead of the root directory +.TP +ENTRY is a number (counting from 0) or the special keyword `default\'. +.SH "REPORTING BUGS" +Report bugs to +.SH "SEE ALSO" +.\" Always quote multiple words for .SH +.BR grub (8), +.BR update-grub (8). +.SH "AUTHOR" +This manual page was written by Patrick Schoenfeld , +for the Debian project (but may be used by others). --- grub-0.97.orig/debian/kernel/zz-update-grub +++ grub-0.97/debian/kernel/zz-update-grub @@ -0,0 +1,19 @@ +#! /bin/sh +set -e + +which update-grub >/dev/null 2>&1 || exit 0 + +set -- $DEB_MAINT_PARAMS +mode="${1#\'}" +mode="${mode%\'}" +case $0:$mode in + # Only run on postinst configure and postrm remove, to avoid wasting + # time by calling update-grub multiple times on upgrade and removal. + # Also run if we have no DEB_MAINT_PARAMS, in order to work with old + # kernel packages. + */postinst.d/*:|*/postinst.d/*:configure|*/postrm.d/*:|*/postrm.d/*:remove) + exec update-grub + ;; +esac + +exit 0 --- grub-0.97.orig/debian/mkbimage +++ grub-0.97/debian/mkbimage @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +cat << EOF +This program is broken, unsupported upstream, and has been deprecated in favour +of grub-mkrescue (grub-pc package). +EOF +exit 0 --- grub-0.97.orig/debian/patches/2gb_limit.patch +++ grub-0.97/debian/patches/2gb_limit.patch @@ -0,0 +1,49 @@ + + Author: Goswin Brederlow + Status: pending + Updated by: Otavio Salvador - resync with 0.97 code + +Index: b/stage2/char_io.c +=================================================================== +--- a/stage2/char_io.c ++++ b/stage2/char_io.c +@@ -1231,13 +1231,13 @@ + #endif /* ! STAGE1_5 */ + + int +-memcheck (int addr, int len) ++memcheck (unsigned long int addr, unsigned long int len) + { + #ifdef GRUB_UTIL +- auto int start_addr (void); +- auto int end_addr (void); ++ auto unsigned long int start_addr (void); ++ auto int unsigned long end_addr (void); + +- auto int start_addr (void) ++ auto unsigned long int start_addr (void) + { + int ret; + # if defined(HAVE_START_SYMBOL) +@@ -1248,7 +1248,7 @@ + return ret; + } + +- auto int end_addr (void) ++ auto unsigned long int end_addr (void) + { + int ret; + # if defined(HAVE_END_SYMBOL) +Index: b/stage2/shared.h +=================================================================== +--- a/stage2/shared.h ++++ b/stage2/shared.h +@@ -921,7 +921,7 @@ + int nul_terminate (char *str); + int get_based_digit (int c, int base); + int safe_parse_maxint (char **str_ptr, int *myint_ptr); +-int memcheck (int start, int len); ++int memcheck (unsigned long int start, unsigned long int len); + void grub_putstr (const char *str); + + #ifndef NO_DECOMPRESSION --- grub-0.97.orig/debian/patches/crossreference_manpages.patch +++ grub-0.97/debian/patches/crossreference_manpages.patch @@ -0,0 +1,54 @@ +Index: b/docs/help2man +=================================================================== +--- a/docs/help2man ++++ b/docs/help2man +@@ -455,7 +455,9 @@ + $include{$sect} .= <s_rev_level == EXT2_GOOD_OLD_REV) ? \ ++ EXT2_GOOD_OLD_INODE_SIZE : \ ++ (s)->s_inode_size) ++#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s)) ++ + /* linux/ext2_fs.h */ + #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) + /* kind of from ext2/super.c */ +@@ -553,7 +606,7 @@ + gdp = GROUP_DESC; + ino_blk = gdp[desc].bg_inode_table + + (((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group)) +- >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode))); ++ >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK))); + #ifdef E2DEBUG + printf ("inode table fsblock=%d\n", ino_blk); + #endif /* E2DEBUG */ +@@ -565,13 +618,12 @@ + /* reset indirect blocks! */ + mapblock2 = mapblock1 = -1; + +- raw_inode = INODE + +- ((current_ino - 1) +- & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1)); ++ raw_inode = (struct ext2_inode *)((char *)INODE + ++ ((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) * ++ EXT2_INODE_SIZE (SUPERBLOCK)); + #ifdef E2DEBUG + printf ("ipb=%d, sizeof(inode)=%d\n", +- (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)), +- sizeof (struct ext2_inode)); ++ EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK)); + printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode); + printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE); + for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode; --- grub-0.97.orig/debian/patches/find-grub-dir.patch +++ grub-0.97/debian/patches/find-grub-dir.patch @@ -0,0 +1,56 @@ +Index: b/util/grub-set-default.in +=================================================================== +--- a/util/grub-set-default.in ++++ b/util/grub-set-default.in +@@ -74,18 +74,45 @@ + exit 1 + fi + ++find_grub_dir () ++{ ++ echo -n "Searching for GRUB installation directory ... " >&2 ++ ++ for d in $grub_dirs ; do ++ if [ -d "$d" ] ; then ++ grub_dir="$d" ++ break ++ fi ++ done ++ ++ if [ -z "$grub_dir" ] ; then ++ abort "No GRUB directory found.\n###" ++ else ++ echo "found: $grub_dir" >&2 ++ fi ++ ++ echo $grub_dir ++} ++ ++grub_dirs="/boot/grub /boot/boot/grub" ++ + # Determine the GRUB directory. This is different among OSes. +-grubdir=${rootdir}/boot/grub +-if test -d ${grubdir}; then ++# if rootdir has been informed use it or find grubdir otherwise ++if [ -n "${rootdir}" ]; then ++ grubdir=${rootdir}/boot/grub ++ if test -d ${grubdir}; then + : +-else ++ else + grubdir=${rootdir}/grub + if test -d ${grubdir}; then +- : ++ : + else +- echo "No GRUB directory found under ${rootdir}/" 1>&2 +- exit 1 ++ echo "No GRUB directory found under ${rootdir}/" 1>&2 ++ exit 1 + fi ++ fi ++else ++ grubdir=$(find_grub_dir) + fi + + file=${grubdir}/default --- grub-0.97.orig/debian/patches/fix_amd64_compile.patch +++ grub-0.97/debian/patches/fix_amd64_compile.patch @@ -0,0 +1,11 @@ +--- grub-0.97-bkp/configure.ac 2005-11-05 16:53:00.419491832 -0200 ++++ grub-0.97/configure.ac 2005-11-05 16:53:13.777461112 -0200 +@@ -47,7 +47,7 @@ + fi + + if test "x$host_cpu" = xx86_64; then +- CFLAGS="-m32 $CFLAGS" ++ CFLAGS="-m64 $CFLAGS" + fi + + # --- grub-0.97.orig/debian/patches/geometry-26kernel.patch +++ grub-0.97/debian/patches/geometry-26kernel.patch @@ -0,0 +1,236 @@ + + Date: 2005-11-11 + Author: Otavio Salvador + Comment: Stolen from Fedora grub package. + Put geometry discover inside of grub code since kernel 2.6 + doesn't do that anymore. + +Index: b/lib/device.c +=================================================================== +--- a/lib/device.c ++++ b/lib/device.c +@@ -131,6 +131,152 @@ + #include + #include + ++#if defined(__linux__) ++/* The 2.6 kernel has removed all of the geometry handling for IDE drives ++ * that did fixups for LBA, etc. This means that the geometry we get ++ * with the ioctl has a good chance of being wrong. So, we get to ++ * also know about partition tables and try to read what the geometry ++ * is there. *grumble* Very closely based on code from cfdisk ++ */ ++static void get_kernel_geometry(int fd, long long *cyl, int *heads, int *sectors) { ++ struct hd_geometry hdg; ++ ++ if (ioctl (fd, HDIO_GETGEO, &hdg)) ++ return; ++ ++ *cyl = hdg.cylinders; ++ *heads = hdg.heads; ++ *sectors = hdg.sectors; ++} ++ ++struct partition { ++ unsigned char boot_ind; /* 0x80 - active */ ++ unsigned char head; /* starting head */ ++ unsigned char sector; /* starting sector */ ++ unsigned char cyl; /* starting cylinder */ ++ unsigned char sys_ind; /* What partition type */ ++ unsigned char end_head; /* end head */ ++ unsigned char end_sector; /* end sector */ ++ unsigned char end_cyl; /* end cylinder */ ++ unsigned char start4[4]; /* starting sector counting from 0 */ ++ unsigned char size4[4]; /* nr of sectors in partition */ ++}; ++ ++#define ALIGNMENT 2 ++typedef union { ++ struct { ++ unsigned char align[ALIGNMENT]; ++ unsigned char b[SECTOR_SIZE]; ++ } c; ++ struct { ++ unsigned char align[ALIGNMENT]; ++ unsigned char buffer[0x1BE]; ++ struct partition part[4]; ++ unsigned char magicflag[2]; ++ } p; ++} partition_table; ++ ++#define PART_TABLE_FLAG0 0x55 ++#define PART_TABLE_FLAG1 0xAA ++ ++static void ++get_partition_table_geometry(partition_table *bufp, long long *cyl, int *heads, ++ int *sectors) { ++ struct partition *p; ++ int i,h,s,hh,ss; ++ int first = 1; ++ int bad = 0; ++ ++ if (bufp->p.magicflag[0] != PART_TABLE_FLAG0 || ++ bufp->p.magicflag[1] != PART_TABLE_FLAG1) { ++ /* Matthew Wilcox: slightly friendlier version of ++ fatal(_("Bad signature on partition table"), 3); ++ */ ++ fprintf(stderr, "Unknown partition table signature\n"); ++ return; ++ } ++ ++ hh = ss = 0; ++ for (i=0; i<4; i++) { ++ p = &(bufp->p.part[i]); ++ if (p->sys_ind != 0) { ++ h = p->end_head + 1; ++ s = (p->end_sector & 077); ++ if (first) { ++ hh = h; ++ ss = s; ++ first = 0; ++ } else if (hh != h || ss != s) ++ bad = 1; ++ } ++ } ++ ++ if (!first && !bad) { ++ *heads = hh; ++ *sectors = ss; ++ } ++} ++ ++static long long my_lseek (unsigned int fd, long long offset, ++ unsigned int origin) ++{ ++#if defined(__linux__) && (!defined(__GLIBC__) || \ ++ ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) ++ /* Maybe libc doesn't have large file support. */ ++ loff_t offset, result; ++ static int _llseek (uint filedes, ulong hi, ulong lo, ++ loff_t *res, uint wh); ++ _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo, ++ loff_t *, res, uint, wh); ++ ++ if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET) < 0) ++ return (long long) -1; ++ return result; ++#else ++ return lseek(fd, offset, SEEK_SET); ++#endif ++} ++ ++static void get_linux_geometry (int fd, struct geometry *geom) { ++ long long kern_cyl = 0; int kern_head = 0, kern_sectors = 0; ++ long long pt_cyl = 0; int pt_head = 0, pt_sectors = 0; ++ partition_table bufp; ++ char *buff, *buf_unaligned; ++ ++ buf_unaligned = malloc(sizeof(partition_table) + 4095); ++ buff = (char *) (((unsigned long)buf_unaligned + 4096 - 1) & ++ (~(4096-1))); ++ ++ get_kernel_geometry(fd, &kern_cyl, &kern_head, &kern_sectors); ++ ++ if (my_lseek (fd, 0*SECTOR_SIZE, SEEK_SET) < 0) { ++ fprintf(stderr, "Unable to seek"); ++ } ++ ++ if (read(fd, buff, SECTOR_SIZE) == SECTOR_SIZE) { ++ memcpy(bufp.c.b, buff, SECTOR_SIZE); ++ get_partition_table_geometry(&bufp, &pt_cyl, &pt_head, &pt_sectors); ++ } else { ++ fprintf(stderr, "Unable to read partition table: %s\n", strerror(errno)); ++ } ++ ++ if (pt_head && pt_sectors) { ++ int cyl_size; ++ ++ geom->heads = pt_head; ++ geom->sectors = pt_sectors; ++ cyl_size = pt_head * pt_sectors; ++ geom->cylinders = geom->total_sectors/cyl_size; ++ } else { ++ geom->heads = kern_head; ++ geom->sectors = kern_sectors; ++ geom->cylinders = kern_cyl; ++ } ++ ++ return; ++} ++#endif ++ + /* Get the geometry of a drive DRIVE. */ + void + get_drive_geometry (struct geometry *geom, char **map, int drive) +@@ -151,19 +297,15 @@ + #if defined(__linux__) + /* Linux */ + { +- struct hd_geometry hdg; + unsigned long long nr; + +- if (ioctl (fd, HDIO_GETGEO, &hdg)) +- goto fail; +- + if (ioctl (fd, BLKGETSIZE64, &nr)) + goto fail; + + /* Got the geometry, so save it. */ +- geom->cylinders = hdg.cylinders; +- geom->heads = hdg.heads; +- geom->sectors = hdg.sectors; ++ get_linux_geometry(fd, geom); ++ if (!geom->heads && !geom->cylinders && !geom->sectors) ++ goto fail; + geom->total_sectors = nr / 512; + + goto success; +@@ -984,6 +1126,7 @@ + { + char dev[PATH_MAX]; /* XXX */ + int fd; ++ off_t offset = (off_t) sector * (off_t) SECTOR_SIZE; + + if ((partition & 0x00FF00) != 0x00FF00) + { +@@ -1018,35 +1161,13 @@ + errnum = ERR_NO_PART; + return 0; + } +- +-#if defined(__linux__) && (!defined(__GLIBC__) || \ +- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) +- /* Maybe libc doesn't have large file support. */ +- { +- loff_t offset, result; +- static int _llseek (uint filedes, ulong hi, ulong lo, +- loff_t *res, uint wh); +- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo, +- loff_t *, res, uint, wh); + +- offset = (loff_t) sector * (loff_t) SECTOR_SIZE; +- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET)) +- { +- errnum = ERR_DEV_VALUES; +- return 0; +- } +- } +-#else +- { +- off_t offset = (off_t) sector * (off_t) SECTOR_SIZE; + +- if (lseek (fd, offset, SEEK_SET) != offset) +- { +- errnum = ERR_DEV_VALUES; +- return 0; +- } +- } +-#endif ++ if (my_lseek(fd, offset, SEEK_SET) != offset) ++ { ++ errnum = ERR_DEV_VALUES; ++ return 0; ++ } + + if (write (fd, buf, size * SECTOR_SIZE) != (size * SECTOR_SIZE)) + { --- grub-0.97.orig/debian/patches/graphics.patch +++ grub-0.97/debian/patches/graphics.patch @@ -0,0 +1,2310 @@ +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -606,6 +606,11 @@ + [ --enable-diskless enable diskless support]) + AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes) + ++dnl Graphical splashscreen support ++AC_ARG_ENABLE(graphics, ++ [ --disable-graphics disable graphics terminal support]) ++AM_CONDITIONAL(GRAPHICS_SUPPORT, test "x$enable_graphics" != xno) ++ + dnl Hercules terminal + AC_ARG_ENABLE(hercules, + [ --disable-hercules disable hercules terminal support]) +Index: b/stage2/asm.S +=================================================================== +--- a/stage2/asm.S ++++ b/stage2/asm.S +@@ -2216,7 +2216,304 @@ + pop %ebx + pop %ebp + ret +- ++ ++ ++/* graphics mode functions */ ++#ifdef SUPPORT_GRAPHICS ++VARIABLE(cursorX) ++.word 0 ++VARIABLE(cursorY) ++.word 0 ++VARIABLE(cursorCount) ++.word 0 ++VARIABLE(cursorBuf) ++.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ++ ++ ++/* ++ * set_int1c_handler(void) ++ */ ++ENTRY(set_int1c_handler) ++ pushl %edi ++ ++ /* save the original int1c handler */ ++ movl $0x70, %edi ++ movw (%edi), %ax ++ movw %ax, ABS(int1c_offset) ++ movw 2(%edi), %ax ++ movw %ax, ABS(int1c_segment) ++ ++ /* save the new int1c handler */ ++ movw $ABS(int1c_handler), %ax ++ movw %ax, (%edi) ++ xorw %ax, %ax ++ movw %ax, 2(%edi) ++ ++ popl %edi ++ ret ++ ++ ++/* ++ * unset_int1c_handler(void) ++ */ ++ENTRY(unset_int1c_handler) ++ pushl %edi ++ ++ /* check if int1c_handler is set */ ++ movl $0x70, %edi ++ movw $ABS(int1c_handler), %ax ++ cmpw %ax, (%edi) ++ jne int1c_1 ++ xorw %ax, %ax ++ cmpw %ax, 2(%edi) ++ jne int1c_1 ++ ++ /* restore the original */ ++ movw ABS(int1c_offset), %ax ++ movw %ax, (%edi) ++ movw ABS(int1c_segment), %ax ++ movw %ax, 2(%edi) ++ ++int1c_1: ++ popl %edi ++ ret ++ ++ ++/* ++ * blinks graphics cursor ++ */ ++ .code16 ++write_data: ++ movw $0, %ax ++ movw %ax, %ds ++ ++ mov $0xA000, %ax /* video in es:di */ ++ mov %ax, %es ++ mov $80, %ax ++ movw $ABS(cursorY), %si ++ mov %ds:(%si), %bx ++ mul %bx ++ movw $ABS(cursorX), %si ++ mov %ds:(%si), %bx ++ shr $3, %bx /* %bx /= 8 */ ++ add %bx, %ax ++ mov %ax, %di ++ ++ movw $ABS(cursorBuf), %si /* fontBuf in ds:si */ ++ ++ /* prepare for data moving */ ++ mov $16, %dx /* altura da fonte */ ++ mov $80, %bx /* bytes por linha */ ++ ++write_loop: ++ movb %ds:(%si), %al ++ xorb $0xff, %al ++ movb %al, %ds:(%si) /* invert cursorBuf */ ++ movb %al, %es:(%di) /* write to video */ ++ add %bx, %di ++ inc %si ++ dec %dx ++ jg write_loop ++ ret ++ ++int1c_handler: ++ pusha ++ mov $0, %ax ++ mov %ax, %ds ++ mov $ABS(cursorCount), %si ++ mov %ds:(%si), %ax ++ inc %ax ++ mov %ax, %ds:(%si) ++ cmp $9, %ax ++ jne int1c_done ++ ++ mov $0, %ax ++ mov %ax, %ds:(%si) ++ call write_data ++ ++int1c_done: ++ popa ++ iret ++ /* call previous int1c handler */ ++ /* ljmp */ ++ .byte 0xea ++int1c_offset: .word 0 ++int1c_segment: .word 0 ++ .code32 ++ ++ ++/* ++ * unsigned char set_videomode(unsigned char mode) ++ * BIOS call "INT 10H Function 0h" to set video mode ++ * Call with %ah = 0x0 ++ * %al = video mode ++ * Returns old videomode. ++ */ ++ENTRY(set_videomode) ++ pushl %ebp ++ movl %esp,%ebp ++ pushl %ebx ++ pushl %ecx ++ ++ movb 8(%ebp), %cl ++ ++ call EXT_C(prot_to_real) ++ .code16 ++ ++ xorb %al, %al ++ movb $0xf, %ah ++ int $0x10 /* Get Current Video mode */ ++ movb %al, %ch ++ xorb %ah, %ah ++ movb %cl, %al ++ int $0x10 /* Set Video mode */ ++ ++ DATA32 call EXT_C(real_to_prot) ++ .code32 ++ ++ xorl %eax, %eax ++ movb %ch, %al ++ ++ popl %ecx ++ popl %ebx ++ popl %ebp ++ ret ++ ++ ++/* ++ * int get_videomode() ++ * BIOS call "INT 10H Function 0Fh" to get current video mode ++ * Call with %al = 0x0 ++ * %ah = 0xF ++ * Returns current videomode. ++ */ ++ENTRY(get_videomode) ++ pushl %ebp ++ movl %esp,%ebp ++ pushl %ebx ++ pushl %ecx ++ ++ call EXT_C(prot_to_real) ++ .code16 ++ ++ xorb %al, %al ++ movb $0xF, %ah ++ int $0x10 /* Get Current Video mode */ ++ movb %al, %cl /* For now we only want display mode */ ++ ++ DATA32 call EXT_C(real_to_prot) ++ .code32 ++ ++ xorl %eax, %eax ++ movb %cl, %al ++ ++ popl %ecx ++ popl %ebx ++ popl %ebp ++ ret ++ ++ ++/* ++ * unsigned char * graphics_get_font() ++ * BIOS call "INT 10H Function 11h" to set font ++ * Call with %ah = 0x11 ++ */ ++ENTRY(graphics_get_font) ++ push %ebp ++ push %ebx ++ push %ecx ++ push %edx ++ ++ call EXT_C(prot_to_real) ++ .code16 ++ ++ movw $0x1130, %ax ++ movb $6, %bh /* font 8x16 */ ++ int $0x10 ++ movw %bp, %dx ++ movw %es, %cx ++ ++ DATA32 call EXT_C(real_to_prot) ++ .code32 ++ ++ xorl %eax, %eax ++ movw %cx, %ax ++ shll $4, %eax ++ movw %dx, %ax ++ ++ pop %edx ++ pop %ecx ++ pop %ebx ++ pop %ebp ++ ret ++ ++ ++/* ++ * graphics_set_palette(index, red, green, blue) ++ * BIOS call "INT 10H Function 10h" to set individual dac register ++ * Call with %ah = 0x10 ++ * %bx = register number ++ * %ch = new value for green (0-63) ++ * %cl = new value for blue (0-63) ++ * %dh = new value for red (0-63) ++ */ ++ ++ENTRY(graphics_set_palette) ++ push %ebp ++ push %eax ++ push %ebx ++ push %ecx ++ push %edx ++ ++ movw $0x3c8, %bx /* address write mode register */ ++ ++ /* wait vertical retrace */ ++ movw $0x3da, %dx ++l1b: ++ inb %dx, %al /* wait vertical active display */ ++ test $8, %al ++ jnz l1b ++ ++l2b: ++ inb %dx, %al /* wait vertical retrace */ ++ test $8, %al ++ jnz l2b ++ ++ mov %bx, %dx ++ movb 0x18(%esp), %al /* index */ ++ outb %al, %dx ++ inc %dx ++ ++ movb 0x1c(%esp), %al /* red */ ++ outb %al, %dx ++ ++ movb 0x20(%esp), %al /* green */ ++ outb %al, %dx ++ ++ movb 0x24(%esp), %al /* blue */ ++ outb %al, %dx ++ ++ movw 0x18(%esp), %bx ++ ++ call EXT_C(prot_to_real) ++ .code16 ++ ++ movb %bl, %bh ++ movw $0x1000, %ax ++ int $0x10 ++ ++ DATA32 call EXT_C(real_to_prot) ++ .code32 ++ ++ pop %edx ++ pop %ecx ++ pop %ebx ++ pop %eax ++ pop %ebp ++ ret ++#endif /* SUPPORT_GRAPHICS */ ++ ++ + /* + * getrtsecs() + * if a seconds value can be read, read it and return it (BCD), +Index: b/stage2/builtins.c +=================================================================== +--- a/stage2/builtins.c ++++ b/stage2/builtins.c +@@ -28,6 +28,10 @@ + #include + #include + ++#ifdef SUPPORT_GRAPHICS ++# include ++#endif ++ + #ifdef SUPPORT_NETBOOT + # define GRUB 1 + # include +@@ -237,12 +241,22 @@ + static int + boot_func (char *arg, int flags) + { ++ struct term_entry *prev_term = current_term; + /* Clear the int15 handler if we can boot the kernel successfully. + This assumes that the boot code never fails only if KERNEL_TYPE is + not KERNEL_TYPE_NONE. Is this assumption is bad? */ + if (kernel_type != KERNEL_TYPE_NONE) + unset_int15_handler (); + ++ /* if our terminal needed initialization, we should shut it down ++ * before booting the kernel, but we want to save what it was so ++ * we can come back if needed */ ++ if (current_term->shutdown) ++ { ++ current_term->shutdown(); ++ current_term = term_table; /* assumption: console is first */ ++ } ++ + #ifdef SUPPORT_NETBOOT + /* Shut down the networking. */ + cleanup_net (); +@@ -306,6 +320,13 @@ + return 1; + } + ++ /* if we get back here, we should go back to what our term was before */ ++ current_term = prev_term; ++ if (current_term->startup) ++ /* if our terminal fails to initialize, fall back to console since ++ * it should always work */ ++ if (current_term->startup() == 0) ++ current_term = term_table; /* we know that console is first */ + return 0; + } + +@@ -852,6 +873,251 @@ + }; + #endif /* SUPPORT_NETBOOT */ + ++#ifdef SUPPORT_GRAPHICS ++ ++static int splashimage_func(char *arg, int flags) { ++ int i; ++ ++ /* filename can only be 256 characters due to our buffer size */ ++ if (grub_strlen(arg) > 256) { ++ grub_printf("Splash image filename too large\n"); ++ grub_printf("Press any key to continue..."); ++ getkey(); ++ return 1; ++ } ++ ++ /* get rid of TERM_NEED_INIT from the graphics terminal. */ ++ for (i = 0; term_table[i].name; i++) { ++ if (grub_strcmp (term_table[i].name, "graphics") == 0) { ++ term_table[i].flags &= ~TERM_NEED_INIT; ++ break; ++ } ++ } ++ ++ graphics_set_splash(arg); ++ ++ if (flags == BUILTIN_CMDLINE && graphics_inited) { ++ graphics_end(); ++ if (graphics_init() == 0) { ++ /* Fallback to default term */ ++ current_term = term_table; ++ max_lines = current_term->max_lines; ++ if (current_term->cls) ++ current_term->cls(); ++ grub_printf("Failed to set splash image and/or graphics mode\n"); ++ return 1; ++ } ++ graphics_cls(); ++ } ++ ++ if (flags == BUILTIN_MENU) ++ current_term = term_table + i; ++ ++ return 0; ++} ++ ++static struct builtin builtin_splashimage = ++{ ++ "splashimage", ++ splashimage_func, ++ BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, ++ "splashimage FILE", ++ "Load FILE as the background image when in graphics mode." ++}; ++ ++ ++/* shade */ ++static int ++shade_func(char *arg, int flags) ++{ ++ int new_shade; ++ ++ if (!arg || safe_parse_maxint(&arg, &new_shade) == 0) ++ return (1); ++ ++ if (shade != new_shade) { ++ shade = new_shade; ++ if (flags == BUILTIN_CMDLINE && graphics_inited) { ++ graphics_end(); ++ graphics_init(); ++ graphics_cls(); ++ } ++ } ++ ++ return 0; ++} ++ ++static struct builtin builtin_shade = ++{ ++ "shade", ++ shade_func, ++ BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, ++ "shade INTEGER", ++ "If set to 0, disables the use of shaded text, else enables it." ++}; ++ ++ ++/* foreground */ ++static int ++foreground_func(char *arg, int flags) ++{ ++ if (grub_strlen(arg) == 6) { ++ int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2; ++ int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2; ++ int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2; ++ ++ foreground = (r << 16) | (g << 8) | b; ++ if (graphics_inited) ++ graphics_set_palette(15, r, g, b); ++ ++ return 0; ++ } ++ ++ return 1; ++} ++ ++static struct builtin builtin_foreground = ++{ ++ "foreground", ++ foreground_func, ++ BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, ++ "foreground RRGGBB", ++ "Sets the foreground color when in graphics mode." ++ "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal." ++}; ++ ++ ++/* background */ ++static int ++background_func(char *arg, int flags) ++{ ++ if (grub_strlen(arg) == 6) { ++ int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2; ++ int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2; ++ int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2; ++ ++ background = (r << 16) | (g << 8) | b; ++ if (graphics_inited) ++ graphics_set_palette(0, r, g, b); ++ return 0; ++ } ++ ++ return 1; ++} ++ ++static struct builtin builtin_background = ++{ ++ "background", ++ background_func, ++ BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, ++ "background RRGGBB", ++ "Sets the background color when in graphics mode." ++ "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal." ++}; ++ ++ ++/* border */ ++static int ++border_func(char *arg, int flags) ++{ ++ if (grub_strlen(arg) == 6) { ++ int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2; ++ int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2; ++ int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2; ++ ++ window_border = (r << 16) | (g << 8) | b; ++ if (graphics_inited) ++ graphics_set_palette(0x11, r, g, b); ++ ++ return 0; ++ } ++ ++ return 1; ++} ++ ++static struct builtin builtin_border = ++{ ++ "border", ++ border_func, ++ BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, ++ "border RRGGBB", ++ "Sets the border video color when in graphics mode." ++ "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal." ++}; ++ ++ ++/* viewport */ ++static int ++viewport_func (char *arg, int flags) ++{ ++ int i; ++ int x0 = 0, y0 = 0, x1 = 80, y1 = 30; ++ int *pos[4] = { &x0, &y0, &x1, &y1 }; ++ ++ if (!arg) ++ return (1); ++ for (i = 0; i < 4; i++) { ++ if (!*arg) ++ return (1); ++ while (*arg && (*arg == ' ' || *arg == '\t')) ++ ++arg; ++ if (!safe_parse_maxint(&arg, pos[i])) ++ return (1); ++ while (*arg && (*arg != ' ' && *arg != '\t')) ++ ++arg; ++ } ++ ++ /* minimum size is 65 colums and 16 rows */ ++ if (x0 > x1 - 66 || y0 > y1 - 16 || x0 < 0 || y0 < 0 || x1 > 80 || y1 > 30) ++ return 1; ++ ++ view_x0 = x0; ++ view_y0 = y0; ++ view_x1 = x1; ++ view_y1 = y1; ++ ++ if (flags == BUILTIN_CMDLINE && graphics_inited) { ++ graphics_end(); ++ graphics_init(); ++ graphics_cls(); ++ } ++ ++ return 0; ++} ++ ++static struct builtin builtin_viewport = ++{ ++ "viewport", ++ viewport_func, ++ BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, ++ "viewport x0 y0 x1 y1", ++ "Changes grub internals to output text in the window defined by" ++ " four parameters. The x and y parameters are 0 based. This option" ++ " only works with the graphics interface." ++}; ++ ++#endif /* SUPPORT_GRAPHICS */ ++ ++ ++/* clear */ ++static int ++clear_func() ++{ ++ if (current_term->cls) ++ current_term->cls(); ++ ++ return 0; ++} ++ ++static struct builtin builtin_clear = ++{ ++ "clear", ++ clear_func, ++ BUILTIN_CMDLINE | BUILTIN_HELP_LIST, ++ "clear", ++ "Clear the screen" ++}; ++ + + /* displayapm */ + static int +@@ -1454,14 +1720,20 @@ + + + /* help */ +-#define MAX_SHORT_DOC_LEN 39 +-#define MAX_LONG_DOC_LEN 66 +- + static int + help_func (char *arg, int flags) + { +- int all = 0; +- ++ int all = 0, max_short_doc_len, max_long_doc_len; ++ max_short_doc_len = 39; ++ max_long_doc_len = 66; ++#ifdef SUPPORT_GRAPHICS ++ if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0) ++ { ++ max_short_doc_len = (view_x1 - view_x0 + 1) / 2 - 1; ++ max_long_doc_len = (view_x1 - view_x0) - 14; ++ } ++#endif ++ + if (grub_memcmp (arg, "--all", sizeof ("--all") - 1) == 0) + { + all = 1; +@@ -1491,13 +1763,13 @@ + + len = grub_strlen ((*builtin)->short_doc); + /* If the length of SHORT_DOC is too long, truncate it. */ +- if (len > MAX_SHORT_DOC_LEN - 1) +- len = MAX_SHORT_DOC_LEN - 1; ++ if (len > max_short_doc_len - 1) ++ len = max_short_doc_len - 1; + + for (i = 0; i < len; i++) + grub_putchar ((*builtin)->short_doc[i]); + +- for (; i < MAX_SHORT_DOC_LEN; i++) ++ for (; i < max_short_doc_len; i++) + grub_putchar (' '); + + if (! left) +@@ -1546,10 +1818,10 @@ + int i; + + /* If LEN is too long, fold DOC. */ +- if (len > MAX_LONG_DOC_LEN) ++ if (len > max_long_doc_len) + { + /* Fold this line at the position of a space. */ +- for (len = MAX_LONG_DOC_LEN; len > 0; len--) ++ for (len = max_long_doc_len; len > 0; len--) + if (doc[len - 1] == ' ') + break; + } +@@ -4085,7 +4357,7 @@ + }; + + +-#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) ++#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS) + /* terminal */ + static int + terminal_func (char *arg, int flags) +@@ -4244,17 +4516,29 @@ + end: + current_term = term_table + default_term; + current_term->flags = term_flags; +- ++ + if (lines) + max_lines = lines; + else +- /* 24 would be a good default value. */ +- max_lines = 24; +- ++ max_lines = current_term->max_lines; ++ + /* If the interface is currently the command-line, + restart it to repaint the screen. */ +- if (current_term != prev_term && (flags & BUILTIN_CMDLINE)) ++ if ((current_term != prev_term) && (flags & BUILTIN_CMDLINE)){ ++ if (prev_term->shutdown) ++ prev_term->shutdown(); ++ if (current_term->startup) { ++ /* If startup fails, return to previous term */ ++ if (current_term->startup() == 0) { ++ current_term = prev_term; ++ max_lines = current_term->max_lines; ++ if (current_term->cls) { ++ current_term->cls(); ++ } ++ } ++ } + grub_longjmp (restart_cmdline_env, 0); ++ } + + return 0; + } +@@ -4264,7 +4548,7 @@ + "terminal", + terminal_func, + BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST, +- "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules]", ++ "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]", + "Select a terminal. When multiple terminals are specified, wait until" + " you push any key to continue. If both console and serial are specified," + " the terminal to which you input a key first will be selected. If no" +@@ -4276,7 +4560,7 @@ + " seconds. The option --lines specifies the maximum number of lines." + " The option --silent is used to suppress messages." + }; +-#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */ ++#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */ + + + #ifdef SUPPORT_SERIAL +@@ -4795,13 +5079,20 @@ + /* The table of builtin commands. Sorted in dictionary order. */ + struct builtin *builtin_table[] = + { ++#ifdef SUPPORT_GRAPHICS ++ &builtin_background, ++#endif + &builtin_blocklist, + &builtin_boot, + #ifdef SUPPORT_NETBOOT + &builtin_bootp, + #endif /* SUPPORT_NETBOOT */ ++#ifdef SUPPORT_GRAPHICS ++ &builtin_border, ++#endif + &builtin_cat, + &builtin_chainloader, ++ &builtin_clear, + &builtin_cmp, + &builtin_color, + &builtin_configfile, +@@ -4821,6 +5112,9 @@ + &builtin_embed, + &builtin_fallback, + &builtin_find, ++#ifdef SUPPORT_GRAPHICS ++ &builtin_foreground, ++#endif + &builtin_fstest, + &builtin_geometry, + &builtin_halt, +@@ -4864,9 +5158,13 @@ + #endif /* SUPPORT_SERIAL */ + &builtin_setkey, + &builtin_setup, +-#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) ++#ifdef SUPPORT_GRAPHICS ++ &builtin_shade, ++ &builtin_splashimage, ++#endif /* SUPPORT_GRAPHICS */ ++#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS) + &builtin_terminal, +-#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */ ++#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */ + #ifdef SUPPORT_SERIAL + &builtin_terminfo, + #endif /* SUPPORT_SERIAL */ +@@ -4880,5 +5178,8 @@ + &builtin_unhide, + &builtin_uppermem, + &builtin_vbeprobe, ++#ifdef SUPPORT_GRAPHICS ++ &builtin_viewport, ++#endif + 0 + }; +Index: b/stage2/char_io.c +=================================================================== +--- a/stage2/char_io.c ++++ b/stage2/char_io.c +@@ -29,12 +29,17 @@ + # include + #endif + ++#ifdef SUPPORT_GRAPHICS ++# include ++#endif ++ + #ifndef STAGE1_5 + struct term_entry term_table[] = + { + { + "console", + 0, ++ 24, + console_putchar, + console_checkkey, + console_getkey, +@@ -43,13 +48,16 @@ + console_cls, + console_setcolorstate, + console_setcolor, +- console_setcursor ++ console_setcursor, ++ 0, ++ 0 + }, + #ifdef SUPPORT_SERIAL + { + "serial", + /* A serial device must be initialized. */ + TERM_NEED_INIT, ++ 24, + serial_putchar, + serial_checkkey, + serial_getkey, +@@ -58,6 +66,8 @@ + serial_cls, + serial_setcolorstate, + 0, ++ 0, ++ 0, + 0 + }, + #endif /* SUPPORT_SERIAL */ +@@ -65,6 +75,7 @@ + { + "hercules", + 0, ++ 24, + hercules_putchar, + console_checkkey, + console_getkey, +@@ -73,11 +84,30 @@ + hercules_cls, + hercules_setcolorstate, + hercules_setcolor, +- hercules_setcursor ++ hercules_setcursor, ++ 0, ++ 0 + }, + #endif /* SUPPORT_HERCULES */ ++#ifdef SUPPORT_GRAPHICS ++ { "graphics", ++ TERM_NEED_INIT, /* flags */ ++ 30, /* number of lines */ ++ graphics_putchar, /* putchar */ ++ console_checkkey, /* checkkey */ ++ console_getkey, /* getkey */ ++ graphics_getxy, /* getxy */ ++ graphics_gotoxy, /* gotoxy */ ++ graphics_cls, /* cls */ ++ graphics_setcolorstate, /* setcolorstate */ ++ graphics_setcolor, /* setcolor */ ++ graphics_setcursor, /* nocursor */ ++ graphics_init, /* initialize */ ++ graphics_end /* shutdown */ ++ }, ++#endif /* SUPPORT_GRAPHICS */ + /* This must be the last entry. */ +- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ++ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + }; + + /* This must be console. */ +@@ -305,9 +335,10 @@ + + /* XXX: These should be defined in shared.h, but I leave these here, + until this code is freezed. */ +-#define CMDLINE_WIDTH 78 + #define CMDLINE_MARGIN 10 +- ++ ++ /* command-line limits */ ++ int cmdline_width = 78, col_start = 0; + int xpos, lpos, c, section; + /* The length of PROMPT. */ + int plen; +@@ -338,7 +369,7 @@ + + /* If the cursor is in the first section, display the first section + instead of the second. */ +- if (section == 1 && plen + lpos < CMDLINE_WIDTH) ++ if (section == 1 && plen + lpos < cmdline_width) + cl_refresh (1, 0); + else if (xpos - count < 1) + cl_refresh (1, 0); +@@ -354,7 +385,7 @@ + grub_putchar ('\b'); + } + else +- gotoxy (xpos, getxy () & 0xFF); ++ gotoxy (xpos + col_start, getxy () & 0xFF); + } + } + +@@ -364,7 +395,7 @@ + lpos += count; + + /* If the cursor goes outside, scroll the screen to the right. */ +- if (xpos + count >= CMDLINE_WIDTH) ++ if (xpos + count >= cmdline_width) + cl_refresh (1, 0); + else + { +@@ -383,7 +414,7 @@ + } + } + else +- gotoxy (xpos, getxy () & 0xFF); ++ gotoxy (xpos + col_start, getxy () & 0xFF); + } + } + +@@ -398,14 +429,14 @@ + if (full) + { + /* Recompute the section number. */ +- if (lpos + plen < CMDLINE_WIDTH) ++ if (lpos + plen < cmdline_width) + section = 0; + else +- section = ((lpos + plen - CMDLINE_WIDTH) +- / (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN) + 1); ++ section = ((lpos + plen - cmdline_width) ++ / (cmdline_width - 1 - CMDLINE_MARGIN) + 1); + + /* From the start to the end. */ +- len = CMDLINE_WIDTH; ++ len = cmdline_width; + pos = 0; + grub_putchar ('\r'); + +@@ -445,8 +476,8 @@ + if (! full) + offset = xpos - 1; + +- start = ((section - 1) * (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN) +- + CMDLINE_WIDTH - plen - CMDLINE_MARGIN); ++ start = ((section - 1) * (cmdline_width - 1 - CMDLINE_MARGIN) ++ + cmdline_width - plen - CMDLINE_MARGIN); + xpos = lpos + 1 - start; + start += offset; + } +@@ -471,7 +502,7 @@ + + /* If the cursor is at the last position, put `>' or a space, + depending on if there are more characters in BUF. */ +- if (pos == CMDLINE_WIDTH) ++ if (pos == cmdline_width) + { + if (start + len < llen) + grub_putchar ('>'); +@@ -488,7 +519,7 @@ + grub_putchar ('\b'); + } + else +- gotoxy (xpos, getxy () & 0xFF); ++ gotoxy (xpos + col_start, getxy () & 0xFF); + } + + /* Initialize the command-line. */ +@@ -518,10 +549,10 @@ + + llen += l; + lpos += l; +- if (xpos + l >= CMDLINE_WIDTH) ++ if (xpos + l >= cmdline_width) + cl_refresh (1, 0); +- else if (xpos + l + llen - lpos > CMDLINE_WIDTH) +- cl_refresh (0, CMDLINE_WIDTH - xpos); ++ else if (xpos + l + llen - lpos > cmdline_width) ++ cl_refresh (0, cmdline_width - xpos); + else + cl_refresh (0, l + llen - lpos); + } +@@ -533,12 +564,22 @@ + grub_memmove (buf + lpos, buf + lpos + count, llen - count + 1); + llen -= count; + +- if (xpos + llen + count - lpos > CMDLINE_WIDTH) +- cl_refresh (0, CMDLINE_WIDTH - xpos); ++ if (xpos + llen + count - lpos > cmdline_width) ++ cl_refresh (0, cmdline_width - xpos); + else + cl_refresh (0, llen + count - lpos); + } + ++ max_lines = current_term->max_lines; ++#ifdef SUPPORT_GRAPHICS ++ if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0) ++ { ++ cmdline_width = (view_x1 - view_x0) - 2; ++ col_start = view_x0; ++ max_lines = view_y1 - view_y0; ++ } ++#endif ++ + plen = grub_strlen (prompt); + llen = grub_strlen (cmdline); + +@@ -1006,6 +1047,48 @@ + } + #endif /* ! STAGE1_5 */ + ++#ifndef STAGE1_5 ++/* Internal pager. */ ++int ++do_more (void) ++{ ++ if (count_lines >= 0) ++ { ++ count_lines++; ++ if (count_lines >= max_lines - 2) ++ { ++ int tmp; ++ ++ /* It's important to disable the feature temporarily, because ++ the following grub_printf call will print newlines. */ ++ count_lines = -1; ++ ++ grub_printf("\n"); ++ if (current_term->setcolorstate) ++ current_term->setcolorstate (COLOR_STATE_HIGHLIGHT); ++ ++ grub_printf ("[Hit return to continue]"); ++ ++ if (current_term->setcolorstate) ++ current_term->setcolorstate (COLOR_STATE_NORMAL); ++ ++ ++ do ++ { ++ tmp = ASCII_CHAR (getkey ()); ++ } ++ while (tmp != '\n' && tmp != '\r'); ++ grub_printf ("\r \r"); ++ ++ /* Restart to count lines. */ ++ count_lines = 0; ++ return 1; ++ } ++ } ++ return 0; ++} ++#endif ++ + /* Display an ASCII character. */ + void + grub_putchar (int c) +@@ -1034,38 +1117,11 @@ + + if (c == '\n') + { ++ int flag; + /* Internal `more'-like feature. */ +- if (count_lines >= 0) +- { +- count_lines++; +- if (count_lines >= max_lines - 2) +- { +- int tmp; +- +- /* It's important to disable the feature temporarily, because +- the following grub_printf call will print newlines. */ +- count_lines = -1; +- +- if (current_term->setcolorstate) +- current_term->setcolorstate (COLOR_STATE_HIGHLIGHT); +- +- grub_printf ("\n[Hit return to continue]"); +- +- if (current_term->setcolorstate) +- current_term->setcolorstate (COLOR_STATE_NORMAL); +- +- do +- { +- tmp = ASCII_CHAR (getkey ()); +- } +- while (tmp != '\n' && tmp != '\r'); +- grub_printf ("\r \r"); +- +- /* Restart to count lines. */ +- count_lines = 0; +- return; +- } +- } ++ flag = do_more (); ++ if (flag) ++ return; + } + + current_term->putchar (c); +@@ -1090,7 +1146,7 @@ + cls (void) + { + /* If the terminal is dumb, there is no way to clean the terminal. */ +- if (current_term->flags & TERM_DUMB) ++ if (current_term->flags & TERM_DUMB) + grub_putchar ('\n'); + else + current_term->cls (); +@@ -1217,6 +1273,16 @@ + return ! errnum; + } + ++void ++grub_memcpy(void *dest, const void *src, int len) ++{ ++ int i; ++ register char *d = (char*)dest, *s = (char*)src; ++ ++ for (i = 0; i < len; i++) ++ d[i] = s[i]; ++} ++ + void * + grub_memmove (void *to, const void *from, int len) + { +Index: b/stage2/cmdline.c +=================================================================== +--- a/stage2/cmdline.c ++++ b/stage2/cmdline.c +@@ -50,10 +50,11 @@ + void + print_cmdline_message (int forever) + { +- printf (" [ Minimal BASH-like line editing is supported. For the first word, TAB\n" +- " lists possible command completions. Anywhere else TAB lists the possible\n" +- " completions of a device/filename.%s ]\n", +- (forever ? "" : " ESC at any time exits.")); ++ grub_printf(" [ Minimal BASH-like line editing is supported. For\n" ++ " the first word, TAB lists possible command\n" ++ " completions. Anywhere else TAB lists the possible\n" ++ " completions of a device/filename.%s ]\n", ++ (forever ? "" : " ESC at any time\n exits.")); + } + + /* Find the builtin whose command name is COMMAND and return the +Index: b/stage2/graphics.c +=================================================================== +--- /dev/null ++++ b/stage2/graphics.c +@@ -0,0 +1,585 @@ ++/* ++ * graphics.c - graphics mode support for GRUB ++ * Implemented as a terminal type by Jeremy Katz based ++ * on a patch by Paulo César Pereira de Andrade ++ * Options and enhancements made by Herton Ronaldo Krzesinski ++ * ++ * ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2001,2002 Red Hat, Inc. ++ * Portions copyright (C) 2000 Conectiva, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#ifdef SUPPORT_GRAPHICS ++ ++#include ++#include ++#include ++ ++int saved_videomode; ++unsigned char *font8x16; ++ ++int graphics_inited = 0; ++static char splashimage[256]; ++ ++int shade = 1, no_cursor = 0; ++ ++#define VSHADOW VSHADOW1 ++unsigned char VSHADOW1[38400]; ++unsigned char VSHADOW2[38400]; ++unsigned char VSHADOW4[38400]; ++unsigned char VSHADOW8[38400]; ++ ++/* define the default viewable area */ ++int view_x0 = 0; ++int view_y0 = 0; ++int view_x1 = 80; ++int view_y1 = 30; ++ ++/* text buffer has to be kept around so that we can write things as we ++ * scroll and the like */ ++unsigned short text[80 * 30]; ++ ++/* graphics options */ ++int foreground = (63 << 16) | (63 << 8) | (63), background = 0, window_border = 0; ++ ++/* current position */ ++static int fontx = 0; ++static int fonty = 0; ++ ++/* global state so that we don't try to recursively scroll or cursor */ ++static int no_scroll = 0; ++ ++/* color state */ ++static int graphics_standard_color = A_NORMAL; ++static int graphics_normal_color = A_NORMAL; ++static int graphics_highlight_color = A_REVERSE; ++static int graphics_current_color = A_NORMAL; ++static color_state graphics_color_state = COLOR_STATE_STANDARD; ++ ++static inline void outb(unsigned short port, unsigned char val) ++{ ++ __asm __volatile ("outb %0,%1"::"a" (val), "d" (port)); ++} ++ ++static void MapMask(int value) { ++ outb(0x3c4, 2); ++ outb(0x3c5, value); ++} ++ ++/* bit mask register */ ++static void BitMask(int value) { ++ outb(0x3ce, 8); ++ outb(0x3cf, value); ++} ++ ++/* move the graphics cursor location to col, row */ ++static void graphics_setxy(int col, int row) { ++ if (col >= view_x0 && col < view_x1) { ++ fontx = col; ++ cursorX = col << 3; ++ } ++ if (row >= view_y0 && row < view_y1) { ++ fonty = row; ++ cursorY = row << 4; ++ } ++} ++ ++/* scroll the screen */ ++static void graphics_scroll() { ++ int i, j, k; ++ ++ /* we don't want to scroll recursively... that would be bad */ ++ if (no_scroll) ++ return; ++ no_scroll = 1; ++ ++ /* disable pager temporarily */ ++ k = count_lines; ++ count_lines = -1; ++ ++ /* move everything up a line */ ++ for (j = view_y0 + 1; j < view_y1; j++) { ++ graphics_gotoxy(view_x0, j - 1); ++ for (i = view_x0; i < view_x1; i++) { ++ graphics_putchar(text[j * 80 + i]); ++ } ++ } ++ ++ /* last line should be blank */ ++ graphics_gotoxy(view_x0, view_y1 - 1); ++ for (i = view_x0; i < view_x1; i++) ++ graphics_putchar(' '); ++ graphics_setxy(view_x0, view_y1 - 1); ++ ++ count_lines = k; ++ ++ no_scroll = 0; ++} ++ ++/* Set the splash image */ ++void graphics_set_splash(char *splashfile) { ++ grub_strcpy(splashimage, splashfile); ++} ++ ++/* Get the current splash image */ ++char *graphics_get_splash(void) { ++ return splashimage; ++} ++ ++/* ++ * Initialize a vga16 graphics display with the palette based off of ++ * the image in splashimage. If the image doesn't exist, leave graphics ++ * mode. The mode initiated is 12h. From "Ralf Brown's Interrupt List": ++ * text/ text pixel pixel colors disply scrn system ++ * grph resol box resolution pages addr ++ * 12h G 80x30 8x16 640x480 16/256K . A000 VGA,ATI VIP ++ * G 80x30 8x16 640x480 16/64 . A000 ATI EGA Wonder ++ * G . . 640x480 16 . . UltraVision+256K EGA ++ */ ++int graphics_init() ++{ ++ if (!graphics_inited) { ++ saved_videomode = set_videomode(0x12); ++ if (get_videomode() != 0x12) { ++ set_videomode(saved_videomode); ++ return 0; ++ } ++ graphics_inited = 1; ++ } ++ else ++ return 1; ++ ++ font8x16 = (unsigned char*)graphics_get_font(); ++ ++ /* make sure that the highlight color is set correctly */ ++ graphics_highlight_color = ((graphics_normal_color >> 4) | ++ ((graphics_normal_color & 0xf) << 4)); ++ ++ graphics_cls(); ++ ++ if (!read_image(splashimage)) { ++ grub_printf("Failed to read splash image (%s)\n", splashimage); ++ grub_printf("Press any key to continue..."); ++ getkey(); ++ set_videomode(saved_videomode); ++ graphics_inited = 0; ++ return 0; ++ } ++ ++ set_int1c_handler(); ++ ++ return 1; ++} ++ ++/* Leave graphics mode */ ++void graphics_end(void) ++{ ++ if (graphics_inited) { ++ unset_int1c_handler(); ++ set_videomode(saved_videomode); ++ graphics_inited = 0; ++ no_cursor = 0; ++ } ++} ++ ++/* Print ch on the screen. Handle any needed scrolling or the like */ ++void graphics_putchar(int ch) { ++ ch &= 0xff; ++ ++ graphics_cursor(0); ++ ++ if (ch == '\n') { ++ if (fonty + 1 < view_y1) ++ graphics_setxy(fontx, fonty + 1); ++ else ++ graphics_scroll(); ++ graphics_cursor(1); ++ return; ++ } else if (ch == '\r') { ++ graphics_setxy(view_x0, fonty); ++ graphics_cursor(1); ++ return; ++ } ++ ++ graphics_cursor(0); ++ ++ text[fonty * 80 + fontx] = ch; ++ text[fonty * 80 + fontx] &= 0x00ff; ++ if (graphics_current_color & 0xf0) ++ text[fonty * 80 + fontx] |= 0x100; ++ ++ graphics_cursor(0); ++ ++ if ((fontx + 1) >= view_x1) { ++ graphics_setxy(view_x0, fonty); ++ if (fonty + 1 < view_y1) ++ graphics_setxy(view_x0, fonty + 1); ++ else ++ graphics_scroll(); ++ graphics_cursor(1); ++ do_more (); ++ graphics_cursor(0); ++ } else { ++ graphics_setxy(fontx + 1, fonty); ++ } ++ ++ graphics_cursor(1); ++} ++ ++/* get the current location of the cursor */ ++int graphics_getxy(void) { ++ return (fontx << 8) | fonty; ++} ++ ++void graphics_gotoxy(int x, int y) { ++ graphics_cursor(0); ++ ++ graphics_setxy(x, y); ++ ++ graphics_cursor(1); ++} ++ ++void graphics_cls(void) { ++ int i; ++ unsigned char *mem, *s1, *s2, *s4, *s8; ++ ++ graphics_cursor(0); ++ graphics_gotoxy(view_x0, view_y0); ++ ++ mem = (unsigned char*)VIDEOMEM; ++ s1 = (unsigned char*)VSHADOW1; ++ s2 = (unsigned char*)VSHADOW2; ++ s4 = (unsigned char*)VSHADOW4; ++ s8 = (unsigned char*)VSHADOW8; ++ ++ for (i = 0; i < 80 * 30; i++) ++ text[i] = ' '; ++ graphics_cursor(1); ++ ++ BitMask(0xff); ++ ++ /* plane 1 */ ++ MapMask(1); ++ grub_memcpy(mem, s1, 38400); ++ ++ /* plane 2 */ ++ MapMask(2); ++ grub_memcpy(mem, s2, 38400); ++ ++ /* plane 3 */ ++ MapMask(4); ++ grub_memcpy(mem, s4, 38400); ++ ++ /* plane 4 */ ++ MapMask(8); ++ grub_memcpy(mem, s8, 38400); ++ ++ MapMask(15); ++ ++ if (no_cursor) { ++ no_cursor = 0; ++ set_int1c_handler(); ++ } ++} ++ ++void graphics_setcolorstate (color_state state) { ++ switch (state) { ++ case COLOR_STATE_STANDARD: ++ graphics_current_color = graphics_standard_color; ++ break; ++ case COLOR_STATE_NORMAL: ++ graphics_current_color = graphics_normal_color; ++ break; ++ case COLOR_STATE_HIGHLIGHT: ++ graphics_current_color = graphics_highlight_color; ++ break; ++ default: ++ graphics_current_color = graphics_standard_color; ++ break; ++ } ++ ++ graphics_color_state = state; ++} ++ ++void graphics_setcolor (int normal_color, int highlight_color) { ++ graphics_normal_color = normal_color; ++ graphics_highlight_color = highlight_color; ++ ++ graphics_setcolorstate (graphics_color_state); ++} ++ ++int graphics_setcursor (int on) { ++ if (!no_cursor && !on) { ++ no_cursor = 1; ++ unset_int1c_handler(); ++ graphics_cursor(0); ++ } ++ else if(no_cursor && on) { ++ no_cursor = 0; ++ set_int1c_handler(); ++ graphics_cursor(1); ++ } ++ return 0; ++} ++ ++/* Read in the splashscreen image and set the palette up appropriately. ++ * Format of splashscreen is an xpm (can be gzipped) with 16 colors and ++ * 640x480. */ ++int read_image(char *s) ++{ ++ char buf[32], pal[16], c; ++ unsigned char base, mask, *s1, *s2, *s4, *s8; ++ unsigned i, len, idx, colors, x, y, width, height; ++ ++ if (!grub_open(s)) ++ return 0; ++ ++ /* read header */ ++ if (!grub_read((char*)&buf, 10) || grub_memcmp(buf, "/* XPM */\n", 10)) { ++ grub_close(); ++ return 0; ++ } ++ ++ /* parse info */ ++ while (grub_read(&c, 1)) { ++ if (c == '"') ++ break; ++ } ++ ++ while (grub_read(&c, 1) && (c == ' ' || c == '\t')) ++ ; ++ ++ i = 0; ++ width = c - '0'; ++ while (grub_read(&c, 1)) { ++ if (c >= '0' && c <= '9') ++ width = width * 10 + c - '0'; ++ else ++ break; ++ } ++ while (grub_read(&c, 1) && (c == ' ' || c == '\t')) ++ ; ++ ++ height = c - '0'; ++ while (grub_read(&c, 1)) { ++ if (c >= '0' && c <= '9') ++ height = height * 10 + c - '0'; ++ else ++ break; ++ } ++ while (grub_read(&c, 1) && (c == ' ' || c == '\t')) ++ ; ++ ++ colors = c - '0'; ++ while (grub_read(&c, 1)) { ++ if (c >= '0' && c <= '9') ++ colors = colors * 10 + c - '0'; ++ else ++ break; ++ } ++ ++ base = 0; ++ while (grub_read(&c, 1) && c != '"') ++ ; ++ ++ /* palette */ ++ for (i = 0, idx = 1; i < colors; i++) { ++ len = 0; ++ ++ while (grub_read(&c, 1) && c != '"') ++ ; ++ grub_read(&c, 1); /* char */ ++ base = c; ++ grub_read(buf, 4); /* \t c # */ ++ ++ while (grub_read(&c, 1) && c != '"') { ++ if (len < sizeof(buf)) ++ buf[len++] = c; ++ } ++ ++ if (len == 6 && idx < 15) { ++ int r = ((hex(buf[0]) << 4) | hex(buf[1])) >> 2; ++ int g = ((hex(buf[2]) << 4) | hex(buf[3])) >> 2; ++ int b = ((hex(buf[4]) << 4) | hex(buf[5])) >> 2; ++ ++ pal[idx] = base; ++ graphics_set_palette(idx, r, g, b); ++ ++idx; ++ } ++ } ++ ++ x = y = len = 0; ++ ++ s1 = (unsigned char*)VSHADOW1; ++ s2 = (unsigned char*)VSHADOW2; ++ s4 = (unsigned char*)VSHADOW4; ++ s8 = (unsigned char*)VSHADOW8; ++ ++ for (i = 0; i < 38400; i++) ++ s1[i] = s2[i] = s4[i] = s8[i] = 0; ++ ++ /* parse xpm data */ ++ while (y < height) { ++ while (1) { ++ if (!grub_read(&c, 1)) { ++ grub_close(); ++ return 0; ++ } ++ if (c == '"') ++ break; ++ } ++ ++ while (grub_read(&c, 1) && c != '"') { ++ for (i = 1; i < 15; i++) ++ if (pal[i] == c) { ++ c = i; ++ break; ++ } ++ ++ mask = 0x80 >> (x & 7); ++ if (c & 1) ++ s1[len + (x >> 3)] |= mask; ++ if (c & 2) ++ s2[len + (x >> 3)] |= mask; ++ if (c & 4) ++ s4[len + (x >> 3)] |= mask; ++ if (c & 8) ++ s8[len + (x >> 3)] |= mask; ++ ++ if (++x >= 640) { ++ x = 0; ++ ++ if (y < 480) ++ len += 80; ++ ++y; ++ } ++ } ++ } ++ ++ grub_close(); ++ ++ graphics_set_palette(0, (background >> 16), (background >> 8) & 63, ++ background & 63); ++ graphics_set_palette(15, (foreground >> 16), (foreground >> 8) & 63, ++ foreground & 63); ++ graphics_set_palette(0x11, (window_border >> 16), (window_border >> 8) & 63, ++ window_border & 63); ++ ++ return 1; ++} ++ ++/* Convert a character which is a hex digit to the appropriate integer */ ++int hex(int v) ++{ ++ if (v >= 'A' && v <= 'F') ++ return (v - 'A' + 10); ++ if (v >= 'a' && v <= 'f') ++ return (v - 'a' + 10); ++ return (v - '0'); ++} ++ ++void graphics_cursor(int set) { ++ unsigned char *pat, *mem, *ptr, chr[16 << 2]; ++ int i, ch, invert, offset; ++ ++ if (set && (no_cursor || no_scroll)) ++ return; ++ ++ offset = cursorY * 80 + fontx; ++ ch = text[fonty * 80 + fontx] & 0xff; ++ invert = (text[fonty * 80 + fontx] & 0xff00) != 0; ++ pat = font8x16 + (ch << 4); ++ ++ mem = (unsigned char*)VIDEOMEM + offset; ++ ++ if (!set) { ++ for (i = 0; i < 16; i++) { ++ unsigned char mask = pat[i]; ++ ++ if (!invert) { ++ chr[i ] = ((unsigned char*)VSHADOW1)[offset]; ++ chr[16 + i] = ((unsigned char*)VSHADOW2)[offset]; ++ chr[32 + i] = ((unsigned char*)VSHADOW4)[offset]; ++ chr[48 + i] = ((unsigned char*)VSHADOW8)[offset]; ++ ++ if (shade) { ++ if (ch == DISP_VERT || ch == DISP_LL || ++ ch == DISP_UR || ch == DISP_LR) { ++ unsigned char pmask = ~(pat[i] >> 1); ++ ++ chr[i ] &= pmask; ++ chr[16 + i] &= pmask; ++ chr[32 + i] &= pmask; ++ chr[48 + i] &= pmask; ++ } ++ if (i > 0 && ch != DISP_VERT) { ++ unsigned char pmask = ~(pat[i - 1] >> 1); ++ ++ chr[i ] &= pmask; ++ chr[16 + i] &= pmask; ++ chr[32 + i] &= pmask; ++ chr[48 + i] &= pmask; ++ if (ch == DISP_HORIZ || ch == DISP_UR || ch == DISP_LR) { ++ pmask = ~pat[i - 1]; ++ ++ chr[i ] &= pmask; ++ chr[16 + i] &= pmask; ++ chr[32 + i] &= pmask; ++ chr[48 + i] &= pmask; ++ } ++ } ++ } ++ chr[i ] |= mask; ++ chr[16 + i] |= mask; ++ chr[32 + i] |= mask; ++ chr[48 + i] |= mask; ++ ++ offset += 80; ++ } ++ else { ++ chr[i ] = mask; ++ chr[16 + i] = mask; ++ chr[32 + i] = mask; ++ chr[48 + i] = mask; ++ } ++ } ++ } ++ else { ++ MapMask(15); ++ ptr = mem; ++ for (i = 0; i < 16; i++, ptr += 80) { ++ cursorBuf[i] = pat[i]; ++ *ptr = ~pat[i]; ++ } ++ return; ++ } ++ ++ offset = 0; ++ for (i = 1; i < 16; i <<= 1, offset += 16) { ++ int j; ++ ++ MapMask(i); ++ ptr = mem; ++ for (j = 0; j < 16; j++, ptr += 80) ++ *ptr = chr[j + offset]; ++ } ++ ++ MapMask(15); ++} ++ ++#endif /* SUPPORT_GRAPHICS */ +Index: b/stage2/graphics.h +=================================================================== +--- /dev/null ++++ b/stage2/graphics.h +@@ -0,0 +1,44 @@ ++/* graphics.h - graphics console interface */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2002 Free Software Foundation, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#ifndef GRAPHICS_H ++#define GRAPHICS_H ++ ++/* magic constant */ ++#define VIDEOMEM 0xA0000 ++ ++/* function prototypes */ ++char *graphics_get_splash(void); ++ ++int read_image(char *s); ++void graphics_cursor(int set); ++ ++/* function prototypes for asm functions */ ++void * graphics_get_font(); ++void graphics_set_palette(int idx, int red, int green, int blue); ++void set_int1c_handler(); ++void unset_int1c_handler(); ++ ++extern short cursorX, cursorY; ++extern char cursorBuf[16]; ++extern int shade; ++extern int view_x0, view_y0, view_x1, view_y1; ++ ++#endif /* GRAPHICS_H */ +Index: b/stage2/Makefile.am +=================================================================== +--- a/stage2/Makefile.am ++++ b/stage2/Makefile.am +@@ -7,7 +7,7 @@ + fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \ + imgact_aout.h iso9660.h jfs.h mb_header.h mb_info.h md5.h \ + nbi.h pc_slice.h serial.h shared.h smp-imps.h term.h \ +- terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h ++ terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h graphics.h + EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS) + + # For . +@@ -19,7 +19,7 @@ + disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \ + fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \ + fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \ +- terminfo.c tparm.c ++ terminfo.c tparm.c graphics.c + libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \ + -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \ + -DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \ +@@ -79,8 +79,14 @@ + HERCULES_FLAGS = + endif + ++if GRAPHICS_SUPPORT ++GRAPHICS_FLAGS = -DSUPPORT_GRAPHICS=1 ++else ++GRAPHICS_FLAGS = ++endif ++ + STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \ +- $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) ++ $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) $(GRAPHICS_FLAGS) + + STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000 + STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 +@@ -90,7 +96,8 @@ + cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \ + fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \ + fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \ +- hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c ++ hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \ ++ graphics.c + pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) + pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) + pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK) +Index: b/stage2/shared.h +=================================================================== +--- a/stage2/shared.h ++++ b/stage2/shared.h +@@ -796,6 +796,11 @@ + /* Set the cursor position. */ + void gotoxy (int x, int y); + ++/* Internal pager ++ Returns 1 = if pager was used ++ 0 = if pager wasn't used */ ++int do_more (void); ++ + /* Displays an ASCII character. IBM displays will translate some + characters to special graphical ones (see the DISP_* constants). */ + void grub_putchar (int c); +@@ -875,6 +880,7 @@ + int grub_tolower (int c); + int grub_isspace (int c); + int grub_strncat (char *s1, const char *s2, int n); ++void grub_memcpy(void *dest, const void *src, int len); + void *grub_memmove (void *to, const void *from, int len); + void *grub_memset (void *start, int c, int len); + int grub_strncat (char *s1, const char *s2, int n); +Index: b/stage2/stage2.c +=================================================================== +--- a/stage2/stage2.c ++++ b/stage2/stage2.c +@@ -20,6 +20,12 @@ + #include + #include + ++#ifdef SUPPORT_GRAPHICS ++# include ++#endif ++ ++int col_start, col_end, row_start, box_size; ++ + grub_jmp_buf restart_env; + + #if defined(PRESET_MENU_STRING) || defined(SUPPORT_DISKLESS) +@@ -105,13 +111,13 @@ + if (highlight && current_term->setcolorstate) + current_term->setcolorstate (COLOR_STATE_HIGHLIGHT); + +- gotoxy (2, y); ++ gotoxy (2 + col_start, y); + grub_putchar (' '); +- for (x = 3; x < 75; x++) ++ for (x = 3 + col_start; x < (col_end - 5); x++) + { +- if (*entry && x <= 72) ++ if (*entry && x <= (col_end - 8)) + { +- if (x == 72) ++ if (x == (col_end - 8)) + grub_putchar (DISP_RIGHT); + else + grub_putchar (*entry++); +@@ -119,7 +125,7 @@ + else + grub_putchar (' '); + } +- gotoxy (74, y); ++ gotoxy ((col_end - 6), y); + + if (current_term->setcolorstate) + current_term->setcolorstate (COLOR_STATE_STANDARD); +@@ -131,7 +137,7 @@ + { + int i; + +- gotoxy (77, y + 1); ++ gotoxy ((col_end - 3), y + 1); + + if (first) + grub_putchar (DISP_UP); +@@ -151,14 +157,14 @@ + menu_entries++; + } + +- gotoxy (77, y + size); ++ gotoxy ((col_end - 3), y + size); + + if (*menu_entries) + grub_putchar (DISP_DOWN); + else + grub_putchar (' '); + +- gotoxy (74, y + entryno + 1); ++ gotoxy ((col_end - 6), y + entryno + 1); + } + + static void +@@ -196,30 +202,30 @@ + if (current_term->setcolorstate) + current_term->setcolorstate (COLOR_STATE_NORMAL); + +- gotoxy (1, y); ++ gotoxy (1 + col_start, y); + + grub_putchar (DISP_UL); +- for (i = 0; i < 73; i++) ++ for (i = col_start; i < (col_end - 7); i++) + grub_putchar (DISP_HORIZ); + grub_putchar (DISP_UR); + + i = 1; + while (1) + { +- gotoxy (1, y + i); ++ gotoxy (1 + col_start, y + i); + + if (i > size) + break; + + grub_putchar (DISP_VERT); +- gotoxy (75, y + i); ++ gotoxy ((col_end - 5), y + i); + grub_putchar (DISP_VERT); + + i++; + } + + grub_putchar (DISP_LL); +- for (i = 0; i < 73; i++) ++ for (i = col_start; i < (col_end - 7); i++) + grub_putchar (DISP_HORIZ); + grub_putchar (DISP_LR); + +@@ -233,6 +239,7 @@ + { + int c, time1, time2 = -1, first_entry = 0; + char *cur_entry = 0; ++ struct term_entry *prev_term = NULL; + + /* + * Main loop for menu UI. +@@ -250,6 +257,22 @@ + } + } + ++ col_start = 0; ++ col_end = 80; ++ row_start = 0; ++ box_size = 12; ++ /* if we're using viewport we need to make sure to setup ++ coordinates correctly. */ ++#ifdef SUPPORT_GRAPHICS ++ if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0) ++ { ++ col_start = view_x0; ++ col_end = view_x1; ++ row_start = view_y0; ++ box_size = (view_y1 - view_y0) - 13; ++ } ++#endif ++ + /* If the timeout was expired or wasn't set, force to show the menu + interface. */ + if (grub_timeout < 0) +@@ -302,36 +325,36 @@ + if (current_term->flags & TERM_DUMB) + print_entries_raw (num_entries, first_entry, menu_entries); + else +- print_border (3, 12); ++ print_border (3 + row_start, box_size); + + grub_printf ("\n\ +- Use the %c and %c keys to select which entry is highlighted.\n", ++ Use the %c and %c keys to select which entry is highlighted.\n", + DISP_UP, DISP_DOWN); + + if (! auth && password) + { + printf ("\ +- Press enter to boot the selected OS or \'p\' to enter a\n\ +- password to unlock the next set of features."); ++ Press enter to boot the selected OS or \'p\' to enter a\n\ ++ password to unlock the next set of features."); + } + else + { + if (config_entries) + printf ("\ +- Press enter to boot the selected OS, \'e\' to edit the\n\ +- commands before booting, or \'c\' for a command-line."); ++ Press enter to boot the selected OS, \'e\' to edit the\n\ ++ commands before booting, or \'c\' for a command-line."); + else + printf ("\ +- Press \'b\' to boot, \'e\' to edit the selected command in the\n\ +- boot sequence, \'c\' for a command-line, \'o\' to open a new line\n\ +- after (\'O\' for before) the selected line, \'d\' to remove the\n\ +- selected line, or escape to go back to the main menu."); ++ Press \'b\' to boot, \'e\' to edit the selected command in the\n\ ++ boot sequence, \'c\' for a command-line, \'o\' to open a new line\n\ ++ after (\'O\' for before) the selected line, \'d\' to remove the\n\ ++ selected line, or escape to go back to the main menu."); + } + + if (current_term->flags & TERM_DUMB) + grub_printf ("\n\nThe selected entry is %d ", entryno); + else +- print_entries (3, 12, first_entry, entryno, menu_entries); ++ print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); + } + + /* XX using RT clock now, need to initialize value */ +@@ -358,10 +381,10 @@ + entryno, grub_timeout); + else + { +- gotoxy (3, 22); +- grub_printf ("The highlighted entry will be booted automatically in %d seconds. ", ++ gotoxy (3 + col_start, 10 + box_size + row_start); ++ grub_printf (" The highlighted entry will be booted automatically in %d seconds. ", + grub_timeout); +- gotoxy (74, 4 + entryno); ++ gotoxy ((col_end - 6), 4 + entryno + row_start); + } + + grub_timeout--; +@@ -387,12 +410,12 @@ + if (current_term->flags & TERM_DUMB) + grub_putchar ('\r'); + else +- gotoxy (3, 22); ++ gotoxy (3 + col_start, 10 + box_size + row_start); + printf (" "); + grub_timeout = -1; + fallback_entryno = -1; + if (! (current_term->flags & TERM_DUMB)) +- gotoxy (74, 4 + entryno); ++ gotoxy ((col_end - 6), 4 + entryno + row_start); + } + + /* We told them above (at least in SUPPORT_SERIAL) to use +@@ -408,12 +431,12 @@ + { + if (entryno > 0) + { +- print_entry (4 + entryno, 0, ++ print_entry (4 + entryno + row_start, 0, + get_entry (menu_entries, + first_entry + entryno, + 0)); + entryno--; +- print_entry (4 + entryno, 1, ++ print_entry (4 + entryno + row_start, 1, + get_entry (menu_entries, + first_entry + entryno, + 0)); +@@ -421,7 +444,7 @@ + else if (first_entry > 0) + { + first_entry--; +- print_entries (3, 12, first_entry, entryno, ++ print_entries (3 + row_start, box_size, first_entry, entryno, + menu_entries); + } + } +@@ -433,29 +456,29 @@ + entryno++; + else + { +- if (entryno < 11) ++ if (entryno < (box_size - 1)) + { +- print_entry (4 + entryno, 0, ++ print_entry (4 + entryno + row_start, 0, + get_entry (menu_entries, + first_entry + entryno, + 0)); + entryno++; +- print_entry (4 + entryno, 1, ++ print_entry (4 + entryno + row_start, 1, + get_entry (menu_entries, + first_entry + entryno, + 0)); + } +- else if (num_entries > 12 + first_entry) ++ else if (num_entries > box_size + first_entry) + { + first_entry++; +- print_entries (3, 12, first_entry, entryno, menu_entries); ++ print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); + } + } + } + else if (c == 7) + { + /* Page Up */ +- first_entry -= 12; ++ first_entry -= box_size; + if (first_entry < 0) + { + entryno += first_entry; +@@ -463,20 +486,20 @@ + if (entryno < 0) + entryno = 0; + } +- print_entries (3, 12, first_entry, entryno, menu_entries); ++ print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); + } + else if (c == 3) + { + /* Page Down */ +- first_entry += 12; ++ first_entry += box_size; + if (first_entry + entryno + 1 >= num_entries) + { +- first_entry = num_entries - 12; ++ first_entry = num_entries - box_size; + if (first_entry < 0) + first_entry = 0; + entryno = num_entries - first_entry - 1; + } +- print_entries (3, 12, first_entry, entryno, menu_entries); ++ print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); + } + + if (config_entries) +@@ -489,7 +512,7 @@ + if ((c == 'd') || (c == 'o') || (c == 'O')) + { + if (! (current_term->flags & TERM_DUMB)) +- print_entry (4 + entryno, 0, ++ print_entry (4 + entryno + row_start, 0, + get_entry (menu_entries, + first_entry + entryno, + 0)); +@@ -537,7 +560,7 @@ + + if (entryno >= num_entries) + entryno--; +- if (first_entry && num_entries < 12 + first_entry) ++ if (first_entry && num_entries < box_size + first_entry) + first_entry--; + } + +@@ -549,7 +572,7 @@ + grub_printf ("\n"); + } + else +- print_entries (3, 12, first_entry, entryno, menu_entries); ++ print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); + } + + cur_entry = menu_entries; +@@ -570,7 +593,7 @@ + if (current_term->flags & TERM_DUMB) + grub_printf ("\r "); + else +- gotoxy (1, 21); ++ gotoxy (1 + col_start, 9 + box_size + row_start); + + /* Wipe out the previously entered password */ + grub_memset (entered, 0, sizeof (entered)); +@@ -717,6 +740,15 @@ + + cls (); + setcursor (1); ++ /* if our terminal needed initialization, we should shut it down ++ * before booting the kernel, but we want to save what it was so ++ * we can come back if needed */ ++ prev_term = current_term; ++ if (current_term->shutdown) ++ { ++ current_term->shutdown(); ++ current_term = term_table; /* assumption: console is first */ ++ } + + while (1) + { +@@ -752,6 +784,13 @@ + break; + } + ++ /* if we get back here, we should go back to what our term was before */ ++ current_term = prev_term; ++ if (current_term->startup) ++ /* if our terminal fails to initialize, fall back to console since ++ * it should always work */ ++ if (current_term->startup() == 0) ++ current_term = term_table; /* we know that console is first */ + show_menu = 1; + goto restart; + } +@@ -1054,6 +1093,16 @@ + while (is_preset); + } + ++ /* go ahead and make sure the terminal is setup */ ++ if (current_term->startup) ++ { ++ /* If initialization fails, go back to default terminal */ ++ if (current_term->startup() == 0) ++ { ++ current_term = term_table; ++ } ++ } ++ + if (! num_entries) + { + /* If no acceptable config file, goto command-line, starting +Index: b/stage2/term.h +=================================================================== +--- a/stage2/term.h ++++ b/stage2/term.h +@@ -60,6 +60,8 @@ + const char *name; + /* The feature flags defined above. */ + unsigned long flags; ++ /* Default for maximum number of lines if not specified */ ++ unsigned short max_lines; + /* Put a character. */ + void (*putchar) (int c); + /* Check if any input character is available. */ +@@ -79,6 +81,10 @@ + void (*setcolor) (int normal_color, int highlight_color); + /* Turn on/off the cursor. */ + int (*setcursor) (int on); ++ /* function to start a terminal */ ++ int (*startup) (void); ++ /* function to use to shutdown a terminal */ ++ void (*shutdown) (void); + }; + + /* This lists up available terminals. */ +@@ -124,4 +130,24 @@ + int hercules_setcursor (int on); + #endif + ++#ifdef SUPPORT_GRAPHICS ++extern int foreground, background, window_border, graphics_inited, saved_videomode; ++ ++void graphics_set_splash(char *splashfile); ++int set_videomode(int mode); ++int get_videomode(void); ++void graphics_putchar (int c); ++int graphics_getxy(void); ++void graphics_gotoxy(int x, int y); ++void graphics_cls(void); ++void graphics_setcolorstate (color_state state); ++void graphics_setcolor (int normal_color, int highlight_color); ++int graphics_setcursor (int on); ++int graphics_init(void); ++void graphics_end(void); ++ ++int hex(int v); ++void graphics_set_palette(int idx, int red, int green, int blue); ++#endif /* SUPPORT_GRAPHICS */ ++ + #endif /* ! GRUB_TERM_HEADER */ --- grub-0.97.orig/debian/patches/grub-install_addsyncs.patch +++ grub-0.97/debian/patches/grub-install_addsyncs.patch @@ -0,0 +1,57 @@ + + Date: 2005-11-11 + Author: Otavio Salvador + Comment: Stolen from Fedora grub package. + Add syncs to ensure that filesystem cache are flushed. + + -- Original comment, bellow + +I just found another semi-critical bug, whose fix should really get +into 0.91. + +It turns out that "grub-install" doesn't have any "sync" calls to make +sure any filesystem caches are coherent with the raw devices they are +on top of... so if your filesystem waits to write out any data from the +copy command in the script to put the "stage1" and "stage2" in their +final location, you're hosed. + +I found this because it just bit me on one of my systems running stock +RedHat 7.2 with a large "stage2". + +The only script that is patched here is "grub-install". The others +don't appear to need it as they either unmount things first or don't +refer to devices. + +Hmm. Maybe the right fix is to make the "sync" system call when +starting the GRUB shell with a device map that refers to any real disks +or something like that. + + Erich Stefan Boleyn http://www.uruk.org/ +"Reality is truly stranger than fiction; Probably why fiction is so popular" + +Index: b/util/grub-install.in +=================================================================== +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -384,6 +384,10 @@ + # Create a safe temporary file. + test -n "$mklog" && log_file=`$mklog` + ++ # Before all invocations of the grub shell, call sync to make sure ++ # the raw device is in sync with any bufferring in filesystems. ++ sync ++ + $grub_shell --batch $no_floppy --device-map=$device_map <$log_file + quit + EOF +@@ -509,6 +513,10 @@ + # Create a safe temporary file. + test -n "$mklog" && log_file=`$mklog` + ++# Before all invocations of the grub shell, call sync to make sure ++# the raw device is in sync with any bufferring in filesystems. ++sync ++ + # Now perform the installation. + $grub_shell --batch $no_floppy --device-map=$device_map <$log_file + root $root_drive --- grub-0.97.orig/debian/patches/grub-install_aoe_support.patch +++ grub-0.97/debian/patches/grub-install_aoe_support.patch @@ -0,0 +1,23 @@ +Index: b/util/grub-install.in +=================================================================== +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -148,13 +148,16 @@ + -e 's%\(d[0-9]*\)p[0-9]*$%\1%' \ + -e 's%\(fd[0-9]*\)$%\1%' \ + -e 's%/part[0-9]*$%/disc%' \ +- -e 's%\(c[0-7]d[0-9]*\).*$%\1%'` ++ -e 's%\(c[0-7]d[0-9]*\).*$%\1%' \ ++ -e 's%\(e[0-9]\.[0-9]*\).*$%\1%'` + tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \ + -e 's%.*d[0-9]*p%%' \ + -e 's%.*/fd[0-9]*$%%' \ + -e 's%.*/floppy/[0-9]*$%%' \ + -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \ +- -e 's%.*c[0-7]d[0-9]*p%%'` ++ -e 's%.*c[0-7]d[0-9]*p*%%' \ ++ -e 's%.*e[0-9]\.[0-9]*p%%' \ ++ -e 's%.*e[0-9]\.[0-9]*\$%%'` + ;; + gnu*) + tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'` --- grub-0.97.orig/debian/patches/grub-install_regexp.patch +++ grub-0.97/debian/patches/grub-install_regexp.patch @@ -0,0 +1,30 @@ +Index: b/util/grub-install.in +=================================================================== +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -179,7 +179,7 @@ + + # Get the drive name. + tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk *$" \ +- | sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%'` ++ | sed 's%.*\(([hf]d[0-9][a-z0-9,]*)\).*%\1%'` + + # If not found, print an error message and exit. + if test "x$tmp_drive" = x; then +@@ -196,13 +196,13 @@ + gnu*) + if echo $tmp_part | grep "^s" >/dev/null; then + tmp_pc_slice=`echo $tmp_part \ +- | sed "s%s\([0-9]*\)[a-g]*$%\1%"` ++ | sed "s%s\([0-9]*\)[a-z]*$%\1%"` + tmp_drive=`echo "$tmp_drive" \ + | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"` + fi +- if echo $tmp_part | grep "[a-g]$" >/dev/null; then ++ if echo $tmp_part | grep "[a-z]$" >/dev/null; then + tmp_bsd_partition=`echo "$tmp_part" \ +- | sed "s%[^a-g]*\([a-g]\)$%\1%"` ++ | sed "s%[^a-z]*\([a-z]\)$%\1%"` + tmp_drive=`echo "$tmp_drive" \ + | sed "s%)%,$tmp_bsd_partition)%"` + fi --- grub-0.97.orig/debian/patches/grub-install_xvd.patch +++ grub-0.97/debian/patches/grub-install_xvd.patch @@ -0,0 +1,13 @@ +Index: b/util/grub-install.in +=================================================================== +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -104,7 +104,7 @@ + )" + + # Convert RAID devices list into a list of disks +- tmp_disks=`echo "$devices" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ ++ tmp_disks=`echo "$devices" | sed -e 's%\(\(s\|h\|xv\)d[a-z]\)[0-9]*$%\1%' \ + -e 's%\(d[0-9]*\)p[0-9]*$%\1%' \ + -e 's%\(fd[0-9]*\)$%\1%' \ + -e 's%/part[0-9]*$%/disc%' \ --- grub-0.97.orig/debian/patches/grub-special_device_names.patch +++ grub-0.97/debian/patches/grub-special_device_names.patch @@ -0,0 +1,13 @@ +Index: b/lib/device.c +=================================================================== +--- a/lib/device.c ++++ b/lib/device.c +@@ -973,6 +973,8 @@ + else + { + if ((strncmp (dev, "/dev/ataraid/", 13) == 0) || ++ (strncmp (dev, "/dev/ida/", 9) == 0) || ++ (strncmp (dev, "/dev/cciss/", 11) == 0) || + (strncmp (dev, "/dev/rd/", 8) == 0)) + strcpy (dev + strlen(dev), "p"); + } --- grub-0.97.orig/debian/patches/grub-xvd_drives.patch +++ grub-0.97/debian/patches/grub-xvd_drives.patch @@ -0,0 +1,51 @@ +Index: b/lib/device.c +=================================================================== +--- a/lib/device.c ++++ b/lib/device.c +@@ -395,6 +395,16 @@ + #endif + } + ++static void ++get_xvd_disk_name (char *name, int unit) ++{ ++#ifdef __linux__ ++ sprintf (name, "/dev/xvd%c", unit + 'a'); ++#else ++# warning "Xen XVD drives cannot be guessed in your operating system." ++ *name = 0; ++#endif ++} + #ifdef __linux__ + static void + get_dac960_disk_name (char *name, int controller, int drive) +@@ -788,7 +798,28 @@ + num_hd++; + } + } +- ++ ++#ifdef __linux__ ++ /* Xen Virtual Disks. */ ++ for (i = 0; i < 16; i++) ++ { ++ char name[16]; ++ ++ get_xvd_disk_name (name, i); ++ if (check_device (name)) ++ { ++ (*map)[num_hd + 0x80] = strdup (name); ++ assert ((*map)[num_hd + 0x80]); ++ ++ /* If the device map file is opened, write the map. */ ++ if (fp) ++ fprintf (fp, "(hd%d)\t%s\n", num_hd, name); ++ ++ num_hd++; ++ } ++ } ++#endif ++ + #ifdef __linux__ + /* This is for DAC960 - we have + /dev/rd/cdp. --- grub-0.97.orig/debian/patches/initrd_max_address.patch +++ grub-0.97/debian/patches/initrd_max_address.patch @@ -0,0 +1,25 @@ + + Date: 2005-11-11 + Author: Otavio Salvador + Comment: Stolen from SuSE grub package. + It fix the max address of initrd image and include a safe + default in case of it isn't available + +Index: b/stage2/boot.c +=================================================================== +--- a/stage2/boot.c ++++ b/stage2/boot.c +@@ -824,8 +824,11 @@ + moveto = (mbi.mem_upper + 0x400) << 10; + + moveto = (moveto - len) & 0xfffff000; +- max_addr = (lh->header == LINUX_MAGIC_SIGNATURE && lh->version >= 0x0203 +- ? lh->initrd_addr_max : LINUX_INITRD_MAX_ADDRESS); ++ max_addr = LINUX_INITRD_MAX_ADDRESS; ++ if (lh->header == LINUX_MAGIC_SIGNATURE && ++ lh->version >= 0x0203 && ++ lh->initrd_addr_max < max_addr) ++ max_addr = lh->initrd_addr_max; + if (moveto + len >= max_addr) + moveto = (max_addr - len) & 0xfffff000; + --- grub-0.97.orig/debian/patches/intelmac.patch +++ grub-0.97/debian/patches/intelmac.patch @@ -0,0 +1,69 @@ +Index: b/stage2/asm.S +=================================================================== +--- a/stage2/asm.S ++++ b/stage2/asm.S +@@ -1651,7 +1651,29 @@ + jnz 3f + ret + +-3: /* use keyboard controller */ ++3: /* ++ * try to switch gateA20 using PORT92, the "Fast A20 and Init" ++ * register ++ */ ++ mov $0x92, %dx ++ inb %dx, %al ++ /* skip the port92 code if it's unimplemented (read returns 0xff) */ ++ cmpb $0xff, %al ++ jz 6f ++ ++ /* set or clear bit1, the ALT_A20_GATE bit */ ++ movb 4(%esp), %ah ++ testb %ah, %ah ++ jz 4f ++ orb $2, %al ++ jmp 5f ++4: and $0xfd, %al ++ ++ /* clear the INIT_NOW bit don't accidently reset the machine */ ++5: and $0xfe, %al ++ outb %al, %dx ++ ++6: /* use keyboard controller */ + pushl %eax + + call gloop1 +@@ -1661,9 +1683,12 @@ + + gloopint1: + inb $K_STATUS ++ cmpb $0xff, %al ++ jz gloopint1_done + andb $K_IBUF_FUL, %al + jnz gloopint1 + ++gloopint1_done: + movb $KB_OUTPUT_MASK, %al + cmpb $0, 0x8(%esp) + jz gdoit +@@ -1684,6 +1709,8 @@ + + gloop1: + inb $K_STATUS ++ cmpb $0xff, %al ++ jz gloop2ret + andb $K_IBUF_FUL, %al + jnz gloop1 + +@@ -1991,6 +2018,11 @@ + ENTRY(console_getkey) + push %ebp + ++wait_for_key: ++ call EXT_C(console_checkkey) ++ incl %eax ++ jz wait_for_key ++ + call EXT_C(prot_to_real) + .code16 + --- grub-0.97.orig/debian/patches/menu.lst_gnu-hurd.patch +++ grub-0.97/debian/patches/menu.lst_gnu-hurd.patch @@ -0,0 +1,21 @@ +Index: b/docs/menu.lst +=================================================================== +--- a/docs/menu.lst ++++ b/docs/menu.lst +@@ -11,11 +11,12 @@ + # Fallback to the second entry. + fallback 1 + +-# For booting GNU/Hurd +-title GNU/Hurd ++# For booting GNU (also known as GNU/Hurd) ++title GNU (also known as GNU/Hurd) + root (hd0,0) +-kernel /boot/gnumach.gz root=hd0s1 +-module /boot/serverboot.gz ++kernel /boot/gnumach.gz root=device:hd0s1 ++module /hurd/ext2fs.static --multiboot-command-line=${kernel-command-line} --host-priv-port=${host-port} --device-master-port=${device-port} --exec-server-task=${exec-task} -T typed ${root} $(task-create) $(task-resume) ++module /lib/ld.so.1 /hurd/exec $(exec-task=task-create) + + # For booting GNU/Linux + title GNU/Linux --- grub-0.97.orig/debian/patches/modern-automake.patch +++ grub-0.97/debian/patches/modern-automake.patch @@ -0,0 +1,69 @@ +Description: Adjust to work with modern Automake +Author: Colin Watson +Bug-Debian: http://bugs.debian.org/724383 +Forwarded: no +Last-Update: 2013-09-24 + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -60,8 +60,7 @@ + _AM_DEPENDENCIES(CC) + + dnl Because recent automake complains about AS, set it here. +-CCAS="$CC" +-AC_SUBST(CCAS) ++AM_PROG_AS + + AC_ARG_WITH(binutils, + [ --with-binutils=DIR search the directory DIR to find binutils]) +Index: b/stage1/Makefile.am +=================================================================== +--- a/stage1/Makefile.am ++++ b/stage1/Makefile.am +@@ -1,5 +1,5 @@ +-pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor) +-nodist_pkglib_DATA = stage1 ++pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor) ++nodist_pkgdata_DATA = stage1 + + CLEANFILES = $(nodist_pkglib_DATA) + +Index: b/stage2/Makefile.am +=================================================================== +--- a/stage2/Makefile.am ++++ b/stage2/Makefile.am +@@ -27,12 +27,12 @@ + -DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 + + # Stage 2 and Stage 1.5's. +-pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor) ++pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor) + + EXTRA_PROGRAMS = nbloader.exec pxeloader.exec diskless.exec + + if DISKLESS_SUPPORT +-pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \ ++pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \ + ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \ + reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \ + nbgrub pxegrub +@@ -43,7 +43,7 @@ + reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \ + xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec + else +-pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \ ++pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \ + ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \ + reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 + noinst_DATA = pre_stage2 start start_eltorito +@@ -112,7 +112,7 @@ + BUILT_SOURCES = stage2_size.h + endif + +-CLEANFILES = $(pkglib_DATA) $(noinst_DATA) $(BUILT_SOURCES) ++CLEANFILES = $(pkgdata_DATA) $(noinst_DATA) $(BUILT_SOURCES) + + stage2_size.h: pre_stage2 + -rm -f stage2_size.h --- grub-0.97.orig/debian/patches/mprotect.patch +++ grub-0.97/debian/patches/mprotect.patch @@ -0,0 +1,40 @@ +Index: b/grub/asmstub.c +=================================================================== +--- a/grub/asmstub.c ++++ b/grub/asmstub.c +@@ -42,6 +42,12 @@ + #include + #include + #include ++#include ++ ++#include ++#ifndef PAGESIZE ++#define PAGESIZE 4096 ++#endif + + #ifdef __linux__ + # include /* ioctl */ +@@ -148,6 +154,22 @@ + assert (grub_scratch_mem == 0); + scratch = malloc (0x100000 + EXTENDED_MEMSIZE + 15); + assert (scratch); ++ ++ { ++ char *p; ++ int ret; ++ ++ /* Align to a multiple of PAGESIZE, assumed to be a power of two. */ ++ p = (char *) (((long) scratch) & ~(PAGESIZE - 1)); ++ ++ /* The simulated stack needs to be executable, since GCC uses stack ++ * trampolines to implement nested functions. ++ */ ++ ret = mprotect (p, 0x100000 + EXTENDED_MEMSIZE + 15, ++ PROT_READ | PROT_WRITE | PROT_EXEC); ++ assert (ret == 0); ++ } ++ + grub_scratch_mem = (char *) ((((int) scratch) >> 4) << 4); + + /* FIXME: simulate the memory holes using mprot, if available. */ --- grub-0.97.orig/debian/patches/no-reorder-functions.patch +++ grub-0.97/debian/patches/no-reorder-functions.patch @@ -0,0 +1,27 @@ +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -112,6 +112,22 @@ + if test "x$grub_cv_cc_no_stack_protector" = xyes; then + STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector" + fi ++ # GCC >= 3.3 supports -fno-reorder-functions; this defends us against ++ # unlikely-to-be-executed functions being linked before _start with GCC ++ # >= 4.6. ++ AC_CACHE_CHECK([whether gcc has -fno-reorder-functions], ++ no_reorder_functions_flag, [ ++ saved_CFLAGS=$CFLAGS ++ CFLAGS="-fno-reorder-functions" ++ AC_TRY_COMPILE(, ++ , ++ no_reorder_functions_flag=yes, ++ no_reorder_functions_flag=no) ++ CFLAGS=$saved_CFLAGS ++ ]) ++ if test "x$no_reorder_functions_flag" = xyes; then ++ STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-reorder-functions" ++ fi + fi + fi + --- grub-0.97.orig/debian/patches/print_func.patch +++ grub-0.97/debian/patches/print_func.patch @@ -0,0 +1,82 @@ +2006-01-05 Otavio Salvador + + * Rediff. + +2005-16-10 Samuel Thibault + + * docs/grub.texi: Added print command description. + * stage2/builtins.c(print_func): New function. + (builtin_print): New variable. + (builtin_table): Added builtin_print in table. + +Debian Status Following: + Added by: Otavio Salvador + Date: 2006-01-05 + +Index: b/docs/grub.texi +=================================================================== +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -2681,6 +2681,7 @@ + * module:: Load a module + * modulenounzip:: Load a module without decompression + * pause:: Wait for a key press ++* print:: Print a message + * quit:: Exit from the grub shell + * reboot:: Reboot your computer + * read:: Read data from memory +@@ -3087,6 +3088,16 @@ + @end deffn + + ++@node print ++@subsection print ++ ++@deffn Command print message @dots{} ++Print the @var{message}. Note that placing @key{^G} (ASCII code 7) in the ++message will cause the speaker to emit the standard beep sound, which is ++useful for visually impaired people. ++@end deffn ++ ++ + @node quit + @subsection quit + +Index: b/stage2/builtins.c +=================================================================== +--- a/stage2/builtins.c ++++ b/stage2/builtins.c +@@ -2595,6 +2595,25 @@ + "Probe I/O ports used for the drive DRIVE." + }; + ++/* print */ ++static int ++print_func (char *arg, int flags) ++{ ++ printf("%s\n", arg); ++ ++ return 0; ++} ++ ++static struct builtin builtin_print = ++{ ++ "print", ++ print_func, ++ BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_NO_ECHO, ++ "print [MESSAGE ...]", ++ "Print MESSAGE." ++}; ++ ++ + + /* kernel */ + static int +@@ -5142,6 +5161,7 @@ + &builtin_parttype, + &builtin_password, + &builtin_pause, ++ &builtin_print, + #ifdef GRUB_UTIL + &builtin_quit, + #endif /* GRUB_UTIL */ --- grub-0.97.orig/debian/patches/raid.patch +++ grub-0.97/debian/patches/raid.patch @@ -0,0 +1,72 @@ + +Copyright: Charles Steinkuehler , except he borrowed +some code from other sources. He's cooperative about rewriting and/or doing +the paperwork. +Upstream: pending + +Index: b/util/grub-install.in +=================================================================== +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -81,6 +81,50 @@ + EOF + } + ++# Usage: getraid_mdadm mddevice ++# Routine to find a physical device from an md device ++# If found, the first grub BIOS device (from device.map) is returned ++# If no BIOS drives match the RAID devices, the first device returned ++# from mdadm -D is returned ++getraid_mdadm() { ++ device=$1 ++ mdadm=$(mdadm -D "$device") || { ++ echo "$PROG: mdadm -D $device failed" >&2 ++ exit 1 ++ } ++ eval "$( ++ echo "$mdadm" | awk ' ++ $1 == "Number" && $2 == "Major" { start = 1; next } ++ $1 == "UUID" { print "uuid=" $3; start = 0; next } ++ !start { next } ++ $2 == 0 && $3 == 0 { next } ++ { devices = devices "\n" $NF } ++ END { print "devices='\''" devices "'\''" } ++ ' ++ )" ++ ++ # Convert RAID devices list into a list of disks ++ tmp_disks=`echo "$devices" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ ++ -e 's%\(d[0-9]*\)p[0-9]*$%\1%' \ ++ -e 's%\(fd[0-9]*\)$%\1%' \ ++ -e 's%/part[0-9]*$%/disc%' \ ++ -e 's%\(c[0-7]d[0-9]*\).*$%\1%' \ ++ -e '/^$/d' | ++ sed -n '1h;2,$H;${g;s/\n/|/g;p}'` ++ ++ # Find first BIOS disk that's a member of the RAID array ++ # Default to first RAID member if no tmp_disks are BIOS devices ++ set -- `egrep $tmp_disks $device_map | \ ++ sort | \ ++ sed -n 1p ` ++ device=${2:-${tmp_disks%%|*}} ++ ++ # Return first partition on BIOS disk that's part of the RAID ++ echo "$devices" | \ ++ sed -n "\:${device}:p" | \ ++ sed -n 1p ++} ++ + # Usage: convert os_device + # Convert an OS device to the corresponding GRUB drive. + # This part is OS-specific. +@@ -96,6 +140,10 @@ + # Break the device name into the disk part and the partition part. + case "$host_os" in + linux*) ++ # Find an actual physical device if we're passed a RAID device ++ case $1 in ++ /dev/md*) set -- `getraid_mdadm $1` ++ esac + tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ + -e 's%\(d[0-9]*\)p[0-9]*$%\1%' \ + -e 's%\(fd[0-9]*\)$%\1%' \ --- grub-0.97.orig/debian/patches/raid_cciss.patch +++ grub-0.97/debian/patches/raid_cciss.patch @@ -0,0 +1,98 @@ +Index: b/lib/device.c +=================================================================== +--- a/lib/device.c ++++ b/lib/device.c +@@ -403,6 +403,18 @@ + } + + static void ++get_cciss_disk_name (char *name, int controller, int drive) ++{ ++ sprintf (name, "/dev/cciss/c%dd%d", controller, drive); ++} ++ ++static void ++get_ida_disk_name (char *name, int controller, int drive) ++{ ++ sprintf (name, "/dev/ida/c%dd%d", controller, drive); ++} ++ ++static void + get_ataraid_disk_name (char *name, int unit) + { + sprintf (name, "/dev/ataraid/d%c", unit + '0'); +@@ -830,6 +842,74 @@ + } + } + } ++ ++ /* This is for CCISS, its like the DAC960 - we have ++ /dev/cciss/dp ++ ++ It currently supports up to 3 controllers, 10 logical volumes ++ and 10 partitions ++ ++ Code gratuitously copied from DAC960 above. ++ Horms 23rd July 2004 ++ */ ++ { ++ int controller, drive; ++ ++ for (controller = 0; controller < 2; controller++) ++ { ++ for (drive = 0; drive < 9; drive++) ++ { ++ char name[24]; ++ ++ get_cciss_disk_name (name, controller, drive); ++ if (check_device (name)) ++ { ++ (*map)[num_hd + 0x80] = strdup (name); ++ assert ((*map)[num_hd + 0x80]); ++ ++ /* If the device map file is opened, write the map. */ ++ if (fp) ++ fprintf (fp, "(hd%d)\t%s\n", num_hd, name); ++ ++ num_hd++; ++ } ++ } ++ } ++ } ++ ++ /* This is for Compaq Smart Array, its like the DAC960 - we have ++ /dev/ida/dp ++ ++ It currently supports up to 3 controllers, 10 logical volumes ++ and 15 partitions ++ ++ Code gratuitously copied from DAC960 above. ++ Piotr Roszatycki ++ */ ++ { ++ int controller, drive; ++ ++ for (controller = 0; controller < 2; controller++) ++ { ++ for (drive = 0; drive < 9; drive++) ++ { ++ char name[24]; ++ ++ get_ida_disk_name (name, controller, drive); ++ if (check_device (name)) ++ { ++ (*map)[num_hd + 0x80] = strdup (name); ++ assert ((*map)[num_hd + 0x80]); ++ ++ /* If the device map file is opened, write the map. */ ++ if (fp) ++ fprintf (fp, "(hd%d)\t%s\n", num_hd, name); ++ ++ num_hd++; ++ } ++ } ++ } ++ } + #endif /* __linux__ */ + + /* OK, close the device map file if opened. */ --- grub-0.97.orig/debian/patches/savedefault.patch +++ grub-0.97/debian/patches/savedefault.patch @@ -0,0 +1,183 @@ +Index: b/stage2/builtins.c +=================================================================== +--- a/stage2/builtins.c ++++ b/stage2/builtins.c +@@ -86,6 +86,10 @@ + inside other functions. */ + static int configfile_func (char *arg, int flags); + ++static int savedefault_helper (char *arg, int flags); ++ ++static int savedefault_shell (char *arg, int flags); ++ + /* Initialize the data for builtins. */ + void + init_builtins (void) +@@ -3512,7 +3516,109 @@ + static int + savedefault_func (char *arg, int flags) + { +-#if !defined(SUPPORT_DISKLESS) && !defined(GRUB_UTIL) ++#if !defined(SUPPORT_DISKLESS) ++ #if !defined(GRUB_UTIL) ++ return savedefault_helper(arg, flags); ++ #else ++ return savedefault_shell(arg, flags); ++ #endif ++#else /* !SUPPORT_DISKLESS */ ++ errnum = ERR_UNRECOGNIZED; ++ return 1; ++#endif /* !SUPPORT_DISKLESS */ ++} ++ ++#if !defined(SUPPORT_DISKLESS) && defined(GRUB_UTIL) ++/* savedefault_shell */ ++static int ++savedefault_shell(char *arg, int flags) ++ { ++ int once_only = 0; ++ int new_default; ++ int curr_default = -1; ++ int curr_prev_default = -1; ++ int new_prev_default = -1; ++ FILE *fp; ++ size_t bytes = 10; ++ char line[bytes]; ++ char *default_file = (char *) DEFAULT_FILE_BUF; ++ char buf[bytes]; ++ int i; ++ ++ while (1) ++ { ++ if (grub_memcmp ("--default=", arg, sizeof ("--default=") - 1) == 0) ++ { ++ char *p = arg + sizeof ("--default=") - 1; ++ if (! safe_parse_maxint (&p, &new_default)) ++ return 1; ++ arg = skip_to (0, arg); ++ } ++ else if (grub_memcmp ("--once", arg, sizeof ("--once") - 1) == 0) ++ { ++ once_only = 1; ++ arg = skip_to (0, arg); ++ } ++ else ++ break; ++ } ++ ++ *default_file = 0; ++ grub_strncat (default_file, config_file, DEFAULT_FILE_BUFLEN); ++ for (i = grub_strlen(default_file); i >= 0; i--) ++ if (default_file[i] == '/') ++ { ++ i++; ++ break; ++ } ++ default_file[i] = 0; ++ grub_strncat (default_file + i, "default", DEFAULT_FILE_BUFLEN - i); ++ ++ if(!(fp = fopen(default_file,"r"))) ++ { ++ errnum = ERR_READ; ++ goto fail; ++ } ++ ++ fgets(line, bytes, fp); ++ fclose(fp); ++ ++ sscanf(line, "%d:%d", &curr_prev_default, &curr_default); ++ ++ if(curr_default != -1) ++ new_prev_default = curr_default; ++ else ++ { ++ if(curr_prev_default != -1) ++ new_prev_default = curr_prev_default; ++ else ++ new_prev_default = 0; ++ } ++ ++ if(once_only) ++ sprintf(buf, "%d:%d", new_prev_default, new_default); ++ else ++ sprintf(buf, "%d", new_default); ++ ++ if(!(fp = fopen(default_file,"w"))) ++ { ++ errnum = ERR_READ; ++ goto fail; ++ } ++ ++ fprintf(fp, buf); ++ ++fail: ++ fclose(fp); ++ return errnum; ++} ++#endif ++ ++/* savedefault_helper */ ++static int ++savedefault_helper (char *arg, int flags) ++{ ++#if !defined(SUPPORT_DISKLESS) + unsigned long tmp_drive = saved_drive; + unsigned long tmp_partition = saved_partition; + char *default_file = (char *) DEFAULT_FILE_BUF; +@@ -3588,22 +3694,26 @@ + + disk_read_hook = disk_read_savesect_func; + len = grub_read (buf, sizeof (buf)); ++ buf[9]='\0';/* Make sure grub_strstr() below terminates */ + disk_read_hook = 0; + grub_close (); + +- if (len != sizeof (buf)) +- { +- /* This is too small. Do not modify the file manually, please! */ +- errnum = ERR_READ; +- goto fail; +- } +- + if (sector_count > 2) + { + /* Is this possible?! Too fragmented! */ + errnum = ERR_FSYS_CORRUPT; + goto fail; + } ++ ++ char *tmp; ++ if((tmp = grub_strstr(buf, ":")) != NULL) ++ { ++ int f_len = grub_strlen(buf) - grub_strlen(tmp); ++ char *def; ++ buf[f_len] = '\0'; ++ def = buf; ++ safe_parse_maxint (&def, &entryno); ++ } + + /* Set up a string to be written. */ + grub_memset (buf, '\n', sizeof (buf)); +Index: b/stage2/stage2.c +=================================================================== +--- a/stage2/stage2.c ++++ b/stage2/stage2.c +@@ -934,8 +934,16 @@ + len = grub_read (buf, sizeof (buf)); + if (len > 0) + { +- buf[sizeof (buf) - 1] = 0; +- safe_parse_maxint (&p, &saved_entryno); ++ char *tmp; ++ char *def; ++ if((tmp = grub_strstr(p, ":")) != NULL) ++ { ++ *tmp++; ++ grub_strcpy(&def, &tmp); ++ }else ++ grub_strcpy(&def, &p); ++ ++ safe_parse_maxint (&def, &saved_entryno); + } + + grub_close (); --- grub-0.97.orig/debian/patches/series +++ grub-0.97/debian/patches/series @@ -0,0 +1,28 @@ +menu.lst_gnu-hurd.patch +graphics.patch +raid.patch +raid_cciss.patch +xfs_freeze.patch +2gb_limit.patch +grub-special_device_names.patch +grub-xvd_drives.patch +initrd_max_address.patch +splashimage_help.patch +grub-install_addsyncs.patch +grub-install_regexp.patch +grub-install_aoe_support.patch +grub-install_xvd.patch +geometry-26kernel.patch +print_func.patch +mprotect.patch +savedefault.patch +find-grub-dir.patch +intelmac.patch +crossreference_manpages.patch +ext3_256byte_inode.patch +use_grub-probe_in_grub-install.patch +no-reorder-functions.patch + +# We aren't building amd64 binaries, see #244498 +#fix_amd64_compile.patch +modern-automake.patch --- grub-0.97.orig/debian/patches/splashimage_help.patch +++ grub-0.97/debian/patches/splashimage_help.patch @@ -0,0 +1,35 @@ + + Date: 2005-11-11 + Author: Otavio Salvador + Comment: Stolen from Fedora grub package. + Add document entry for splashimage option. + +Index: b/docs/grub.texi +=================================================================== +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -2184,6 +2184,7 @@ + * rarp:: Initialize a network device via RARP + * serial:: Set up a serial device + * setkey:: Configure the key map ++* splashimage:: Use a splash image + * terminal:: Choose a terminal + * terminfo:: Define escape sequences for a terminal + * tftpserver:: Specify a TFTP server +@@ -2563,6 +2564,16 @@ + @end deffn + + ++@node splashimage ++@subsection splashimage ++ ++@deffn Command splashimage file ++Select an image to use as the background image. This should be ++specified using normal GRUB device naming syntax. The format of the ++file is a gzipped xpm which is 640x480 with a 14 color palette. ++@end deffn ++ ++ + @node terminal + @subsection terminal + --- grub-0.97.orig/debian/patches/use_grub-probe_in_grub-install.patch +++ grub-0.97/debian/patches/use_grub-probe_in_grub-install.patch @@ -0,0 +1,148 @@ +Index: b/util/grub-install.in +=================================================================== +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -137,106 +137,12 @@ + exit 1 + fi + +- # Break the device name into the disk part and the partition part. +- case "$host_os" in +- linux*) + # Find an actual physical device if we're passed a RAID device + case $1 in +- /dev/md*) set -- `getraid_mdadm $1` ++ /dev/md* | /dev/md/*) set -- `getraid_mdadm $1` + esac +- tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \ +- -e 's%\(d[0-9]*\)p[0-9]*$%\1%' \ +- -e 's%\(fd[0-9]*\)$%\1%' \ +- -e 's%/part[0-9]*$%/disc%' \ +- -e 's%\(c[0-7]d[0-9]*\).*$%\1%' \ +- -e 's%\(e[0-9]\.[0-9]*\).*$%\1%'` +- tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \ +- -e 's%.*d[0-9]*p%%' \ +- -e 's%.*/fd[0-9]*$%%' \ +- -e 's%.*/floppy/[0-9]*$%%' \ +- -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \ +- -e 's%.*c[0-7]d[0-9]*p*%%' \ +- -e 's%.*e[0-9]\.[0-9]*p%%' \ +- -e 's%.*e[0-9]\.[0-9]*\$%%'` +- ;; +- gnu*) +- tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'` +- tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;; +- freebsd* | kfreebsd*-gnu) +- tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \ +- | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'` +- tmp_part=`echo "$1" \ +- | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \ +- | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"` +- ;; +- netbsd* | knetbsd*-gnu) +- tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([sw]d[0-9]*\).*$%r\1d%' \ +- | sed 's%r\{0,1\}\(fd[0-9]*\).*$%r\1a%'` +- tmp_part=`echo "$1" \ +- | sed "s%.*/r\{0,1\}[sw]d[0-9]\([abe-p]\)%\1%"` +- ;; +- *) +- echo "grub-install does not support your OS yet." 1>&2 +- exit 1 ;; +- esac +- +- # Get the drive name. +- tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk *$" \ +- | sed 's%.*\(([hf]d[0-9][a-z0-9,]*)\).*%\1%'` +- +- # If not found, print an error message and exit. +- if test "x$tmp_drive" = x; then +- echo "$1 does not have any corresponding BIOS drive." 1>&2 +- exit 1 +- fi + +- if test "x$tmp_part" != x; then +- # If a partition is specified, we need to translate it into the +- # GRUB's syntax. +- case "$host_os" in +- linux*) +- echo "$tmp_drive" | sed "s%)$%,`expr $tmp_part - 1`)%" ;; +- gnu*) +- if echo $tmp_part | grep "^s" >/dev/null; then +- tmp_pc_slice=`echo $tmp_part \ +- | sed "s%s\([0-9]*\)[a-z]*$%\1%"` +- tmp_drive=`echo "$tmp_drive" \ +- | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"` +- fi +- if echo $tmp_part | grep "[a-z]$" >/dev/null; then +- tmp_bsd_partition=`echo "$tmp_part" \ +- | sed "s%[^a-z]*\([a-z]\)$%\1%"` +- tmp_drive=`echo "$tmp_drive" \ +- | sed "s%)%,$tmp_bsd_partition)%"` +- fi +- echo "$tmp_drive" ;; +- freebsd* | kfreebsd*-gnu) +- if echo $tmp_part | grep "^s" >/dev/null; then +- tmp_pc_slice=`echo $tmp_part \ +- | sed "s%s\([0-9]*\)[a-h]*$%\1%"` +- tmp_drive=`echo "$tmp_drive" \ +- | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"` +- fi +- if echo $tmp_part | grep "[a-h]$" >/dev/null; then +- tmp_bsd_partition=`echo "$tmp_part" \ +- | sed "s%s\{0,1\}[0-9]*\([a-h]\)$%\1%"` +- tmp_drive=`echo "$tmp_drive" \ +- | sed "s%)%,$tmp_bsd_partition)%"` +- fi +- echo "$tmp_drive" ;; +- netbsd* | knetbsd*-gnu) +- if echo $tmp_part | grep "^[abe-p]$" >/dev/null; then +- tmp_bsd_partition=`echo "$tmp_part" \ +- | sed "s%\([a-p]\)$%\1%"` +- tmp_drive=`echo "$tmp_drive" \ +- | sed "s%)%,$tmp_bsd_partition)%"` +- fi +- echo "$tmp_drive" ;; +- esac +- else +- # If no partition is specified, just print the drive name. +- echo "$tmp_drive" +- fi ++ GRUB_LEGACY_0_BASED_PARTITIONS=1 grub-probe --device-map=${device_map} -t drive -d "$1" + } + + # Usage: resolve_symlink file +@@ -265,9 +171,7 @@ + # Usage: find_device file + # Find block device on which the file resides. + find_device () { +- # For now, this uses the program `df' to get the device name, but is +- # this really portable? +- tmp_fname=`df $1/ | sed -n 's%.*\(/dev/[^ ]*\).*%\1%p'` ++ tmp_fname=`grub-probe --device-map=${device_map} -t device $1/` + + if test -z "$tmp_fname"; then + echo "Could not find device for $1" 2>&1 +@@ -384,22 +288,7 @@ + if test -f "$device_map"; then + : + else +- # Create a safe temporary file. +- test -n "$mklog" && log_file=`$mklog` +- +- # Before all invocations of the grub shell, call sync to make sure +- # the raw device is in sync with any bufferring in filesystems. +- sync +- +- $grub_shell --batch $no_floppy --device-map=$device_map <$log_file +-quit +-EOF +- if grep "Error [0-9]*: " $log_file >/dev/null; then +- cat $log_file 1>&2 +- exit 1 +- fi +- +- rm -f $log_file ++ grub-mkdevicemap $no_floppy --device-map=$device_map + fi + + # Make sure that there is no duplicated entry. --- grub-0.97.orig/debian/patches/xfs_freeze.patch +++ grub-0.97/debian/patches/xfs_freeze.patch @@ -0,0 +1,22 @@ +Index: b/util/grub-install.in +=================================================================== +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -470,6 +470,17 @@ + test -n "$mkimg" && img_file=`$mkimg` + test -n "$mklog" && log_file=`$mklog` + ++# GRUB will try to verify that stage2 is accessible using its own ++# filesystem drivers. Make sure it's committed to disk. ++sync ++ ++# On XFS, sync() is not enough. ++if [ x"`grub-probe --device-map=${device_map} -t fs ${grubdir}`" = "xxfs" ] ; then ++ xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir} ++ # We don't have set -e. If xfs_freeze failed, it's worth trying anyway, ++ # maybe we're lucky. ++fi ++ + for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do + count=5 + tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"` --- grub-0.97.orig/debian/presubj +++ grub-0.97/debian/presubj @@ -0,0 +1,11 @@ + +GRUB LEGACY IS IN FEATURE FREEZE + + Before you submit a request for new feature, please note that GRUB Legacy is + in feature freeze (both in upstream and in debian) and only bug fixes are + accepted. All requests for new features will be rejected; even if you provide + a patch, or if the feature is specific to debian. + + Please, rather than directing your work at a frozen branch, look at wether + your proposed feature makes sense in GRUB 2. GRUB 2 is in active development + (both debian and upstream) and new features are welcome there. --- grub-0.97.orig/debian/rules +++ grub-0.97/debian/rules @@ -0,0 +1,247 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +SHELL = bash + +CFLAGS = -Wall -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_BUILD_GNU_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) +DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) + +# Add backward compatibility to allow backport to stable +ifeq ($(DEB_HOST_GNU_SYSTEM), linux) +DEB_HOST_GNU_SYSTEM=linux-gnu +endif +ifeq ($(DEB_BUILD_GNU_SYSTEM), linux) +DEB_BUILD_GNU_SYSTEM=linux-gnu +endif + +GRUB_VERSION=0.97 +GRUB_DISK_IMAGE=grub-${GRUB_VERSION}-$(DEB_BUILD_GNU_CPU)-pc + +ifeq ($(DEB_BUILD_GNU_SYSTEM),linux-gnu) +filesystems=e2fs jfs minix reiserfs xfs fat +endif +ifeq ($(DEB_BUILD_GNU_SYSTEM),gnu) +filesystems=e2fs ffs minix +endif + +ifeq ($(DEB_BUILD_GNU_CPU),x86_64) + LDFLAGS=-static +endif + +include /usr/share/quilt/quilt.make + +configure: configure-stamp +configure-stamp: $(QUILT_STAMPFN) + dh_testdir + + # Add here commands to configure the package. + dh_autoreconf + LDFLAGS=$(LDFLAGS) ./configure \ + --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-auto-linux-mem-opt + + touch configure-stamp + +build: build-arch + +build-arch: build-arch-stamp +build-arch-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + chmod +x docs/help2man + + ## the creation of these manpages here is temporary, + ## when building grub finally works with the version + ## of autoconf in debian we can use MAINTAINER_MODE_TRUE + # create man page for grub + ( cd docs && ./help2man \ + --name="the grub shell" \ + --include=grub.8.additions \ + --section=8 --output=grub.8 \ + ../grub/grub ) + + # create man page for grub-install + ( cd util && chmod 755 grub-install ) + ( cd docs && ./help2man \ + --name="install GRUB on your drive" \ + --include=grub-install.8.additions \ + --section=8 --output=grub-install.8 \ + ../util/grub-install ) + + # create man page for mbchk + ( cd docs && ./help2man \ + --name="check the format of a Multiboot kernel" \ + --section=1 --output=mbchk.1 \ + ../util/mbchk ) + + # create man page for grub-md5-crypt + ( cd util && chmod 755 grub-md5-crypt ) + ( cd docs && ./help2man \ + --name="Encrypt a password in MD5 format" \ + --section=8 --output=grub-md5-crypt.8 \ + ../util/grub-md5-crypt ) + + touch build-arch-stamp + +build-indep: build-indep-stamp +build-indep-stamp: configure-stamp + dh_testdir + + # create html documentation from texi files + ( cd docs && texi2html -split_chapter --output=grub grub.texi ) + + touch build-indep-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-arch-stamp build-indep-stamp configure-stamp config.log + chmod +x debian/script debian/kernel/* + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + + # The Makefile doesn't clean up the generated info files so we will do + # it here so the doco is uptodate. + -( cd docs && rm -f *.info* ) + + # clean up generated html documentation + -( cd docs && rm -f *.html ) + + # clean up documentation directory removing created dirs. + -( cd docs && rm -rf grub multiboot ) + + # remove files that will be change due our automake and autoconf rebuilding + -rm -f $(shell find . -name 'Makefile.in' -o \ + -name 'aclocal.m4' -o \ + -name 'configure') + + dh_autoreconf_clean + + # reverse patches we applied. this has to happen after make distclean + -$(MAKE) -s -f debian/rules unpatch + +# debconf-updatepo + + dh_clean + +install: install-indep install-arch +install-indep: install-arch + dh_testdir + dh_testroot + dh_clean -k -i + dh_installdirs -i + + # Add here commands to install the indep part of the package into + # debian/-doc. + #INSTALLDOC# + + dh_install -i + +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + + $(MAKE) install DESTDIR=$(CURDIR)/debian/grub-legacy/ + + # make install puts the info files in the grub package but we want them + # in the grub-legacy-doc package so lets clean shop and + # let dh_installinfo do the work + rm -rf debian/grub-legacy/usr/share/info + + # Cleanup filesystems not used natively in Debian. + # (non-native filesystems are supported via stage2) + mkdir debian/grub-legacy/usr/lib/grub/tmp/ + mv debian/grub-legacy/usr/lib/grub/{*-*/*_stage1_5,tmp} + for i in $(filesystems) ; do \ + mv debian/grub-legacy/usr/lib/grub/tmp/$${i}_stage1_5 \ + debian/grub-legacy/usr/lib/grub/*-*/ ; \ + done + rm -rf debian/grub-legacy/usr/lib/grub/tmp/ + + mkdir -p $(CURDIR)/debian/grub-legacy/usr/share/lintian/overrides + cd $(CURDIR)/debian/grub-legacy && find usr/bin/ -name mbchk \ + | sed -e "s%.*%grub-legacy: statically-linked-binary &%g" \ + > $(CURDIR)/debian/grub-legacy/usr/share/lintian/overrides/grub-legacy + cd $(CURDIR)/debian/grub-legacy && find usr/sbin/ -name grub \ + | sed -e "s%.*%grub-legacy: statically-linked-binary &%g" \ + >> $(CURDIR)/debian/grub-legacy/usr/share/lintian/overrides/grub-legacy + + dh_install -s + +# Must not depend on anything. This is to be called by +# binary-arch/binary-indep +# in another 'make' thread. +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples +# dh_installmenu + dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron + cp docs/grub{,-legacy}.info && dh_installinfo + dh_installman +# dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure --- grub-0.97.orig/debian/script +++ grub-0.97/debian/script @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +for i in /boot/grub/device.map ; do + if test -e $i ; then + echo -e "\n*********************** BEGIN $i" >&3 + cat $i >&3 + echo "*********************** END $i" >&3 + fi +done + +for i in /proc/mounts ; do + if test -e $i ; then + echo -e "\n*********************** BEGIN $i" >&3 + grep ^/dev/ $i >&3 + echo "*********************** END $i" >&3 + fi +done + +for i in /boot/grub/menu.lst ; do + if test -e $i ; then + echo -e "\n*********************** BEGIN $i" >&3 + sed $i -e "s/.*password.*/### PASSWORD LINE REMOVED ###/g" >&3 + echo "*********************** END $i" >&3 + fi +done + +exit 0 --- grub-0.97.orig/debian/update-grub +++ grub-0.97/debian/update-grub @@ -0,0 +1,1068 @@ +#!/bin/bash +# +# Insert a list of installed kernels in a grub config file +# Copyright 2001 Wichert Akkerman +# Copyright (C) 2007,2008 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . +# +# Contributors: +# Jason Thomas +# David B.Harris +# Marc Haber +# Crispin Flowerday + +# Abort on errors +set -e + +host_os=`uname -s | tr '[A-Z]' '[a-z]'` + +abort() { + message=$@ + + echo >&2 + echo -e "$message" >&2 + echo >&2 + exit 1 +} + +find_grub_dir () +{ + echo -n "Searching for GRUB installation directory ... " >&2 + + for d in /boot/grub /boot/boot/grub ; do + if [ -d "$d" ] ; then + grub_dir="$d" + break + fi + done + + if [ -z "$grub_dir" ] ; then + abort "No GRUB directory found.\n To create a template run 'mkdir /boot/grub' first.\n To install grub, install it manually or try the 'grub-install' command.\n ### Warning, grub-install is used to change your MBR. ###" + else + echo "found: $grub_dir" >&2 + fi + + echo $grub_dir +} + +# This function was borrowed from grub2/util/update-grub_lib.in +make_system_path_relative_to_its_root () +{ + path=$1 + # abort if file doesn't exist + if test -e $path ; then : ;else + return 1 + fi + + # canonicalize + if path=`readlink -f $path` ; then : ; else + return 1 + fi + + # if not a directory, climb up to the directory containing it + if test -d $path ; then + dir=$path + else + dir=`echo $path | sed -e "s,/[^/]*$,,g"` + fi + + num=`stat -c %d $dir` + + # this loop sets $dir to the root directory of the filesystem we're inspecting + while : ; do + parent=`readlink -f $dir/..` + if [ "x`stat -c %d $parent`" = "x$num" ] ; then : ; else + # $parent is another filesystem; we found it. + break + fi + if [ "x$dir" = "x/" ] ; then + # / is our root. + break + fi + dir=$parent + done + + # This function never prints trailing slashes (so that its output can be + # appended a slash unconditionally). Each slash in $dir is considered a + # preceding slash, and therefore the root directory is an empty string. + if [ "$dir" = "/" ] ; then + dir="" + fi + + echo $path | sed -e "s,^$dir,,g" +} + +# The grub installation directory +grub_dir=$(find_grub_dir) + +# Full path to the device.map +device_map=$grub_dir/device.map + +find_device () +{ + if ! test -e ${device_map} ; then + echo quit | grub --batch --no-floppy --device-map=${device_map} > /dev/null + fi + grub-probe --device-map=${device_map} -t device $1 2> /dev/null +} + +# Usage: convert_raid1 os_device +# Checks if os_device is a software raid1. +# If so, converts to first physical device in array. +convert_raid1 () +{ + case $1 in + /dev/md[0-9] | /dev/md/[0-9]) + : ;; # Continue + *) + return 1 ;; + esac + + [ -x /sbin/mdadm ] || return 1 + + # Check that the raid device is raid1 + raidlevel=$(mdadm -D -b $1 | grep "^ARRAY" | \ + sed "s/^.*level=//" | cut -d" " -f1) + [ "$raidlevel" = "raid1" ] || return 1 + + # Take only the first device that makes up the raid + raiddev=$(mdadm -D $1 | grep -A1 "Number" | grep "dev" \ + | sed "s/^.*\(\/dev\/.*\)$/\1/") + [ -n "$raiddev" ] || return 1 + + echo $raiddev + return 0 +} + +# Usage: convert os_device +# Convert an OS device to the corresponding GRUB drive. +convert () { + if ! test -e ${device_map} ; then + echo quit | grub --batch --no-floppy --device-map=${device_map} > /dev/null + fi + GRUB_LEGACY_0_BASED_PARTITIONS=1 grub-probe --device-map=${device_map} -t drive -d "$1" 2> /dev/null || { + echo "warning: grub-probe can't find drive for $1." >&2 + tmp_map=$(mktemp -t device.map.XXXXXXXX) + grub-mkdevicemap --device-map=${tmp_map} --no-floppy >/dev/null 2>&1 || true + GRUB_LEGACY_0_BASED_PARTITIONS=1 grub-probe --device-map=${tmp_map} -t drive -d "$1" || { + rm -f ${tmp_map} + return 1 + } + echo "Please check ${device_map}, you might have to regenerate it with grub-mkdevicemap." >&2 + rm -f ${tmp_map} + } +} + +# Usage: convert_default os_device +# Convert an OS device to the corresponding GRUB drive. +convert_default () { + # Check if device is software raid1 array + if tmp_dev=$(convert_raid1 $1 2>/dev/null) ; then + : # Use device returned by convert_raid1 + else + tmp_dev=$1 + fi + + convert $tmp_dev +} + +## Configuration Options + +# Full path to the menu.lst +menu_file_basename=menu.lst +menu_file=$grub_dir/$menu_file_basename + +# Full path to the default file +default_file_basename=default +default_file=$grub_dir/$default_file_basename + +# the device for the / filesystem +root_device=$(find_device "/") + +# loop-AES arranges things so that /dev/loop/X can be our root device, but +# the initrds that Linux uses don't like that. +case ${root_device} in + /dev/loop/*|/dev/loop[0-9]) + root_device=`losetup ${root_device} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + ;; +esac + +# the device for the /boot filesystem +boot_device=$(find_device "/boot") + +# where grub looks for the kernels at boot time +kernel_dir=`make_system_path_relative_to_its_root /boot` + +# the "-t abstraction" check is a workaround untill #484297 is fixed +if abstraction=`grub-probe -t abstraction --device ${root_device} 2> /dev/null` && [ "$abstraction" = "" ] && \ + root_uuid=`grub-probe --device-map=${device_map} --device ${root_device} --target=fs_uuid 2> /dev/null` && \ + test -e "/dev/disk/by-uuid/${root_uuid}" ; then + linux_root_device=UUID=${root_uuid} +else + linux_root_device=${root_device} +fi + +# Default kernel options, overidden by the kopt statement in the menufile. +kopt="root=$linux_root_device ro" + +# Title +title="Debian GNU/`uname -s | sed -e s,GNU/,,g`" + +# should update-grub remember the default entry +updatedefaultentry="false" + +# Drive(in GRUB terms) where the kernel is located. Overridden by the +# groot statement in menufile. +grub_root_device=$(convert_default "$boot_device") + +# should grub create the alternative boot options in the menu + alternative="true" + +# should grub lock the alternative boot options in the menu + lockalternative="false" + +# additional options to use with the default boot option, but not with the +# alternatives + defoptions="" + +# should grub lock the old kernels + lockold="false" + +# Xen hypervisor options to use with the default Xen boot option + xenhopt="" + +# Xen Linux kernel options to use with the default Xen boot option + xenkopt="console=tty0" + +# options to use with the alternative boot options + altoptions="(single-user mode) single" + +# controls howmany kernels are listed in the config file, +# this does not include the alternative kernels + howmany="all" + +# should grub create a memtest86 entry + memtest86="true" + +# should grub add "savedefault" to default boot options + savedefault="false" + +# stores the command line arguments + command_line_arguments=$1 + +# read user configuration +if test -f "/etc/default/grub" ; then + . /etc/default/grub +fi + +# Default options to use in a new config file. This will only be used if $menu_file +# doesn't already exist. Only edit the lines between the two "EOF"s. The others are +# part of the script. +newtemplate=$(tempfile) +cat > "$newtemplate" <&2 +if [ -f "$default_file" ] ; then + echo "found: $default_file" >&2 +else + echo "Generating $default_file file and setting the default boot entry to 0" >&2 + if [ -f /usr/lib/grub-legacy/grub-set-default ] ; then + /usr/lib/grub-legacy/grub-set-default 0 + else + grub-set-default 0 + fi +fi + +# Make sure we use the standard sorting order +LC_COLLATE=C +# Magic markers we use +start="### BEGIN AUTOMAGIC KERNELS LIST" +end="### END DEBIAN AUTOMAGIC KERNELS LIST" + +startopt="## ## Start Default Options ##" +endopt="## ## End Default Options ##" + +# Extract options from config file +ExtractMenuOpt() +{ + opt=$1 + + sed -ne "/^$start\$/,/^$end\$/ { + /^$startopt\$/,/^$endopt\$/ { + /^# $opt=/ { + s/^# $opt=\(.*\)\$/\1/ + p + } + } + }" $menu +} + +GetMenuOpts() +{ + opt=$1 + + sed -ne "/^$start\$/,/^$end\$/ { + /^$startopt\$/,/^$endopt\$/ { + /^# $opt=/ { + p + } + } + }" $menu +} + +ExtractMenuOpts() +{ + opt=$1 + + GetMenuOpts $opt | sed "s/^# $opt=\(.*\)\$/\1=\"\2\"/" +} + +GetMenuOpt() +{ + opt=$1 + value=$2 + + [ -z "$(GetMenuOpts "$opt")" ] || value=$(ExtractMenuOpt "$opt") + + echo $value +} + +# Compares two version strings A and B +# Returns -1 if AB +# This compares version numbers of the form +# 2.4.14.2 > 2.4.14 +# 2.4.14random = 2.4.14-random > 2.4.14-ac10 > 2.4.14 > 2.4.14-pre2 > +# 2.4.14-pre1 > 2.4.13-ac99 +CompareVersions() +{ + local sedexp="s,.*/vmlinu[zx]-,,g;s/[._-]\(pre\|rc\|test\|git\|trunk\)/~\1/g" + local a=`echo $1 | sed -e "$sedexp"` + local b=`echo $2 | sed -e "$sedexp"` + if [ "$a" = "$b" ] ; then + echo 0 + elif dpkg --compare-versions "$a" gt "$b" ; then + echo 1 + else + echo -1 + fi +} + +# looks in the directory specified for an initrd image with the version specified +FindInitrdName() +{ + # strip trailing slashes + directory=$(echo $1 | sed -e 's#/*$##') + version=$2 + + # initrd + # initrd.img + # initrd-lvm + # .*.gz + + initrdName="" + names="initrd initrd.img initrd-lvm" + compressed="gz" + + for n in $names ; do + # make sure we haven't already found it + if [ -z "$initrdName" ] ; then + if [ -f "$directory/$n$version" ] ; then + initrdName="$n$version" + break + else + for c in $compressed ; do + if [ -f "$directory/$n$version.$c" ] ; then + initrdName="$n$version.$c" + break + fi + done + fi + else + break + fi + done + + # return the result + echo $initrdName +} + +FindXenHypervisorVersions () +{ + version=$1 + + if [ -f "/var/lib/linux-image-$version/xen-versions" ]; then + ret="$(cat /var/lib/linux-image-$version/xen-versions)" + fi + + echo $ret +} + +get_kernel_opt() +{ + kernel_version=$1 + + version=$(echo $kernel_version | sed 's/^[^0-9]*//') + version=$(echo $version | sed 's/[-\+\.]/_/g') + if [ -n "$version" ] ; then + while [ -n "$version" ] ; do + currentOpt="$(eval "echo \${kopt_$version}")" + if [ -n "$currentOpt" ] ; then + break + fi + version=$(echo $version | sed 's/_\?[^_]*$//') + done + fi + + if [ -z "$currentOpt" ] ; then + currentOpt=$kopt + fi + + echo $currentOpt +} + +write_kernel_entry() +{ + local kernel_version; kernel_version=$1; shift + local recovery_desc; recovery_desc=$1; shift + local lock_alternative; lock_alternative=$1; shift + local grub_root_device; grub_root_device=$1; shift + local kernel; kernel=$1; shift + local kernel_options; kernel_options=$1; shift + local recovery_suffix; recovery_suffix=$1; shift + local initrd; initrd=$1; shift + local savedefault; savedefault=$1; shift + local lockold; lockold=$1; shift + local hypervisor + if [ -n "$1" ]; then + # Hypervisor. + hypervisor=$1; shift + local hypervisor_image; hypervisor_image=$1; shift + local hypervisor_version; hypervisor_version=$1; shift + local hypervisor_options; hypervisor_options=$1; shift + fi + + echo -n "title " >> $buffer + + if [ -n "$hypervisor" ]; then + echo -n "$hypervisor $hypervisor_version / " >> $buffer + fi + + echo -n "$title" >> $buffer + if [ -n "$kernel_version" ]; then + echo -n ", kernel $kernel_version" >> $buffer + fi + if [ -n "$recovery_desc" ]; then + echo -n " $recovery_desc" >> $buffer + fi + echo >> $buffer + + # lock the alternative options + if test x"$lock_alternative" = x"true" ; then + echo "lock" >> $buffer + fi + # lock the old entries + if test x"$lockold" = x"true" ; then + echo "lock" >> $buffer + fi + + echo "root $grub_root_device" >> $buffer + + echo -n "kernel " >> $buffer + if [ -n "$hypervisor" ]; then + echo -n "$hypervisor_image" >> $buffer + if [ -n "$hypervisor_options" ]; then + echo -n " $hypervisor_options" >> $buffer + fi + echo >> $buffer + echo -n "module " >> $buffer + fi + echo -n "$kernel" >> $buffer + if [ -n "$kernel_options" ]; then + echo -n " $kernel_options" >> $buffer + fi + if [ -n "$recovery_desc" ]; then + echo -n " $recovery_suffix" >> $buffer + fi + echo >> $buffer + + if [ -n "$initrd" ]; then + if [ -n "$hypervisor" ]; then + echo -n "module " >> $buffer + else + echo -n "initrd " >> $buffer + fi + echo "$initrd" >> $buffer + fi + + if test x"$savedefault" = x"true" ; then + echo "savedefault" >> $buffer + fi + echo >> $buffer +} + + +echo -n "Testing for an existing GRUB $menu_file_basename file ... " >&2 + +# Test if our menu file exists +if [ -f "$menu_file" ] ; then + menu="$menu_file" + rm -f $newtemplate + unset newtemplate + echo "found: $menu_file" >&2 + cp -f "$menu_file" "$menu_file~" +else + # if not ask user if they want us to create one + menu="$menu_file" + echo >&2 + echo >&2 + if [ "-y" = "$command_line_arguments" ] ; then + echo "Warning: ignoring deprecated -y option." >&2 + fi + echo >&2 + echo "Generating $menu_file" >&2 + cat "$newtemplate" > $menu_file + rm -f $newtemplate + unset newtemplate +fi + +# Extract the kernel options to use +kopt=$(GetMenuOpt "kopt" "$kopt") + +# Set the kernel 2.6 option only for fresh install +test -z "$(GetMenuOpt "kopt" "")" && kopt_2_6="root=$linux_root_device ro" + +# Extract options for specific kernels +opts="$(ExtractMenuOpts "\(kopt_[[:alnum:]_]\+\)")" +test -z "$opts" || eval "$opts" +CustomKopts=$(GetMenuOpts "\(kopt_[[:alnum:]_]\+\)") + +# Extract the grub root +grub_root_device=$(GetMenuOpt "groot" "$grub_root_device") + +# Extract the old recovery value +alternative=$(GetMenuOpt "recovery" "$alternative") + +# Extract the alternative value +alternative=$(GetMenuOpt "alternative" "$alternative") + +# Extract the lockalternative value +lockalternative=$(GetMenuOpt "lockalternative" "$lockalternative") + +# Extract the additional default options +defoptions=$(GetMenuOpt "defoptions" "$defoptions") + +# Extract the lockold value +lockold=$(GetMenuOpt "lockold" "$lockold") + +# Extract Xen hypervisor options +xenhopt=$(GetMenuOpt "xenhopt" "$xenhopt") + +# Extract Xen Linux kernel options +xenkopt=$(GetMenuOpt "xenkopt" "$xenkopt") + +# Extract the howmany value +howmany=$(GetMenuOpt "howmany" "$howmany") + +# Extract the memtest86 value +memtest86=$(GetMenuOpt "memtest86" "$memtest86") + + +# Extract the updatedefaultentry option +updatedefaultentry=$(GetMenuOpt "updatedefaultentry" "$updatedefaultentry") + +# Extract the savedefault option +savedefault=$(GetMenuOpt "savedefault" "$savedefault") + +# Generate the menu options we want to insert +buffer=$(tempfile) +echo $start >> $buffer +echo "## lines between the AUTOMAGIC KERNELS LIST markers will be modified" >> $buffer +echo "## by the debian update-grub script except for the default options below" >> $buffer +echo >> $buffer +echo "## DO NOT UNCOMMENT THEM, Just edit them to your needs" >> $buffer +echo >> $buffer +echo "## ## Start Default Options ##" >> $buffer + +echo "## default kernel options" >> $buffer +echo "## default kernel options for automagic boot options" >> $buffer +echo "## If you want special options for specific kernels use kopt_x_y_z" >> $buffer +echo "## where x.y.z is kernel version. Minor versions can be omitted." >> $buffer +echo "## e.g. kopt=root=/dev/hda1 ro" >> $buffer +echo "## kopt_2_6_8=root=/dev/hdc1 ro" >> $buffer +echo "## kopt_2_6_8_2_686=root=/dev/hdc2 ro" >> $buffer +echo "# kopt=$kopt" >> $buffer +if [ -n "$CustomKopts" ] ; then + echo "$CustomKopts" >> $buffer +elif [ -n "$kopt_2_6" ] && [ "$kopt" != "$kopt_2_6" ]; then + echo "# kopt_2_6=$kopt_2_6" >> $buffer +fi +echo >> $buffer + +echo "## default grub root device" >> $buffer +echo "## e.g. groot=(hd0,0)" >> $buffer +echo "# groot=$grub_root_device" >> $buffer +echo >> $buffer + +echo "## should update-grub create alternative automagic boot options" >> $buffer +echo "## e.g. alternative=true" >> $buffer +echo "## alternative=false" >> $buffer +echo "# alternative=$alternative" >> $buffer +echo >> $buffer + +echo "## should update-grub lock alternative automagic boot options" >> $buffer +echo "## e.g. lockalternative=true" >> $buffer +echo "## lockalternative=false" >> $buffer +echo "# lockalternative=$lockalternative" >> $buffer +echo >> $buffer + +echo "## additional options to use with the default boot option, but not with the" >> $buffer +echo "## alternatives" >> $buffer +echo "## e.g. defoptions=vga=791 resume=/dev/hda5" >> $buffer +echo "# defoptions=$defoptions" >> $buffer +echo >> $buffer + +echo "## should update-grub lock old automagic boot options" >> $buffer +echo "## e.g. lockold=false" >> $buffer +echo "## lockold=true" >> $buffer +echo "# lockold=$lockold" >> $buffer +echo >> $buffer + +echo "## Xen hypervisor options to use with the default Xen boot option" >> $buffer +echo "# xenhopt=$xenhopt" >> $buffer +echo >> $buffer + +echo "## Xen Linux kernel options to use with the default Xen boot option" >> $buffer +echo "# xenkopt=$xenkopt" >> $buffer +echo >> $buffer + +echo "## altoption boot targets option" >> $buffer +echo "## multiple altoptions lines are allowed" >> $buffer +echo "## e.g. altoptions=(extra menu suffix) extra boot options" >> $buffer +echo "## altoptions=(single-user) single" >> $buffer + +if ! grep -q "^# altoptions" $menu ; then + echo "# altoptions=$altoptions" >> $buffer +else + grep "^# altoptions" $menu >> $buffer +fi +echo >> $buffer + +echo "## controls how many kernels should be put into the $menu_file_basename" >> $buffer +echo "## only counts the first occurence of a kernel, not the" >> $buffer +echo "## alternative kernel options" >> $buffer +echo "## e.g. howmany=all" >> $buffer +echo "## howmany=7" >> $buffer +echo "# howmany=$howmany" >> $buffer +echo >> $buffer + + +echo "## should update-grub create memtest86 boot option" >> $buffer +echo "## e.g. memtest86=true" >> $buffer +echo "## memtest86=false" >> $buffer +echo "# memtest86=$memtest86" >> $buffer +echo >> $buffer + +echo "## should update-grub adjust the value of the default booted system" >> $buffer +echo "## can be true or false" >> $buffer +echo "# updatedefaultentry=$updatedefaultentry" >> $buffer +echo >> $buffer + +echo "## should update-grub add savedefault to the default options" >> $buffer +echo "## can be true or false" >> $buffer +echo "# savedefault=$savedefault" >> $buffer +echo >> $buffer + +echo "## ## End Default Options ##" >> $buffer +echo >> $buffer + +echo -n "Searching for splash image ... " >&2 +current_splash=`grep '^splashimage=' ${menu_file} || true` +grub_dir_rel=`make_system_path_relative_to_its_root $grub_dir` +splashimage_path="splashimage=${grub_root_device}/${grub_dir_rel##${kernel_dir}}/splash.xpm.gz" +if [ `sed -e "/^$start/,/^$end/d" $menu_file | grep -c '^splashimage='` != "0" ] ; then + #checks for splashscreen defined outside the autoupdated part + splashimage=$(grep '^splashimage=' ${menu_file}) + echo "found: ${splashimage##*=}" >&2 + echo >&2 +elif [ -f "${grub_dir}/splash.xpm.gz" ] && [ "$current_splash" = "" ]; then + echo "found: /boot/grub/splash.xpm.gz" >&2 + echo "$splashimage_path" >> $buffer + echo >> $buffer +elif [ -f "${grub_dir}/splash.xpm.gz" ] && [ "$current_splash" = "$splashimage_path" ]; then + echo "found: /boot/grub/splash.xpm.gz" >&2 + echo "$splashimage_path" >> $buffer + echo >> $buffer +elif [ "$current_splash" != "" ] && [ "$current_splash" != "$splashimage_path" ]; then + echo "found but preserving previous setting: $(grep '^splashimage=' ${menu_file})" >&2 + echo "$current_splash" >> $buffer + echo >> $buffer +else + echo "none found, skipping ..." >&2 +fi + +xen0Kernels="" +# First kernels with xen0 support. +for ver in `grep -l CONFIG_XEN=y /boot/config* | sed -e s%/boot/config-%%`; do + if ! grep -q CONFIG_XEN_PRIVILEGED_GUEST=y /boot/config-$ver ; then + continue + fi + # ver is a kernel version + kern="/boot/vmlinuz-$ver" + if [ -r $kern ] ; then + newerKernels="" + for i in $xen0Kernels ; do + res=$(CompareVersions "$kern" "$i") + if [ "$kern" != "" ] && [ "$res" -gt 0 ] ; then + newerKernels="$newerKernels $kern $i" + kern="" + else + newerKernels="$newerKernels $i" + fi + done + if [ "$kern" != "" ] ; then + newerKernels="$newerKernels $kern" + fi + xen0Kernels="$newerKernels" + fi +done + +sortedKernels="" +for kern in $(/bin/ls -1vr /boot | grep -v "dpkg-*" | grep "^vmlinuz-") ; do + kern="/boot/$kern" + newerKernels="" + for i in $sortedKernels ; do + res=$(CompareVersions "$kern" "$i") + if [ "$kern" != "" ] && [ "$res" -gt 0 ] ; then + newerKernels="$newerKernels $kern $i" + kern="" + else + newerKernels="$newerKernels $i" + fi + done + if [ "$kern" != "" ] ; then + newerKernels="$newerKernels $kern" + fi + sortedKernels="$newerKernels" +done + +if test -f "/boot/vmlinuz.old" ; then + sortedKernels="/boot/vmlinuz.old $sortedKernels" +fi +if test -f "/boot/vmlinuz" ; then + sortedKernels="/boot/vmlinuz $sortedKernels" +fi + +hypervisors="" +for hyp in /boot/xen-*.gz; do + if [ ! -h "$hyp" ] && [ -f "$hyp" ]; then + hypervisors="$hypervisors `basename "$hyp"`" + fi +done + +#Finding the value the default line +use_grub_set_default="false" +if test "$updatedefaultentry" = "true" ; then + defaultEntryNumber=$(sed -ne 's/^[[:blank:]]*default[[:blank:]]*\(.*\).*/\1/p' $menu) + + if [ "$defaultEntryNumber" = "saved" ] ; then + defaultEntryNumber=$(sed 'q' "$grub_dir/default") + use_grub_set_default="true" + fi + + if test -n "$defaultEntryNumber"; then + defaultEntryNumberPlusOne=$(expr $defaultEntryNumber \+ 1); + defaultEntry=$(grep "^[[:blank:]]*title" $menu | sed -ne "${defaultEntryNumberPlusOne}p" | sed -ne ";s/^[[:blank:]]*title[[:blank:]]*//p") + defaultEntry=$(echo $defaultEntry | sed -e "s/[[:blank:]]*$//") # don't trust trailing blanks + else + notChangeDefault="yes" + fi +else + notChangeDefault="yes" +fi + +## heres where we start writing out the kernel entries +counter=0 + +grub2name="${kernel_dir}/grub/core.img" +if [ "$LET_US_TRY_GRUB_2" = "true" ] \ + && test -f /boot/grub/core.img ; then + echo "Found GRUB 2: $grub2name" >&2 + cat >> $buffer << EOF +title Chainload into GRUB 2 +root $grub_root_device +kernel $grub2name + +title `echo ───────────────────────────────────────────────────────────────────── | iconv -f utf-8 -t cp437` +root + +title When you have verified GRUB 2 works, you can use this command to +root + +title complete the upgrade: upgrade-from-grub-legacy +root + +title `echo ───────────────────────────────────────────────────────────────────── | iconv -f utf-8 -t cp437` +root + +EOF +fi + + +# Xen entries first. +for kern in $xen0Kernels ; do + if test ! x"$howmany" = x"all" ; then + if [ $counter -gt $howmany ] ; then + break + fi + fi + + kernelName=$(basename $kern) + kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz//') + + initrdName=$(FindInitrdName "/boot" "$kernelVersion") + initrd="" + + kernel=$kernel_dir/$kernelName + if [ -n "$initrdName" ] ; then + initrd=$kernel_dir/$initrdName + fi + + kernelVersion=$(echo $kernelVersion | sed -e 's/^-//') + currentOpt=$(get_kernel_opt $kernelVersion) + + hypervisorVersions=$(FindXenHypervisorVersions "$kernelVersion") + + found= + for hypervisorVersion in $hypervisorVersions; do + hypervisor="$kernel_dir/xen-$hypervisorVersion.gz" + if [ -e "$hypervisor" ]; then + found=1 + + echo "Found Xen hypervisor $hypervisorVersion, kernel: $kernel" >&2 + + write_kernel_entry "$kernelVersion" '' '' "$grub_root_device" \ + "$kernel" "$currentOpt $xenkopt" '' "$initrd" "$savedefault" '' \ + Xen "$hypervisor" "$hypervisorVersion" "$xenhopt" + counter=$(($counter + 1)) + fi + done + + if [ -z $found ]; then + for hypervisor in $hypervisors; do + hypVersion=`basename "$hypervisor" .gz | sed s%xen-%%` + + echo "Found Xen hypervisor $hypVersion, kernel: $kernel" >&2 + + write_kernel_entry "$kernelVersion" '' '' "$grub_root_device" \ + "$kernel" "$currentOpt $xenkopt" '' "$initrd" "$savedefault" '' \ + Xen "$kernel_dir/$hypervisor" "$hypVersion" "$xenhopt" + counter=$(($counter + 1)) + done + fi +done + +for kern in $sortedKernels ; do + counter=$(($counter + 1)) + if test ! x"$howmany" = x"all" ; then + if [ $counter -gt $howmany ] ; then + break + fi + fi + kernelName=$(basename $kern) + kernelVersion=$(echo $kernelName | sed -e 's/vmlinuz//') + initrdName=$(FindInitrdName "/boot" "$kernelVersion") + initrd="" + + kernel=$kernel_dir/$kernelName + if [ -n "$initrdName" ] ; then + initrd=$kernel_dir/$initrdName + fi + + echo "Found kernel: $kernel" >&2 + + if [ "$kernelName" = "vmlinuz" ]; then + if [ -L "/boot/$kernelName" ]; then + kernelVersion=`readlink -f "/boot/$kernelName"` + kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//') + kernelVersion="$kernelVersion Default" + else + kernelVersion="Default" + fi + fi + if [ "$kernelName" = "vmlinuz.old" ]; then + if [ -L "/boot/$kernelName" ]; then + kernelVersion=`readlink -f "/boot/$kernelName"` + kernelVersion=$(echo $kernelVersion | sed -e 's/.*vmlinuz-//') + kernelVersion="$kernelVersion Previous" + else + kernelVersion="Previous" + fi + fi + kernelVersion=$(echo $kernelVersion | sed -e 's/^-//') + + currentOpt=$(get_kernel_opt $kernelVersion) + + do_lockold=$lockold + # do not lockold for the first entry + [ $counter -eq 1 ] && do_lockold=false + + write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" "$kernel" \ + "$currentOpt $defoptions" "" "$initrd" "$savedefault" "$do_lockold" + + # insert the alternative boot options + if test ! x"$alternative" = x"false" ; then + # for each altoptions line do this stuff + sed -ne 's/# altoptions=\(.*\)/\1/p' $buffer | while read line; do + descr=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\1/p') + suffix=$(echo $line | sed -ne 's/\(([^)]*)\)[[:space:]]\(.*\)/\2/p') + + test x"$lockalternative" = x"true" && do_lockold=false + write_kernel_entry "$kernelVersion" "$descr" "$lockalternative" \ + "$grub_root_device" "$kernel" "$currentOpt" "$suffix" "$initrd" \ + "$savedefault" "$do_lockold" + + done + fi +done + +memtest86names="memtest86 memtest86+" + +if test ! x"$memtest86" = x"false" ; then + for name in $memtest86names ; do + if test -f "/boot/$name.bin" ; then + kernelVersion="$name" + kernel="$kernel_dir/$name.bin" + currentOpt= + initrd= + + echo "Found kernel: $kernel" >&2 + + write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" \ + "$kernel" "$currentOpt" "" "$initrd" "false" "" + fi + done +fi + +echo $end >> $buffer + +echo -n "Updating $menu ... " >&2 +# Insert the new options into the menu +if ! grep -q "^$start" $menu ; then + cat $buffer >> $menu + rm -f $buffer +else + umask 077 + sed -e "/^$start/,/^$end/{ + /^$start/r $buffer + d + } + " $menu > $menu.new + cat $menu.new > $menu + rm -f $buffer $menu.new +fi + +# Function to update the default value +set_default_value() { + if [ "$use_grub_set_default" = "true" ] ; then + if [ -f /usr/lib/grub-legacy/grub-set-default ] ; then + /usr/lib/grub-legacy/grub-set-default $1 + else + grub-set-default $1 + fi + else + value="$1" + newmenu=$(tempfile) + sed -e "s/^[[:blank:]]*default[[:blank:]]*[[:digit:]]*\(.*\)/default ${value}\1/;b" $menu > $newmenu + cat $newmenu > $menu + rm -f $newmenu + unset newmenu + fi +} + +#Updating the default number +if [ "$LET_US_TRY_GRUB_2" = "true" ] && test -f /boot/grub/core.img ; then + set_default_value "0" +elif test -z "$notChangeDefault"; then + newDefaultNumberPlusOne=$(grep "^[[:blank:]]*title[[:blank:]]*" $menu | grep -n "${defaultEntry}" | cut -f1 -d ":" | sed -ne "1p") + if test -z "$newDefaultNumberPlusOne"; then + echo "Previous default entry removed, resetting to 0">&2 + set_default_value "0" + elif test -z "$defaultEntry"; then + echo "Value of default value matches no entry, resetting to 0" >&2 + set_default_value "0" + else + if test "$newDefaultNumberPlusOne" = "1"; then + newDefaultNumber="0" + else + newDefaultNumber=$(expr $newDefaultNumberPlusOne - 1) + fi + echo "Updating the default booting kernel">&2 + set_default_value "$newDefaultNumber" + fi +fi + +echo "done" >&2 +echo >&2 --- grub-0.97.orig/debian/update-grub.8 +++ grub-0.97/debian/update-grub.8 @@ -0,0 +1,106 @@ +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.TH "update-grub" "8" "June 18, 2001" "Jason Thomas" +.SH "NAME" +update\-grub \- program to generate GRUB's menu.lst file +.SH "SYNOPSIS" +.B update\-grub +.SH "DESCRIPTION" +.B \fBupdate\-grub\fR +is a program used to generate the \fImenu.lst\fR file used by the grub bootloader. +It works by looking in \fI/boot\fR for all files which start with "\fIvmlinuz\-\fR". They will be treated as kernels, and grub menu entries will be created for each. It will also create the initial \fImenu.lst\fR if none exists, after prompting the user. +It will also add initrd lines for ramdisk images found with the same version as kernels found. e.g. /boot/vmlinuz-2.4.5 and /boot/initrd-2.4.5 will cause a line of "initrd=/boot/initrd-2.4.5 or similar to be added for the kernel entry in the menu.lst. + +After \fBupdate\-grub\fR has been run for the first time, the user is required to edit the generated \fBmenu.lst\fR. The user must set the two options \fBupdate\-grub\fR uses. Then re\-run the \fBupdate\-grub\fR script to update the \fImenu.lst\fR file using the default's that have been set. + +These are the options passed to the linux kernel: +.br +# kopt=root=/dev/hda1 ro +.br +Everything after "kopt=" is passed to the kernel as parameters. See bootparam(7) for more information. + +This is the grub device from which grub loads the kernel: +.br +# groot=(hd0,1) +.br +(hd0,1) is a partition in grub notation. See grub(8) for more information. + +This option controls if grub should create the alternative boot options in the menu entries +.br +# alternative=true +.br +# alternative=false + +This option controls if grub should lock the alternative boot options see grub(8) for more information. +.br +# lockalternative=true +.br +# lockalternative=false + +This option controls if grub should lock the old kernels. +.br +# lockold=true +.br +# lockold=false + +This options controls what is used for the alternative boot options, multiple altoptions lines are allowed. +.br +# altoptions=(some description) some kernel command line options +.br +# altoptions=(recovery option) single +.br +The description is placed in '()' and the kernel command line options follow that. +.br +# updatedefault=true +.br +# updatedefault=false + +This option controls if grub should update the default entry to keep +booting the same kernel even if a new one is installed. + + +The \fBupdate\-grub\fR script can be ran automagically from the \fI/etc/kernel\-img.conf\fR file by adding the following lines: + +postinst_hook = update\-grub +.br +postrm_hook = update\-grub +.br +do_bootloader = no + +For further information related to \fI/etc/kernel\-img.conf\fR, see the manpage kernel\-img.conf(5). +.SH "SEE ALSO" +.BR grub (8), +.BR grub\-install (8), +.BR kernel\-img.conf (5) +(contained in the +.B kernel-package +package), +.BR bootparam (7). +.PP +The full documentation for +.B grub +is maintained as a Texinfo manual in the +.B grub-legacy-doc +package. If the +.B info +and +.B grub +programs are properly installed at your site, the command +.IP +.B info grub +.PP +should give you access to the complete manual. +.SH "AUTHOR" +This manual page was written by Jason Thomas , +for the Debian GNU/Linux system (but may be used by others). +.\" vim:syn=nroff --- grub-0.97.orig/debian/watch +++ grub-0.97/debian/watch @@ -0,0 +1,2 @@ +version=3 +ftp://alpha.gnu.org/gnu/grub/grub-(0.[0-9.]+).tar.gz debian uupdate --- grub-0.97.orig/docs/Makefile.am +++ grub-0.97/docs/Makefile.am @@ -1,5 +1,5 @@ info_TEXINFOS = grub.texi multiboot.texi -grub_TEXINFOS = internals.texi +grub_TEXINFOS = internals.texi fdl.texi EXAMPLES = boot.S kernel.c multiboot.h multiboot_TEXINFOS = boot.S.texi kernel.c.texi multiboot.h.texi man_MANS = grub.8 mbchk.1 grub-install.8 grub-md5-crypt.8 grub-terminfo.8 --- grub-0.97.orig/docs/boot.S +++ grub-0.97/docs/boot.S @@ -77,4 +77,3 @@ /* Our stack area. */ .comm stack, STACK_SIZE - \ No newline at end of file --- grub-0.97.orig/docs/boot.S.texi +++ grub-0.97/docs/boot.S.texi @@ -77,4 +77,3 @@ /* @r{Our stack area.} */ .comm stack, STACK_SIZE - \ No newline at end of file --- grub-0.97.orig/docs/fdl.texi +++ grub-0.97/docs/fdl.texi @@ -0,0 +1,452 @@ + +@node GNU Free Documentation License +@appendixsec GNU Free Documentation License + +@cindex FDL, GNU Free Documentation License +@center Version 1.2, November 2002 + +@display +Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. +51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +@sc{ascii} without markup, Texinfo input format, La@TeX{} input +format, @acronym{SGML} or @acronym{XML} using a publicly available +@acronym{DTD}, and standard-conforming simple @acronym{HTML}, +PostScript or @acronym{PDF} designed for human modification. Examples +of transparent image formats include @acronym{PNG}, @acronym{XCF} and +@acronym{JPG}. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, @acronym{SGML} or +@acronym{XML} for which the @acronym{DTD} and/or processing tools are +not generally available, and the machine-generated @acronym{HTML}, +PostScript or @acronym{PDF} produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. +@end enumerate + +@page +@appendixsubsec ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with...Texts.'' line with this: + +@smallexample +@group + with the Invariant Sections being @var{list their titles}, with + the Front-Cover Texts being @var{list}, and with the Back-Cover Texts + being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@c Local Variables: +@c ispell-local-pdict: "ispell-dict" +@c End: + --- grub-0.97.orig/docs/grub-install.8 +++ grub-0.97/docs/grub-install.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB-INSTALL "8" "May 2005" "grub-install (GNU GRUB 0.97)" FSF +.TH GRUB-INSTALL "8" "June 2006" "grub-install (GNU GRUB 0.97)" FSF .SH NAME grub-install \- install GRUB on your drive .SH SYNOPSIS --- grub-0.97.orig/docs/grub-md5-crypt.8 +++ grub-0.97/docs/grub-md5-crypt.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB-MD5-CRYPT "8" "May 2005" "grub-md5-crypt (GNU GRUB )" FSF +.TH GRUB-MD5-CRYPT "8" "June 2006" "grub-md5-crypt (GNU GRUB )" FSF .SH NAME grub-md5-crypt \- Encrypt a password in MD5 format .SH SYNOPSIS --- grub-0.97.orig/docs/grub-terminfo.8 +++ grub-0.97/docs/grub-terminfo.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB-TERMINFO "8" "May 2005" "grub-terminfo (GNU GRUB 0.97)" FSF +.TH GRUB-TERMINFO "8" "June 2006" "grub-terminfo (GNU GRUB 0.97)" FSF .SH NAME grub-terminfo \- Generate a terminfo command from a terminfo name .SH SYNOPSIS --- grub-0.97.orig/docs/grub.8 +++ grub-0.97/docs/grub.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB "8" "May 2005" "grub (GNU GRUB 0.97)" FSF +.TH GRUB "8" "June 2006" "grub (GNU GRUB 0.97)" FSF .SH NAME grub \- the grub shell .SH SYNOPSIS --- grub-0.97.orig/docs/grub.texi +++ grub-0.97/docs/grub.texi @@ -2,22 +2,41 @@ @c -*-texinfo-*- @c %**start of header @setfilename grub.info -@settitle GRUB Manual -@c %**end of header - @include version.texi - +@settitle GNU GRUB Manual @value{VERSION} @c Unify all our little indices for now. @syncodeindex fn cp @syncodeindex vr cp @syncodeindex ky cp @syncodeindex pg cp @syncodeindex tp cp +@c %**end of header @footnotestyle separate @paragraphindent 3 @finalout +@copying +This manual is for GNU GRUB (version @value{VERSION}, +@value{UPDATED}). + +Copyright @copyright{} 1999,2000,2001,2002,2004,2006 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' +and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License.'' + +(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify +this GNU Manual, like GNU software. Copies published by the Free +Software Foundation raise funds for GNU development.'' +@end quotation +@end copying + @dircategory Kernel @direntry * GRUB: (grub). The GRand Unified Bootloader @@ -34,53 +53,16 @@ @setchapternewpage odd -@ifinfo -Copyright @copyright{} 1999,2000,2001,2002,2004 Free Software Foundation, Inc. - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries a copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided also that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. -@end ifinfo - @titlepage @sp 10 -@title the GRUB manual +@title the GNU GRUB manual @subtitle The GRand Unified Bootloader, version @value{VERSION}, @value{UPDATED}. @author Gordon Matzigkeit @author Yoshinori K. Okuji @c The following two commands start the copyright page. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1999,2000,2001,2002,2004 Free Software Foundation, Inc. - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by Free Software Foundation. +@insertcopying @end titlepage @c Output the table of contents at the beginning. @@ -91,12 +73,14 @@ @ifnottex @node Top -@top GRUB manual +@top GNU GRUB manual This is the documentation of GNU GRUB, the GRand Unified Bootloader, a flexible and powerful boot loader program for @sc{pc}s. This edition documents version @value{VERSION}. + +@insertcopying @end ifnottex @menu @@ -112,7 +96,7 @@ * Images:: GRUB image files * Filesystem:: Filesystem syntax and semantics * Interface:: The menu and the command-line -* Commands:: The list of available builtin commands +* Commands:: The list of available built-in commands * Troubleshooting:: Error messages produced by GRUB * Invoking the grub shell:: How to use the grub shell * Invoking grub-install:: How to use the GRUB installer @@ -124,6 +108,7 @@ * Reporting bugs:: Where you should send a bug report * Future:: Some future plans on GRUB * Internals:: Hacking GRUB +* Copying This Manual:: Copying This Manual * Index:: @end menu @@ -251,7 +236,7 @@ compliance (primarily FreeBSD, NetBSD, OpenBSD, and Linux). Chain-loading of other boot loaders is also supported. -@item Load multiples modules +@item Load multiple modules Fully support the Multiboot feature of loading multiple modules. @item Load a configuration file @@ -531,7 +516,7 @@ @section Installing GRUB natively @strong{Caution:} Installing GRUB's stage1 in this manner will erase the -normal boot-sector used by an OS. +normal boot sector used by an OS. GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD directly, so using it on a boot sector (the first sector of a @@ -653,7 +638,7 @@ Another example is when you have a separate boot partition which is mounted at @file{/boot}. Since GRUB is a boot loader, it -doesn't know anything about mountpoints at all. Thus, you need to run +doesn't know anything about mount points at all. Thus, you need to run @command{grub-install} like this: @example @@ -837,7 +822,7 @@ @samp{+1} indicates that GRUB should read one sector from the start of the partition. The complete description about this syntax can be found -in @ref{Block list syntax}. +in @ref{blocklist syntax}. @item Run the command @command{boot} (@pxref{boot}). @@ -1302,7 +1287,7 @@ @end example As the comment says, GRUB will boot automatically in 30 seconds, unless -interrupted with a keypress. +interrupted with a key press. @example @group @@ -1474,7 +1459,7 @@ grub> @kbd{ifconfig --address=192.168.110.23 --server=192.168.110.14} @end example -You can also use @command{ifconfig} in conjuction with @command{bootp}, +You can also use @command{ifconfig} in conjunction with @command{bootp}, @command{dhcp} or @command{rarp} (e.g. to reassign the server address manually). @xref{ifconfig}, for more details. @@ -1763,7 +1748,7 @@ All @file{stage1} must do is to load Stage 2 or Stage 1.5 from a local disk. Because of the size restriction, @file{stage1} encodes the -location of Stage 2 (or Stage 1.5) in a block list format, so it never +location of Stage 2 (or Stage 1.5) in a blocklist format, so it never understand any filesystem structure. @item stage2 @@ -1823,7 +1808,7 @@ @menu * Device syntax:: How to specify devices * File name syntax:: How to specify files -* Block list syntax:: How to specify block lists +* blocklist syntax:: How to specify blocklists @end menu @@ -1878,7 +1863,7 @@ @section How to specify files There are two ways to specify files, by @dfn{absolute file name} and by -@dfn{block list}. +@dfn{blocklist}. An absolute file name resembles a Unix absolute file name, using @samp{/} for the directory separator (not @samp{\} as in DOS). One @@ -1890,10 +1875,10 @@ @code{/boot/kernel} is the same as @code{(hd1,0)/boot/kernel}. -@node Block list syntax -@section How to specify block lists +@node blocklist syntax +@section How to specify blocklists -A block list is used for specifying a file that doesn't appear in the +A blocklist is used for specifying a file that doesn't appear in the filesystem, like a chainloader. The syntax is @code{[@var{offset}]+@var{length}[,[@var{offset}]+@var{length}]@dots{}}. Here is an example: @@ -2658,7 +2643,7 @@ (@pxref{help}). @menu -* blocklist:: Get the block list notation of a file +* blocklist:: Get the blocklist notation of a file * boot:: Start up your operating system * cat:: Show the contents of a file * chainloader:: Chain-load another boot loader @@ -2693,9 +2678,9 @@ * savedefault:: Save current entry as the default entry * setup:: Set up GRUB's installation automatically * testload:: Load a file for testing a filesystem -* testvbe:: Test VESA BIOS EXTENSION +* testvbe:: Test VESA BIOS Extension * uppermem:: Set the upper memory size -* vbeprobe:: Probe VESA BIOS EXTENSION +* vbeprobe:: Probe VESA BIOS Extension @end menu @@ -2703,7 +2688,7 @@ @subsection blocklist @deffn Command blocklist file -Print the block list notation of the file @var{file}. @xref{Block list +Print the blocklist notation of the file @var{file}. @xref{blocklist syntax}. @end deffn @@ -2875,7 +2860,7 @@ @subsection help @deffn Command help @option{--all} [pattern @dots{}] -Display helpful information about builtin commands. If you do not +Display helpful information about built-in commands. If you do not specify @var{pattern}, this command shows short descriptions of most of available commands. If you specify the option @option{--all} to this command, short descriptions of rarely used commands (such as @@ -3124,7 +3109,7 @@ Set the current @dfn{root device} to the device @var{device}, then attempt to mount it to get the partition size (for passing the partition descriptor in @code{ES:ESI}, used by some chain-loaded boot loaders), the -BSD drive-type (for booting BSD kernels using their native boot format), +BSD drive type (for booting BSD kernels using their native boot format), and correctly determine the PC partition where a BSD sub-partition is located. The optional @var{hdbias} parameter is a number to tell a BSD kernel how many BIOS drive numbers are on controllers before the current @@ -3225,7 +3210,7 @@ @subsection testvbe @deffn Command testvbe mode -Test the VESA BIOS EXTENSION mode @var{mode}. This command will switch +Test the VESA BIOS Extension mode @var{mode}. This command will switch your video card to the graphics mode, and show an endless animation. Hit any key to return. See also @ref{vbeprobe}. @end deffn @@ -3249,7 +3234,7 @@ @subsection vbeprobe @deffn Command vbeprobe [mode] -Probe VESA BIOS EXTENSION information. If the mode @var{mode} is +Probe VESA BIOS Extension information. If the mode @var{mode} is specified, show only the information about @var{mode}. Otherwise, this command lists up available VBE modes on the screen. See also @ref{testvbe}. @@ -3711,7 +3696,7 @@ @chapter Invoking grub-md5-crypt The program @command{grub-md5-crypt} encrypts a password in MD5 format. -This is just a frontend of the grub shell (@pxref{Invoking the grub +This is just a front-end of the grub shell (@pxref{Invoking the grub shell}). Passwords encrypted by this program can be used with the command @command{password} (@pxref{password}). @@ -3933,7 +3918,7 @@ @item Write down anything that you think might be related. Please understand -that we often need to reproduce the same problem you encounterred in our +that we often need to reproduce the same problem you encountered in our environment. So your information should be sufficient for us to do the same thing---Don't forget that we cannot see your computer directly. If you are not sure whether to state a fact or leave it out, state it! @@ -3965,6 +3950,16 @@ @include internals.texi +@node Copying This Manual +@appendix Copying This Manual + +@menu +* GNU Free Documentation License:: License for copying this manual. +@end menu + +@include fdl.texi + + @node Index @unnumbered Index --- grub-0.97.orig/docs/internals.texi +++ grub-0.97/docs/internals.texi @@ -120,18 +120,18 @@ See the file @file{stage1/stage1.S}, for more information. -In the first sector of Stage 1.5 and Stage 2, the block lists are +In the first sector of Stage 1.5 and Stage 2, the blocklists are recorded between @code{firstlist} and @code{lastlist}. The address of @code{lastlist} is determined when assembling the file @file{stage2/start.S}. The trick here is that it is actually read backward, and the first -8-byte block list is not read here, but after the pointer is decremented +8-byte blocklist is not read here, but after the pointer is decremented 8 bytes, then after reading it, it decrements again, reads, and so on, until it is finished. The terminating condition is when the number of -sectors to be read in the next block list is zero. +sectors to be read in the next blocklist is zero. -The format of a block list can be seen from the example in the code just +The format of a blocklist can be seen from the example in the code just before the @code{firstlist} label. Note that it is always from the beginning of the disk, but @emph{not} relative to the partition boundaries. @@ -173,10 +173,10 @@ @file{disk_io.c}. The notation is that you can only @dfn{mount} one at a time. -The block list filesystem has a special place in the system. In addition +The blocklist filesystem has a special place in the system. In addition to the @dfn{normal} filesystem (or even without one mounted), you can access disk blocks directly (in the indicated partition) via the block -list notation. Using the block list filesystem doesn't effect any other +list notation. Using the blocklist filesystem doesn't effect any other filesystem mounts. The variables which can be read by the filesystem backend are: @@ -243,7 +243,7 @@ in the partition. @item grub_read -If the backend uses the block list code, then @code{grub_read} can be +If the backend uses the blocklist code, then @code{grub_read} can be used, after setting @var{block_file} to 1. @item print_a_completion @@ -267,9 +267,9 @@ @node Command interface @section The generic interface for built-ins -GRUB built-in commands are defined in a uniformal interface, whether +GRUB built-in commands are defined in a uniform interface, whether they are menu-specific or can be used anywhere. The definition of a -builtin command consists of two parts: the code itself and the table of +built-in command consists of two parts: the code itself and the table of the information. The code must be a function which takes two arguments, a command-line @@ -339,7 +339,7 @@ @enumerate @item Load the rest of itself to the real starting address, that is, the -starting address plus 512 bytes. The block lists are stored in the last +starting address plus 512 bytes. The blocklists are stored in the last part of the first sector. @item --- grub-0.97.orig/docs/mbchk.1 +++ grub-0.97/docs/mbchk.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH MBCHK "1" "May 2005" "mbchk (GNU GRUB 0.97)" FSF +.TH MBCHK "1" "June 2006" "mbchk (GNU GRUB 0.97)" FSF .SH NAME mbchk \- check the format of a Multiboot kernel .SH SYNOPSIS --- grub-0.97.orig/docs/multiboot.texi +++ grub-0.97/docs/multiboot.texi @@ -1,32 +1,28 @@ \input texinfo @c -*-texinfo-*- -@c -*-texinfo-*- @c %**start of header @setfilename multiboot.info -@settitle Multiboot Specification -@c %**end of header - +@set VERSION 0.6.95 +@settitle Multiboot Specification version @value{VERSION} @c Unify all our little indices for now. @syncodeindex fn cp @syncodeindex vr cp @syncodeindex ky cp @syncodeindex pg cp @syncodeindex tp cp +@c %**end of header @footnotestyle separate @paragraphindent 3 @finalout +@copying +Copyright @copyright{} 1995,96 Bryan Ford -@dircategory Kernel -@direntry -* Multiboot Specification: (multiboot). Multiboot Specification. -@end direntry +Copyright @copyright{} 1995,96 Erich Stefan Boleyn -@ifinfo -Copyright @copyright{} 1995, 96 Bryan Ford -Copyright @copyright{} 1995, 96 Erich Stefan Boleyn -Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright @copyright{} 1999,2000,2001,2002,2005,2006 Free Software Foundation, Inc. +@quotation Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @@ -36,7 +32,6 @@ results, provided the printed document carries a copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). - @end ignore Permission is granted to copy and distribute modified versions of this @@ -45,31 +40,23 @@ permission notice identical to this one. Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. -@end ifinfo +into another language, under the above conditions for modified +versions. +@end quotation +@end copying + +@dircategory Kernel +@direntry +* Multiboot Specification: (multiboot). Multiboot Specification. +@end direntry @titlepage @sp 10 -@title The Multiboot Specification +@title The Multiboot Specification version @value{VERSION} @author Yoshinori K. Okuji, Bryan Ford, Erich Stefan Boleyn, Kunihiro Ishiguro @page - @vskip 0pt plus 1filll -Copyright @copyright{} 1995, 96 Bryan Ford -Copyright @copyright{} 1995, 96 Erich Stefan Boleyn -Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided also that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. +@insertcopying @end titlepage @finalout @@ -80,7 +67,9 @@ @top Multiboot Specification This file documents Multiboot Specification, the proposal for the boot -sequence standard. This edition documents version 0.6.93. +sequence standard. This edition documents version @value{VERSION}. + +@insertcopying @end ifnottex @menu @@ -169,7 +158,7 @@ Disk-based boot loaders may use a variety of techniques to find the relevant OS image and boot module data on disk, such as by interpretation of specific file systems (e.g. the BSD/Mach boot loader), -using precalculated @dfn{block lists} (e.g. LILO), loading from a +using precalculated @dfn{blocklists} (e.g. LILO), loading from a special @dfn{boot partition} (e.g. OS/2), or even loading from within another operating system (e.g. the VSTa boot code, which loads from DOS). Similarly, network-based boot loaders could use a variety of @@ -386,7 +375,7 @@ @samp{load_addr}, @samp{load_end_addr}, @samp{bss_end_addr} and @samp{entry_addr} are defined in @ref{Header address fields}, and the fields @samp{mode_type}, @samp{width}, @samp{height} and @samp{depth} are -defind in @ref{Header graphics fields}. +defined in @ref{Header graphics fields}. @node Header magic fields @@ -426,7 +415,7 @@ kernel. If bit 16 in the @samp{flags} word is set, then the fields at offsets -8-24 in the Multiboot header are valid, and the boot loader should use +12-28 in the Multiboot header are valid, and the boot loader should use them instead of the fields in the actual executable header to calculate where to load the OS image. This information does not need to be provided if the kernel image is in @sc{elf} format, but it @emph{must} @@ -677,7 +666,7 @@ @example @group +-------+-------+-------+-------+ -| drive | part1 | part2 | part3 | +| part3 | part2 | part1 | drive | +-------+-------+-------+-------+ @end group @end example @@ -1197,6 +1186,17 @@ @item The maintainer changes to the GNU GRUB maintainer team @email{bug-grub@@gnu.org}, from Bryan Ford and Erich Stefan Boleyn. + +@item +The byte order of the @samp{boot_device} in Multiboot information is +reversed. This was a mistake. + +@item +The offset of the address fields were wrong. + +@item +The format is adapted to a newer Texinfo, and the version number is +specified more explicitly in the title. @end itemize @item 0.6 @@ -1208,7 +1208,7 @@ Header checksum. @item -Clasification of machine state passed to an operating system. +Classification of machine state passed to an operating system. @end itemize @item 0.5 --- grub-0.97.orig/grub/asmstub.c +++ grub-0.97/grub/asmstub.c @@ -55,6 +55,10 @@ # endif /* ! BLKFLSBUF */ #endif /* __linux__ */ +#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) +# include +#endif + /* We want to prevent any circularararity in our stubs, as well as libc name clashes. */ #define WITHOUT_LIBC_STUBS 1 @@ -777,7 +781,39 @@ /* Open read/write, or read-only if that failed. */ if (! read_only) - disks[drive].flags = open (devname, O_RDWR); + { +/* By default, kernel of FreeBSD does not allow overwriting MBR */ +#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) +#define GEOM_SYSCTL "kern.geom.debugflags" + int old_flags, flags; + size_t sizeof_int = sizeof (int); + + if (sysctlbyname (GEOM_SYSCTL, &old_flags, &sizeof_int, NULL, 0) != 0) + grub_printf ("failed to get " GEOM_SYSCTL "sysctl: %s\n", strerror (errno)); + + if ((old_flags & 0x10) == 0) + { + /* "allow foot shooting", see geom(4) */ + flags = old_flags | 0x10; + + if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int)) != 0) + { + flags = old_flags; + grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno)); + } + } + else + flags = old_flags; +#endif + disks[drive].flags = open (devname, O_RDWR); +#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) + if (flags != old_flags) + { + if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &old_flags, sizeof (int)) != 0) + grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno)); + } +#endif + } if (disks[drive].flags == -1) { @@ -926,7 +962,7 @@ int biosdisk (int subfunc, int drive, struct geometry *geometry, - int sector, int nsec, int segment) + unsigned int sector, int nsec, int segment) { char *buf; int fd = geometry->flags; --- grub-0.97.orig/grub/main.c +++ grub-0.97/grub/main.c @@ -32,6 +32,7 @@ #define WITHOUT_LIBC_STUBS 1 #include #include +#include char *program_name = 0; int use_config_file = 1; @@ -192,6 +193,12 @@ perror ("strtoul"); exit (1); } + if (boot_drive >= NUM_DISKS) + { + fprintf (stderr, "boot_drive should be from 0 to %d\n", + NUM_DISKS - 1); + exit (1); + } break; case OPT_NO_CONFIG_FILE: --- grub-0.97.orig/lib/device.c +++ grub-0.97/lib/device.c @@ -69,9 +69,9 @@ # ifndef CDROM_GET_CAPABILITY # define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ # endif /* ! CDROM_GET_CAPABILITY */ -# ifndef BLKGETSIZE -# define BLKGETSIZE _IO(0x12,96) /* return device size */ -# endif /* ! BLKGETSIZE */ +# ifndef BLKGETSIZE64 +# define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size */ +# endif /* ! BLKGETSIZE64 */ #endif /* __linux__ */ /* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with @@ -152,19 +152,19 @@ /* Linux */ { struct hd_geometry hdg; - unsigned long nr; + unsigned long long nr; if (ioctl (fd, HDIO_GETGEO, &hdg)) goto fail; - if (ioctl (fd, BLKGETSIZE, &nr)) + if (ioctl (fd, BLKGETSIZE64, &nr)) goto fail; /* Got the geometry, so save it. */ geom->cylinders = hdg.cylinders; geom->heads = hdg.heads; geom->sectors = hdg.sectors; - geom->total_sectors = nr; + geom->total_sectors = nr / 512; goto success; } @@ -407,6 +407,12 @@ { sprintf (name, "/dev/ataraid/d%c", unit + '0'); } + +static void +get_i2o_disk_name (char *name, char unit) +{ + sprintf (name, "/dev/i2o/hd%c", unit); +} #endif /* Check if DEVICE can be read. If an error occurs, return zero, @@ -801,6 +807,29 @@ } } } + + /* This is for I2O - we have /dev/i2o/hd */ + { + int unit; + + for (unit = 'a'; unit < 'f'; unit++) + { + char name[24]; + + get_i2o_disk_name (name, unit); + if (check_device (name)) + { + (*map)[num_hd + 0x80] = strdup (name); + assert ((*map)[num_hd + 0x80]); + + /* If the device map file is opened, write the map. */ + if (fp) + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); + + num_hd++; + } + } + } #endif /* __linux__ */ /* OK, close the device map file if opened. */ @@ -861,6 +890,12 @@ if (strcmp (dev + strlen(dev) - 5, "/disc") == 0) strcpy (dev + strlen(dev) - 5, "/part"); } + else + { + if ((strncmp (dev, "/dev/ataraid/", 13) == 0) || + (strncmp (dev, "/dev/rd/", 8) == 0)) + strcpy (dev + strlen(dev), "p"); + } sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1); /* Open the partition. */ --- grub-0.97.orig/netboot/3c509.c +++ grub-0.97/netboot/3c509.c @@ -18,7 +18,7 @@ 3c509 support added by Serge Babkin (babkin@hq.icb.chel.su) -$Id: 3c509.c,v 1.4 2002/01/02 21:56:40 okuji Exp $ +$Id$ ***************************************************************************/ --- grub-0.97.orig/netboot/cs89x0.c +++ grub-0.97/netboot/cs89x0.c @@ -1,3 +1,21 @@ +/** + Per an email message from Russ Nelson on + 18 March 2008 this file is now licensed under GPL Version 2. + + From: Russ Nelson + Date: Tue, 18 Mar 2008 12:42:00 -0400 + Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot + -- quote from email + As copyright holder, if I say it doesn't conflict with the GPL, + then it doesn't conflict with the GPL. + + However, there's no point in causing people's brains to overheat, + so yes, I grant permission for the code to be relicensed under the + GPLv2. Please make sure that this change in licensing makes its + way upstream. -russ + -- quote from email +**/ + /* cs89x0.c: A Crystal Semiconductor CS89[02]0 driver for etherboot. */ /* Permission is granted to distribute the enclosed cs89x0.[ch] driver --- grub-0.97.orig/netboot/cs89x0.h +++ grub-0.97/netboot/cs89x0.h @@ -1,3 +1,21 @@ +/** + Per an email message from Russ Nelson on + 18 March 2008 this file is now licensed under GPL Version 2. + + From: Russ Nelson + Date: Tue, 18 Mar 2008 12:42:00 -0400 + Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot + -- quote from email + As copyright holder, if I say it doesn't conflict with the GPL, + then it doesn't conflict with the GPL. + + However, there's no point in causing people's brains to overheat, + so yes, I grant permission for the code to be relicensed under the + GPLv2. Please make sure that this change in licensing makes its + way upstream. -russ + -- quote from email +**/ + /* Copyright, 1988-1992, Russell Nelson, Crynwr Software This program is free software; you can redistribute it and/or modify --- grub-0.97.orig/netboot/etherboot.h +++ grub-0.97/netboot/etherboot.h @@ -531,9 +531,6 @@ extern int network_ready; extern struct rom_info rom; extern struct arptable_t arptable[MAX_ARP]; -extern struct bootpd_t bootp_data; -#define BOOTP_DATA_ADDR (&bootp_data) -extern unsigned char *end_of_rfc1533; /* config.c */ extern struct nic nic; --- grub-0.97.orig/netboot/main.c +++ grub-0.97/netboot/main.c @@ -56,7 +56,8 @@ static unsigned long netmask; static struct bootpd_t bootp_data; static unsigned long xid; -static unsigned char *end_of_rfc1533 = NULL; + +#define BOOTP_DATA_ADDR (&bootp_data) #ifndef NO_DHCP_SUPPORT #endif /* NO_DHCP_SUPPORT */ @@ -967,7 +968,6 @@ if (block == 0) { - end_of_rfc1533 = NULL; vendorext_isvalid = 0; if (grub_memcmp (p, rfc1533_cookie, 4)) @@ -1021,7 +1021,7 @@ } else if (c == RFC1533_END) { - end_of_rfc1533 = endp = p; + endp = p; continue; } else if (c == RFC1533_NETMASK) --- grub-0.97.orig/netboot/natsemi.c +++ grub-0.97/netboot/natsemi.c @@ -608,7 +608,7 @@ const char *p) /* Packet */ { u32 status, to, nstype; - u32 tx_status; + volatile u32 tx_status; /* Stop the transmitter */ outl(TxOff, ioaddr + ChipCmd); @@ -647,7 +647,7 @@ to = currticks() + TX_TIMEOUT; - while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to)) + while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to)) /* wait */ ; if (currticks() >= to) { --- grub-0.97.orig/netboot/sis900.c +++ grub-0.97/netboot/sis900.c @@ -901,7 +901,7 @@ const char *p) /* Packet */ { u32 status, to, nstype; - u32 tx_status; + volatile u32 tx_status; /* Stop the transmitter */ outl(TxDIS, ioaddr + cr); @@ -940,7 +940,7 @@ to = currticks() + TX_TIMEOUT; - while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to)) + while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to)) /* wait */ ; if (currticks() >= to) { --- grub-0.97.orig/netboot/sk_g16.c +++ grub-0.97/netboot/sk_g16.c @@ -13,12 +13,12 @@ * * Module : sk_g16.c * - * Version : $Revision: 1.4 $ + * Version : $Revision$ * * Author : Patrick J.D. Weichmann * * Date Created : 94/05/26 - * Last Updated : $Date: 2002/01/02 21:56:40 $ + * Last Updated : $Date$ * * Description : Schneider & Koch G16 Ethernet Device Driver for * Linux Kernel >= 1.1.22 --- grub-0.97.orig/netboot/sk_g16.h +++ grub-0.97/netboot/sk_g16.h @@ -4,7 +4,7 @@ * of the GNU Public License, incorporated herein by reference. * * Module : sk_g16.h - * Version : $Revision: 1.3 $ + * Version : $Revision$ * * Author : M.Hipp (mhipp@student.uni-tuebingen.de) * changes by : Patrick J.D. Weichmann @@ -15,8 +15,8 @@ * the am7990 (LANCE) chip used for writing a * network device driver which uses this chip * - * $Log: sk_g16.h,v $ - * Revision 1.3 2000/07/29 19:22:54 okuji + * $Log$ + * Revision 1.3 2000-07-29 19:22:54 okuji * update the network support to etherboot-4.6.4. * -*/ --- grub-0.97.orig/stage1/Makefile.am +++ grub-0.97/stage1/Makefile.am @@ -5,7 +5,7 @@ # We can't use builtins or standard includes. AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc -LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 +stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 noinst_PROGRAMS = stage1.exec stage1_exec_SOURCES = stage1.S stage1.h --- grub-0.97.orig/stage2/bios.c +++ grub-0.97/stage2/bios.c @@ -47,7 +47,7 @@ return the error number. Otherwise, return 0. */ int biosdisk (int read, int drive, struct geometry *geometry, - int sector, int nsec, int segment) + unsigned int sector, int nsec, int segment) { int err; --- grub-0.97.orig/stage2/boot.c +++ grub-0.97/stage2/boot.c @@ -1,7 +1,7 @@ /* boot.c - load and bootstrap a kernel */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -96,7 +96,7 @@ lh = (struct linux_kernel_header *) buffer; /* ELF loading supported if multiboot, FreeBSD and NetBSD. */ - if ((type == KERNEL_TYPE_MULTIBOOT + if (((type == KERNEL_TYPE_MULTIBOOT && ! (flags & MULTIBOOT_AOUT_KLUDGE)) || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0 || suggested_type == KERNEL_TYPE_NETBSD) --- grub-0.97.orig/stage2/builtins.c +++ grub-0.97/stage2/builtins.c @@ -3830,15 +3830,15 @@ { char tmp[16]; grub_sprintf (tmp, ",%d", (partition >> 16) & 0xFF); - grub_strncat (device, tmp, 256); + grub_strncat (device, tmp, sizeof (device)); } if ((partition & 0x00FF00) != 0x00FF00) { char tmp[16]; grub_sprintf (tmp, ",%c", 'a' + ((partition >> 8) & 0xFF)); - grub_strncat (device, tmp, 256); + grub_strncat (device, tmp, sizeof (device)); } - grub_strncat (device, ")", 256); + grub_strncat (device, ")", sizeof (device)); } int embed_stage1_5 (char *stage1_5, int drive, int partition) --- grub-0.97.orig/stage2/disk_io.c +++ grub-0.97/stage2/disk_io.c @@ -137,7 +137,7 @@ } int -rawread (int drive, int sector, int byte_offset, int byte_len, char *buf) +rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf) { int slen, sectors_per_vtrack; int sector_size_bits = log2 (buf_geom.sector_size); @@ -261,7 +261,7 @@ */ if (disk_read_func) { - int sector_num = sector; + unsigned int sector_num = sector; int length = buf_geom.sector_size - byte_offset; if (length > size) length = size; @@ -291,7 +291,7 @@ int -devread (int sector, int byte_offset, int byte_len, char *buf) +devread (unsigned int sector, int byte_offset, int byte_len, char *buf) { /* * Check partition boundaries @@ -330,7 +330,7 @@ #ifndef STAGE1_5 int -rawwrite (int drive, int sector, char *buf) +rawwrite (int drive, unsigned int sector, char *buf) { if (sector == 0) { @@ -363,7 +363,7 @@ } int -devwrite (int sector, int sector_count, char *buf) +devwrite (unsigned int sector, int sector_count, char *buf) { #if defined(GRUB_UTIL) && defined(__linux__) if (current_partition != 0xFFFFFF --- grub-0.97.orig/stage2/fsys_ffs.c +++ grub-0.97/stage2/fsys_ffs.c @@ -50,7 +50,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:35:49 rpd - * $Id: fsys_ffs.c,v 1.10 2001/11/12 06:57:29 okuji Exp $ + * $Id$ */ #ifdef FSYS_FFS --- grub-0.97.orig/stage2/fsys_ufs2.c +++ grub-0.97/stage2/fsys_ufs2.c @@ -51,7 +51,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:35:49 rpd - * $Id: fsys_ufs2.c,v 1.2 2004/06/19 12:17:52 okuji Exp $ + * $Id$ */ #ifdef FSYS_UFS2 --- grub-0.97.orig/stage2/imgact_aout.h +++ grub-0.97/stage2/imgact_aout.h @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)exec.h 8.1 (Berkeley) 6/11/93 - * $Id: imgact_aout.h,v 1.1 1999/06/24 00:03:22 okuji Exp $ + * $Id$ */ /* * 11/23/95 - Kludge to get "ntohl" null macro added. -- ESB --- grub-0.97.orig/stage2/iso9660.h +++ grub-0.97/stage2/iso9660.h @@ -73,11 +73,11 @@ typedef struct __iso_16bit { u_int16_t l, b; -} iso_16bit_t __attribute__ ((packed)); +} iso_16bit_t; typedef struct __iso_32bit { u_int32_t l, b; -} iso_32bit_t __attribute__ ((packed)); +} iso_32bit_t; typedef u_int8_t iso_date_t[7]; --- grub-0.97.orig/stage2/shared.h +++ grub-0.97/stage2/shared.h @@ -499,7 +499,11 @@ unsigned char linear_reserved_field_position; unsigned long max_pixel_clock; - unsigned char reserved3[189]; + /* Reserved field to make structure to be 256 bytes long, VESA BIOS + Extension 3.0 Specification says to reserve 189 bytes here but + that doesn't make structure to be 256 bytes. So additional one is + added here. */ + unsigned char reserved3[189 + 1]; } __attribute__ ((packed)); @@ -807,7 +811,7 @@ /* Low-level disk I/O */ int get_diskinfo (int drive, struct geometry *geometry); int biosdisk (int subfunc, int drive, struct geometry *geometry, - int sector, int nsec, int segment); + unsigned int sector, int nsec, int segment); void stop_floppy (void); /* Command-line interface functions. */ @@ -920,10 +924,10 @@ int gunzip_read (char *buf, int len); #endif /* NO_DECOMPRESSION */ -int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf); -int devread (int sector, int byte_offset, int byte_len, char *buf); -int rawwrite (int drive, int sector, char *buf); -int devwrite (int sector, int sector_len, char *buf); +int rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf); +int devread (unsigned int sector, int byte_offset, int byte_len, char *buf); +int rawwrite (int drive, unsigned int sector, char *buf); +int devwrite (unsigned int sector, int sector_len, char *buf); /* Parse a device string and initialize the global parameters. */ char *set_device (char *device); --- grub-0.97.orig/stage2/stage2.c +++ grub-0.97/stage2/stage2.c @@ -651,7 +651,10 @@ *(new_heap++) = 0; if (config_entries) - run_menu (heap, NULL, new_num_entries, new_heap, 0); + { + current_entryno = first_entry + entryno; + run_menu (heap, NULL, new_num_entries, new_heap, 0); + } else { cls (); @@ -727,7 +730,8 @@ cur_entry = get_entry (config_entries, first_entry + entryno, 1); /* Set CURRENT_ENTRYNO for the command "savedefault". */ - current_entryno = first_entry + entryno; + if (config_entries) + current_entryno = first_entry + entryno; if (run_script (cur_entry, heap)) { --- grub-0.97.orig/stage2/tparm.c +++ grub-0.97/stage2/tparm.c @@ -63,7 +63,7 @@ #define MAX_FORMAT_LEN 256 #define max(a,b) ((a) > (b) ? (a) : (b)) -//MODULE_ID("$Id: tparm.c,v 1.1 2002/11/29 20:39:24 okuji Exp $") +//MODULE_ID("$Id$") /* * char * --- grub-0.97.orig/stamp-h.in +++ grub-0.97/stamp-h.in @@ -0,0 +1 @@ +timestamp --- grub-0.97.orig/util/grub-install.in +++ grub-0.97/util/grub-install.in @@ -112,8 +112,8 @@ tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'` tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;; freebsd* | kfreebsd*-gnu) - tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \ - | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'` + tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \ + | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'` tmp_part=`echo "$1" \ | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \ | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"` --- grub-0.97.orig/util/mkbimage +++ grub-0.97/util/mkbimage @@ -1,7 +1,7 @@ #!/bin/sh # MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode # C) 2001,2002,2003 Thierry Laronde -# C) 2001,2002,2003 Robert Millan +# C) 2001,2002,2003 Robert Millan # This program is free software; you can redistribute it and/or modify @@ -19,7 +19,7 @@ # program's maintainer or write to: The Free Software Foundation, # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. -# $Id: mkbimage,v 1.19 2004/07/21 14:43:04 robertmh Exp $ +# $Id$ # Global variables tarfile= @@ -58,7 +58,7 @@ # Name by which this script was invoked. program=`echo "$0" | sed -e 's/[^\/]*\///g'` -version_number='$Revision: 1.19 $' +version_number='$Revision$' usage=" Usage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE @@ -94,15 +94,13 @@ display Version information and exit Copyright (c) 2001,2002,2003 Thierry Laronde . -Copyright (c) 2001,2002 Robert Millan . GPLed." version="mkbimage $version_number -Written by Thierry Laronde and Robert Millan. +Written by Thierry Laronde. Copyright (c) 2001,2002,2003 Thierry Laronde . -Copyright (c) 2001,2002,2003 Robert Millan . This is free software under the GPL version 2 or later; see the source for copying conditions. There is NO warranty, not even for MERCHANTABILITY or