tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 170 +++++++++++---------------------------------
1 file changed, 43 insertions(+), 127 deletions(-)
New commits:
commit 93310a734449754203b1653ac82d072259e7ff67
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Apr 26 14:43:41 2012 -0700
copy repo data to USB for F17 (#806166)
Fedora 17 runs from the media so repo= cannot be used to mount the same
device for access to the repo so we now copy the repodata from the iso
over to the / of the USB. This requires anaconda-17.23-1 or later.
For releases before F17 the iso is still copied and repo= is setup to
point to it.
This reverts the use of 2 partitions that was used to work around this.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 95f0fae..7df49c2 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -276,14 +276,11 @@ cleanup() {
sleep 2
[ -d "$SRCMNT" ] && umount $SRCMNT && rmdir $SRCMNT
[ -d "$TGTMNT" ] && umount $TGTMNT && rmdir $TGTMNT
- if [ -n "$REPOMNT" ]; then
- [ -d "$REPOMNT" ] && umount $REPOMNT && rmdir $REPOMNT
- fi
}
exitclean() {
RETVAL=$?
- if [ -d "$SRCMNT" ] || [ -d "$TGTMNT" ] || [ -n "$REPOMNT" ];
+ if [ -d "$SRCMNT" ] || [ -d "$TGTMNT" ];
then
[ "$RETVAL" = 0 ] || echo "Cleaning up to exit..."
cleanup
@@ -423,16 +420,7 @@ createGPTLayout() {
/sbin/parted --script $device mklabel gpt
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -442,11 +430,6 @@ createGPTLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart '"EFI System Partition"' fat32 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart '"LIVE REPO"' fat32 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -455,12 +438,6 @@ createGPTLayout() {
umount $TGTDEV &> /dev/null || :
/sbin/mkdosfs -n LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- /sbin/mkdosfs -n LIVE-REPO $REPODEV
- fi
}
createMSDOSLayout() {
@@ -475,16 +452,7 @@ createMSDOSLayout() {
/sbin/parted --script $device mklabel msdos
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -494,11 +462,6 @@ createMSDOSLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart primary fat32 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart primary fat32 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -511,12 +474,6 @@ createMSDOSLayout() {
umount $TGTDEV &> /dev/null || :
/sbin/mkdosfs -n LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- /sbin/mkdosfs -n LIVE-REPO $REPODEV
- fi
}
createEXTFSLayout() {
@@ -531,16 +488,7 @@ createEXTFSLayout() {
/sbin/parted -s $device mklabel msdos
partinfo=$(LC_ALL=C /sbin/parted -s -m $device "u MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -550,11 +498,6 @@ createEXTFSLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart primary ext2 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart primary ext2 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -570,12 +513,6 @@ createEXTFSLayout() {
fi
$mkfs -L LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- $mkfs -L LIVE-REPO $REPODEV
- fi
}
checkGPT() {
@@ -650,25 +587,6 @@ checkFilesystem() {
fi
}
-# Check partition 2 to see if it has been setup as LIVE-REPO
-# Setup REPODEV for later use
-findLIVEREPO() {
- dev=$1
- getdisk $dev
-
- if [ -b ${device}2 ]; then
- label=$(/sbin/blkid -s LABEL -o value ${device}2)
- if [ "$label" == "LIVE-REPO" ]; then
- echo "Found LIVE-REPO on ${device}2"
- REPODEV=${device}2
- return
- fi
- fi
- echo "DVD installs need a second partition labeled LIVE-REPO."
- echo "This is setup when you use --format"
- exitclean
-}
-
checkSyslinuxVersion() {
if [ ! -x /usr/bin/syslinux ]; then
echo "You need to have syslinux installed to run this script"
@@ -710,9 +628,7 @@ fi
detectsrctype() {
if [[ -e "$SRCMNT/Packages" ]]; then
- # This will cause the source .iso to be copied to a second partiton
- # on the target and the boot args to have repo=... pointing to the iso
- echo "/Packages found, will copy source .iso to target"
+ echo "/Packages found, will copy source packages to target"
packages=1
fi
if [[ -e "$SRCMNT/LiveOS/squashfs.img" ]]; then
@@ -947,9 +863,6 @@ if [ -n "$format" -a -z "$skipcopy" ]; then
else
createEXTFSLayout $TGTDEV
fi
-elif [ -n "$packages" ]; then
- # Need the LIVE-REPO partition to copy the .iso to
- findLIVEREPO $TGTDEV
fi
checkFilesystem $TGTDEV
@@ -993,11 +906,6 @@ fi
TGTMNT=$(mktemp -d /media/tgttmp.XXXXXX)
mount $mountopts $TGTDEV $TGTMNT || exitclean
-if [ -n "$REPODEV" ]; then
- REPOLABEL="UUID=$(/sbin/blkid -s UUID -o value $REPODEV)"
- REPOMNT=$(mktemp -d /media/repotmp.XXXXXX)
- mount $mountopts $REPODEV $REPOMNT || exitclean
-fi
trap exitclean SIGINT SIGTERM
@@ -1163,27 +1071,6 @@ if [ "$srctype" = "live" -a -z "$skipcopy" ]; then
sync
fi
-# DVD installer copy
-# Also copies over the source .iso if the image is a new-style LiveOS DVD (F17+)
-if [ -z "$skipcopy" -a \( "$srctype" = "installer" -o "$srctype" = "netinst" \) ]; then
- echo "Copying DVD image to target device."
- mkdir -p $TGTMNT/images/
- if [ "$imgtype" = "install" ]; then
- for img in install.img updates.img product.img; do
- if [ -e $SRCMNT/images/$img ]; then
- copyFile $SRCMNT/images/$img $TGTMNT/images/$img || exitclean
- fi
- done
- fi
-fi
-
-# Copy source .iso to repo partition
-if [ -n "$packages" -a -z "$skipcopy" -a -n "$REPOMNT" ]; then
- echo "Copying $SRC"
- copyFile "$SRC" $REPOMNT/
- sync
-fi
-
# Adjust syslinux sources for replication of installed images
# between filesystem types.
if [[ -d $SRCMNT/isolinux/ ]]; then
@@ -1201,6 +1088,7 @@ BOOTCONFIG=$TGTMNT/$SYSLINUXPATH/isolinux.cfg
# Set this to nothing so sed doesn't care
BOOTCONFIG_EFI=
if [ -n "$efi" ]; then
+ echo "Setting up $EFI_BOOT"
cp $SRCMNT$EFI_BOOT/* $TGTMNT$EFI_BOOT
# FIXME
@@ -1240,7 +1128,43 @@ if [ -n "$efi" ]; then
fi
fi
-if [[ live == $srctype ]]; then
+# DVD installer copy
+if [ -z "$skipcopy" -a \( "$srctype" = "installer" -o "$srctype" = "netinst" \) ]; then
+ echo "Copying DVD image to target device."
+ mkdir -p $TGTMNT/images/
+ if [ "$imgtype" = "install" ]; then
+ for img in install.img updates.img product.img; do
+ if [ -e $SRCMNT/images/$img ]; then
+ copyFile $SRCMNT/images/$img $TGTMNT/images/$img || exitclean
+ fi
+ done
+ fi
+fi
+
+# Copy packages over.
+# Before Fedora17 we could copy the .iso and setup a repo=
+# F17 and later look for repodata on the source media.
+# The presence of packages and LiveOS indicates F17 or later.
+if [ -n "$packages" -a -z "$skipcopy" ]; then
+ if [ "$srctype" != "live" ]; then
+ echo "Copying $SRC to device"
+ copyFile "$SRC" "$TGTMNT/"
+
+ # Setup a repo= to point to the .iso
+ sed -i -e "s;initrd.img;initrd.img repo=hd:$TGTLABEL:/;g" $BOOTCONFIG
+ if [ -n "$efi" ]; then
+ sed -i -e "s;vmlinuz;vmlinuz repo=hd:$TGTLABEL:/;g" $BOOTCONFIG_EFI
+ fi
+ else
+ echo "Copying package data from $SRC to device"
+ rsync --inplace -rLDP --exclude EFI/ --exclude images/ --exclude isolinux/ \
+ --exclude TRANS.TBL --exclude LiveOS/ "$SRCMNT/" "$TGTMNT/"
+ fi
+ echo "Waiting for device to finish writing"
+ sync
+fi
+
+if [ "$srctype" = "live" ]; then
# Copy this installer script.
cp -fT "$thisScriptpath" $TGTMNT/$LIVEOS/livecd-iso-to-disk
chmod +x $TGTMNT/$LIVEOS/livecd-iso-to-disk &> /dev/null || :
@@ -1278,14 +1202,6 @@ if [ -n "$efi" ]; then
sed -i -e "s;findiso;;g" $BOOTCONFIG_EFI
fi
-# Add repo= to point to the source .iso with the packages
-if [[ -n "$packages" ]]; then
- sed -i -e "s;initrd.img;initrd.img repo=hd:$REPOLABEL:/;g" $BOOTCONFIG
- if [ -n "$efi" ]; then
- sed -i -e "s;vmlinuz;vmlinuz repo=hd:$REPOLABEL:/;g" $BOOTCONFIG_EFI
- fi
-fi
-
# DVD Installer for netinst
if [ "$srctype" != "live" ]; then
if [ "$imgtype" = "install" ]; then
12 years
Changes to 'refs/tags/livecd-tools-16.13'
by Brian C. Lane
Tag 'livecd-tools-16.13' created by Brian C. Lane <bcl(a)redhat.com> at 2012-04-25 17:55 +0000
Tag as livecd-tools-16.13
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAT5g6dBF+jBaO/jp/AQJ/Agf9EwYOluiHbhg+zydCLSIupY8Z8ecRTJVz
yXqHjX9zsCpwIsaToNsF8hXr5UzugLzyr7TBtzwVG3FYB+o1thc5vjubskmBuniQ
AO+BeoSaXp9KyKcAiwssrxjRfTAbwYj+sai04SH0mg1z7vdzj6ShvN21bG1OWk+E
+VsYGdkY8Ji5idNexFzIwqdg23JM4StNyxyR5rBo8xWBsZR9Y/D+YhS3+dDh1QvZ
NRr4Dae9NRP65d9kBR8R4aOC9EFijqZGfOxFQbrYejPsVnM+HumsJAnO82+9oQL5
FNAmlz0V8IEKBZIOKWYXDxz1t513fd/HGCTYSS9d3OhJ0+OsMvMzYA==
=PwLJ
-----END PGP SIGNATURE-----
Changes since livecd-tools-16.12:
Bill Nottingham (1):
allow for use of yum plugins during livecd creation
Brian C. Lane (3):
check for LIVE-REPO partition when writing DVD (#813905)
fix quoting with basename and SRC (#814174)
Version 16.13
Matthew Garrett (2):
Add tighter Mac boot image integration
Capitalise EFI names
---
Makefile | 2 +-
imgcreate/creator.py | 10 ++++++----
imgcreate/live.py | 11 +++++++----
imgcreate/yuminst.py | 8 ++++++--
tools/livecd-creator | 5 +++++
tools/livecd-iso-to-disk.sh | 34 +++++++++++++++++++++++++++-------
6 files changed, 52 insertions(+), 18 deletions(-)
---
12 years
Branch 'f16-branch' - 4 commits - imgcreate/creator.py imgcreate/live.py imgcreate/yuminst.py Makefile tools/livecd-creator
by Brian C. Lane
Makefile | 2 +-
imgcreate/creator.py | 10 ++++++----
imgcreate/live.py | 11 +++++++----
imgcreate/yuminst.py | 8 ++++++--
tools/livecd-creator | 5 +++++
5 files changed, 25 insertions(+), 11 deletions(-)
New commits:
commit 96c201fb1ab268e777b145eb90c33294d32f3a60
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Apr 25 10:54:44 2012 -0700
Version 16.13
diff --git a/Makefile b/Makefile
index 7922b65..f9a927e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 16.12
+VERSION = 16.13
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 674575e7582e04f63239a521462605d242aedefe
Author: Bill Nottingham <notting(a)redhat.com>
Date: Mon Apr 23 18:31:22 2012 -0400
allow for use of yum plugins during livecd creation
https://bugzilla.redhat.com/show_bug.cgi?id=813429
This adds an option ("-p", or "--plugins") to livecd-creator to allow for
the use of yum plugins during image creation. The initial usage case is
for localized live images that want to use yum-langpacks when creating their
live image so that they include the proper language packs for their locale.
Aside from the noise of propagating the commandline options down to the yum
instance, there is a bugfix where we re-call repository setup after we've
actually added the repositories; this is required so that plugins operate
properly.
Bill
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 35fe777..d8249cb 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -51,7 +51,7 @@ class ImageCreator(object):
"""
- def __init__(self, ks, name, releasever=None, tmpdir="/tmp"):
+ def __init__(self, ks, name, releasever=None, tmpdir="/tmp", useplugins=False):
"""Initialize an ImageCreator instance.
ks -- a pykickstart.KickstartParser instance; this instance will be
@@ -72,6 +72,7 @@ class ImageCreator(object):
"""A name for the image."""
self.releasever = releasever
+ self.useplugins = useplugins
self.tmpdir = tmpdir
"""The directory in which all temporary files will be created."""
@@ -617,7 +618,7 @@ class ImageCreator(object):
"""
yum_conf = self._mktemp(prefix = "yum.conf-")
- ayum = LiveCDYum(releasever=self.releasever)
+ ayum = LiveCDYum(releasever=self.releasever, useplugins=self.useplugins)
ayum.setup(yum_conf, self._instroot)
for repo in kickstart.get_repos(self.ks, repo_urls):
@@ -632,6 +633,7 @@ class ImageCreator(object):
yr.proxy = proxy
if cost is not None:
yr.cost = cost
+ ayum.setup(yum_conf, self._instroot)
if kickstart.exclude_docs(self.ks):
rpm.addMacro("_excludedocs", "1")
@@ -778,7 +780,7 @@ class LoopImageCreator(ImageCreator):
"""
- def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp"):
+ def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp", useplugins=False):
"""Initialize a LoopImageCreator instance.
This method takes the same arguments as ImageCreator.__init__() with
@@ -787,7 +789,7 @@ class LoopImageCreator(ImageCreator):
fslabel -- A string used as a label for any filesystems created.
"""
- ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir)
+ ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir, useplugins=useplugins)
self.__fslabel = None
self.fslabel = fslabel
diff --git a/imgcreate/live.py b/imgcreate/live.py
index c468d41..b9867a5 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -40,7 +40,7 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp",
- title="Linux", product="Linux"):
+ title="Linux", product="Linux", useplugins=False):
"""Initialise a LiveImageCreator instance.
This method takes the same arguments as LoopImageCreator.__init__().
@@ -49,7 +49,8 @@ class LiveImageCreatorBase(LoopImageCreator):
LoopImageCreator.__init__(self, ks, name,
fslabel=fslabel,
releasever=releasever,
- tmpdir=tmpdir)
+ tmpdir=tmpdir,
+ useplugins=useplugins)
self.compress_type = "xz"
"""mksquashfs compressor to use."""
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index d835d9f..5605eea 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -45,12 +45,13 @@ class TextProgress(object):
self.emit(logging.INFO, "...OK\n")
class LiveCDYum(yum.YumBase):
- def __init__(self, releasever=None):
+ def __init__(self, releasever=None, useplugins=False):
"""
releasever = optional value to use in replacing $releasever in repos
"""
yum.YumBase.__init__(self)
self.releasever = releasever
+ self.useplugins = useplugins
def doFileLogSetup(self, uid, logfile):
# don't do the file log for the livecd as it can lead to open fds
@@ -71,7 +72,10 @@ class LiveCDYum(yum.YumBase):
conf = "[main]\n"
conf += "installroot=%s\n" % installroot
conf += "cachedir=/var/cache/yum\n"
- conf += "plugins=0\n"
+ if self.useplugins:
+ conf += "plugins=1\n"
+ else:
+ conf += "plugins=0\n"
conf += "reposdir=\n"
conf += "failovermethod=priority\n"
conf += "keepcache=1\n"
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 6b2c799..8bb81aa 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -49,6 +49,9 @@ def parse_options(args):
# Provided for img-create compatibility
imgopt.add_option("-n", "--name", type="string", dest="fslabel",
help=optparse.SUPPRESS_HELP)
+ imgopt.add_option("-p", "--plugins", action="store_true", dest="plugins",
+ help="Use yum plugins during image creation",
+ default=False)
imgopt.add_option("", "--image-type", type="string", dest="image_type",
help=optparse.SUPPRESS_HELP)
imgopt.add_option("", "--compression-type", type="string", dest="compress_type",
@@ -171,11 +174,13 @@ def main():
fslabel=fslabel,
releasever=options.releasever,
tmpdir=os.path.abspath(options.tmpdir),
+ useplugins=options.plugins,
title=title, product=product)
elif options.image_type == 'image':
creator = imgcreate.LoopImageCreator(ks, name,
fslabel=fslabel,
releasever=options.releasever,
+ useplugins=options.plugins,
tmpdir=os.path.abspath(options.tmpdir))
else:
# Cannot happen, we validate this when parsing options.
commit 387c37260c063fa70d998dee8e882aad95ed65cf
Author: Matthew Garrett <mjg(a)redhat.com>
Date: Tue Apr 24 10:41:48 2012 -0400
Capitalise EFI names
The spec says these are mixed case, but the implementation has them as
upper case. This is fine on vfat, but breaks on iso9660. Make them upper
case.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 167ac94..c468d41 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -773,7 +773,7 @@ hiddenmenu
os.link(isodir + "/EFI/BOOT/grub.conf", isodir + "/EFI/BOOT/BOOT.conf")
# for most things, we want them named boot$efiarch
- efiarch = {"i386": "ia32", "x86_64": "x64"}
+ efiarch = {"i386": "IA32", "x86_64": "X64"}
efiname = efiarch[rpmUtils.arch.getBaseArch()]
os.rename(isodir + "/EFI/BOOT/grub.efi", isodir + "/EFI/BOOT/BOOT%s.efi" %(efiname,))
os.link(isodir + "/EFI/BOOT/grub.conf", isodir + "/EFI/BOOT/BOOT%s.conf" %(efiname,))
commit cd63accd3fc0c5c25af2fd83361ac3b9edfe3338
Author: Matthew Garrett <mjg(a)redhat.com>
Date: Tue Apr 24 09:47:31 2012 -0400
Add tighter Mac boot image integration
Make sure that the Mac boot image ends up with an icon and has the product
info set correctly.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 656f49c..167ac94 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -234,7 +234,9 @@ class LiveImageCreatorBase(LoopImageCreator):
subprocess.call(["mkefiboot", isodir + "/EFI/BOOT",
isodir + "/isolinux/efiboot.img"])
subprocess.call(["mkefiboot", "-a", isodir + "/EFI/BOOT",
- isodir + "/isolinux/macboot.img"])
+ isodir + "/isolinux/macboot.img", "-l", self.product,
+ "-i", "/usr/share/pixmaps/bootloader/fedora.icns",
+ "-p", self.product])
def _create_bootconfig(self):
"""Configure the image so that it's bootable."""
12 years
Changes to 'refs/tags/livecd-tools-17.9'
by Brian C. Lane
Tag 'livecd-tools-17.9' created by Brian C. Lane <bcl(a)redhat.com> at 2012-04-24 21:55 +0000
Tag as livecd-tools-17.9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAT5chQRF+jBaO/jp/AQIZagf+NHtRCwZYBD53uZ5xNvy3jXlEgfTNQaOr
6KAnJfBXNftkSqIOf7S/n3esSJ/4+r6xl1x/i5TYNgTcegwvnmdOJ1Vt3UcRg+Q4
KRxpfAiIdD5QeL3fRd16i2MLZjaSc5XH7rMD4TooLtiIW1v2isCXOlazBhg2MkSx
RMfG3HsEGtpbXIKh10qBEZnedHv0nYpYRDpxPsmZN9Hsk5niIgXHDmhxtY1NHe4u
5aEqcyuxXq6q94HIoEMPQYYzdcBs4W5KKPVBBiEdQTBdEU5bVXSu507XAye8QBxJ
qt2M4O8YHfhd7w14cuZUCX1eJhAxZaX/oPNQ/lIs16dGDPF9fM4INA==
=m73P
-----END PGP SIGNATURE-----
Changes since livecd-tools-17.8:
Bill Nottingham (1):
allow for use of yum plugins during livecd creation
Brian C. Lane (3):
check for LIVE-REPO partition when writing DVD (#813905)
fix quoting with basename and SRC (#814174)
Version 17.9
Matthew Garrett (2):
Add tighter Mac boot image integration
Capitalise EFI names
---
Makefile | 2 +-
imgcreate/creator.py | 10 ++++++----
imgcreate/live.py | 11 +++++++----
imgcreate/yuminst.py | 8 ++++++--
tools/livecd-creator | 5 +++++
tools/livecd-iso-to-disk.sh | 34 +++++++++++++++++++++++++++-------
6 files changed, 52 insertions(+), 18 deletions(-)
---
12 years
Branch 'f17-branch' - Makefile
by Brian C. Lane
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 30c7b17ed5305655a1f419f77ab58e3747364927
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Apr 24 14:55:05 2012 -0700
Version 17.9
diff --git a/Makefile b/Makefile
index 1f504e1..0667a0b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 17.8
+VERSION = 17.9
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
12 years
Changes to 'refs/tags/livecd-tools-18.4'
by Brian C. Lane
Tag 'livecd-tools-18.4' created by Brian C. Lane <bcl(a)redhat.com> at 2012-04-24 21:54 +0000
Tag as livecd-tools-18.4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAT5chAhF+jBaO/jp/AQJ52wf/WNv29WIc6a/lS8QQuw5HuOUz3TgVlRt2
7dvhbjboB4TELlirxMKm4xuHPgH+AGhSWf9xJsMwTp4nIjIRWSimK4RU+l44emXC
S1REIHu0dScr6Ouk/lrrfSUgklL3oCpr4CEEPpGsD9Igf22cZ+zqIyzMnWe/8lKL
eCjyaBsOKYGNGMwJZtXcXcxpfhEgYp41WK0dC+PPmZ4wLcZvCLdKZKZMgIzRNsUo
SfI7hxK4387bUJX5mwEB4sFsk5yJ559GSOjjE/LQlyVGudh+HuUj2UiFK0X6Js3S
Ajxg1C8ttLSVoB697sIZgooU5kPXlqrnkLBw0Nb5gIsEiTsYX89ajA==
=gdPu
-----END PGP SIGNATURE-----
Changes since livecd-tools-18.3:
Bill Nottingham (1):
allow for use of yum plugins during livecd creation
Brian C. Lane (3):
check for LIVE-REPO partition when writing DVD (#813905)
fix quoting with basename and SRC (#814174)
Version 18.4
Matthew Garrett (2):
Add tighter Mac boot image integration
Capitalise EFI names
---
Makefile | 2 +-
imgcreate/creator.py | 10 ++++++----
imgcreate/live.py | 11 +++++++----
imgcreate/yuminst.py | 8 ++++++--
tools/livecd-creator | 5 +++++
tools/livecd-iso-to-disk.sh | 34 +++++++++++++++++++++++++++-------
6 files changed, 52 insertions(+), 18 deletions(-)
---
12 years
Makefile
by Brian C. Lane
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 9e2b586ae20288d1b1ba4dae7e9e341d77f9b78b
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Apr 24 14:53:55 2012 -0700
Version 18.4
diff --git a/Makefile b/Makefile
index c1ed0ac..fa54bf0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 18.3
+VERSION = 18.4
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
12 years
3 commits - imgcreate/creator.py imgcreate/live.py imgcreate/yuminst.py tools/livecd-creator
by Brian C. Lane
imgcreate/creator.py | 10 ++++++----
imgcreate/live.py | 11 +++++++----
imgcreate/yuminst.py | 8 ++++++--
tools/livecd-creator | 5 +++++
4 files changed, 24 insertions(+), 10 deletions(-)
New commits:
commit 29303d0b2547c2da87a437c517267417d84581de
Author: Bill Nottingham <notting(a)redhat.com>
Date: Mon Apr 23 18:31:22 2012 -0400
allow for use of yum plugins during livecd creation
https://bugzilla.redhat.com/show_bug.cgi?id=813429
This adds an option ("-p", or "--plugins") to livecd-creator to allow for
the use of yum plugins during image creation. The initial usage case is
for localized live images that want to use yum-langpacks when creating their
live image so that they include the proper language packs for their locale.
Aside from the noise of propagating the commandline options down to the yum
instance, there is a bugfix where we re-call repository setup after we've
actually added the repositories; this is required so that plugins operate
properly.
Bill
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 35fe777..d8249cb 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -51,7 +51,7 @@ class ImageCreator(object):
"""
- def __init__(self, ks, name, releasever=None, tmpdir="/tmp"):
+ def __init__(self, ks, name, releasever=None, tmpdir="/tmp", useplugins=False):
"""Initialize an ImageCreator instance.
ks -- a pykickstart.KickstartParser instance; this instance will be
@@ -72,6 +72,7 @@ class ImageCreator(object):
"""A name for the image."""
self.releasever = releasever
+ self.useplugins = useplugins
self.tmpdir = tmpdir
"""The directory in which all temporary files will be created."""
@@ -617,7 +618,7 @@ class ImageCreator(object):
"""
yum_conf = self._mktemp(prefix = "yum.conf-")
- ayum = LiveCDYum(releasever=self.releasever)
+ ayum = LiveCDYum(releasever=self.releasever, useplugins=self.useplugins)
ayum.setup(yum_conf, self._instroot)
for repo in kickstart.get_repos(self.ks, repo_urls):
@@ -632,6 +633,7 @@ class ImageCreator(object):
yr.proxy = proxy
if cost is not None:
yr.cost = cost
+ ayum.setup(yum_conf, self._instroot)
if kickstart.exclude_docs(self.ks):
rpm.addMacro("_excludedocs", "1")
@@ -778,7 +780,7 @@ class LoopImageCreator(ImageCreator):
"""
- def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp"):
+ def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp", useplugins=False):
"""Initialize a LoopImageCreator instance.
This method takes the same arguments as ImageCreator.__init__() with
@@ -787,7 +789,7 @@ class LoopImageCreator(ImageCreator):
fslabel -- A string used as a label for any filesystems created.
"""
- ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir)
+ ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir, useplugins=useplugins)
self.__fslabel = None
self.fslabel = fslabel
diff --git a/imgcreate/live.py b/imgcreate/live.py
index d80f518..a73d7f0 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -40,7 +40,7 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp",
- title="Linux", product="Linux"):
+ title="Linux", product="Linux", useplugins=False):
"""Initialise a LiveImageCreator instance.
This method takes the same arguments as LoopImageCreator.__init__().
@@ -49,7 +49,8 @@ class LiveImageCreatorBase(LoopImageCreator):
LoopImageCreator.__init__(self, ks, name,
fslabel=fslabel,
releasever=releasever,
- tmpdir=tmpdir)
+ tmpdir=tmpdir,
+ useplugins=useplugins)
self.compress_type = "xz"
"""mksquashfs compressor to use."""
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index d835d9f..5605eea 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -45,12 +45,13 @@ class TextProgress(object):
self.emit(logging.INFO, "...OK\n")
class LiveCDYum(yum.YumBase):
- def __init__(self, releasever=None):
+ def __init__(self, releasever=None, useplugins=False):
"""
releasever = optional value to use in replacing $releasever in repos
"""
yum.YumBase.__init__(self)
self.releasever = releasever
+ self.useplugins = useplugins
def doFileLogSetup(self, uid, logfile):
# don't do the file log for the livecd as it can lead to open fds
@@ -71,7 +72,10 @@ class LiveCDYum(yum.YumBase):
conf = "[main]\n"
conf += "installroot=%s\n" % installroot
conf += "cachedir=/var/cache/yum\n"
- conf += "plugins=0\n"
+ if self.useplugins:
+ conf += "plugins=1\n"
+ else:
+ conf += "plugins=0\n"
conf += "reposdir=\n"
conf += "failovermethod=priority\n"
conf += "keepcache=1\n"
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 6b2c799..8bb81aa 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -49,6 +49,9 @@ def parse_options(args):
# Provided for img-create compatibility
imgopt.add_option("-n", "--name", type="string", dest="fslabel",
help=optparse.SUPPRESS_HELP)
+ imgopt.add_option("-p", "--plugins", action="store_true", dest="plugins",
+ help="Use yum plugins during image creation",
+ default=False)
imgopt.add_option("", "--image-type", type="string", dest="image_type",
help=optparse.SUPPRESS_HELP)
imgopt.add_option("", "--compression-type", type="string", dest="compress_type",
@@ -171,11 +174,13 @@ def main():
fslabel=fslabel,
releasever=options.releasever,
tmpdir=os.path.abspath(options.tmpdir),
+ useplugins=options.plugins,
title=title, product=product)
elif options.image_type == 'image':
creator = imgcreate.LoopImageCreator(ks, name,
fslabel=fslabel,
releasever=options.releasever,
+ useplugins=options.plugins,
tmpdir=os.path.abspath(options.tmpdir))
else:
# Cannot happen, we validate this when parsing options.
commit ace3d83189fe1b06640c5451316084f50cb0bd3c
Author: Matthew Garrett <mjg(a)redhat.com>
Date: Tue Apr 24 10:41:48 2012 -0400
Capitalise EFI names
The spec says these are mixed case, but the implementation has them as
upper case. This is fine on vfat, but breaks on iso9660. Make them upper
case.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 0fc20e9..d80f518 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -771,7 +771,7 @@ hiddenmenu
os.link(isodir + "/EFI/BOOT/grub.conf", isodir + "/EFI/BOOT/BOOT.conf")
# for most things, we want them named boot$efiarch
- efiarch = {"i386": "ia32", "x86_64": "x64"}
+ efiarch = {"i386": "IA32", "x86_64": "X64"}
efiname = efiarch[rpmUtils.arch.getBaseArch()]
os.rename(isodir + "/EFI/BOOT/grub.efi", isodir + "/EFI/BOOT/BOOT%s.efi" %(efiname,))
os.link(isodir + "/EFI/BOOT/grub.conf", isodir + "/EFI/BOOT/BOOT%s.conf" %(efiname,))
commit 06322244dc56912366190cb53d9d0957959c6fd8
Author: Matthew Garrett <mjg(a)redhat.com>
Date: Tue Apr 24 09:47:31 2012 -0400
Add tighter Mac boot image integration
Make sure that the Mac boot image ends up with an icon and has the product
info set correctly.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index c5c9db8..0fc20e9 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -234,7 +234,9 @@ class LiveImageCreatorBase(LoopImageCreator):
subprocess.call(["mkefiboot", isodir + "/EFI/BOOT",
isodir + "/isolinux/efiboot.img"])
subprocess.call(["mkefiboot", "-a", isodir + "/EFI/BOOT",
- isodir + "/isolinux/macboot.img"])
+ isodir + "/isolinux/macboot.img", "-l", self.product,
+ "-i", "/usr/share/pixmaps/bootloader/fedora.icns",
+ "-p", self.product])
def _create_bootconfig(self):
"""Configure the image so that it's bootable."""
12 years
Branch 'f17-branch' - 3 commits - imgcreate/creator.py imgcreate/live.py imgcreate/yuminst.py tools/livecd-creator
by Brian C. Lane
imgcreate/creator.py | 10 ++++++----
imgcreate/live.py | 11 +++++++----
imgcreate/yuminst.py | 8 ++++++--
tools/livecd-creator | 5 +++++
4 files changed, 24 insertions(+), 10 deletions(-)
New commits:
commit 9b2965aa880e07b0ab805e8a996e21bec77da1b6
Author: Bill Nottingham <notting(a)redhat.com>
Date: Mon Apr 23 18:31:22 2012 -0400
allow for use of yum plugins during livecd creation
https://bugzilla.redhat.com/show_bug.cgi?id=813429
This adds an option ("-p", or "--plugins") to livecd-creator to allow for
the use of yum plugins during image creation. The initial usage case is
for localized live images that want to use yum-langpacks when creating their
live image so that they include the proper language packs for their locale.
Aside from the noise of propagating the commandline options down to the yum
instance, there is a bugfix where we re-call repository setup after we've
actually added the repositories; this is required so that plugins operate
properly.
Bill
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 35fe777..d8249cb 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -51,7 +51,7 @@ class ImageCreator(object):
"""
- def __init__(self, ks, name, releasever=None, tmpdir="/tmp"):
+ def __init__(self, ks, name, releasever=None, tmpdir="/tmp", useplugins=False):
"""Initialize an ImageCreator instance.
ks -- a pykickstart.KickstartParser instance; this instance will be
@@ -72,6 +72,7 @@ class ImageCreator(object):
"""A name for the image."""
self.releasever = releasever
+ self.useplugins = useplugins
self.tmpdir = tmpdir
"""The directory in which all temporary files will be created."""
@@ -617,7 +618,7 @@ class ImageCreator(object):
"""
yum_conf = self._mktemp(prefix = "yum.conf-")
- ayum = LiveCDYum(releasever=self.releasever)
+ ayum = LiveCDYum(releasever=self.releasever, useplugins=self.useplugins)
ayum.setup(yum_conf, self._instroot)
for repo in kickstart.get_repos(self.ks, repo_urls):
@@ -632,6 +633,7 @@ class ImageCreator(object):
yr.proxy = proxy
if cost is not None:
yr.cost = cost
+ ayum.setup(yum_conf, self._instroot)
if kickstart.exclude_docs(self.ks):
rpm.addMacro("_excludedocs", "1")
@@ -778,7 +780,7 @@ class LoopImageCreator(ImageCreator):
"""
- def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp"):
+ def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp", useplugins=False):
"""Initialize a LoopImageCreator instance.
This method takes the same arguments as ImageCreator.__init__() with
@@ -787,7 +789,7 @@ class LoopImageCreator(ImageCreator):
fslabel -- A string used as a label for any filesystems created.
"""
- ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir)
+ ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir, useplugins=useplugins)
self.__fslabel = None
self.fslabel = fslabel
diff --git a/imgcreate/live.py b/imgcreate/live.py
index d80f518..a73d7f0 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -40,7 +40,7 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp",
- title="Linux", product="Linux"):
+ title="Linux", product="Linux", useplugins=False):
"""Initialise a LiveImageCreator instance.
This method takes the same arguments as LoopImageCreator.__init__().
@@ -49,7 +49,8 @@ class LiveImageCreatorBase(LoopImageCreator):
LoopImageCreator.__init__(self, ks, name,
fslabel=fslabel,
releasever=releasever,
- tmpdir=tmpdir)
+ tmpdir=tmpdir,
+ useplugins=useplugins)
self.compress_type = "xz"
"""mksquashfs compressor to use."""
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index d835d9f..5605eea 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -45,12 +45,13 @@ class TextProgress(object):
self.emit(logging.INFO, "...OK\n")
class LiveCDYum(yum.YumBase):
- def __init__(self, releasever=None):
+ def __init__(self, releasever=None, useplugins=False):
"""
releasever = optional value to use in replacing $releasever in repos
"""
yum.YumBase.__init__(self)
self.releasever = releasever
+ self.useplugins = useplugins
def doFileLogSetup(self, uid, logfile):
# don't do the file log for the livecd as it can lead to open fds
@@ -71,7 +72,10 @@ class LiveCDYum(yum.YumBase):
conf = "[main]\n"
conf += "installroot=%s\n" % installroot
conf += "cachedir=/var/cache/yum\n"
- conf += "plugins=0\n"
+ if self.useplugins:
+ conf += "plugins=1\n"
+ else:
+ conf += "plugins=0\n"
conf += "reposdir=\n"
conf += "failovermethod=priority\n"
conf += "keepcache=1\n"
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 6b2c799..8bb81aa 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -49,6 +49,9 @@ def parse_options(args):
# Provided for img-create compatibility
imgopt.add_option("-n", "--name", type="string", dest="fslabel",
help=optparse.SUPPRESS_HELP)
+ imgopt.add_option("-p", "--plugins", action="store_true", dest="plugins",
+ help="Use yum plugins during image creation",
+ default=False)
imgopt.add_option("", "--image-type", type="string", dest="image_type",
help=optparse.SUPPRESS_HELP)
imgopt.add_option("", "--compression-type", type="string", dest="compress_type",
@@ -171,11 +174,13 @@ def main():
fslabel=fslabel,
releasever=options.releasever,
tmpdir=os.path.abspath(options.tmpdir),
+ useplugins=options.plugins,
title=title, product=product)
elif options.image_type == 'image':
creator = imgcreate.LoopImageCreator(ks, name,
fslabel=fslabel,
releasever=options.releasever,
+ useplugins=options.plugins,
tmpdir=os.path.abspath(options.tmpdir))
else:
# Cannot happen, we validate this when parsing options.
commit fb443dae640131cff2058f81dd8ab747be31914b
Author: Matthew Garrett <mjg(a)redhat.com>
Date: Tue Apr 24 10:41:48 2012 -0400
Capitalise EFI names
The spec says these are mixed case, but the implementation has them as
upper case. This is fine on vfat, but breaks on iso9660. Make them upper
case.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 0fc20e9..d80f518 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -771,7 +771,7 @@ hiddenmenu
os.link(isodir + "/EFI/BOOT/grub.conf", isodir + "/EFI/BOOT/BOOT.conf")
# for most things, we want them named boot$efiarch
- efiarch = {"i386": "ia32", "x86_64": "x64"}
+ efiarch = {"i386": "IA32", "x86_64": "X64"}
efiname = efiarch[rpmUtils.arch.getBaseArch()]
os.rename(isodir + "/EFI/BOOT/grub.efi", isodir + "/EFI/BOOT/BOOT%s.efi" %(efiname,))
os.link(isodir + "/EFI/BOOT/grub.conf", isodir + "/EFI/BOOT/BOOT%s.conf" %(efiname,))
commit 59e2bcf150480f9f1a28a6be45941fcfb1297234
Author: Matthew Garrett <mjg(a)redhat.com>
Date: Tue Apr 24 09:47:31 2012 -0400
Add tighter Mac boot image integration
Make sure that the Mac boot image ends up with an icon and has the product
info set correctly.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index c5c9db8..0fc20e9 100755
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -234,7 +234,9 @@ class LiveImageCreatorBase(LoopImageCreator):
subprocess.call(["mkefiboot", isodir + "/EFI/BOOT",
isodir + "/isolinux/efiboot.img"])
subprocess.call(["mkefiboot", "-a", isodir + "/EFI/BOOT",
- isodir + "/isolinux/macboot.img"])
+ isodir + "/isolinux/macboot.img", "-l", self.product,
+ "-i", "/usr/share/pixmaps/bootloader/fedora.icns",
+ "-p", self.product])
def _create_bootconfig(self):
"""Configure the image so that it's bootable."""
12 years
[PATCH] allow for use of yum plugins during livecd creation
by Bill Nottingham
https://bugzilla.redhat.com/show_bug.cgi?id=813429
This adds an option ("-p", or "--plugins") to livecd-creator to allow for
the use of yum plugins during image creation. The initial usage case is
for localized live images that want to use yum-langpacks when creating their
live image so that they include the proper language packs for their locale.
Aside from the noise of propagating the commandline options down to the yum
instance, there is a bugfix where we re-call repository setup after we've
actually added the repositories; this is required so that plugins operate
properly.
Bill
12 years