Changes to 'refs/tags/livecd-tools-15.5'
by Brian C. Lane
Tag 'livecd-tools-15.5' created by Brian C. Lane <bcl(a)redhat.com> at 2011-02-18 22:10 +0000
Tag as livecd-tools-15.5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUATV7uVRF+jBaO/jp/AQIf+Qf/SWF9YqeeM+wfK5FxGX7XNO466f7tYz6d
IoOE29zn6CIMhcJWnqXdwDm5MhQjEKTm1NRl6KbyAaEHKkyGfKY6gTF2JyUSWVII
motAAtEL/xkAT8wSegQtFCHJgY1Ta2bpV3FiCYA5NbV7T8HVQK1XFVgWVnURwhMA
1XV5eD2ApV7VQogfk7KGSsa1B0DpUQhEXpxk1VUyG1SBzvPFlSUKVk8q5Q3ui53H
+Kar2A+ETrrvQmsQ5KNx++6Y1ZuNJdvsM1eYQdyGfxs+9Lst/XxuULZsytDxlnci
AM0fRuyk+PnNn6Tz/zDNDNAVZzKGDktRGdOkinJj4Mvo4/uTX7K3ew==
=6T88
-----END PGP SIGNATURE-----
Changes since livecd-tools-15.4:
Brian C. Lane (5):
Check return value on udevadm (#637258)
Add support for virtio disks to livecd (#672936)
Move selinux relabel to after %post (#648591)
Print reason for sudden exit
Version 15.5
Bruce Jerrick (1):
Fix skipcopy usage with DVD iso (#644194)
Frederick Grose (1):
Support attached LiveOS devices as well as image files for LiveOS editing.
---
Makefile | 2
imgcreate/creator.py | 2
imgcreate/live.py | 4 +
tools/edit-livecd | 101 ++++++++++++++++++++++++--------------------
tools/livecd-iso-to-disk.sh | 25 +++++++++-
5 files changed, 83 insertions(+), 51 deletions(-)
---
13 years, 2 months
Changes to 'refs/tags/livecd-tools-16.1'
by Brian C. Lane
Tag 'livecd-tools-16.1' created by Brian C. Lane <bcl(a)redhat.com> at 2011-02-18 21:37 +0000
Tag as livecd-tools-16.1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUATV7moBF+jBaO/jp/AQL1tggAluIksUy1Ycn5N71/a1bV0DXJjXcdxfxp
UfDwdesNxMjSgFpqX9yoRSJYJTOWSdUFbv8Si1wsXnRlNmQ/+yOqooXMZUtnHXre
i9T3GRKNnJr66NORbFWV5v7zMw4FHX5pMBHuJNwAv89x0NPkJVtldYJLTs4oaq/4
lr7hO7Eb78mU38CWIJJ8RzLH9tmcbu7xMDg7Cn5GqPq9c2PFEX+QBP0IDMkDa2cs
raHB/LPH+RJ5YaFm6u7jLb1HTbFupUWuKesavH/l4/MwzbmOhKvUIG2vxA3UmBKL
GzU4GIkkc5q2/Rnv3Zj149dSMStFAYPcW8ZYDN1cGINR2EZXkySD3g==
=Z0qu
-----END PGP SIGNATURE-----
Changes since livecd-tools-16.0:
Brian C. Lane (5):
Check return value on udevadm (#637258)
Add support for virtio disks to livecd (#672936)
Move selinux relabel to after %post (#648591)
Print reason for sudden exit
Version 16.1
Bruce Jerrick (1):
Fix skipcopy usage with DVD iso (#644194)
Frederick Grose (1):
Support attached LiveOS devices as well as image files for LiveOS editing.
---
Makefile | 2
imgcreate/creator.py | 2
imgcreate/live.py | 4 +
tools/edit-livecd | 101 ++++++++++++++++++++++++--------------------
tools/livecd-iso-to-disk.sh | 25 +++++++++-
5 files changed, 83 insertions(+), 51 deletions(-)
---
13 years, 2 months
5 commits - imgcreate/creator.py imgcreate/live.py Makefile tools/livecd-iso-to-disk.sh
by Brian C. Lane
Makefile | 2 +-
imgcreate/creator.py | 2 +-
imgcreate/live.py | 4 +++-
tools/livecd-iso-to-disk.sh | 21 +++++++++++++++++----
4 files changed, 22 insertions(+), 7 deletions(-)
New commits:
commit e5963245b43abbf13888ba58f11ad914f6efb648
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Feb 16 09:44:05 2011 -0800
Version 16.1
diff --git a/Makefile b/Makefile
index 7ac3511..0de167f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 16.0
+VERSION = 16.1
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit d7434d405d29ff95cab89e664056ddb4d031be7d
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Feb 17 12:10:26 2011 -0800
Print reason for sudden exit
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 213985e..700eac4 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -740,17 +740,26 @@ SRC=$(readlink -f "$1")
TGTDEV=$(readlink -f "$2")
if [ -z "$SRC" ]; then
+ echo "Missing source"
shortusage
exit 1
fi
if [ ! -b "$SRC" -a ! -f "$SRC" ]; then
+ echo "$SRC is not a file or block device"
shortusage
exit 1
fi
# FIXME: If --format is given, we shouldn't care and just use /dev/foo1
-if [ -z "$TGTDEV" -o ! -b "$TGTDEV" ]; then
+if [ -z "$TGTDEV" ]; then
+ echo "Missing target device"
+ shortusage
+ exit 1
+fi
+
+if [ ! -b "$TGTDEV" ]; then
+ echo "$TGTDEV is not a block device"
shortusage
exit 1
fi
commit 34bc411e2b71556cbf3101999c5555afd1283f80
Author: Bruce Jerrick <bmj001(a)gmail.com>
Date: Thu Feb 17 11:00:44 2011 -0800
Fix skipcopy usage with DVD iso (#644194)
Fix size estimation with skipcopy
Copy install.img when using skipcopy with a DVD iso
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 607783f..213985e 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -912,7 +912,11 @@ fi
# Verify available space for DVD installer
if [ "$srctype" = "installer" ]; then
- srcsize=$(du -s -B 1M $SRC | awk {'print $1;'})
+ if [ -z "$skipcopy" ]; then
+ srcsize=$(du -s -B 1M $SRC | awk {'print $1;'})
+ else
+ srcsize=0
+ fi
if [ "$imgtype" = "install" ]; then
imgpath=images/install.img
else
@@ -981,13 +985,13 @@ if [ "$srctype" = "live" -a -z "$skipcopy" ]; then
fi
# DVD installer copy
-if [ \( "$srctype" = "installer" -o "$srctype" = "netinst" \) -a -z "$skipcopy" ]; then
+if [ \( "$srctype" = "installer" -o "$srctype" = "netinst" \) ]; then
echo "Copying DVD image to target device."
mkdir -p $TGTMNT/images/
if [ "$imgtype" = "install" ]; then
copyFile $SRCMNT/images/install.img $TGTMNT/images/install.img || exitclean
fi
- if [ "$srctype" = "installer" ]; then
+ if [ "$srctype" = "installer" -a -z "$skipcopy" ]; then
cp $SRC $TGTMNT/
fi
sync
commit a3e38942d29bcefd69b5d876dee1c95775a8bba0
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Feb 17 08:38:36 2011 -0800
Move selinux relabel to after %post (#648591)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index b915b11..ec4c1ba 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -738,7 +738,6 @@ class ImageCreator(object):
kickstart.KeyboardConfig(self._instroot).apply(ksh.keyboard)
kickstart.TimezoneConfig(self._instroot).apply(ksh.timezone)
kickstart.AuthConfig(self._instroot).apply(ksh.authconfig)
- kickstart.SelinuxConfig(self._instroot).apply(ksh.selinux)
kickstart.FirewallConfig(self._instroot).apply(ksh.firewall)
kickstart.RootPasswordConfig(self._instroot).apply(ksh.rootpw)
kickstart.ServicesConfig(self._instroot).apply(ksh.services)
@@ -749,6 +748,7 @@ class ImageCreator(object):
self._create_bootconfig()
self.__run_post_scripts()
+ kickstart.SelinuxConfig(self._instroot).apply(ksh.selinux)
def launch_shell(self):
"""Launch a shell in the install root.
commit 228f10f51c8e415d6ddf59e8f94c99f5867caa86
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Feb 16 09:41:43 2011 -0800
Add support for virtio disks to livecd (#672936)
VirtIO disks need their own drivers.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 708ff05..10d5cec 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -73,7 +73,9 @@ class LiveImageCreatorBase(LoopImageCreator):
self.__isodir = None
- self.__modules = ["=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire", "=mmc", "=pcmcia", "mptsas", "udf"]
+ self.__modules = ["=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire",
+ "=mmc", "=pcmcia", "mptsas", "udf", "virtio_blk",
+ "virtio_pci"]
self.__modules.extend(kickstart.get_modules(self.ks))
self._isofstype = "iso9660"
13 years, 2 months
[patch] Regression livecd-iso-to-disk --livedir
by Jan Kratochvil
Hi,
Biarch_Spin has stopped building since livecd-tools-15.4-1.fc15.x86_64, I had
to provide the fix below.
So far AFAIK there exists no `livecd-creator --livedir' so on the source media
the directory is always called `LiveOS'.
Thanks,
Jan
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -582,7 +582,7 @@ if [ $(id -u) != 0 ]; then
fi
detectsrctype() {
- if [[ -e $SRCMNT/$LIVEOS/squashfs.img ]]; then
+ if [[ -e $SRCMNT/LiveOS/squashfs.img ]]; then
srctype=live
return
fi
@@ -870,8 +870,8 @@ if [[ live == $srctype ]]; then
((tbd += ${duTable[*]: -2:1}))
fi
-if [[ -n $skipcompress ]] && [[ -s $SRCMNT/$LIVEOS/squashfs.img ]]; then
- if mount -o loop $SRCMNT/$LIVEOS/squashfs.img $SRCMNT; then
+if [[ -n $skipcompress ]] && [[ -s $SRCMNT/LiveOS/squashfs.img ]]; then
+ if mount -o loop $SRCMNT/LiveOS/squashfs.img $SRCMNT; then
livesize=($(du -B 1M --apparent-size $SRCMNT/LiveOS/ext3fs.img))
umount $SRCMNT
else
@@ -884,8 +884,8 @@ if [[ -n $skipcompress ]] && [[ -s $SRCMNT/$LIVEOS/squashfs.img ]]; then
fi
if [[ live == $srctype ]]; then
thisScriptpath=$(readlink -f "$0")
- sources="$SRCMNT/$LIVEOS/ext3fs.img $SRCMNT/$LIVEOS/osmin.img"
- [[ -z $skipcompress ]] && sources+=" $SRCMNT/$LIVEOS/squashfs.img"
+ sources="$SRCMNT/LiveOS/ext3fs.img $SRCMNT/LiveOS/osmin.img"
+ [[ -z $skipcompress ]] && sources+=" $SRCMNT/LiveOS/squashfs.img"
sources+=" $SRCMNT/isolinux $SRCMNT/syslinux"
[[ -n $efi ]] && sources+=" $SRCMNT/EFI/boot"
duTable=($(du -c -B 1M "$thisScriptpath" $sources 2> /dev/null))
@@ -977,18 +977,18 @@ if [ "$srctype" = "live" -a -z "$skipcopy" ]; then
echo "Copying live image to target device."
[ ! -d $TGTMNT/$LIVEOS ] && mkdir $TGTMNT/$LIVEOS
[ -n "$keephome" -a -f "$TGTMNT/$HOMEFILE" ] && mv $TGTMNT/$HOMEFILE $TGTMNT/$LIVEOS/$HOMEFILE
- if [ -n "$skipcompress" -a -f $SRCMNT/$LIVEOS/squashfs.img ]; then
- mount -o loop $SRCMNT/$LIVEOS/squashfs.img $SRCMNT || exitclean
+ if [ -n "$skipcompress" -a -f $SRCMNT/LiveOS/squashfs.img ]; then
+ mount -o loop $SRCMNT/LiveOS/squashfs.img $SRCMNT || exitclean
copyFile $SRCMNT/LiveOS/ext3fs.img $TGTMNT/$LIVEOS/ext3fs.img || {
umount $SRCMNT ; exitclean ; }
umount $SRCMNT
- elif [ -f $SRCMNT/$LIVEOS/squashfs.img ]; then
- copyFile $SRCMNT/$LIVEOS/squashfs.img $TGTMNT/$LIVEOS/squashfs.img || exitclean
- elif [ -f $SRCMNT/$LIVEOS/ext3fs.img ]; then
- copyFile $SRCMNT/$LIVEOS/ext3fs.img $TGTMNT/$LIVEOS/ext3fs.img || exitclean
+ elif [ -f $SRCMNT/LiveOS/squashfs.img ]; then
+ copyFile $SRCMNT/LiveOS/squashfs.img $TGTMNT/$LIVEOS/squashfs.img || exitclean
+ elif [ -f $SRCMNT/LiveOS/ext3fs.img ]; then
+ copyFile $SRCMNT/LiveOS/ext3fs.img $TGTMNT/$LIVEOS/ext3fs.img || exitclean
fi
- if [ -f $SRCMNT/$LIVEOS/osmin.img ]; then
- copyFile $SRCMNT/$LIVEOS/osmin.img $TGTMNT/$LIVEOS/osmin.img || exitclean
+ if [ -f $SRCMNT/LiveOS/osmin.img ]; then
+ copyFile $SRCMNT/LiveOS/osmin.img $TGTMNT/$LIVEOS/osmin.img || exitclean
fi
sync
fi
13 years, 2 months
tools/edit-livecd
by Brian C. Lane
tools/edit-livecd | 101 ++++++++++++++++++++++++++++++------------------------
1 file changed, 57 insertions(+), 44 deletions(-)
New commits:
commit 026d5de9283e2760691edbd97bdadced8546f4d4
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Wed Feb 16 09:35:27 2011 -0800
Support attached LiveOS devices as well as image files for LiveOS editing.
Adjust naming of iso, log the iso name, adjust usage text, restore script
option.
diff --git a/tools/edit-livecd b/tools/edit-livecd
index 79a6061..659cfae 100755
--- a/tools/edit-livecd
+++ b/tools/edit-livecd
@@ -72,8 +72,9 @@ class LiveImageEditor(LiveImageCreator):
self._include = None
"""A string of file or directory paths to include in __copy_img_root."""
- self._builder = "someone"
- """The name of the Remix builder for _branding."""
+ self._builder = os.getlogin()
+ """The name of the Remix builder for _branding.
+ Default = os.getlogin()"""
self.compress_type = None
"""mksquashfs compressor to use. Use 'None' to force reading of the
@@ -119,21 +120,7 @@ class LiveImageEditor(LiveImageCreator):
rtn = self._LoopImageCreator__imagedir + "/ext3fs.img"
return rtn
_image = property(__get_image)
- """The location of the image file or filesystem root."""
-
- def _get_fstype(self, filesystem):
- dev_null = os.open('/dev/null', os.O_WRONLY)
- args = ['/sbin/blkid', '-s', 'TYPE', '-o', 'value', filesystem]
- try:
- fs_type = subprocess.Popen(args,
- stdout=subprocess.PIPE,
- stderr=dev_null).communicate()[0]
- except IOError, e:
- raise CreatorError("Failed to determine fsimage TYPE: %s" % e )
- finally:
- os.close(dev_null)
-
- return fs_type.rstrip()
+ """The location of the filesystem image file."""
def _get_fslabel(self):
dev_null = os.open("/dev/null", os.O_WRONLY)
@@ -211,11 +198,11 @@ class LiveImageEditor(LiveImageCreator):
if self.clone:
# Need to clone base_on into ext3fs.img at this point
- self._base_on(base_on)
self._LoopImageCreator__fslabel = self.name
+ self._base_on(base_on)
else:
LiveImageCreator._base_on(self, base_on)
- self._LoopImageCreator__fstype = self._get_fstype(self._image)
+ self._LoopImageCreator__fstype = get_fsvalue(self._image, 'TYPE')
self._get_fslabel()
self.fslabel = self._LoopImageCreator__fslabel
@@ -250,7 +237,6 @@ class LiveImageEditor(LiveImageCreator):
self.__copy_img_root(base_on)
self._brand(self._builder)
-
def _base_on(self, base_on):
"""Clone the running LiveOS image as the basis for the new image."""
@@ -353,6 +339,7 @@ class LiveImageEditor(LiveImageCreator):
"""Adjust the image branding to show its variation from original
source by builder and build date."""
+ self.fslabel = self.name
dt = time.strftime('%d-%b-%Y')
lst = ['isolinux/isolinux.cfg', 'syslinux/syslinux.cfg',
@@ -371,12 +358,11 @@ class LiveImageEditor(LiveImageCreator):
for line in cfgf:
i = line.find('Welcome to ')
if i > -1:
- self.name = line[i+11:-2]
+ release = line[i+11:-2]
break
cfgf.close()
- ntext = dt.translate(None,
- '-') + '-' + _builder + '-Remix-' + self.name
+ ntext = dt.translate(None, '-') + '-' + _builder + '-Remix-' + release
# Update fedora-release message with Remix details.
releasefiles = '/etc/fedora-release, /etc/generic-release'
@@ -392,8 +378,8 @@ class LiveImageEditor(LiveImageCreator):
raise CreatorError("Failed to open or write '%s' : %s" %
(f.name, e))
- self.name = ntext
- self.fslabel += '-' + os.uname()[4] + '-' + time.strftime('%Y%m%d.%H')
+ self._releasefile = ntext
+ self.name += '-' + os.uname()[4] + '-' + time.strftime('%Y%m%d.%H%M')
def _configure_bootloader(self, isodir):
@@ -411,8 +397,8 @@ class LiveImageEditor(LiveImageCreator):
os.rename(src, cfgf)
args = ['/bin/sed', '-i',
- '-e', 's/Welcome to .*/Welcome to ' + self.name + '!/',
- '-e', 's/root=[^ ]*/root=live:CDLABEL=' + self.fslabel + '/',
+ '-e', 's/Welcome to .*/Welcome to ' + self._releasefile + '!/',
+ '-e', 's/root=[^ ]*/root=live:CDLABEL=' + self.name + '/',
'-e', 's/rootfstype=[^ ]* [^ ]*/rootfstype=auto ro/',
'-e', 's/liveimg .* quiet/liveimg quiet/', cfgf]
@@ -430,20 +416,21 @@ class LiveImageEditor(LiveImageCreator):
os.close(dev_null)
def parse_options(args):
- parser = optparse.OptionParser(usage = "\n %prog [-n=<name>]"
- "\n [-o=<output>]"
- "\n [-s=<script.sh>]"
- "\n [-t=<tmpdir>]"
- "\n [-e=<excludes>]"
- "\n [-f=<exclude-file>]"
- "\n [-i=<includes>]"
- "\n [-r=<releasefile>]"
- "\n [-b=<builder>]"
- "\n [--clone]"
- "\n [-c=<compress_type>]"
- "\n [--skip-compression]"
- "\n [--skip-minimize]"
- "\n <LIVEIMG.src>")
+ parser = optparse.OptionParser(usage = """
+ %prog [-n=<name>]
+ [-o=<output>]
+ [-s=<script.sh>]
+ [-t=<tmpdir>]
+ [-e=<excludes>]
+ [-f=<exclude-file>]
+ [-i=<includes>]
+ [-r=<releasefile>]
+ [-b=<builder>]
+ [--clone]
+ [-c=<compress_type>]
+ [--skip-compression]
+ [--skip-minimize]
+ <LIVEIMG.src>""")
parser.add_option("-n", "--name", type="string", dest="name",
help="name of new LiveOS (don't include .iso, it will "
@@ -476,7 +463,8 @@ def parse_options(args):
parser.add_option("-r", "--releasefile", type="string", dest="releasefile",
help="Specify release file/s for branding.")
- parser.add_option("-b", "--builder", type="string", dest="builder",
+ parser.add_option("-b", "--builder", type="string",
+ dest="builder", default=os.getlogin(),
help="Specify the builder of a Remix.")
parser.add_option("", "--clone", action="store_true", dest="clone",
@@ -507,6 +495,20 @@ def parse_options(args):
return (args[0], options)
+def get_fsvalue(filesystem, tag):
+ dev_null = os.open('/dev/null', os.O_WRONLY)
+ args = ['/sbin/blkid', '-s', tag, '-o', 'value', filesystem]
+ try:
+ fs_type = subprocess.Popen(args,
+ stdout=subprocess.PIPE,
+ stderr=dev_null).communicate()[0]
+ except IOError, e:
+ raise CreatorError("Failed to determine fs %s: %s" % value, e )
+ finally:
+ os.close(dev_null)
+
+ return fs_type.rstrip()
+
def rebuild_iso_symlinks(isodir):
# remove duplicate files and rebuild symlinks to reduce iso size
efi_vmlinuz = "%s/EFI/boot/vmlinuz0" % isodir
@@ -528,7 +530,9 @@ def main():
print >> sys.stderr, "You must run edit-liveos as root"
return 1
- if options.name and options.name != os.path.basename(LiveOS):
+ if stat.S_ISBLK(os.stat(LiveOS).st_mode):
+ name = get_fsvalue(LiveOS, 'LABEL') + '.edited'
+ elif options.name and options.name != os.path.basename(LiveOS):
name = options.name
else:
name = os.path.basename(LiveOS) + ".edited"
@@ -537,6 +541,8 @@ def main():
output = options.output
else:
output = os.path.dirname(LiveOS)
+ if output == '/dev':
+ output = options.tmpdir
editor = LiveImageEditor(name)
editor._exclude = options.exclude
@@ -553,10 +559,17 @@ def main():
try:
editor.mount(LiveOS, cachedir = None)
editor._configure_bootloader(editor._LiveImageCreatorBase__isodir)
- editor.name = editor.fslabel
+ if options.script:
+ print "Running edit script '%s'" % options.script
+ editor._run_script(options.script)
+ else:
+ print "Launching shell. Exit to continue."
+ print "----------------------------------"
+ editor.launch_shell()
rebuild_iso_symlinks(editor._LiveImageCreatorBase__isodir)
editor.unmount()
editor.package(output)
+ logging.info("%s.iso saved to %s" % (editor.name, output))
except CreatorError, e:
logging.error(u"Error editing LiveOS : %s" % e)
return 1
13 years, 2 months
[PATCH] Support attached LiveOS devices in edit-livecd
by Frederick Grose
I wasn't expecting the alpha to get committed yet, so here is a patch:
Support attached LiveOS devices as well as image files for LiveOS editing.
Adjust naming of iso, log the iso name, adjust usage text, restore script
option.
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Tue Feb 15 22:27:14 2011 -0500
Support attached LiveOS devices as well as image files for LiveOS
editing.
Adjust naming of iso, log the iso name, adjust usage text, restore
script
option.
diff --git a/tools/edit-livecd b/tools/edit-livecd
index 79a6061..659cfae 100755
--- a/tools/edit-livecd
+++ b/tools/edit-livecd
@@ -72,8 +72,9 @@ class LiveImageEditor(LiveImageCreator):
self._include = None
"""A string of file or directory paths to include in
__copy_img_root."""
- self._builder = "someone"
- """The name of the Remix builder for _branding."""
+ self._builder = os.getlogin()
+ """The name of the Remix builder for _branding.
+ Default = os.getlogin()"""
self.compress_type = None
"""mksquashfs compressor to use. Use 'None' to force reading of the
@@ -119,21 +120,7 @@ class LiveImageEditor(LiveImageCreator):
rtn = self._LoopImageCreator__imagedir + "/ext3fs.img"
return rtn
_image = property(__get_image)
- """The location of the image file or filesystem root."""
-
- def _get_fstype(self, filesystem):
- dev_null = os.open('/dev/null', os.O_WRONLY)
- args = ['/sbin/blkid', '-s', 'TYPE', '-o', 'value', filesystem]
- try:
- fs_type = subprocess.Popen(args,
- stdout=subprocess.PIPE,
- stderr=dev_null).communicate()[0]
- except IOError, e:
- raise CreatorError("Failed to determine fsimage TYPE: %s" % e )
- finally:
- os.close(dev_null)
-
- return fs_type.rstrip()
+ """The location of the filesystem image file."""
def _get_fslabel(self):
dev_null = os.open("/dev/null", os.O_WRONLY)
@@ -211,11 +198,11 @@ class LiveImageEditor(LiveImageCreator):
if self.clone:
# Need to clone base_on into ext3fs.img at this point
- self._base_on(base_on)
self._LoopImageCreator__fslabel = self.name
+ self._base_on(base_on)
else:
LiveImageCreator._base_on(self, base_on)
- self._LoopImageCreator__fstype = self._get_fstype(self._image)
+ self._LoopImageCreator__fstype = get_fsvalue(self._image,
'TYPE')
self._get_fslabel()
self.fslabel = self._LoopImageCreator__fslabel
@@ -250,7 +237,6 @@ class LiveImageEditor(LiveImageCreator):
self.__copy_img_root(base_on)
self._brand(self._builder)
-
def _base_on(self, base_on):
"""Clone the running LiveOS image as the basis for the new
image."""
@@ -353,6 +339,7 @@ class LiveImageEditor(LiveImageCreator):
"""Adjust the image branding to show its variation from original
source by builder and build date."""
+ self.fslabel = self.name
dt = time.strftime('%d-%b-%Y')
lst = ['isolinux/isolinux.cfg', 'syslinux/syslinux.cfg',
@@ -371,12 +358,11 @@ class LiveImageEditor(LiveImageCreator):
for line in cfgf:
i = line.find('Welcome to ')
if i > -1:
- self.name = line[i+11:-2]
+ release = line[i+11:-2]
break
cfgf.close()
- ntext = dt.translate(None,
- '-') + '-' + _builder + '-Remix-' + self.name
+ ntext = dt.translate(None, '-') + '-' + _builder + '-Remix-' +
release
# Update fedora-release message with Remix details.
releasefiles = '/etc/fedora-release, /etc/generic-release'
@@ -392,8 +378,8 @@ class LiveImageEditor(LiveImageCreator):
raise CreatorError("Failed to open or write '%s' : %s"
%
(f.name, e))
- self.name = ntext
- self.fslabel += '-' + os.uname()[4] + '-' +
time.strftime('%Y%m%d.%H')
+ self._releasefile = ntext
+ self.name += '-' + os.uname()[4] + '-' +
time.strftime('%Y%m%d.%H%M')
def _configure_bootloader(self, isodir):
@@ -411,8 +397,8 @@ class LiveImageEditor(LiveImageCreator):
os.rename(src, cfgf)
args = ['/bin/sed', '-i',
- '-e', 's/Welcome to .*/Welcome to ' + self.name + '!/',
- '-e', 's/root=[^ ]*/root=live:CDLABEL=' + self.fslabel +
'/',
+ '-e', 's/Welcome to .*/Welcome to ' + self._releasefile +
'!/',
+ '-e', 's/root=[^ ]*/root=live:CDLABEL=' + self.name + '/',
'-e', 's/rootfstype=[^ ]* [^ ]*/rootfstype=auto ro/',
'-e', 's/liveimg .* quiet/liveimg quiet/', cfgf]
@@ -430,20 +416,21 @@ class LiveImageEditor(LiveImageCreator):
os.close(dev_null)
def parse_options(args):
- parser = optparse.OptionParser(usage = "\n %prog [-n=<name>]"
- "\n [-o=<output>]"
- "\n [-s=<script.sh>]"
- "\n [-t=<tmpdir>]"
- "\n [-e=<excludes>]"
- "\n [-f=<exclude-file>]"
- "\n [-i=<includes>]"
- "\n [-r=<releasefile>]"
- "\n [-b=<builder>]"
- "\n [--clone]"
- "\n [-c=<compress_type>]"
- "\n [--skip-compression]"
- "\n [--skip-minimize]"
- "\n <LIVEIMG.src>")
+ parser = optparse.OptionParser(usage = """
+ %prog [-n=<name>]
+ [-o=<output>]
+ [-s=<script.sh>]
+ [-t=<tmpdir>]
+ [-e=<excludes>]
+ [-f=<exclude-file>]
+ [-i=<includes>]
+ [-r=<releasefile>]
+ [-b=<builder>]
+ [--clone]
+ [-c=<compress_type>]
+ [--skip-compression]
+ [--skip-minimize]
+ <LIVEIMG.src>""")
parser.add_option("-n", "--name", type="string", dest="name",
help="name of new LiveOS (don't include .iso, it will
"
@@ -476,7 +463,8 @@ def parse_options(args):
parser.add_option("-r", "--releasefile", type="string",
dest="releasefile",
help="Specify release file/s for branding.")
- parser.add_option("-b", "--builder", type="string", dest="builder",
+ parser.add_option("-b", "--builder", type="string",
+ dest="builder", default=os.getlogin(),
help="Specify the builder of a Remix.")
parser.add_option("", "--clone", action="store_true", dest="clone",
@@ -507,6 +495,20 @@ def parse_options(args):
return (args[0], options)
+def get_fsvalue(filesystem, tag):
+ dev_null = os.open('/dev/null', os.O_WRONLY)
+ args = ['/sbin/blkid', '-s', tag, '-o', 'value', filesystem]
+ try:
+ fs_type = subprocess.Popen(args,
+ stdout=subprocess.PIPE,
+ stderr=dev_null).communicate()[0]
+ except IOError, e:
+ raise CreatorError("Failed to determine fs %s: %s" % value, e )
+ finally:
+ os.close(dev_null)
+
+ return fs_type.rstrip()
+
def rebuild_iso_symlinks(isodir):
# remove duplicate files and rebuild symlinks to reduce iso size
efi_vmlinuz = "%s/EFI/boot/vmlinuz0" % isodir
@@ -528,7 +530,9 @@ def main():
print >> sys.stderr, "You must run edit-liveos as root"
return 1
- if options.name and options.name != os.path.basename(LiveOS):
+ if stat.S_ISBLK(os.stat(LiveOS).st_mode):
+ name = get_fsvalue(LiveOS, 'LABEL') + '.edited'
+ elif options.name and options.name != os.path.basename(LiveOS):
name = options.name
else:
name = os.path.basename(LiveOS) + ".edited"
@@ -537,6 +541,8 @@ def main():
output = options.output
else:
output = os.path.dirname(LiveOS)
+ if output == '/dev':
+ output = options.tmpdir
editor = LiveImageEditor(name)
editor._exclude = options.exclude
@@ -553,10 +559,17 @@ def main():
try:
editor.mount(LiveOS, cachedir = None)
editor._configure_bootloader(editor._LiveImageCreatorBase__isodir)
- editor.name = editor.fslabel
+ if options.script:
+ print "Running edit script '%s'" % options.script
+ editor._run_script(options.script)
+ else:
+ print "Launching shell. Exit to continue."
+ print "----------------------------------"
+ editor.launch_shell()
rebuild_iso_symlinks(editor._LiveImageCreatorBase__isodir)
editor.unmount()
editor.package(output)
+ logging.info("%s.iso saved to %s" % (editor.name, output))
except CreatorError, e:
logging.error(u"Error editing LiveOS : %s" % e)
return 1
13 years, 2 months
New release, please test
by Brian C. Lane
I've just built new versions for rawhide and f15 (same changes for
both). I've tested the liveos to target feature in a KVM, and tested
building a f15 minimial cd (rawhide seems broken at the moment).
Any additional testing of the new features would be appreciated, and
don't forget to leave karma feedback on:
https://admin.fedoraproject.org/updates/livecd-tools-15.4-1.fc15
Thanks!
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
13 years, 2 months
tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit b33c5274d8412c7338d63842b39e85ca853bcb52
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Feb 15 16:37:47 2011 -0800
Check return value on udevadm (#637258)
Make sure we don't proceed with an empty $device
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index ad0eebc..607783f 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -292,6 +292,10 @@ getdisk() {
fi
p=$(udevadm info -q path -n $DEV)
+ if [ $? -gt 0 ]; then
+ echo "Error getting udev path to $DEV"
+ exitclean
+ fi
if [ -e /sys/$p/device ]; then
device=$(basename /sys/$p)
else
13 years, 2 months
Changes to 'refs/tags/livecd-tools-15.4'
by Brian C. Lane
Tag 'livecd-tools-15.4' created by Brian C. Lane <bcl(a)redhat.com> at 2011-02-16 00:10 +0000
Tag as livecd-tools-15.4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUATVsV+hF+jBaO/jp/AQIWVwf/YfGbuFwkUv+kCx+PVbESeREmyVCvPuN5
lPA8bizYd2uaFf5C8O5bcKSwhd9ezITuowejg9uu3cJQ1GNBVovr+paL8mzUMtxp
8bfE6ACfJySOaTHlhGp6jVst98/lyCzlu721WjRUar9A71GYx5Ez8U7nId3xLVp6
WwPnb7LkTyhPRuzK9WtD0ChdtggDUGh+sOR/qmx8vs5+Of3xUIhT1APVeNy6e6UE
tlu2ovZTabXUpOfLvbbpLmT7Wlv37EPCSnbQLKXqOmcFogha8+WB5N9KXhb1+r6W
39ucF3EM8baw+Fhz2FyHCVvRSHJ8qTMYRHj9uW6Nu+nZxCoAfLxv8Q==
=MUAL
-----END PGP SIGNATURE-----
Changes since livecd-tools-15.3:
Brian C. Lane (6):
Add tmpdir to ImageCreator class initializer (#476676)
Pass tmpdir to ImageCreator class initializer (#476676)
Align start of partition at 1MiB (#668967)
Source may be a file or a block device, mount accordingly
Add tmpdir to LiveImageCreator
Version 15.4
Frederick Grose (6):
Enable an optional tmpdir for e2image in fs.resize2fs()
Rename image source- and target-related variables
Support the propagation of an installed Live image
Update usage documentation & add it to the script
Enable cloning of a running LiveOS image into a fresh iso.
Enable reading of SquashFS compression type.
Jeroen van Meeuwen (Ergo Project) (2):
Really switch the default compression type, not just the default cli option value
Bad karma commit reverted; The option to boot from a local
---
Makefile | 2
docs/livecd-creator.pod | 1
docs/livecd-iso-to-disk.pod | 121 +++++-
imgcreate/creator.py | 18 -
imgcreate/fs.py | 52 ++
imgcreate/live.py | 24 +
tools/edit-livecd | 422 ++++++++++++++++++-----
tools/livecd-creator | 19 -
tools/livecd-iso-to-disk.sh | 783 +++++++++++++++++++++++++++++---------------
9 files changed, 1044 insertions(+), 398 deletions(-)
---
13 years, 2 months