All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] osdetect.lua improvement
@ 2009-07-11  5:58 Bean
  2009-07-13 23:49 ` Pavel Roskin
  2009-12-19 18:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 4+ messages in thread
From: Bean @ 2009-07-11  5:58 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

Hi,

This patch would check for drive number and use drivemap to map disks,
this is required to boot DOS/Windows from secondary drive. It also
change commands like root (hd0,0) to root=hd0,0 (I remember someone
want to remove the root command ?)

-- 
Bean

[-- Attachment #2: osdetect.diff --]
[-- Type: text/x-patch, Size: 1373 bytes --]

diff --git a/util/osdetect.lua b/util/osdetect.lua
index 38a9099..ebda940 100644
--- a/util/osdetect.lua
+++ b/util/osdetect.lua
@@ -42,7 +42,13 @@ function enum_device (device, fs, uuid)
   end
 
   root = "(" .. device .. ")/"
-  source = "root (" .. device .. ")\nchainloader +1"
+  source = "root=" .. device .. "\nchainloader +1"
+
+  local drive_num = string.match (device, "hd(%d+)")
+  if (drive_num ~= nil) and (drive_num ~= "0") then
+    source = source .. "\ndrivemap -s hd0 hd" .. drive_num
+  end
+
   title = nil
   if (grub.file_exist (root .. "bootmgr") and
       grub.file_exist (root .. "boot/bcd")) then
@@ -60,7 +66,7 @@ function enum_device (device, fs, uuid)
     title = "FreeDOS"
   elseif (grub.file_exist (root .. "boot/loader") and
 	  grub.file_exist (root .. "boot/device.hints")) then
-    source = "root (" .. device .. ")\nfreebsd /boot/loader" ..
+    source = "root=" .. device .. "\nfreebsd /boot/loader" ..
       "\nfreebsd_loadenv /boot/device.hints"
     title = "FreeBSD"
   else
@@ -71,8 +77,8 @@ function enum_device (device, fs, uuid)
 	local initrd
 
 	title = "Linux " .. kernels[i]
-	source = "root (" .. device ..
-	  ")\nlinux /boot/vmlinuz-" .. kernels[i] ..
+	source = "root=" .. device ..
+	  "\nlinux /boot/vmlinuz-" .. kernels[i] ..
 	  " root=UUID=" .. uuid .. " ro"
 
 	if grub.file_exist (root .. "boot/initrd-" ..

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] osdetect.lua improvement
  2009-07-11  5:58 [PATCH] osdetect.lua improvement Bean
@ 2009-07-13 23:49 ` Pavel Roskin
  2009-12-19 18:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 4+ messages in thread
From: Pavel Roskin @ 2009-07-13 23:49 UTC (permalink / raw)
  To: The development of GRUB 2

On Sat, 2009-07-11 at 13:58 +0800, Bean wrote:
> Hi,
> 
> This patch would check for drive number and use drivemap to map disks,
> this is required to boot DOS/Windows from secondary drive. It also
> change commands like root (hd0,0) to root=hd0,0 (I remember someone
> want to remove the root command ?)

Looks good to me.  Actually, the logic should be changed so that we
don't add "chainloader" and "drivemap" for Linux and FreeBSD, but it
could be a separate patch.

What's really needed in osdetect.lua is elimination of partitions with
invalid bootloader signatures.  If the first sector doesn't end with
0x55 0xaa, the partition should not appear with the "chainloader"
command.

For "Other OS", it would be nice to specify the partition in the menu
title.  Actually, maybe we should provide partitions for all names.
Since osdetect.lua scans all drives, it would be nice to distinguish
Linux 2.6.30 that boots Fedora from Linux 2.6.30 that boots SUSE.

-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] osdetect.lua improvement
  2009-07-11  5:58 [PATCH] osdetect.lua improvement Bean
  2009-07-13 23:49 ` Pavel Roskin
@ 2009-12-19 18:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2009-12-24 21:40   ` Robert Millan
  1 sibling, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2009-12-19 18:03 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 539 bytes --]

Bean wrote:
> Hi,
>
> This patch would check for drive number and use drivemap to map disks,
> this is required to boot DOS/Windows from secondary drive. 
Committed with exception for Vista (it neither needs nor supports
drivemap). Thanks
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] osdetect.lua improvement
  2009-12-19 18:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2009-12-24 21:40   ` Robert Millan
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Millan @ 2009-12-24 21:40 UTC (permalink / raw)
  To: The development of GNU GRUB

On Sat, Dec 19, 2009 at 07:03:31PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Bean wrote:
> > Hi,
> >
> > This patch would check for drive number and use drivemap to map disks,
> > this is required to boot DOS/Windows from secondary drive. 
> Committed with exception for Vista (it neither needs nor supports
> drivemap). Thanks

Uhm it's a bit confusing to discuss grub-extras patches here.  I wouldn't
want to give the impression that the GRUB / grub-extras separation is just
a "charade", since it has a purpose for legal reasons.

Should I create a new mailing list for grub-extras?

-- 
Robert Millan

  "Be the change you want to see in the world" -- Gandhi



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-24 21:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-11  5:58 [PATCH] osdetect.lua improvement Bean
2009-07-13 23:49 ` Pavel Roskin
2009-12-19 18:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-24 21:40   ` Robert Millan

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.