All of lore.kernel.org
 help / color / mirror / Atom feed
From: adrian15 <adrian15sgd@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: os-detect lua uuid fix
Date: Sat, 22 Aug 2009 18:32:20 +0200	[thread overview]
Message-ID: <4A901D94.3090406@gmail.com> (raw)

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

Here you a have a patch that fixes the error that osdetect.lua script
had uuid not being set.

Now the linux kernel does not complain about not finding root device.

The only problem that this patch has is that is made with grub shell in 
mind instead of lua.

I suppose that we can do the same thing but getting the uuid values from 
lua script itself. If I am able to do so I will also send a patch for it.

adrian15
-- 
Support free software. Donate to Super Grub Disk. Apoya el software
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/index.php?pid=10


[-- Attachment #2: os_detect.lua.uuid_fix_way1.diff --]
[-- Type: text/plain, Size: 898 bytes --]

diff -urN original/osdetect.lua uuid_fix/osdetect.lua
--- original/osdetect.lua	2009-08-22 17:42:43.000000000 +0200
+++ uuid_fix/osdetect.lua	2009-08-22 18:23:12.000000000 +0200
@@ -156,9 +156,11 @@
 	local initrd
 
 	title = "Linux " .. kernels[i]
+	uuid_setup = "search --set=sgd_linux_kernel -f /boot/" .. kernelnames[i] .. "\n"
+	uuid_set = "probe -u ($sgd_linux_kernel) --set=sgd_root_uuid" .. "\n"
 	source = "set root=" .. device ..
 	  "\nlinux /boot/" .. kernelnames[i] ..
-	  " root=UUID=" ..  " ro"
+	  " root=UUID=" .. "$sgd_root_uuid" ..  " ro"
 
 	if grub.file_exist (root .. "boot/initrd-" ..
 			    kernels[i] .. ".img") then
@@ -171,7 +173,7 @@
 	  initrd = ""
 	end
 
-	grub.add_menu (source .. initrd, title)
+	grub.add_menu (uuid_setup .. uuid_set .. source .. initrd, title)
 	grub.add_menu (source .. " single" .. initrd,
 		       title .. " (single-user mode)")
       end

                 reply	other threads:[~2009-08-22 16:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A901D94.3090406@gmail.com \
    --to=adrian15sgd@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.