Branch 'f15-branch' - tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 46fa124651ebd8654cc1dd1fbfecdc09d4174cc7
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Feb 24 15:44:46 2011 -0800
gptmbr can be written directly to the mbr
With the change to syslinux 4 in F14 the gptmbr.bin no longer needs the
GUID of the partition to boot, it just needs the boot flag set on it.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 532022c..b7cee72 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -327,15 +327,13 @@ resetMBR() {
# if efi, we need to use the hybrid MBR
if [ -n "$efi" ]; then
if [ -f /usr/lib/syslinux/gptmbr.bin ]; then
- gptmbr='/usr/lib/syslinux/gptmbr.bin'
+ cat /usr/lib/syslinux/gptmbr.bin > $device
elif [ -f /usr/share/syslinux/gptmbr.bin ]; then
- gptmbr='/usr/share/syslinux/gptmbr.bin'
+ cat /usr/share/syslinux/gptmbr.bin > $device
else
echo "Could not find gptmbr.bin (syslinux)"
exitclean
fi
- # our magic number is LBA-2, offset 16 - (512+512+16)/$bs
- dd if=$device bs=16 skip=65 count=1 | cat $gptmbr - > $device
else
if [ -f /usr/lib/syslinux/mbr.bin ]; then
cat /usr/lib/syslinux/mbr.bin > $device
12 years, 9 months
Branch 'f14-branch' - tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 8bc9ca6c4fac47d686d5adc920c90863c57dc270
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Feb 24 15:44:46 2011 -0800
gptmbr can be written directly to the mbr
With the change to syslinux 4 in F14 the gptmbr.bin no longer needs the
GUID of the partition to boot, it just needs the boot flag set on it.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index a2e7d34..fe49fd4 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -87,15 +87,13 @@ resetMBR() {
# if efi, we need to use the hybrid MBR
if [ -n "$efi" ];then
if [ -f /usr/lib/syslinux/gptmbr.bin ]; then
- gptmbr='/usr/lib/syslinux/gptmbr.bin'
+ cat /usr/lib/syslinux/gptmbr.bin > $device
elif [ -f /usr/share/syslinux/gptmbr.bin ]; then
- gptmbr='/usr/share/syslinux/gptmbr.bin'
+ cat /usr/share/syslinux/gptmbr.bin > $device
else
echo "Could not find gptmbr.bin (syslinux)"
exitclean
fi
- # our magic number is LBA-2, offset 16 - (512+512+16)/$bs
- dd if=$device bs=16 skip=65 count=1 | cat $gptmbr - > $device
else
if [ -f /usr/lib/syslinux/mbr.bin ]; then
cat /usr/lib/syslinux/mbr.bin > $device
12 years, 9 months
tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 73a4a7ed29ba0eef0ceed6380442f9059130db75
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Feb 24 15:44:46 2011 -0800
gptmbr can be written directly to the mbr
With the change to syslinux 4 in F14 the gptmbr.bin no longer needs the
GUID of the partition to boot, it just needs the boot flag set on it.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 532022c..b7cee72 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -327,15 +327,13 @@ resetMBR() {
# if efi, we need to use the hybrid MBR
if [ -n "$efi" ]; then
if [ -f /usr/lib/syslinux/gptmbr.bin ]; then
- gptmbr='/usr/lib/syslinux/gptmbr.bin'
+ cat /usr/lib/syslinux/gptmbr.bin > $device
elif [ -f /usr/share/syslinux/gptmbr.bin ]; then
- gptmbr='/usr/share/syslinux/gptmbr.bin'
+ cat /usr/share/syslinux/gptmbr.bin > $device
else
echo "Could not find gptmbr.bin (syslinux)"
exitclean
fi
- # our magic number is LBA-2, offset 16 - (512+512+16)/$bs
- dd if=$device bs=16 skip=65 count=1 | cat $gptmbr - > $device
else
if [ -f /usr/lib/syslinux/mbr.bin ]; then
cat /usr/lib/syslinux/mbr.bin > $device
12 years, 9 months
Changes to 'refs/tags/livecd-tools-13.2'
by Brian C. Lane
Tag 'livecd-tools-13.2' created by Brian C. Lane <bcl(a)redhat.com> at 2011-02-24 00:34 +0000
Tag as livecd-tools-13.2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUATWWnjBF+jBaO/jp/AQIRpwf+NkfvmxOeCfC/RAtohtIAEWwvqXjJYlDO
vWE+L60/5wASJH/UYsm29EWw2n3N4b2BfTdlXIS/sW6AWv50477dHQITQExpGPom
ED4XgAL3eGLWNLPdcsDf7WKoM6Zxhk9/xHEJJBFtlgJRNhSClKaFs5NbYO8OyfdW
5BK+AGFWSVEcbeiaWarlHUeikvs/1M/omPGrWI/Mh0UpBbRAbSGKE+xhx8mgko5O
wT5SvdGw7InR2H8byLkQr/Mv8w6S1Hx4zEoz7xvR4F8KWtVRqjhx7AVtey5w4RTG
3fbRBE837KITYZYavQ8ueUUjIdhLNv7Ai7b25p562x4HXdmEOGSNHg==
=vWuD
-----END PGP SIGNATURE-----
Changes since livecd-tools-13.1:
Brian C. Lane (9):
Change releasever to a command line option (#667474)
Check for one big initrd.img (#671900)
Align start of partition at 1MiB (#668967)
Source may be a file or a block device, mount accordingly
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 13.2
Bruce Jerrick (1):
Fix skipcopy usage with DVD iso (#644194)
Bruno Wolff III (1):
Update documentation for xz availability.
David Lehman (2):
Fix git URLs to match reality.
Assign a device-mapper UUID w/ subsystem prefix to the dm snapshot.
---
HACKING | 4 +-
Makefile | 2 -
docs/livecd-creator.pod | 19 +++++++---
imgcreate/creator.py | 13 ++++---
imgcreate/fs.py | 3 +
imgcreate/live.py | 10 +++--
imgcreate/yuminst.py | 17 ++++++++-
tools/livecd-creator | 23 +++++++-----
tools/livecd-iso-to-disk.sh | 79 +++++++++++++++++++++++++++++++++-----------
9 files changed, 121 insertions(+), 49 deletions(-)
---
12 years, 9 months
Branch 'f13-branch' - 13 commits - docs/livecd-creator.pod HACKING imgcreate/creator.py imgcreate/fs.py imgcreate/live.py imgcreate/yuminst.py Makefile tools/livecd-creator tools/livecd-iso-to-disk.sh
by Brian C. Lane
HACKING | 4 +-
Makefile | 2 -
docs/livecd-creator.pod | 19 +++++++---
imgcreate/creator.py | 13 ++++---
imgcreate/fs.py | 3 +
imgcreate/live.py | 10 +++--
imgcreate/yuminst.py | 17 ++++++++-
tools/livecd-creator | 23 +++++++-----
tools/livecd-iso-to-disk.sh | 79 +++++++++++++++++++++++++++++++++-----------
9 files changed, 121 insertions(+), 49 deletions(-)
New commits:
commit 12f55f70398e0baef6329293bf81598fab62020a
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Feb 23 13:22:20 2011 -0800
Version 13.2
diff --git a/Makefile b/Makefile
index d667622..34349d5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 13.1
+VERSION = 13.2
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 774cde666a178aab462226834d56bfbd39ccbf6c
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 1077455..a2e7d34 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -492,15 +492,23 @@ ISO=$(readlink -f "$1")
USBDEV=$(readlink -f "$2")
if [ -z "$ISO" ]; then
+ echo "Missing source"
usage
fi
if [ ! -b "$ISO" -a ! -f "$ISO" ]; then
+ echo "$ISO is not a file or block device"
usage
fi
# FIXME: If --format is given, we shouldn't care and just use /dev/foo1
-if [ -z "$USBDEV" -o ! -b "$USBDEV" ]; then
+if [ -z "$USBDEV" ]; then
+ echo "Missing target device"
+ usage
+fi
+
+if [ ! -b "$USBDEV" ]; then
+ echo "$USBDEV is not a block device"
usage
fi
commit 7e03867c424b51b3ec329404d3ad45cd1443912c
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 6dc27ce..1077455 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -639,7 +639,11 @@ fi
# Verify available space for DVD installer
if [ "$isotype" = "installer" ]; then
- isosize=$(du -s -B 1M $ISO | awk {'print $1;'})
+ if [ -z "$skipcopy" ]; then
+ isosize=$(du -s -B 1M $ISO | awk {'print $1;'})
+ else
+ isosize=0
+ fi
if [ "$imgtype" = "install" ]; then
imgpath=images/install.img
else
@@ -708,13 +712,13 @@ if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
fi
# DVD installer copy
-if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) -a -z "$skipcopy" ]; then
+if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) ]; then
echo "Copying DVD image to USB stick"
mkdir -p $USBMNT/images/
if [ "$imgtype" = "install" ]; then
copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
fi
- if [ "$isotype" = "installer" ]; then
+ if [ "$isotype" = "installer" -a -z "$skipcopy" ]; then
cp $ISO $USBMNT/
fi
sync
commit a5aaa61291085c1c01d6bc44821e6b39fbefe69e
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 9e87854..b7436e6 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -732,7 +732,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)
@@ -743,6 +742,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 3ddd4bae2f7e6ade603d23c7ad1a0aea898384fd
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 d6e28da..0905dcc 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -70,7 +70,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"
commit 9e275f416a3ebad81dfc8f5885bd365673c1c7d5
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 2448cbc..6dc27ce 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -52,6 +52,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
commit 1a43ab7d602a5335ef9f05d934202a2589ea745f
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Feb 15 11:51:48 2011 -0800
Source may be a file or a block device, mount accordingly
When the source is a block device don't mount it loopback.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 1879e83..2448cbc 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -561,7 +561,14 @@ fi
# FIXME: would be better if we had better mountpoints
CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
-mount -o loop,ro "$ISO" $CDMNT || exitclean
+if [ -b $ISO ]; then
+ mount -o ro "$ISO" $CDMNT || exitclean
+elif [ -f $ISO ]; then
+ mount -o loop,ro "$ISO" $CDMNT || exitclean
+else
+ echo "$ISO is not a file or block device."
+ exitclean
+fi
USBMNT=$(mktemp -d /media/usbdev.XXXXXX)
mount $mountopts $USBDEV $USBMNT || exitclean
commit db7ae57dfd6493ba80c16ef468c2ec8fb0bf6d88
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Fri Feb 4 17:45:00 2011 -0800
Align start of partition at 1MiB (#668967)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 853c063..1879e83 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -172,7 +172,7 @@ createGPTLayout() {
/sbin/parted --script $device mklabel gpt
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
+ /sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 1048576 $(($size - 1048576)) set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -195,7 +195,7 @@ createMSDOSLayout() {
/sbin/parted --script $device mklabel msdos
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
+ /sbin/parted --script $device unit b mkpart primary fat32 1048576 $(($size - 1048576)) set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -222,7 +222,7 @@ createEXTFSLayout() {
/sbin/parted --script $device mklabel msdos
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
+ /sbin/parted --script $device unit b mkpart primary ext2 1048576 $(($size - 1048576)) set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
commit 71197a31b6415138b48abb668b9ea5b40c0dbea0
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Jan 26 15:50:48 2011 -0800
Check for one big initrd.img (#671900)
rawhide now uses one big initrd.img instead of splitting it into
initrd.img and install.img
This checks for the existance of only initrd.img and skips trying to
copy the install.img
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index b730b52..853c063 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -341,14 +341,18 @@ detectisotype() {
isotype=live
return
fi
- if [ -e $CDMNT/images/install.img ]; then
+ if [ -e $CDMNT/images/install.img -o $CDMNT/isolinux/initrd.img ]; then
+ imgtype=install
if [ -e $CDMNT/Packages ]; then
isotype=installer
- return
- else
+ else
isotype=netinst
- return
- fi
+ fi
+ if [ ! -e $CDMNT/images/install.img ]; then
+ echo "$ISO uses initrd.img w/o install.img"
+ imgtype=initrd
+ fi
+ return
fi
echo "ERROR: $ISO does not appear to be a Live image or DVD installer."
exitclean
@@ -390,6 +394,7 @@ homesizemb=0
swapsizemb=0
overlaysizemb=0
isotype=
+imgtype=
LIVEOS=LiveOS
HOMEFILE="home.img"
@@ -624,16 +629,22 @@ fi
# Verify available space for DVD installer
if [ "$isotype" = "installer" ]; then
isosize=$(du -s -B 1M $ISO | awk {'print $1;'})
- installimgsize=$(du -s -B 1M $CDMNT/images/install.img | awk {'print $1;'})
+ if [ "$imgtype" = "install" ]; then
+ imgpath=images/install.img
+ else
+ imgpath=isolinux/initrd.img
+ fi
+ installimgsize=$(du -s -B 1M $CDMNT/$imgpath | awk {'print $1;'})
+
tbd=0
- if [ -e $USBMNT/images/install.img ]; then
- tbd=$(du -s -B 1M $USBMNT/images/install.img | awk {'print $1;'})
+ if [ -e $USBMNT/$imgpath ]; then
+ tbd=$(du -s -B 1M $USBMNT/$imgpath | awk {'print $1;'})
fi
if [ -e $USBMNT/$(basename $ISO) ]; then
tbd=$(($tbd + $(du -s -B 1M $USBMNT/$(basename $ISO) | awk {'print $1;'})))
fi
echo "Size of DVD image: $isosize"
- echo "Size of install.img: $installimgsize"
+ echo "Size of $imgpath: $installimgsize"
echo "Available space: $(($free + $tbd))"
if [ $(($isosize + $installimgsize)) -gt $(($free + $tbd)) ]; then
echo "ERROR: Unable to fit DVD image + install.img on available space on USB stick"
@@ -689,7 +700,9 @@ fi
if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) -a -z "$skipcopy" ]; then
echo "Copying DVD image to USB stick"
mkdir -p $USBMNT/images/
- copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
+ if [ "$imgtype" = "install" ]; then
+ copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
+ fi
if [ "$isotype" = "installer" ]; then
cp $ISO $USBMNT/
fi
@@ -725,7 +738,12 @@ fi
# DVD Installer for netinst
if [ "$isotype" = "netinst" ]; then
- sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ if [ "$imgtype" = "install" ]; then
+ sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ else
+ # The initrd has everything, so no stage2
+ sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ fi
fi
# Adjust the boot timeouts
commit 79239b788f775d064352c973877e9f50de148d4f
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Sat Jan 15 23:14:52 2011 -0600
Update documentation for xz availability.
diff --git a/docs/livecd-creator.pod b/docs/livecd-creator.pod
index dd70fb9..63ea88b 100644
--- a/docs/livecd-creator.pod
+++ b/docs/livecd-creator.pod
@@ -42,10 +42,11 @@ Defines the file system label. The default is based on the configuration name.
=item --compression-type=COMPRESSOR
-Specify a compressor recognized by mksquashfs. The default is gzip. lzma
-currently requires a custom kernel to produce a functional image. lzo works with 2.6.36+ kernels, but will generally take up more space than using gzip. If gzip
-is used, the -comp option is not passed to mksquashfs to allow the use of
-older versions of mksquashfs.
+Specify a compressor recognized by mksquashfs.
+gzip is the default and should work with all kernels.
+lzo works with 2.6.36 and later kernels.
+xz works with 2.6.38 and later kernels. lzma will only work with custom kernels.
+If gzip is used, the -comp option is not passed to mksquashfs to allow the use of older versions of mksquashfs.
=item --releasever=VER
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 94da3ac..6841c94 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -43,7 +43,7 @@ def parse_options(args):
imgopt.add_option("-f", "--fslabel", type="string", dest="fslabel",
help="File system label (default based on config name)")
imgopt.add_option("", "--compression-type", type="string", dest="compress_type",
- help="Compression type recognized by mksquashfs (default gzip, lzma needs custom kernel, lzo needs a 2.6.36+ kernel)",
+ help="Compression type recognized by mksquashfs (default gzip, xz needs a 2.6.38+ kernel, lzo needs a 2.6.36+ kernel, lzma needs custom kernel)",
default="gzip")
imgopt.add_option("", "--releasever", type="string", dest="releasever",
default=None,
commit e51a6d5cd6884ad547230d051cc2303e203fd606
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Jan 5 10:18:47 2011 -0800
Change releasever to a command line option (#667474)
The release version of the running system may not be the release you
want to build the livecd for, or the rpmdb may not be accessable from
the build environment (koji and chroot) so set the value to use for
$releasever in kickstart repo url's by passing --releasever=VER
If $releasever is used and no --releasever is passed it will try to
use the system's version. Under some circumstances (chroot environments
like koji) this isn't possible so an error will be raised.
diff --git a/docs/livecd-creator.pod b/docs/livecd-creator.pod
index 553f865..dd70fb9 100644
--- a/docs/livecd-creator.pod
+++ b/docs/livecd-creator.pod
@@ -47,6 +47,10 @@ currently requires a custom kernel to produce a functional image. lzo works with
is used, the -comp option is not passed to mksquashfs to allow the use of
older versions of mksquashfs.
+=item --releasever=VER
+
+Set the value to substitute for $releasever in kickstart repo urls
+
=back
=head1 SYSTEM DIRECTORY OPTIONS
@@ -81,12 +85,16 @@ livecd-creator \
=head1 REPO EXTENSIONS
livecd-creator provides for some extensions to the repo commands similar
-to what yum supports. The strings $arch, $basearch and $releveasever
+to what yum supports. The strings $arch, $basearch and $releasever
are replaced with the system arch, basearch and release version respectively.
+When no --releasever is passed it defaults to the current system's version.
The allows the use of repo commands such as the following:
repo --name=fedora --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
+Note that in a chroot environment (like koji) the rpmdb is not available,
+so either don't use $releasever in that case, or pass --releasever=VER
+
=head1 CONTRIBUTORS
David Zeuthen, Jeremy Katz, Douglas McClendon and a team of many other contributors. See the AUTHORS file in the source distribution for the complete list of credits.
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 20be148..9e87854 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -51,7 +51,7 @@ class ImageCreator(object):
"""
- def __init__(self, ks, name):
+ def __init__(self, ks, name, releasever=None):
"""Initialize an ImageCreator instance.
ks -- a pykickstart.KickstartParser instance; this instance will be
@@ -61,6 +61,7 @@ class ImageCreator(object):
name -- a name for the image; used for e.g. image filenames or
filesystem labels
+ releasever -- Value to substitute for $releasever in repo urls
"""
self.ks = ks
"""A pykickstart.KickstartParser instance."""
@@ -68,6 +69,8 @@ class ImageCreator(object):
self.name = name
"""A name for the image."""
+ self.releasever = releasever
+
self.tmpdir = "/var/tmp"
"""The directory in which all temporary files will be created."""
@@ -634,7 +637,7 @@ class ImageCreator(object):
"""
yum_conf = self._mktemp(prefix = "yum.conf-")
- ayum = LiveCDYum()
+ ayum = LiveCDYum(releasever=self.releasever)
ayum.setup(yum_conf, self._instroot)
for repo in kickstart.get_repos(self.ks, repo_urls):
@@ -791,7 +794,7 @@ class LoopImageCreator(ImageCreator):
"""
- def __init__(self, ks, name, fslabel = None):
+ def __init__(self, ks, name, fslabel=None, releasever=None):
"""Initialize a LoopImageCreator instance.
This method takes the same arguments as ImageCreator.__init__() with
@@ -800,7 +803,7 @@ class LoopImageCreator(ImageCreator):
fslabel -- A string used as a label for any filesystems created.
"""
- ImageCreator.__init__(self, ks, name)
+ ImageCreator.__init__(self, ks, name, releasever=releasever)
self.__fslabel = None
self.fslabel = fslabel
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 105a937..d6e28da 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -38,13 +38,13 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
- def __init__(self, *args):
+ def __init__(self, ks, name, fslabel=None, releasever=None):
"""Initialise a LiveImageCreator instance.
- This method takes the same arguments as ImageCreator.__init__().
+ This method takes the same arguments as LoopImageCreator.__init__().
"""
- LoopImageCreator.__init__(self, *args)
+ LoopImageCreator.__init__(self, ks, name, fslabel=fslabel, releasever=releasever)
self.compress_type = "gzip"
"""mksquashfs compressor to use."""
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 5f3333b..721a2d0 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -37,8 +37,12 @@ class TextProgress(object):
sys.stdout.write("...OK\n")
class LiveCDYum(yum.YumBase):
- def __init__(self):
+ def __init__(self, releasever=None):
+ """
+ releasever = optional value to use in replacing $releasever in repos
+ """
yum.YumBase.__init__(self)
+ self.releasever = releasever
def doFileLogSetup(self, uid, logfile):
# don't do the file log for the livecd as it can lead to open fds
@@ -130,7 +134,16 @@ class LiveCDYum(yum.YumBase):
# takes a variable and substitutes like yum configs do
option = option.replace("$basearch", rpmUtils.arch.getBaseArch())
option = option.replace("$arch", rpmUtils.arch.getCanonArch())
- option = option.replace("$releasever", yum.config._getsysver("/", "redhat-release"))
+ # If the url includes $releasever substitute user's value or
+ # current system's version.
+ if option.find("$releasever") > -1:
+ if self.releasever:
+ option = option.replace("$releasever", self.releasever)
+ else:
+ try:
+ option = option.replace("$releasever", yum.config._getsysver("/", "redhat-release"))
+ except yum.Errors.YumBaseError:
+ raise CreatorError("$releasever in repo url, but no releasever set")
return option
repo = yum.yumRepo.YumRepository(name)
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 64b645a..94da3ac 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -40,11 +40,14 @@ def parse_options(args):
help="Path or url to kickstart config file")
imgopt.add_option("-b", "--base-on", type="string", dest="base_on",
help="Add packages to an existing live CD iso9660 image.")
- imgopt.add_option("-f", "--fslabel", type="string", dest="fs_label",
+ imgopt.add_option("-f", "--fslabel", type="string", dest="fslabel",
help="File system label (default based on config name)")
imgopt.add_option("", "--compression-type", type="string", dest="compress_type",
help="Compression type recognized by mksquashfs (default gzip, lzma needs custom kernel, lzo needs a 2.6.36+ kernel)",
default="gzip")
+ imgopt.add_option("", "--releasever", type="string", dest="releasever",
+ default=None,
+ help="Value to substitute for $releasever in kickstart repo urls")
parser.add_option_group(imgopt)
# options related to the config of your system
@@ -75,9 +78,9 @@ def parse_options(args):
raise Usage("Kickstart file must be provided")
if options.base_on and not os.path.isfile(options.base_on):
raise Usage("Live CD ISO '%s' does not exist" %(options.base_on,))
- if options.fs_label and len(options.fs_label) > imgcreate.FSLABEL_MAXLEN:
+ if options.fslabel and len(options.fslabel) > imgcreate.FSLABEL_MAXLEN:
raise Usage("CD labels are limited to 32 characters")
- if options.fs_label and options.fs_label.find(" ") != -1:
+ if options.fslabel and options.fslabel.find(" ") != -1:
raise Usage("CD labels cannot contain spaces.")
return options
@@ -100,22 +103,22 @@ def main():
print >> sys.stderr, "You must run livecd-creator as root"
return 1
- if options.fs_label:
- fs_label = options.fs_label
- name = fs_label
+ if options.fslabel:
+ fslabel = options.fslabel
+ name = fslabel
else:
name = imgcreate.build_name(options.kscfg, "livecd-")
- fs_label = imgcreate.build_name(options.kscfg,
+ fslabel = imgcreate.build_name(options.kscfg,
"livecd-",
maxlen = imgcreate.FSLABEL_MAXLEN,
suffix = "%s-%s" %(os.uname()[4], time.strftime("%Y%m%d%H%M")))
- logging.info("Using label '%s' and name '%s'" % (fs_label, name))
+ logging.info("Using label '%s' and name '%s'" % (fslabel, name))
ks = imgcreate.read_kickstart(options.kscfg)
- creator = imgcreate.LiveImageCreator(ks, name, fs_label)
+ creator = imgcreate.LiveImageCreator(ks, name, fslabel=fslabel, releasever=options.releasever)
creator.tmpdir = os.path.abspath(options.tmpdir)
if not os.path.exists(creator.tmpdir):
makedirs(creator.tmpdir)
commit cbd356fa84632c9b1a53f1c5bddab451a2e98777
Author: David Lehman <dlehman(a)redhat.com>
Date: Fri Dec 17 10:21:02 2010 -0600
Assign a device-mapper UUID w/ subsystem prefix to the dm snapshot.
Creators of device-mapper maps/devices should set a device-mapper
UUID for their devices which include a prefix to identify the
subsystem responsible for the device. The format generally used is
$SUBSYSTEM-$MAPNAME, with subsystem being all caps.
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index 9f9d8ea..9c60501 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -525,7 +525,8 @@ class DeviceMapperSnapshot(object):
self.imgloop.device,
self.cowloop.device)
- args = ["/sbin/dmsetup", "create", self.__name, "--table", table]
+ args = ["/sbin/dmsetup", "create", self.__name,
+ "--uuid", "LIVECD-%s" % self.__name, "--table", table]
if subprocess.call(args) != 0:
self.cowloop.cleanup()
self.imgloop.cleanup()
commit e0dcf666488b730291acba9993dc8cde3cb4c290
Author: David Lehman <dlehman(a)redhat.com>
Date: Fri Dec 17 10:21:01 2010 -0600
Fix git URLs to match reality.
diff --git a/HACKING b/HACKING
index 0e88c32..e912112 100644
--- a/HACKING
+++ b/HACKING
@@ -4,11 +4,11 @@ SOURCE CONTROL MANAGEMENT
This project is stored in git and can be checked out using
- git clone git://git.fedoraproject.org/git/hosted/livecd
+ git clone git://git.fedorahosted.org/git/livecd
or if you have write access you might want to use
- git clone ssh://git.fedoraproject.org/git/hosted/livecd
+ git clone ssh://git.fedorahosted.org/git/livecd
Change history etc. can be obtained from the web interface
12 years, 9 months
Branch 'f15-branch' - tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
New commits:
commit e3c447281b86b2521f029741393f5791b9d9861c
Author: Jan Kratochvil <jan.kratochvil(a)redhat.com>
Date: Fri Feb 18 10:33:46 2011 +0100
Fixup livedir support (#679023)
When using --livedir to set the target LiveOS directory don't use the
same for the source. The source is always named LiveOS
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 700eac4..532022c 100755
--- 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
12 years, 9 months
tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 0be9e3b75114912ed4e6b539ba70798661f8ab01
Author: Jan Kratochvil <jan.kratochvil(a)redhat.com>
Date: Fri Feb 18 10:33:46 2011 +0100
Fixup livedir support (#679023)
When using --livedir to set the target LiveOS directory don't use the
same for the source. The source is always named LiveOS
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 700eac4..532022c 100755
--- 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
12 years, 9 months
Changes to 'refs/tags/livecd-tools-14.2'
by Brian C. Lane
Tag 'livecd-tools-14.2' created by Brian C. Lane <bcl(a)redhat.com> at 2011-02-19 02:09 +0000
Tag as livecd-tools-14.2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUATV8mVhF+jBaO/jp/AQJj1gf9GdwqinosGjeObeYGbViHzygZIH/2lkpA
RP1AF8hY2RNgDnIMm+ugwhNm8wNbKhcEgz5s1Nz+NFz12bAhK0Ei2z8AtIG2Dokj
hst+BV5AWQu4uEy325gfihJrAvi/vAjAb/2JoD/BUGjnYMGrktYTNrUyCdeoVExn
gOQVoBVOpMMtVmS+kb0+LCBCtTeRbrl4B9tj9HwkY54pWXzAZykdqqkLkL0rk6Ag
SlvV2StcnYQKMFMOz6qBGTuPuHuvrtD6V4S8r8wqTm9ko7gZ2y+cVmg6AOJikMlD
1YxpyrND9XmvKZlT275yjkvxQXo2BgLSULvnEco2W0yApNYVybC90w==
=OpxY
-----END PGP SIGNATURE-----
Changes since livecd-tools-14.1:
Brian C. Lane (9):
Change releasever to a command line option (#667474)
Check for one big initrd.img (#671900)
Align start of partition at 1MiB (#668967)
Source may be a file or a block device, mount accordingly
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 14.2
Bruce Jerrick (1):
Fix skipcopy usage with DVD iso (#644194)
Bruno Wolff III (1):
Update documentation for xz availability.
David Lehman (2):
Fix git URLs to match reality.
Assign a device-mapper UUID w/ subsystem prefix to the dm snapshot.
---
HACKING | 4 +-
Makefile | 2 -
docs/livecd-creator.pod | 19 +++++++---
imgcreate/creator.py | 13 ++++---
imgcreate/fs.py | 3 +
imgcreate/live.py | 10 +++--
imgcreate/yuminst.py | 17 ++++++++-
tools/livecd-creator | 23 +++++++-----
tools/livecd-iso-to-disk.sh | 79 +++++++++++++++++++++++++++++++++-----------
9 files changed, 121 insertions(+), 49 deletions(-)
---
12 years, 9 months
Branch 'f14-branch' - 13 commits - docs/livecd-creator.pod HACKING imgcreate/creator.py imgcreate/fs.py imgcreate/live.py imgcreate/yuminst.py Makefile tools/livecd-creator tools/livecd-iso-to-disk.sh
by Brian C. Lane
HACKING | 4 +-
Makefile | 2 -
docs/livecd-creator.pod | 19 +++++++---
imgcreate/creator.py | 13 ++++---
imgcreate/fs.py | 3 +
imgcreate/live.py | 10 +++--
imgcreate/yuminst.py | 17 ++++++++-
tools/livecd-creator | 23 +++++++-----
tools/livecd-iso-to-disk.sh | 79 +++++++++++++++++++++++++++++++++-----------
9 files changed, 121 insertions(+), 49 deletions(-)
New commits:
commit 050b94274c0616f98f995732ade967ba18d4d9a3
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Fri Feb 18 16:47:35 2011 -0800
Version 14.2
diff --git a/Makefile b/Makefile
index 87e8448..de4dd5e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 14.1
+VERSION = 14.2
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit c0e20e01eecb5300438f5234a4f297c6c1d3c51d
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 1077455..a2e7d34 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -492,15 +492,23 @@ ISO=$(readlink -f "$1")
USBDEV=$(readlink -f "$2")
if [ -z "$ISO" ]; then
+ echo "Missing source"
usage
fi
if [ ! -b "$ISO" -a ! -f "$ISO" ]; then
+ echo "$ISO is not a file or block device"
usage
fi
# FIXME: If --format is given, we shouldn't care and just use /dev/foo1
-if [ -z "$USBDEV" -o ! -b "$USBDEV" ]; then
+if [ -z "$USBDEV" ]; then
+ echo "Missing target device"
+ usage
+fi
+
+if [ ! -b "$USBDEV" ]; then
+ echo "$USBDEV is not a block device"
usage
fi
commit a482c438af1c17ae4becbfa7124e8770c8f29443
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 6dc27ce..1077455 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -639,7 +639,11 @@ fi
# Verify available space for DVD installer
if [ "$isotype" = "installer" ]; then
- isosize=$(du -s -B 1M $ISO | awk {'print $1;'})
+ if [ -z "$skipcopy" ]; then
+ isosize=$(du -s -B 1M $ISO | awk {'print $1;'})
+ else
+ isosize=0
+ fi
if [ "$imgtype" = "install" ]; then
imgpath=images/install.img
else
@@ -708,13 +712,13 @@ if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
fi
# DVD installer copy
-if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) -a -z "$skipcopy" ]; then
+if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) ]; then
echo "Copying DVD image to USB stick"
mkdir -p $USBMNT/images/
if [ "$imgtype" = "install" ]; then
copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
fi
- if [ "$isotype" = "installer" ]; then
+ if [ "$isotype" = "installer" -a -z "$skipcopy" ]; then
cp $ISO $USBMNT/
fi
sync
commit fb64acf66064b09750f21172e731fe0989f8cfed
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 9e87854..b7436e6 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -732,7 +732,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)
@@ -743,6 +742,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 52528fddd176aee57eb6152c460842701e35b7a5
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 d6e28da..0905dcc 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -70,7 +70,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"
commit 07ae6f112a06e5f7ef7f6565bbab5536d4c1d76e
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 2448cbc..6dc27ce 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -52,6 +52,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
commit fba99d3508bc27e2ad65bf98e81733f90f70cc6c
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Feb 15 11:51:48 2011 -0800
Source may be a file or a block device, mount accordingly
When the source is a block device don't mount it loopback.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 1879e83..2448cbc 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -561,7 +561,14 @@ fi
# FIXME: would be better if we had better mountpoints
CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
-mount -o loop,ro "$ISO" $CDMNT || exitclean
+if [ -b $ISO ]; then
+ mount -o ro "$ISO" $CDMNT || exitclean
+elif [ -f $ISO ]; then
+ mount -o loop,ro "$ISO" $CDMNT || exitclean
+else
+ echo "$ISO is not a file or block device."
+ exitclean
+fi
USBMNT=$(mktemp -d /media/usbdev.XXXXXX)
mount $mountopts $USBDEV $USBMNT || exitclean
commit c5cde3844e1be8299c283df536c44cca9f1f1581
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Fri Feb 4 17:45:00 2011 -0800
Align start of partition at 1MiB (#668967)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 853c063..1879e83 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -172,7 +172,7 @@ createGPTLayout() {
/sbin/parted --script $device mklabel gpt
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
+ /sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 1048576 $(($size - 1048576)) set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -195,7 +195,7 @@ createMSDOSLayout() {
/sbin/parted --script $device mklabel msdos
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
+ /sbin/parted --script $device unit b mkpart primary fat32 1048576 $(($size - 1048576)) set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -222,7 +222,7 @@ createEXTFSLayout() {
/sbin/parted --script $device mklabel msdos
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
+ /sbin/parted --script $device unit b mkpart primary ext2 1048576 $(($size - 1048576)) set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
commit 9d56030152c2a707b61c16808ea078c1bbd0c89d
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Jan 26 15:50:48 2011 -0800
Check for one big initrd.img (#671900)
rawhide now uses one big initrd.img instead of splitting it into
initrd.img and install.img
This checks for the existance of only initrd.img and skips trying to
copy the install.img
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index b730b52..853c063 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -341,14 +341,18 @@ detectisotype() {
isotype=live
return
fi
- if [ -e $CDMNT/images/install.img ]; then
+ if [ -e $CDMNT/images/install.img -o $CDMNT/isolinux/initrd.img ]; then
+ imgtype=install
if [ -e $CDMNT/Packages ]; then
isotype=installer
- return
- else
+ else
isotype=netinst
- return
- fi
+ fi
+ if [ ! -e $CDMNT/images/install.img ]; then
+ echo "$ISO uses initrd.img w/o install.img"
+ imgtype=initrd
+ fi
+ return
fi
echo "ERROR: $ISO does not appear to be a Live image or DVD installer."
exitclean
@@ -390,6 +394,7 @@ homesizemb=0
swapsizemb=0
overlaysizemb=0
isotype=
+imgtype=
LIVEOS=LiveOS
HOMEFILE="home.img"
@@ -624,16 +629,22 @@ fi
# Verify available space for DVD installer
if [ "$isotype" = "installer" ]; then
isosize=$(du -s -B 1M $ISO | awk {'print $1;'})
- installimgsize=$(du -s -B 1M $CDMNT/images/install.img | awk {'print $1;'})
+ if [ "$imgtype" = "install" ]; then
+ imgpath=images/install.img
+ else
+ imgpath=isolinux/initrd.img
+ fi
+ installimgsize=$(du -s -B 1M $CDMNT/$imgpath | awk {'print $1;'})
+
tbd=0
- if [ -e $USBMNT/images/install.img ]; then
- tbd=$(du -s -B 1M $USBMNT/images/install.img | awk {'print $1;'})
+ if [ -e $USBMNT/$imgpath ]; then
+ tbd=$(du -s -B 1M $USBMNT/$imgpath | awk {'print $1;'})
fi
if [ -e $USBMNT/$(basename $ISO) ]; then
tbd=$(($tbd + $(du -s -B 1M $USBMNT/$(basename $ISO) | awk {'print $1;'})))
fi
echo "Size of DVD image: $isosize"
- echo "Size of install.img: $installimgsize"
+ echo "Size of $imgpath: $installimgsize"
echo "Available space: $(($free + $tbd))"
if [ $(($isosize + $installimgsize)) -gt $(($free + $tbd)) ]; then
echo "ERROR: Unable to fit DVD image + install.img on available space on USB stick"
@@ -689,7 +700,9 @@ fi
if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) -a -z "$skipcopy" ]; then
echo "Copying DVD image to USB stick"
mkdir -p $USBMNT/images/
- copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
+ if [ "$imgtype" = "install" ]; then
+ copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
+ fi
if [ "$isotype" = "installer" ]; then
cp $ISO $USBMNT/
fi
@@ -725,7 +738,12 @@ fi
# DVD Installer for netinst
if [ "$isotype" = "netinst" ]; then
- sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ if [ "$imgtype" = "install" ]; then
+ sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ else
+ # The initrd has everything, so no stage2
+ sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ fi
fi
# Adjust the boot timeouts
commit 03b2c1244cddd3ea867d9f9bcbcd080ff58b91ee
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Sat Jan 15 23:14:52 2011 -0600
Update documentation for xz availability.
diff --git a/docs/livecd-creator.pod b/docs/livecd-creator.pod
index dd70fb9..63ea88b 100644
--- a/docs/livecd-creator.pod
+++ b/docs/livecd-creator.pod
@@ -42,10 +42,11 @@ Defines the file system label. The default is based on the configuration name.
=item --compression-type=COMPRESSOR
-Specify a compressor recognized by mksquashfs. The default is gzip. lzma
-currently requires a custom kernel to produce a functional image. lzo works with 2.6.36+ kernels, but will generally take up more space than using gzip. If gzip
-is used, the -comp option is not passed to mksquashfs to allow the use of
-older versions of mksquashfs.
+Specify a compressor recognized by mksquashfs.
+gzip is the default and should work with all kernels.
+lzo works with 2.6.36 and later kernels.
+xz works with 2.6.38 and later kernels. lzma will only work with custom kernels.
+If gzip is used, the -comp option is not passed to mksquashfs to allow the use of older versions of mksquashfs.
=item --releasever=VER
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 94da3ac..6841c94 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -43,7 +43,7 @@ def parse_options(args):
imgopt.add_option("-f", "--fslabel", type="string", dest="fslabel",
help="File system label (default based on config name)")
imgopt.add_option("", "--compression-type", type="string", dest="compress_type",
- help="Compression type recognized by mksquashfs (default gzip, lzma needs custom kernel, lzo needs a 2.6.36+ kernel)",
+ help="Compression type recognized by mksquashfs (default gzip, xz needs a 2.6.38+ kernel, lzo needs a 2.6.36+ kernel, lzma needs custom kernel)",
default="gzip")
imgopt.add_option("", "--releasever", type="string", dest="releasever",
default=None,
commit ce06c3d394ab28819ecf4f2457beb1d820854ed7
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Jan 5 10:18:47 2011 -0800
Change releasever to a command line option (#667474)
The release version of the running system may not be the release you
want to build the livecd for, or the rpmdb may not be accessable from
the build environment (koji and chroot) so set the value to use for
$releasever in kickstart repo url's by passing --releasever=VER
If $releasever is used and no --releasever is passed it will try to
use the system's version. Under some circumstances (chroot environments
like koji) this isn't possible so an error will be raised.
diff --git a/docs/livecd-creator.pod b/docs/livecd-creator.pod
index 553f865..dd70fb9 100644
--- a/docs/livecd-creator.pod
+++ b/docs/livecd-creator.pod
@@ -47,6 +47,10 @@ currently requires a custom kernel to produce a functional image. lzo works with
is used, the -comp option is not passed to mksquashfs to allow the use of
older versions of mksquashfs.
+=item --releasever=VER
+
+Set the value to substitute for $releasever in kickstart repo urls
+
=back
=head1 SYSTEM DIRECTORY OPTIONS
@@ -81,12 +85,16 @@ livecd-creator \
=head1 REPO EXTENSIONS
livecd-creator provides for some extensions to the repo commands similar
-to what yum supports. The strings $arch, $basearch and $releveasever
+to what yum supports. The strings $arch, $basearch and $releasever
are replaced with the system arch, basearch and release version respectively.
+When no --releasever is passed it defaults to the current system's version.
The allows the use of repo commands such as the following:
repo --name=fedora --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
+Note that in a chroot environment (like koji) the rpmdb is not available,
+so either don't use $releasever in that case, or pass --releasever=VER
+
=head1 CONTRIBUTORS
David Zeuthen, Jeremy Katz, Douglas McClendon and a team of many other contributors. See the AUTHORS file in the source distribution for the complete list of credits.
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 20be148..9e87854 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -51,7 +51,7 @@ class ImageCreator(object):
"""
- def __init__(self, ks, name):
+ def __init__(self, ks, name, releasever=None):
"""Initialize an ImageCreator instance.
ks -- a pykickstart.KickstartParser instance; this instance will be
@@ -61,6 +61,7 @@ class ImageCreator(object):
name -- a name for the image; used for e.g. image filenames or
filesystem labels
+ releasever -- Value to substitute for $releasever in repo urls
"""
self.ks = ks
"""A pykickstart.KickstartParser instance."""
@@ -68,6 +69,8 @@ class ImageCreator(object):
self.name = name
"""A name for the image."""
+ self.releasever = releasever
+
self.tmpdir = "/var/tmp"
"""The directory in which all temporary files will be created."""
@@ -634,7 +637,7 @@ class ImageCreator(object):
"""
yum_conf = self._mktemp(prefix = "yum.conf-")
- ayum = LiveCDYum()
+ ayum = LiveCDYum(releasever=self.releasever)
ayum.setup(yum_conf, self._instroot)
for repo in kickstart.get_repos(self.ks, repo_urls):
@@ -791,7 +794,7 @@ class LoopImageCreator(ImageCreator):
"""
- def __init__(self, ks, name, fslabel = None):
+ def __init__(self, ks, name, fslabel=None, releasever=None):
"""Initialize a LoopImageCreator instance.
This method takes the same arguments as ImageCreator.__init__() with
@@ -800,7 +803,7 @@ class LoopImageCreator(ImageCreator):
fslabel -- A string used as a label for any filesystems created.
"""
- ImageCreator.__init__(self, ks, name)
+ ImageCreator.__init__(self, ks, name, releasever=releasever)
self.__fslabel = None
self.fslabel = fslabel
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 105a937..d6e28da 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -38,13 +38,13 @@ class LiveImageCreatorBase(LoopImageCreator):
"""
- def __init__(self, *args):
+ def __init__(self, ks, name, fslabel=None, releasever=None):
"""Initialise a LiveImageCreator instance.
- This method takes the same arguments as ImageCreator.__init__().
+ This method takes the same arguments as LoopImageCreator.__init__().
"""
- LoopImageCreator.__init__(self, *args)
+ LoopImageCreator.__init__(self, ks, name, fslabel=fslabel, releasever=releasever)
self.compress_type = "gzip"
"""mksquashfs compressor to use."""
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 5f3333b..721a2d0 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -37,8 +37,12 @@ class TextProgress(object):
sys.stdout.write("...OK\n")
class LiveCDYum(yum.YumBase):
- def __init__(self):
+ def __init__(self, releasever=None):
+ """
+ releasever = optional value to use in replacing $releasever in repos
+ """
yum.YumBase.__init__(self)
+ self.releasever = releasever
def doFileLogSetup(self, uid, logfile):
# don't do the file log for the livecd as it can lead to open fds
@@ -130,7 +134,16 @@ class LiveCDYum(yum.YumBase):
# takes a variable and substitutes like yum configs do
option = option.replace("$basearch", rpmUtils.arch.getBaseArch())
option = option.replace("$arch", rpmUtils.arch.getCanonArch())
- option = option.replace("$releasever", yum.config._getsysver("/", "redhat-release"))
+ # If the url includes $releasever substitute user's value or
+ # current system's version.
+ if option.find("$releasever") > -1:
+ if self.releasever:
+ option = option.replace("$releasever", self.releasever)
+ else:
+ try:
+ option = option.replace("$releasever", yum.config._getsysver("/", "redhat-release"))
+ except yum.Errors.YumBaseError:
+ raise CreatorError("$releasever in repo url, but no releasever set")
return option
repo = yum.yumRepo.YumRepository(name)
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 64b645a..94da3ac 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -40,11 +40,14 @@ def parse_options(args):
help="Path or url to kickstart config file")
imgopt.add_option("-b", "--base-on", type="string", dest="base_on",
help="Add packages to an existing live CD iso9660 image.")
- imgopt.add_option("-f", "--fslabel", type="string", dest="fs_label",
+ imgopt.add_option("-f", "--fslabel", type="string", dest="fslabel",
help="File system label (default based on config name)")
imgopt.add_option("", "--compression-type", type="string", dest="compress_type",
help="Compression type recognized by mksquashfs (default gzip, lzma needs custom kernel, lzo needs a 2.6.36+ kernel)",
default="gzip")
+ imgopt.add_option("", "--releasever", type="string", dest="releasever",
+ default=None,
+ help="Value to substitute for $releasever in kickstart repo urls")
parser.add_option_group(imgopt)
# options related to the config of your system
@@ -75,9 +78,9 @@ def parse_options(args):
raise Usage("Kickstart file must be provided")
if options.base_on and not os.path.isfile(options.base_on):
raise Usage("Live CD ISO '%s' does not exist" %(options.base_on,))
- if options.fs_label and len(options.fs_label) > imgcreate.FSLABEL_MAXLEN:
+ if options.fslabel and len(options.fslabel) > imgcreate.FSLABEL_MAXLEN:
raise Usage("CD labels are limited to 32 characters")
- if options.fs_label and options.fs_label.find(" ") != -1:
+ if options.fslabel and options.fslabel.find(" ") != -1:
raise Usage("CD labels cannot contain spaces.")
return options
@@ -100,22 +103,22 @@ def main():
print >> sys.stderr, "You must run livecd-creator as root"
return 1
- if options.fs_label:
- fs_label = options.fs_label
- name = fs_label
+ if options.fslabel:
+ fslabel = options.fslabel
+ name = fslabel
else:
name = imgcreate.build_name(options.kscfg, "livecd-")
- fs_label = imgcreate.build_name(options.kscfg,
+ fslabel = imgcreate.build_name(options.kscfg,
"livecd-",
maxlen = imgcreate.FSLABEL_MAXLEN,
suffix = "%s-%s" %(os.uname()[4], time.strftime("%Y%m%d%H%M")))
- logging.info("Using label '%s' and name '%s'" % (fs_label, name))
+ logging.info("Using label '%s' and name '%s'" % (fslabel, name))
ks = imgcreate.read_kickstart(options.kscfg)
- creator = imgcreate.LiveImageCreator(ks, name, fs_label)
+ creator = imgcreate.LiveImageCreator(ks, name, fslabel=fslabel, releasever=options.releasever)
creator.tmpdir = os.path.abspath(options.tmpdir)
if not os.path.exists(creator.tmpdir):
makedirs(creator.tmpdir)
commit 572d1c03cb498820bcb414951e6b6da55addeef6
Author: David Lehman <dlehman(a)redhat.com>
Date: Fri Dec 17 10:21:02 2010 -0600
Assign a device-mapper UUID w/ subsystem prefix to the dm snapshot.
Creators of device-mapper maps/devices should set a device-mapper
UUID for their devices which include a prefix to identify the
subsystem responsible for the device. The format generally used is
$SUBSYSTEM-$MAPNAME, with subsystem being all caps.
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index 9f9d8ea..9c60501 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -525,7 +525,8 @@ class DeviceMapperSnapshot(object):
self.imgloop.device,
self.cowloop.device)
- args = ["/sbin/dmsetup", "create", self.__name, "--table", table]
+ args = ["/sbin/dmsetup", "create", self.__name,
+ "--uuid", "LIVECD-%s" % self.__name, "--table", table]
if subprocess.call(args) != 0:
self.cowloop.cleanup()
self.imgloop.cleanup()
commit 38f3ebb4949233ee75c52ee7335deabf71ae59aa
Author: David Lehman <dlehman(a)redhat.com>
Date: Fri Dec 17 10:21:01 2010 -0600
Fix git URLs to match reality.
diff --git a/HACKING b/HACKING
index 0e88c32..e912112 100644
--- a/HACKING
+++ b/HACKING
@@ -4,11 +4,11 @@ SOURCE CONTROL MANAGEMENT
This project is stored in git and can be checked out using
- git clone git://git.fedoraproject.org/git/hosted/livecd
+ git clone git://git.fedorahosted.org/git/livecd
or if you have write access you might want to use
- git clone ssh://git.fedoraproject.org/git/hosted/livecd
+ git clone ssh://git.fedorahosted.org/git/livecd
Change history etc. can be obtained from the web interface
12 years, 9 months
Branch 'f15-branch' - 7 commits - imgcreate/creator.py imgcreate/live.py Makefile tools/edit-livecd tools/livecd-iso-to-disk.sh
by Brian C. Lane
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(-)
New commits:
commit b52bcec7dc254ae653fc0d08d239072f8a71be37
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Fri Feb 18 14:09:48 2011 -0800
Version 15.5
diff --git a/Makefile b/Makefile
index be948ab..5d360aa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 15.4
+VERSION = 15.5
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit ed957cf59bbcfc5a8d3e73e51daca91d98cec06b
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 1aa9744bb05d29f34a67c35ce67492192dc9529d
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 b8bfa24dba71036ddd941b8cdf773f6e44e2428e
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 9a98af9cee78fa48442e513a4128eb5d794d6f40
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"
commit c15e1f51924286abdf5ba42fda3bd82f6d6943b0
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
commit a6d7414ed5ecf8c495d4bd3be7b132a1dc8fa6aa
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
12 years, 9 months