commit a5fca0079e567a8ec1800c24ab27fb7c5fb5c05d
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Wed Jan 5 20:15:54 2011 +0000
added mount/umount functions
multiboot-media-creator.py | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 867e624..b9bdf68 100644
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -2,6 +2,7 @@
import os
import glob
import tempfile
+import shutil
def lives():
"""This part handles live images"""
@@ -10,20 +11,31 @@ def installs():
"""This part handles installation images"""
path=os.getcwd() # ok, so this will need to change
+mytemp=tempfile.mkdtemp(suffix=".mmc")
def getisos(isopath):
isopath=os.path.join(isopath, "*.iso")
return glob.glob(isopath)
def makedirs():
- mytemp=tempfile.mkdtemp()
for i in getisos(path):
BN=i.strip(".iso"+path)
os.makedirs(os.path.join(mytemp, BN,"boot"))
os.makedirs(os.path.join(mytemp, BN,"images"))
os.makedirs(os.path.join(mytemp, BN,"CHECKSUM"))
+ os.makedirs(os.path.join(mytemp, BN,"tmp"))
print mytemp
-
+
+def mount_iso(iso):
+ BN=iso.strip(".iso"+path)
+ os.system("mount -o loop %s %s" % (iso, os.path.join(mytemp, BN,
"tmp")))
+
+def umount_iso(iso):
+ BN=iso.strip(".iso"+path)
+ os.system("umount %s" % (iso))
+
+def removetemps():
+ shutil.rmtree(mytemp)
if __name__ == "__main__":
makedirs()
Show replies by date