[PATCH lorax/master 3/6] mkefiboot: add --debug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can use the --debug flag to get debugging output from mkefiboot and
pylorax.imgutils. Helpful!
---
 src/sbin/mkefiboot |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/sbin/mkefiboot b/src/sbin/mkefiboot
index d546b0e..fb695ed 100755
--- a/src/sbin/mkefiboot
+++ b/src/sbin/mkefiboot
@@ -17,6 +17,10 @@
 #
 # Red Hat Author(s):  Will Woods <wwoods@xxxxxxxxxx>
 
+import logging
+logging.basicConfig()
+log = logging.getLogger()
+
 import os, tempfile, argparse
 from subprocess import check_call, PIPE
 from pylorax.imgutils import mkdosimg, round_to_blocks, LoopDev, DMDev, dm_detach
@@ -106,6 +110,9 @@ def mkefidisk(efiboot, outfile):
 
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description="Make an EFI boot image from the given directory.")
+    parser.add_argument("--debug", action="store_const", const=logging.DEBUG,
+        dest="loglevel", default=log.getEffectiveLevel(),
+        help="print debugging info")
     parser.add_argument("-d", "--disk", action="store_true",
         help="make a full EFI disk image (including partition table)")
     parser.add_argument("-a", "--apple", action="store_const", const="apple",
@@ -124,6 +131,8 @@ if __name__ == '__main__':
     parser.add_argument("outfile", metavar="OUTPUTFILE",
         help="output file to write")
     opt = parser.parse_args()
+    # logging
+    log.setLevel(opt.loglevel)
     # sanity checks
     if not os.path.isdir(opt.bootdir):
         parser.error("%s is not a directory" % opt.bootdir)
-- 
1.7.10.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux