New GRUB package suitable for Etch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
Leandro did another small set of changes fixing important bugs on
GRUB. Please check the bellow changelog and hint it if possible.
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 <baiti@web.de>
to savedefault-once. closes: #254475
-- Otavio Salvador <otavio@ossystems.com.br> Tue, 20 Mar 2007 23:37:46 -0300
Diffstat:
changelog | 10 ++++++++
patches/00list | 1
patches/find-grub-dir.diff | 55 +++++++++++++++++++++++++++++++++++++++++++++
patches/savedefault.diff | 33 ++++++++++++++++-----------
4 files changed, 86 insertions(+), 13 deletions(-)
Patch:
Index: debian/patches/find-grub-dir.diff
===================================================================
--- debian/patches/find-grub-dir.diff (revisão 0)
+++ debian/patches/find-grub-dir.diff (revisão 435)
@@ -0,0 +1,55 @@
+diff -uNr grub-0.97/util/grub-set-default.in grub-0.97-changed/util/grub-set-default.in
+--- grub-0.97/util/grub-set-default.in 2007-03-06 22:17:12.000000000 +0000
++++ grub-0.97-changed/util/grub-set-default.in 2007-03-07 00:00:08.000000000 +0000
+@@ -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
Index: debian/patches/savedefault.diff
===================================================================
--- debian/patches/savedefault.diff (revisão 421)
+++ debian/patches/savedefault.diff (revisão 435)
@@ -1,6 +1,6 @@
-diff -uNr grub-0.97/stage2/builtins.c grub-0.97.modif/stage2/builtins.c
---- grub-0.97/stage2/builtins.c 2005-02-15 16:58:23.000000000 -0500
-+++ grub-0.97.modif/stage2/builtins.c 2007-01-09 00:17:59.000000000 -0500
+diff -uNr grub-0.97.orig/stage2/builtins.c grub-0.97/stage2/builtins.c
+--- grub-0.97.orig/stage2/builtins.c 2005-02-15 21:58:23.000000000 +0000
++++ grub-0.97/stage2/builtins.c 2007-03-06 22:32:02.000000000 +0000
@@ -82,6 +82,10 @@
inside other functions. */
static int configfile_func (char *arg, int flags);
@@ -12,7 +12,7 @@
/* Initialize the data for builtins. */
void
init_builtins (void)
-@@ -3221,7 +3225,102 @@
+@@ -3221,7 +3225,109 @@
static int
savedefault_func (char *arg, int flags)
{
@@ -75,14 +75,15 @@
+ default_file[i] = 0;
+ grub_strncat (default_file + i, "default", DEFAULT_FILE_BUFLEN - i);
+
-+ if(!(fp = fopen(default_file,"w")))
++ if(!(fp = fopen(default_file,"r")))
+ {
+ errnum = ERR_READ;
+ goto fail;
+ }
+
-+ read(&line, -1);
-+
++ fgets(line, bytes, fp);
++ fclose(fp);
++
+ sscanf(line, "%d:%d", &curr_prev_default, &curr_default);
+
+ if(curr_default != -1)
@@ -96,9 +97,15 @@
+ }
+
+ if(once_only)
-+ sprintf(buf, "%d:%d\n", new_prev_default, new_default);
++ sprintf(buf, "%d:%d", new_prev_default, new_default);
+ else
-+ sprintf(buf, "%d\n", new_default);
++ sprintf(buf, "%d", new_default);
++
++ if(!(fp = fopen(default_file,"w")))
++ {
++ errnum = ERR_READ;
++ goto fail;
++ }
+
+ fprintf(fp, buf);
+
@@ -116,7 +123,7 @@
unsigned long tmp_drive = saved_drive;
unsigned long tmp_partition = saved_partition;
char *default_file = (char *) DEFAULT_FILE_BUF;
-@@ -3297,22 +3396,26 @@
+@@ -3297,22 +3403,26 @@
disk_read_hook = disk_read_savesect_func;
len = grub_read (buf, sizeof (buf));
@@ -150,9 +157,9 @@
/* Set up a string to be written. */
grub_memset (buf, '\n', sizeof (buf));
-diff -uNr grub-0.97/stage2/stage2.c grub-0.97.modif/stage2/stage2.c
---- grub-0.97/stage2/stage2.c 2005-03-19 12:51:57.000000000 -0500
-+++ grub-0.97.modif/stage2/stage2.c 2007-01-09 00:13:18.000000000 -0500
+diff -uNr grub-0.97.orig/stage2/stage2.c grub-0.97/stage2/stage2.c
+--- grub-0.97.orig/stage2/stage2.c 2005-03-19 17:51:57.000000000 +0000
++++ grub-0.97/stage2/stage2.c 2007-03-06 22:17:55.000000000 +0000
@@ -891,8 +891,16 @@
len = grub_read (buf, sizeof (buf));
if (len > 0)
Index: debian/patches/00list
===================================================================
--- debian/patches/00list (revisão 421)
+++ debian/patches/00list (revisão 435)
@@ -18,6 +18,7 @@
print_func.diff
mprotect.diff
savedefault.diff
+find-grub-dir.diff
intelmac.diff
crossreference_manpages.diff
Index: debian/changelog
===================================================================
--- debian/changelog (revisão 421)
+++ debian/changelog (revisão 435)
@@ -1,3 +1,13 @@
+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 <baiti@web.de>
+ to savedefault-once. closes: #254475
+
+ -- Otavio Salvador <otavio@ossystems.com.br> Tue, 20 Mar 2007 23:37:46 -0300
+
grub (0.97-23) unstable; urgency=high
[ Tomas Pospisek ]
- --
O T A V I O S A L V A D O R
- ---------------------------------------------
E-mail: otavio@debian.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://otavio.ossystems.com.br
- ---------------------------------------------
"Microsoft sells you Windows ... Linux gives
you the whole house."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>
iD8DBQFGAJxxLqiZQEml+FURAoZbAKCPVacjsH5VMuvtRVsGw2625ZmwPgCfaCvy
M+Vv/IayKLcEbnE0bBJrNmk=
=YNie
-----END PGP SIGNATURE-----
Reply to: