Makefile | 2 +-
imgcreate/yuminst.py | 4 ++++
tools/livecd-creator | 3 +++
tools/livecd-iso-to-disk.sh | 28 ++++++++++++++++++++--------
4 files changed, 28 insertions(+), 9 deletions(-)
New commits:
commit 22906d509ec12b7a66f52b5e1ececb4a0ac32043
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Dec 22 15:25:08 2010 -0800
Version 13.1
diff --git a/Makefile b/Makefile
index 935b025..d667622 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 13.0
+VERSION = 13.1
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 7557c86f838264ec4cfc0105652825f91427e40d
Author: Frederick Grose <fgrose(a)localhost.localdomain>
Date: Wed Dec 22 13:59:06 2010 -0800
Trap copyFile errors (#663849)
'Set -o pipefail' is needed with the new starce-based copy function.
Also, keep || clauses inprocess, so that an exit command applies to
the main script and not just a subshell.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 23e2d4a..b730b52 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -664,13 +664,15 @@ fi
[ -n "$efi" -a ! -d $USBMNT/EFI/boot ] && mkdir -p $USBMNT/EFI/boot
# Live image copy
+set -o pipefail
if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
echo "Copying live image to USB stick"
[ ! -d $USBMNT/$LIVEOS ] && mkdir $USBMNT/$LIVEOS
[ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/$LIVEOS/$HOMEFILE
if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
- copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || (umount $CDMNT ; exitclean)
+ copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || {
+ umount $CDMNT ; exitclean ; }
umount $CDMNT
elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
commit a3a300e4c832c4e5f584bf52d1a6e792797cd392
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Nov 30 15:14:53 2010 -0800
Create tmpdir if it doesn't exist (#658632)
If the directory passed to --tmpdir doesn't exist, create it and its
parent directories.
diff --git a/tools/livecd-creator b/tools/livecd-creator
index d352d74..64b645a 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -25,6 +25,7 @@ import optparse
import logging
import imgcreate
+from imgcreate.fs import makedirs
class Usage(Exception):
def __init__(self, msg = None, no_error = False):
@@ -116,6 +117,8 @@ def main():
creator = imgcreate.LiveImageCreator(ks, name, fs_label)
creator.tmpdir = os.path.abspath(options.tmpdir)
+ if not os.path.exists(creator.tmpdir):
+ makedirs(creator.tmpdir)
creator.compress_type = options.compress_type
creator.skip_compression = options.skip_compression
creator.skip_minimize = options.skip_minimize
commit 1a36e1603f5be37e9d506854decf6a5fabe86e72
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Mon Nov 29 17:15:09 2010 -0800
Fix partition number selection for MMC bus devices (#587411)
Enable detection of partition number prefixes.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 4cfca27..23e2d4a 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -68,6 +68,13 @@ getdisk() {
partnum=${p##$device}
}
+getpartition() {
+ DEV=$1
+ pa=$( < /proc/partitions )
+ pa=${pa##*$DEV}
+ partnum=${pa%% *}
+}
+
resetMBR() {
if isdevloop "$DEV"; then
return
@@ -166,11 +173,12 @@ createGPTLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 17408 $(($size - 17408)) set 1 boot on
- USBDEV=${device}1
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
umount $USBDEV &> /dev/null
/sbin/mkdosfs -n LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
@@ -188,15 +196,16 @@ createMSDOSLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart primary fat32 17408 $(($size - 17408)) set 1 boot on
- if ! isdevloop "$DEV"; then
- USBDEV=${device}1
- else
- USBDEV=${device}
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ if ! isdevloop "$DEV"; then
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
+ else
+ USBDEV=${device}
+ fi
umount $USBDEV &> /dev/null
/sbin/mkdosfs -n LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
@@ -214,11 +223,12 @@ createEXTFSLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart primary ext2 17408 $(($size - 17408)) set 1 boot on
- USBDEV=${device}1
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
umount $USBDEV &> /dev/null
/sbin/mkfs.ext4 -L LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
commit d33e398d6778f0260d256840d246a73810e6cfe4
Author: Lubomir Rintel <lkundrak(a)v3.sk>
Date: Sat Nov 20 13:01:24 2010 +0100
Tolerate empty transactions
It can be useful when rebuilding the image without adding or removing a
package.
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 9e54982..5f3333b 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -171,6 +171,10 @@ class LiveCDYum(yum.YumBase):
(res, resmsg) = self.buildTransaction()
except yum.Errors.RepoError, e:
raise CreatorError("Unable to download from repo : %s" %(e,))
+ # Empty transactions are generally fine, we might be rebuilding an
+ # existing image with no packages added
+ if resmsg and resmsg[0].endswith(" - empty transaction"):
+ return res
if res != 2:
raise CreatorError("Failed to build transaction : %s" % str.join("\n", resmsg))