commit 5976c8e2f45f42af866db0b443449f9d3993ce31
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Tue Jan 18 22:16:18 2011 +0000
Script completes as prescribed, start to finish. run with -j or --justdoit for a
complete run
Does not work with Live isos
multiboot-media-creator.py | 28 +++++++++++-----------------
1 files changed, 11 insertions(+), 17 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 5084985..33afa93 100755
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -51,9 +51,10 @@ else:
mytemp=tempfile.mkdtemp(suffix=".mmc")
dev=options.device
+rawdev=dev[:-1]
-#if dev==None:
-# sys.exit("Program requires a destination device")
+if dev==None:
+ sys.exit("Program requires a destination device")
print path
print dev
@@ -73,7 +74,7 @@ def umount_device(dev):
def grub_install():
try:
- os.system("grub2-install --root-directory=%s %s --force" %
(mytemp,dev))
+ os.system("grub2-install --root-directory=%s %s --force" %
(mytemp,rawdev))
except:
sys.exit("Unable to grub-install, check device")
try:
@@ -101,14 +102,11 @@ based on a given type"""
def makedirs(iso,filesys):
BN=os.path.basename(iso.strip(".iso"))
- try:
- os.makedirs(os.path.join(mytemp, BN,"boot"))
- os.makedirs(os.path.join(mytemp, BN,"CHECKSUM"))
- os.makedirs(os.path.join(mytemp, BN,"tmp"))
- if filesys=="dvd":
- os.makedirs(os.path.join(mytemp, BN,"images"))
- except:
- sys.exit("Unable to create directory structure on device")
+ os.makedirs(os.path.join(mytemp, "boot/grub2"))
+ os.makedirs(os.path.join(mytemp, BN,"CHECKSUM"))
+ os.makedirs(os.path.join(mytemp, BN,"tmp"))
+ if filesys=="dvd":
+ os.makedirs(os.path.join(mytemp, BN,"images"))
print mytemp
def mount_iso(iso):
@@ -164,7 +162,6 @@ def build_filesystem():
umount_iso(i)
except:
print "No dvd isos found"
- os.makedirs(os.path.join(mytemp, "boot/grub2"))
print "Done!"
def create_grub(gtimeout=10):
@@ -185,17 +182,14 @@ def create_grub(gtimeout=10):
grub.write(" initrd /%s/boot/initrd.img\n}\n" % BN)
grub.close()
-#if __name__=="__main__":
-# build_filesystem()
-# create_grub()
-# make_iso()
-# removetemps()
def doit(device):
mount_device(device)
build_filesystem()
create_grub()
grub_install()
umount_device(dev)
+ removetemps()
if options.justdoit==True:
doit(dev)
+
Show replies by date