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"