Skip to contentSkip to conversation

patch for [xfs, grub-probe -t fs] and a question about lvm

PATCH Adrian Migraso 3 participants 3 messages Feb 28, 2008

lore
Share & tools
lore
#0 lore raw

hi... can we add this patch... at least the first patch @ lines 249, i was trying to grub-probe the xfs filesystem under the lvm, and got some error...

Also,... i have been trying to use the lvm.mod with the grub, the problem is, my logical volumes are not detected by 'ls' command during grub resucue>

is lvm.mod ok?

can i have a peek of how grub2 works? I mean its flow... thanks guys...

kern/disk.c 2008-02-26 15:58:58.000000000 +0000 renamed from grub2/kern/disk.c 2008-02-08 12:22:51.000000000 +0000 +7 -5
@@ -246,7 +246,8 @@
 
   for (dev = grub_disk_dev_list; dev; dev = dev->next)
     {
-      if ((dev->open) (raw, disk) == GRUB_ERR_NONE)
+      grub_errno = (dev->open) (raw, disk);
+      if (grub_errno == GRUB_ERR_NONE)
        break;
       else if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
        grub_errno = GRUB_ERR_NONE;
@@ -364,7 +365,8 @@
   grub_dprintf ("disk", "Reading `%s'...\n", disk->name);
 
   /* First of all, check if the region is within the disk.  */
-  if (grub_disk_check_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
+  grub_errno = grub_disk_check_range (disk, &sector, &offset, size);
+  if (grub_errno != GRUB_ERR_NONE)
     {
       grub_error_push ();
       grub_dprintf ("disk", "Read out of range: sector 0x%llx (%s).\n",
@@ -407,9 +409,9 @@
       else
        {
          /* Otherwise read data from the disk actually.  */
-         if ((disk->dev->read) (disk, start_sector,
-                                GRUB_DISK_CACHE_SIZE, tmp_buf)
-             != GRUB_ERR_NONE)
+         grub_errno = (disk->dev->read) (disk, start_sector,
+                                GRUB_DISK_CACHE_SIZE, tmp_buf);
+         if (grub_errno != GRUB_ERR_NONE)
            {
              /* Uggh... Failed. Instead, just read necessary data.  */
              unsigned num;
#1 lore raw
Quoted 39 lines · Adrian Migraso

hi... can we add this patch... at least the first patch @ lines 249, i was trying to grub-probe the xfs filesystem under the lvm, and got some error...

Also,... i have been trying to use the lvm.mod with the grub, the problem is, my logical volumes are not detected by 'ls' command during grub resucue>

is lvm.mod ok?

can i have a peek of how grub2 works? I mean its flow... thanks guys...

kern/disk.c 2008-02-26 15:58:58.000000000 +0000 renamed from grub2/kern/disk.c 2008-02-08 12:22:51.000000000 +0000 +4 -2
@@ -246,7 +246,8 @@
 
   for (dev = grub_disk_dev_list; dev; dev = dev->next)
     {
-      if ((dev->open) (raw, disk) == GRUB_ERR_NONE)
+      grub_errno = (dev->open) (raw, disk);
+      if (grub_errno == GRUB_ERR_NONE)
        break;
       else if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
        grub_errno = GRUB_ERR_NONE;
@@ -364,7 +365,8 @@
   grub_dprintf ("disk", "Reading `%s'...\n", disk->name);
 
   /* First of all, check if the region is within the disk.  */
-  if (grub_disk_check_range (disk, &sector, &offset, size) !=
 GRUB_ERR_NONE)
+  grub_errno = grub_disk_check_range (disk, &sector, &offset, size);
+  if (grub_errno != GRUB_ERR_NONE)
     {
       grub_error_push ();
       grub_dprintf ("disk", "Read out of range: sector 0x%llx (%s).\n",
kern/disk.c 2008-02-26 15:58:58.000000000 +0000 renamed from grub2/kern/disk.c 2008-02-08 12:22:51.000000000 +0000 +0 -0
@@ -407,9 +409,9 @@
       else
        {

kern/disk.c 2008-02-26 15:58:58.000000000 +0000 line 417

Quoted 10 lines
kern/disk.c 2008-02-26 15:58:58.000000000 +0000 renamed from grub2/kern/disk.c 2008-02-08 12:22:51.000000000 +0000 +3 -3
          /* Otherwise read data from the disk actually.  */
-         if ((disk->dev->read) (disk, start_sector,
-                                GRUB_DISK_CACHE_SIZE, tmp_buf)
-             != GRUB_ERR_NONE)
+         grub_errno = (disk->dev->read) (disk, start_sector,
+                                GRUB_DISK_CACHE_SIZE, tmp_buf);
+         if (grub_errno != GRUB_ERR_NONE)
            {
              /* Uggh... Failed. Instead, just read necessary data.  */
              unsigned num;

It's generally not a good idea to set grub_errno directly, have you got a reason to do so ?

Signature · 1 line
Bean
#2 lore raw
In reply to Adrian Migraso

On Thu, 28 Feb 2008 13:12:08 +0800, "Adrian Migraso" <[email protected]> wrote:
<snip>

Quoted 7 lines

Also,... i have been trying to use the lvm.mod with the grub, the problem is, my logical volumes are not detected by 'ls' command during grub resucue>

is lvm.mod ok?

can i have a peek of how grub2 works? I mean its flow... thanks guys...

FYI I boot off a LV with grub2 for months now without a problem. I am running ext3 on it though but I do not think that XFS is the problem. For testing purposes, do you see your LVs in grub-emu?

Kind regards,
Michael