From: John Haxby <john.haxby@oracle.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Fix pygrub --isconfig
Date: Fri, 21 Jan 2011 15:20:40 +0000 [thread overview]
Message-ID: <4D39A448.2020904@oracle.com> (raw)
In-Reply-To: <19768.25958.450244.247435@mariner.uk.xensource.com>
[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]
On 20/01/11 16:40, Ian Jackson wrote:
> John Haxby writes ("[Xen-devel] [PATCH] Fix pygrub --isconfig"):
>> Recentlly, when trying to get to the bottom of some strange booting
>> problem, I discovered that
>>
>> pyrgub --isconfig <image file>
>>
>> usefully reports the kernel, initrd (ramdisk) and arguments that would
>> be used to boot a kernel. Well, actually, what it reported was an
>> error. This patch makes it work (and jolly useful it is too). The
>> patch also removes a spurious "print >>sys.stderr" that seems to have
>> been left in from some previous debugging.
> Thanks, but this patch doesn't apply to xen-unstable.hg. xen-unstable
> has a loop "for offset in part_offs" surrounding the code you seem to
> be trying to patch.
Sorry. This patch was originally from something rather older which I
then applied to xen-4.0-testing by mistake.
I have attached an updated patch against xen-unstable.hg.
> Is it important to check for "isconfig" before running sniff_solaris
> and sniff_netware ?
No, it should really be checked after as (presumably) the intention is
to report what would actually be chosen.
Although I have attached the patch to move the isconfig stuff to the
point where the chosenconfig is finally known "pygrub --isconfig" is
functionally equivalent to "pygrub --not-really --output-format simple
--output -" so it might be better just to remove the isconfig code
altogether. You could make it a synonym for the longer command, but as
isconfig has been unloved for quite a while it probably isn't worth it.
jch
[-- Attachment #2: pygrub.patch --]
[-- Type: text/x-patch, Size: 1659 bytes --]
diff -r 003acf02d416 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub Thu Jan 20 17:04:06 2011 +0000
+++ b/tools/pygrub/src/pygrub Fri Jan 21 15:20:17 2011 +0000
@@ -404,7 +404,6 @@
for f,parser in cfg_list:
if fs.file_exists(f):
- print >>sys.stderr, "Using %s to parse %s" % (parser,f)
self.cf = parser()
self.cf.filename = f
break
@@ -725,15 +724,6 @@
else:
fd = os.open(output, os.O_WRONLY)
- # debug
- if isconfig:
- chosencfg = run_grub(file, entry, fs, incfg["args"])
- print " kernel: %s" % chosencfg["kernel"]
- if chosencfg["ramdisk"]:
- print " initrd: %s" % chosencfg["ramdisk"]
- print " args: %s" % chosencfg["args"]
- sys.exit(0)
-
# if boot filesystem is set then pass to fsimage.open
bootfsargs = '"%s"' % incfg["args"]
bootfsgroup = re.findall('zfs-bootfs=(.*?)[\s\,\"]', bootfsargs)
@@ -769,6 +759,19 @@
fs = None
continue
+ # debug
+ if isconfig:
+ if fs:
+ if chosencfg.has_key("kernel"):
+ print " kernel: %s" % chosencfg["kernel"]
+ if chosencfg.has_key("ramdisk"):
+ print " initrd: %s" % chosencfg["ramdisk"]
+ if chosencfg.has_key("args"):
+ print " args: %s" % chosencfg["args"]
+ else:
+ print " Unable to find partition containing kernel"
+ sys.exit(0)
+
# Did looping through partitions find us a kernel?
if not fs:
raise RuntimeError, "Unable to find partition containing kernel"
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-01-21 15:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-20 15:52 [PATCH] Fix pygrub --isconfig John Haxby
2011-01-20 16:40 ` Ian Jackson
2011-01-21 15:20 ` John Haxby [this message]
2011-01-21 15:25 ` Ian Jackson
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=4D39A448.2020904@oracle.com \
--to=john.haxby@oracle.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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.