Re: [PATCH] Fix chainloding + Chainloading into logical partitions

2009-07-23 Thread Jean-Pierre Flori
On Thu, Jul 23, 2009 at 2:04 AM, Pavel Roskinaddr...@hidden wrote:
 On Thu, 2009-07-23 at 00:18 +0200, Vladimir 'phcoder' Serbinenko wrote:

 There is strictly no need to do this restructuration. The real bug is
 different fix would be setting dev-disk-partition to 0 before
 calling grub_disk_read and restoring it afterwards. This part of code
 is changed anyway with my nested partition patch and I was hoping it
 could be applied quickly. Could you test nestpart branch of my
 repository?
With your version exerything seems to work fine.
Thanks a lot.

 I'm not comfortable to approve a 60k long patch that reorganizes the
 code and fixed numerous bugs in the same time.  I'm sure bugs can be
 fixed separately.

It fixed bugs because it replaced some parts of code with new
constructions. So basically wht you ask is to do some work and then
abandon, it additionally spending time rediffing patches. Similar
thing happens when you ask to split patches but then all split go in
without any discussion. Sorry, but this is just useless work
 --
 Regards,
 Pavel Roskin


 ___
 Grub-devel mailing list
 addr...@hidden
 http://lists.gnu.org/mailman/listinfo/grub-devel




--
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git

-- 
Jean-Pierre Flori


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Fix chainloding + Chainloading into logical partitions

2009-07-22 Thread Jean-Pierre Flori
As already mentioned in this mailing list (
http://lists.gnu.org/archive/html/grub-devel/2008-07/msg00192.html)nhttp://lists.gnu.org/archive/html/grub-devel/2008-07/msg00192.html%29nI
can't chainload Syslinux from Grub2 on a disk with a pc partition
table
(Syslinux is installed on a primary partition).
I just get Boot error (from Syslinux i guess).
However it does work from Grub Legacy.
I also couldn't chainload Syslinux from Grub2 if the disk used a GPT
partition table.
The patch provided in the previous thread and adapted to current Debian
unstable Grub2 package (1.96+20090721-3, patch attached) fixes the problem.
Have any decision been made to include that patch in a future release (or a
better one just providing enough information for Syslinux to boot as it
was mentioned that this one copies more than necessary) ?

Thanks.

-- 
Jean-Pierre Flori
diff -ru grub2-1.96+20090721/include/grub/pc_partition.h grub2+patch/include/grub/pc_partition.h
--- grub2-1.96+20090721/include/grub/pc_partition.h	2009-05-09 13:04:08.0 +0200
+++ grub2+patch/include/grub/pc_partition.h	2009-07-22 10:49:34.557536456 +0200
@@ -184,6 +184,9 @@
 
   /* The offset of the extended partition.  */
   unsigned long ext_offset;
+
+  /* Partition entry. */
+  struct grub_pc_partition_entry pc_part_entry;
 };
 
 static inline int
diff -ru grub2-1.96+20090721/loader/i386/pc/chainloader.c grub2+patch/loader/i386/pc/chainloader.c
--- grub2-1.96+20090721/loader/i386/pc/chainloader.c	2009-06-11 18:13:39.0 +0200
+++ grub2+patch/loader/i386/pc/chainloader.c	2009-07-22 10:51:36.170516258 +0200
@@ -32,6 +32,7 @@
 #include grub/dl.h
 #include grub/command.h
 #include grub/machine/biosnum.h
+#include grub/pc_partition.h
 
 static grub_dl_t my_mod;
 static int boot_drive;
@@ -94,10 +95,11 @@
   dev = grub_device_open (0);
   if (dev  dev-disk  dev-disk-partition)
 {
-  grub_disk_read (dev-disk, dev-disk-partition-offset, 446, 64,
-		  (void *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);
-  part_addr = (void *) (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR
-			+ (dev-disk-partition-index  4));
+  struct grub_pc_partition *pcdata = dev-disk-partition-data;
+  grub_memcpy((void *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR,
+			  (void *) pcdata-pc_part_entry,
+			  sizeof(struct grub_pc_partition_entry));
+  part_addr = (void *) (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);
 }
 
   if (dev)
diff -ru grub2-1.96+20090721/partmap/pc.c grub2+patch/partmap/pc.c
--- grub2-1.96+20090721/partmap/pc.c	2009-06-10 23:04:23.0 +0200
+++ grub2+patch/partmap/pc.c	2009-07-22 10:53:34.679495828 +0200
@@ -131,6 +131,8 @@
 	  pcdata.bsd_part = -1;
 	  pcdata.dos_type = e-type;
 	  pcdata.bsd_type = -1;
+	  grub_memcpy(pcdata.pc_part_entry, e, sizeof(struct grub_pc_partition_entry));
+	  pcdata.pc_part_entry.start = grub_cpu_to_le32(p.offset + grub_le_to_cpu32 (e-start));
 
 	  grub_dprintf (partition,
 			partition %d: flag 0x%x, type 0x%x, start 0x%llx, len 0x%llx\n,
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel