Skip to contentSkip to conversation

GRUB MTD DISKONCHIP patch failure with "grub-2003-01-08-doc.patch" on file stage2/disk_io.c using latest GRUB CVS

DISCUSSION Mike Gore 3 participants 3 messages Nov 11, 2003 Memory technology devices (MTD)

lore
Share & tools
lore

Mike Gore

author
#0 lore 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 == ')')
       {
Signature · 13 lines
# 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:	[email protected]
#
# 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:	[email protected]
#1 lore raw

Mike,

Quoted 4 lines · Mike Gore

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)

I updated the patch to match the change in disk_io.c you've found. The new patch is grub-2003-11-10-doc.patch. I tested it only with a floppy boot.

Signature · 5 lines
Ilguiz Latypov

tel.  +1 (519) 569-8746
66 Wildlark Crescent
Kitchener, Ontario N2N 3E9
#2 lore raw

Re: GRUB MTD DISKONCHIP patch failure withGRUB CVS

Quoted 11 lines · Ilguiz Latypov

Mike,

Quoted 4 lines · Mike Gore

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)

I updated the patch to match the change in disk_io.c you've found. The new patch is grub-2003-11-10-doc.patch. I tested it only with a floppy boot.

Thanks for doing that. We _really_ ought to sort out the copyright assignments so the patch can be merged.

Signature · 1 line
dwmw2