[multiboot-media-creator/python-development] rsync, because bob won't let it go
by Dave Riches
commit 3cbc624c86b3ad69c64f87199b3d2578249e55fc
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Tue Jan 11 01:11:11 2011 +0000
rsync, because bob won't let it go
multiboot-media-creator.py | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 0be0d3d..d458be2 100755
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -126,10 +126,14 @@ def build_filesystem():
BN=os.path.basename(i.strip(".iso"))
makedirs(i, "dvd")
tree_path=mount_iso(i)
- shutil.copy2(os.path.join(tree_path, "isolinux/vmlinuz"),os.path.join(mytemp, BN,"boot/"))
- shutil.copy2(os.path.join(tree_path, "isolinux/initrd.img"),os.path.join(mytemp, BN,"boot/"))
- shutil.copy2(os.path.join(tree_path, "images/install.img"),os.path.join(mytemp, BN,"images/"))
- shutil.copy2(i,os.path.join(mytemp, BN))
+# shutil.copy2(os.path.join(tree_path, "isolinux/vmlinuz"),os.path.join(mytemp, BN,"boot/"))
+ os.system("rsync -avH --progress %s %s" % (os.path.join(tree_path, "isolinux/vmlinuz"),os.path.join(mytemp, BN,"boot/")))
+# shutil.copy2(os.path.join(tree_path, "isolinux/initrd.img"),os.path.join(mytemp, BN,"boot/"))
+ os.system("rsync -avH --progress %s %s" % (os.path.join(tree_path, "isolinux/initrd.img"),os.path.join(mytemp, BN,"boot/")))
+# shutil.copy2(os.path.join(tree_path, "images/install.img"),os.path.join(mytemp, BN,"images/"))
+ os.system("rsync -avH --progress %s %s" % (os.path.join(tree_path, "isolinux/initrd.img"),os.path.join(mytemp, BN,"boot/")))
+# shutil.copy2(i,os.path.join(mytemp, BN))
+ os.system("rsync -avH --progress %s %s" % (i,os.path.join(mytemp, BN)))
umount_iso(i)
except:
print "No dvd isos found"
13 years, 3 months
[multiboot-media-creator/python-development] minor bugfix
by Dave Riches
commit 95433cc7105f31b3d2519eba866482f92e993ef9
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Tue Jan 11 01:05:26 2011 +0000
minor bugfix
multiboot-media-creator.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 3e69ac1..0be0d3d 100755
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -93,7 +93,7 @@ def makedirs(iso,filesys):
print mytemp
def mount_iso(iso):
- BN=iso.strip(".iso")
+ BN=os.path.basename(iso.strip(".iso"))
os.system("mount -o loop %s %s" % (iso, os.path.join(mytemp, BN, "tmp")))
return os.path.join(mytemp, BN, "tmp")
@@ -113,7 +113,7 @@ def build_filesystem():
try:
for i in getisos(path, "live"):
print "Building filesystem for: %s" % i
- BN=i.strip(".iso")
+ BN=os.path.basename(i.strip(".iso"))
makedirs(i, "live")
tree_path=mount_iso(i)
shutil.copytree(tree_path,os.path.join(mytemp, BN,"images/"))
13 years, 3 months
[multiboot-media-creator/python-development] fixed -s / --source
by Dave Riches
commit 4a9dc49f1546e3f6c4f173f8e194c749da119ade
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Tue Jan 11 00:35:16 2011 +0000
fixed -s / --source
multiboot-media-creator.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 12b2cc7..3e69ac1 100755
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -80,11 +80,11 @@ based on a given type"""
print i+" is live"
os.system("umount %s &>/dev/null" % i)
if info==isotype:
- isos.append(os.path.basename(i))
+ isos.append(i)
return isos
def makedirs(iso,filesys):
- BN=iso.strip(".iso")
+ BN=os.path.basename(iso.strip(".iso"))
os.makedirs(os.path.join(mytemp, BN,"boot"))
os.makedirs(os.path.join(mytemp, BN,"CHECKSUM"))
os.makedirs(os.path.join(mytemp, BN,"tmp"))
@@ -129,7 +129,7 @@ def build_filesystem():
shutil.copy2(os.path.join(tree_path, "isolinux/vmlinuz"),os.path.join(mytemp, BN,"boot/"))
shutil.copy2(os.path.join(tree_path, "isolinux/initrd.img"),os.path.join(mytemp, BN,"boot/"))
shutil.copy2(os.path.join(tree_path, "images/install.img"),os.path.join(mytemp, BN,"images/"))
- shutil.copy2(os.path.join(path, i),os.path.join(mytemp, BN))
+ shutil.copy2(i,os.path.join(mytemp, BN))
umount_iso(i)
except:
print "No dvd isos found"
@@ -165,7 +165,7 @@ def doit(device):
build_filesystem()
create_grub()
grub_install()
- umount_device()
+ umount_device(dev)
if options.justdoit==True:
doit(dev)
13 years, 3 months
[multiboot-media-creator/python-development] forgot to add the symlink
by Dave Riches
commit 8525071d8b94207545e97e2a50079d63598e7630
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Tue Jan 11 00:07:59 2011 +0000
forgot to add the symlink
mmc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/mmc b/mmc
new file mode 120000
index 0000000..764ae40
--- /dev/null
+++ b/mmc
@@ -0,0 +1 @@
+multiboot-media-creator.py
\ No newline at end of file
13 years, 3 months
[multiboot-media-creator/python-development] symlinked mmc and made it run directly, no need for python mmc.py
by Dave Riches
commit b35251a93c94218c26778d9dc1cd64dcabc9b9a2
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Tue Jan 11 00:07:37 2011 +0000
symlinked mmc and made it run directly, no need for python mmc.py
multiboot-media-creator.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
old mode 100644
new mode 100755
index 8beb4ee..12b2cc7
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/env python
### This program is free software; you can redistribute it and/or modify it
### under the terms of the GNU Library General Public License as published by
13 years, 3 months
[multiboot-media-creator/python-development: 1/2] Who knows what this was
by Robert 'Bob' Jensen
commit 35d3413098bd706064739119a69beb5c57992928
Author: Robert 'Bob' Jensen <rpjensen(a)lt01.bobjensen.com>
Date: Mon Jan 10 16:12:18 2011 -0600
Who knows what this was
bin/multiboot-media-creator | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/bin/multiboot-media-creator b/bin/multiboot-media-creator
index 8b81d3c..5b78cca 100755
--- a/bin/multiboot-media-creator
+++ b/bin/multiboot-media-creator
@@ -54,9 +54,8 @@ EOT
CS=$(echo ${BN} | sed "s/DVD/CHECKSUM/g")
# cp -fv $CS* image/${BN}/CHECKSUM/
rsync -avH --progress $CS* image/${BN}/CHECKSUM/
-# umount -v tmp
+ umount -v tmp
fi
- umount -v tmp
done
rsync -avH /boot/grub/splash.xpm.gz image/boot/grub/
cat >> image/boot/grub/grub.conf <<EOT
13 years, 3 months
[multiboot-media-creator/python-development] added 'justdoit' test run for experimental use, and made enough options work for minimal interventio
by Dave Riches
commit 6f8214fa4e86bcb3c629c797928d47558220d602
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Mon Jan 10 21:41:41 2011 +0000
added 'justdoit' test run for experimental use, and made enough options work for minimal intervention
multiboot-media-creator.py | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 417174a..8beb4ee 100644
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -14,7 +14,7 @@
### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
### multiboot-media-creator Copyright 2010-2011 Robert 'Bob' Jensen <bob(a)fedoraunity.org>, Dave Riches <dcr226(a)fedorapeople.org>, Dennis Johnson <drjohnson1(a)gmail.com>, Ben Williams <vaioof(a)yahoo.com>
-import os, glob, tempfile, shutil
+import sys, os, glob, tempfile, shutil
__version__ = "$Revision: 4 $"
# $Source$
@@ -31,6 +31,8 @@ parser.add_option("-q", "--quiet",
help="don't print status messages to stdout (curently not implemented)")
parser.add_option("-d", "--destination", dest="device",
help="USB device to create media", metavar="USB")
+parser.add_option("-j", "--justdoit", action="store_true", dest="justdoit", default=False,
+ help="Attempt to build without intervention - be careful")
(options, args) = parser.parse_args()
#print options.directory
@@ -47,12 +49,21 @@ else:
mytemp=tempfile.mkdtemp(suffix=".mmc")
dev=options.device
+
+if dev==None:
+ sys.exit("Program requires a destination device")
+
print path
print dev
-def mount_device(device):
+def mount_device(dev):
os.system("mount %s %s" % (dev, mytemp))
+def umount_device(dev):
+ os.system("umount %s" % dev)
+
+def grub_install():
+ os.system("grub-install --root-directory=%s %s" % (mytemp,dev))
def getisos(isopath,isotype):
"""getisos returns a list of isos inside a specific path
@@ -149,3 +160,12 @@ def create_grub(gtimeout=10):
# create_grub()
# make_iso()
# removetemps()
+def doit(device):
+ mount_device(device)
+ build_filesystem()
+ create_grub()
+ grub_install()
+ umount_device()
+
+if options.justdoit==True:
+ doit(dev)
13 years, 3 months
[multiboot-media-creator/python-development] changed options to -s (source directory) -d (destination device)
by Dave Riches
commit b7140702af4f941bfd730a4abb78438528e0f2b1
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Mon Jan 10 21:11:52 2011 +0000
changed options to -s (source directory) -d (destination device)
multiboot-media-creator.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 979576f..417174a 100644
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -24,12 +24,12 @@ VERSION = '0.4.0'
from optparse import OptionParser
parser = OptionParser()
-parser.add_option("-d", "--directory", dest="directory",
+parser.add_option("-s", "--source", dest="directory",
help="Directory containing ISO images", metavar="DIR")
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
help="don't print status messages to stdout (curently not implemented)")
-parser.add_option("-D", "--device", dest="device",
+parser.add_option("-d", "--destination", dest="device",
help="USB device to create media", metavar="USB")
(options, args) = parser.parse_args()
13 years, 3 months