All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Gore <magore@sympatico.ca>
To: linux-mtd@lists.infradead.org
Subject: GRUB MTD DISKONCHIP patch failure with "grub-2003-01-08-doc.patch" on file stage2/disk_io.c using latest GRUB CVS
Date: Mon, 10 Nov 2003 22:11:32 -0500	[thread overview]
Message-ID: <3FB05364.2000608@sympatico.ca> (raw)


I downloaded the latest CVS for grub on 10 Nov 2003 at 9:30pmEST and 
attempted to apply the MTD patch grub-2003-01-08-doc.patch
Besides the expected Changelog and Authors errors I got one rejected 
section on stage2/disk_io.c (see below for copy of the failed section)

It is not totally clear to me how to fix this - looking at the code it 
seems that the patch is using a different parsing method and as such it 
is not clear  how to proceed since
I do not have the grub code from the original patch date - nor do I know 
what bugs it may have had and or have fixed...

I suspect the problem must be recent since others have reported success 
with patching GRUB in the last few months

I would be thankfull for any pointers

Here is disk_io.c.rej

***************
*** 964,987 ****
                return device + 2;
            }
 
-         if ((*device == 'f' || *device == 'h' || *device == 'n')
-             && (device += 2, (*(device - 1) != 'd')))
-           errnum = ERR_NUMBER_PARSING;
 
-         if (ch == 'n')
-           current_drive = NETWORK_DRIVE;
-         else
            {
              safe_parse_maxint (&device, (int *) &current_drive);
             
              disk_choice = 0;
              if (ch == 'h')
                current_drive += 0x80;
            }
        }
 
        if (errnum)
-       return 0;
 
        if (*device == ')')
        {
--- 1024,1060 ----
                return device + 2;
            }
 
+         device += 2;
 
+ #define MK16(a,b) ( ((a)<<8) + (b) )
+
+         switch (MK16(ch, *(device-1)))
            {
+           case MK16('n','d'):
+             current_drive = NETWORK_DRIVE;
+             break;
+            
+           case MK16('d','c'):
              safe_parse_maxint (&device, (int *) &current_drive);
+             disk_choice = 0;
+             current_drive += DISK_ON_CHIP;
+             break;
             
+           case MK16('h','d'):
+           case MK16('f','d'):
+             safe_parse_maxint (&device, (int *) &current_drive);
              disk_choice = 0;
              if (ch == 'h')
                current_drive += 0x80;
+             break;
+            
+           default:
+             errnum = ERR_NUMBER_PARSING;
            }
        }
 
        if (errnum)
+        return 0;
 
        if (*device == ')')
        {



-- 
# Mike Gore
# At Home:	InfoWrite Consulting
# Mail:		405 Midwood Cres, Waterloo Ontario, N2L 5N4
# Phone:	1-519-884-4943
# Fax:		1-519-885-0548
# Email:	magore@sympatico.ca
#
# At Work: 	Technical Support, CSCF
# Smail:   	DC3549C, University of Waterloo, 200 University Ave
#	     	Waterloo Ontario, Canada, N2L 3G1
# Phone:	1-519-888-4567, x6205
# Fax:		1-519-746-5036
# Email:	magore@uwaterloo.ca

             reply	other threads:[~2003-11-11  3:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-11  3:11 Mike Gore [this message]
2003-11-11  6:33 ` GRUB MTD DISKONCHIP patch failure with "grub-2003-01-08-doc.patch" on file stage2/disk_io.c using latest GRUB CVS Ilguiz Latypov
2003-11-11  8:37   ` GRUB MTD DISKONCHIP patch failure withGRUB CVS David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FB05364.2000608@sympatico.ca \
    --to=magore@sympatico.ca \
    --cc=linux-mtd@lists.infradead.org \
    --cc=magore@icr1.uwaterloo.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.