Fix chainloding + Chainloading into logical partitions
A message that is not in the archive (sent off-list or not yet received): [email protected]
As already mentioned in this mailing list (
http://lists.gnu.org/archive/html/grub-devel/2008-07/msg00192.html)n<http://lists.gnu.org/archive/html/grub-devel/2008-07/msg00192.html%29n>I
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.
Signature · 1 line
Jean-Pierre Flori
include/grub/pc_partition.h +3 -0
@@ -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
loader/i386/pc/chainloader.c +6 -4
@@ -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)
partmap/pc.c +2 -0
@@ -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",
Quoted 5 lines · Jean-Pierre Flori
As already mentioned in this mailing list
(http://lists.gnu.org/archive/html/grub-devel/2008-07/msg00192.html)n I 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).
Quoted 9 lines
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) ?
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?
Quoted 11 lines
Thanks.
--
Jean-Pierre Flori_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
Quoted 6 lines · Vladimir 'phcoder' Serbinenko
There is strictly no need to do this restructuration. The real bug is different fix would be setting
dev->disk->partitionto 0 before callinggrub_disk_readand 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?
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.
Signature · 2 lines
Regards, Pavel Roskin
Quoted 9 lines · Pavel Roskin
Quoted 6 lines · Vladimir 'phcoder' Serbinenko
There is strictly no need to do this restructuration. The real bug is different fix would be setting
dev->disk->partitionto 0 before callinggrub_disk_readand 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?
Quoted 4 lines
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
Quoted 10 lines
--
Regards,
Pavel Roskin_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
Hello!
But I am. It is better that we fix these numerous bugs and probably does reorganize the code at the same time; then allowing this to persist and probably explode into a mess that causes undo upset to a user who's got no idea as to how to fix it if he can.
Just like I am not comfortable with people persisting in posting their messages to this list using a so called digital signature file, and causing a nuisance amongst us who run primitive scanning tools who mistake it for a binary thing behind the viruses. (Those same messages also arrive in ugly UTF-7 or UTF-8 as well.)
--
Gregg C Levine [email protected]
"The Force will be with you always." Obi-Wan Kenobi
Quoted 2 lines
-----Original Message-----
From: [email protected]
[mailto:grub-devel-
Quoted 4 lines
[email protected]] On Behalf Of Pavel Roskin
Sent: Wednesday, July 22, 2009 8:05 PM
To: The development of GRUB 2
Subject: Re: [PATCH] Fix chainloding + Chainloading into logical
partitions
Quoted 17 lines · Vladimir 'phcoder' Serbinenko
Quoted 7 lines
There is strictly no need to do this restructuration. The real bug is different fix would be setting
dev->disk->partitionto 0 before callinggrub_disk_readand 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?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.
--
Regards,
Pavel Roskin
Quoted 9 lines · Pavel Roskin
Quoted 8 lines · Vladimir 'phcoder' Serbinenko
Quoted 7 lines
There is strictly no need to do this restructuration. The real bug is different fix would be setting
dev->disk->partitionto 0 before callinggrub_disk_readand 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.
Quoted 28 lines
Quoted 5 lines
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
Quoted 10 lines
--
Regards,
Pavel Roskin_______________________________________________
Grub-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/grub-devel--
Regards
Vladimir 'phcoder' SerbinenkoPersonal git repository: http://repo.or.cz/w/grub2/phcoder.git
Signature · 1 line
Jean-Pierre Flori