livecd-tools build pushed
by Jeremy Katz
I've pushed a build of current git of livecd-tools into rawhide so that
it can start to get some more testing beyond those of us who are using
git. While I don't know of anything big and looming as far as changes
to the API, I reserve the right to change it until we're a lot closer to
finished with Fedora 9.
Now that it's pushed out, though, there are three more things that I
want to get into the tree feature-wise for Fedora 9 (and thus, over the
next couple of weeks) and otherwise, just focus on finding and fixing up
any latent bugs
1) Get Rich's patch from yesterday/today in. I mostly just didn't want
to rock the boat since I was pretty comfortable with things as they were
but should just be a matter of me doing the commit
2) Get dmc's bits for persistence in
3) Get some of Luke's work for allowing livecd-iso-to-disk to also be
useful on Windows (and have a GUI) into the main livecd repo. This is
perhaps a little more controversial, but I really don't see the value of
maintaining this elsewhere and having two of these scripts. Other
opinions welcome, though.
Jeremy
16 years, 2 months
livecd-tools.spec Makefile tools/livecd-iso-to-pxeboot.sh tools/mayflower
by Jeremy Katz
Makefile | 1
livecd-tools.spec | 1
tools/livecd-iso-to-pxeboot.sh | 129 +++++++++++++++++++++++++++++++++++++++++
tools/mayflower | 3
4 files changed, 133 insertions(+), 1 deletion(-)
New commits:
commit e0f0269d3a8f8f310e7c5fdfb8af45892f419c13
Author: Richard W.M. Jones <rjones(a)redhat.com>
Date: Tue Feb 12 09:50:32 2008 +0000
Add support for pxeboot
Myself and Chris Lalancette looked into this in some detail and came up
with two different ways to do this. This is the simpler of the two
methods and results in the least invasive changes to livecd-creator --
just a single line patch to mayflower and a 100-or-so-line extra script
called 'livecd-iso-to-pxeboot' which works analogously to
'livecd-iso-to-disk'.
The way it works is to bundle the complete ISO image inside the initrd.
The kernel and (bloated) initrd are downloaded using PXE in the normal
way, and the init script finds and loopback-mounts the ISO image and
booting continues as normal.
diff --git a/Makefile b/Makefile
index b04cba4..050fe88 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ install:
$(INSTALL_PROGRAM) -D tools/livecd-creator $(DESTDIR)/usr/bin/livecd-creator
$(INSTALL_PROGRAM) -D tools/image-creator $(DESTDIR)/usr/bin/image-creator
$(INSTALL_PROGRAM) -D tools/livecd-iso-to-disk.sh $(DESTDIR)/usr/bin/livecd-iso-to-disk
+ $(INSTALL_PROGRAM) -D tools/livecd-iso-to-pxeboot.sh $(DESTDIR)/usr/bin/livecd-iso-to-pxeboot
$(INSTALL_PROGRAM) -D tools/mayflower $(DESTDIR)/usr/lib/livecd-creator/mayflower
$(INSTALL_DATA) -D AUTHORS $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/AUTHORS
$(INSTALL_DATA) -D COPYING $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/COPYING
diff --git a/livecd-tools.spec b/livecd-tools.spec
index 7aa5b40..a789460 100644
--- a/livecd-tools.spec
+++ b/livecd-tools.spec
@@ -52,6 +52,7 @@ rm -rf $RPM_BUILD_ROOT
%doc AUTHORS COPYING README HACKING
%{_bindir}/livecd-creator
%{_bindir}/livecd-iso-to-disk
+%{_bindir}/livecd-iso-to-pxeboot
%dir /usr/lib/livecd-creator
/usr/lib/livecd-creator/mayflower
%dir %{_datadir}/livecd-tools
diff --git a/tools/livecd-iso-to-pxeboot.sh b/tools/livecd-iso-to-pxeboot.sh
new file mode 100755
index 0000000..b1ccf5f
--- /dev/null
+++ b/tools/livecd-iso-to-pxeboot.sh
@@ -0,0 +1,129 @@
+#!/bin/bash
+# Convert a live CD iso so that it can be booted over the network
+# using PXELINUX.
+# Copyright 2008 Red Hat, Inc.
+# Written by Richard W.M. Jones <rjones(a)redhat.com>
+# Based on a script by Jeremy Katz <katzj(a)redhat.com>
+# Based on original work by Chris Lalancette <clalance(a)redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+export PATH=/sbin:/usr/sbin:$PATH
+
+usage() {
+ echo "Usage: livecd-iso-to-pxeboot <isopath>"
+ exit 1
+}
+
+cleanup() {
+ [ -d "$CDMNT" ] && umount $CDMNT && rmdir $CDMNT
+}
+
+exitclean() {
+ echo "Cleaning up to exit..."
+ cleanup
+ exit 1
+}
+
+if [ $(id -u) != 0 ]; then
+ echo "You need to be root to run this script."
+ exit 1
+fi
+
+# Check pxelinux.0 exists.
+if [ ! -f /usr/lib/syslinux/pxelinux.0 ]; then
+ echo "Warning: /usr/lib/syslinux/pxelinux.0 not found."
+ echo "Make sure syslinux or pxelinux is installed on this system."
+fi
+
+while [ $# -gt 1 ]; do
+ case "$1" in
+ *) usage ;;
+ esac
+ shift
+done
+
+ISO="$1"
+
+if [ -z "$ISO" -o ! -e "$ISO" ]; then
+ usage
+fi
+
+if [ -d tftpboot ]; then
+ echo "Subdirectory tftpboot exists already. I won't overwrite it."
+ echo "Delete the subdirectory before running."
+ exit 1
+fi
+
+mkdir tftpboot
+
+# Mount the ISO.
+# FIXME: would be better if we had better mountpoints
+CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
+mount -o loop "$ISO" $CDMNT || exitclean
+
+trap exitclean SIGINT SIGTERM
+
+# Does it look like an ISO?
+if [ ! -d $CDMNT/isolinux -o ! -f $CDMNT/isolinux/initrd0.img ]; then
+ echo "The ISO image doesn't look like a LiveCD ISO image to me."
+ exitclean
+fi
+
+# Create a cpio archive of just the ISO and append it to the
+# initrd image. The Linux kernel will do the right thing,
+# aggregating both cpio archives (initrd + ISO) into a single
+# filesystem.
+ISOBASENAME=`basename "$ISO"`
+ISODIRNAME=`dirname "$ISO"`
+( cd "$ISODIRNAME" && echo "$ISOBASENAME" | cpio -H newc --quiet -o ) |
+ gzip -9 |
+ cat $CDMNT/isolinux/initrd0.img - > tftpboot/initrd0.img
+
+# Kernel image.
+cp $CDMNT/isolinux/vmlinuz0 tftpboot/vmlinuz0
+
+# pxelinux bootloader.
+if [ -f /usr/lib/syslinux/pxelinux.0 ]; then
+ cp /usr/lib/syslinux/pxelinux.0 tftpboot
+else
+ echo "Warning: You need to add pxelinux.0 to tftpboot/ subdirectory"
+fi
+
+# pxelinux configuration.
+mkdir tftpboot/pxelinux.cfg
+cat > tftpboot/pxelinux.cfg/default <<EOF
+DEFAULT pxeboot
+TIMEOUT 20
+PROMPT 0
+LABEL pxeboot
+ KERNEL vmlinuz0
+ APPEND initrd=initrd0.img root=/$ISOBASENAME rootfstype=iso9660 rootflags=loop
+ONERROR LOCALBOOT 0
+EOF
+
+# All done, clean up.
+umount $CDMNT
+rmdir $CDMNT
+
+echo "Your pxeboot image is complete."
+echo
+echo "Copy tftpboot/ subdirectory to /tftpboot or a subdirectory of /tftpboot."
+echo "Set up your DHCP, TFTP and PXE server to serve /tftpboot/.../pxeboot.0"
+echo
+echo "Note: The initrd image contains the whole CD ISO and is consequently"
+echo "very large. You will notice when pxebooting that initrd can take a"
+echo "long time to download. This is normal behaviour."
+
+exit 0
diff --git a/tools/mayflower b/tools/mayflower
index 2e46098..162d4d4 100755
--- a/tools/mayflower
+++ b/tools/mayflower
@@ -477,7 +477,8 @@ if [ "$shell" == "1" ] ; then
fi
# don't wait for "mtd0" as no device file will appear
-if [ "$root" != "mtd0" ] ; then
+# and don't worry about this if $thingtomount is a regular file
+if [ "$root" != "mtd0" -a ! -f "$thingtomount" ] ; then
# If we don't have the /dev/root link.. ask the user to create..
if [ "$waitforsymlink" != "1" ] ; then
16 years, 2 months
Changes to 'refs/tags/livecd-tools-012'
by Jeremy Katz
Tag 'livecd-tools-012' created by Jeremy Katz <katzj(a)redhat.com> at 2007-09-25 21:38 -0700
livecd-tools-012
Changes since livecd-tools-011-71:
---
0 files changed
---
16 years, 2 months
2 commits - imgcreate/yuminst.py livecd-tools.spec Makefile
by Jeremy Katz
Makefile | 2 +-
imgcreate/yuminst.py | 2 +-
livecd-tools.spec | 11 ++++++++++-
3 files changed, 12 insertions(+), 3 deletions(-)
New commits:
commit 2130d64d02f1593d73594f0b2f48fe1fc0686ad8
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue Feb 12 13:30:58 2008 -0500
Bump version
diff --git a/Makefile b/Makefile
index 393d6db..b04cba4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 013
+VERSION = 014
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
diff --git a/livecd-tools.spec b/livecd-tools.spec
index 8201cc8..7aa5b40 100644
--- a/livecd-tools.spec
+++ b/livecd-tools.spec
@@ -4,7 +4,7 @@
Summary: Tools for building live CD's
Name: livecd-tools
-Version: 013
+Version: 014
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Base
@@ -63,6 +63,15 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/imgcreate/*.pyc
%changelog
+* Tue Feb 12 2008 Jeremy Katz <katzj(a)redhat.com> - 014-1
+- Rework to provide a python API for use by other tools (thanks to
+ markmc for a lot of the legwork here)
+- Fix creation of images with ext2 filesystems and no SELinux
+- Don't require a yum-cache directory inside of the cachedir (#430066)
+- Many config updates for rawhide
+- Allow running live images from MMC/SD (#430444)
+- Don't let a non-standard TMPDIR break things (Jim Meyering)
+
* Mon Oct 29 2007 Jeremy Katz <katzj(a)redhat.com> - 013-1
- Lots of config updates
- Support 'device foo' to say what modules go in the initramfs
commit 9dfce5f149205bdbc1b1761dd637b23772f6e5dd
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue Feb 12 13:26:59 2008 -0500
Fix bad import
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index c42e77e..4c9ae40 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -23,7 +23,7 @@ import yum
import rpmUtils
import pykickstart.parser
-from yuminst import *
+from imgcreate.errors import *
class TextProgress(object):
def start(self, filename, url, *args, **kwargs):
16 years, 2 months
3 commits - config/livecd-fedora-base-desktop.ks imgcreate/yuminst.py
by Jeremy Katz
config/livecd-fedora-base-desktop.ks | 3 ---
imgcreate/yuminst.py | 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 843df455573d95e615f2c573662e82f8cfca401f
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue Feb 12 08:46:39 2008 -0500
Ensure that HOME is set to /
Some package %post scripts end up using the value of $HOME; let's make sure
we don't leak things into the environment that way
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 55003e2..c42e77e 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -147,6 +147,7 @@ class LiveCDYum(yum.YumBase):
return repo
def runInstall(self):
+ os.environ["HOME"] = "/"
try:
(res, resmsg) = self.buildTransaction()
except yum.Errors.RepoError, e:
commit 0dff0597eae747a10d6f58c7eb98d1ac9ab2201d
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Mon Feb 11 22:33:03 2008 -0500
Remove gparted from the desktop spins
gparted now depends on vim-common and thus has a sizable footprint for the live
images. Additionally, as anaconda provides support for resizing filesystems,
the need for gparted is reduced.
diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks
index 4fe7299..092d621 100644
--- a/config/livecd-fedora-base-desktop.ks
+++ b/config/livecd-fedora-base-desktop.ks
@@ -55,9 +55,6 @@ memtest86+
-xsane-gimp
-sane-backends
-# lots of people want to have this
-gparted
-
# livecd bits to set up the livecd and be able to install
anaconda
isomd5sum
commit 6094ff202f8b4bb6eda75473e1c442d4f9a0805c
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Mon Feb 11 22:17:45 2008 -0500
Merge fix I lost moving things between machines
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 14f4806..55003e2 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -105,7 +105,7 @@ class LiveCDYum(yum.YumBase):
# we also need to remove from the conditionals
# dict so that things don't get pulled back in as a result
# of them. yes, this is ugly. conditionals should die.
- for req, pkgs in self.tsInfo.conditionals:
+ for req, pkgs in self.tsInfo.conditionals.iteritems():
if x in pkgs:
pkgs.remove(x)
self.tsInfo.conditionals[req] = pkgs
16 years, 2 months
[PATCH] Add support for pxeboot
by Richard W.M. Jones
The attached patch adds support for turning a liveCD ISO image into a
network-bootable PXE image.
Myself and Chris Lalancette looked into this in some detail and came up
with two different ways to do this. This is the simpler of the two
methods and results in the least invasive changes to livecd-creator --
just a single line patch to mayflower and a 100-or-so-line extra script
called 'livecd-iso-to-pxeboot' which works analogously to
'livecd-iso-to-disk'.
The way it works is to bundle the complete ISO image inside the initrd.
The kernel and (bloated) initrd are downloaded using PXE in the normal
way, and the init script finds and loopback-mounts the ISO image and
booting continues as normal.
One possible con of this approach is whether or not it's a good idea to
download a very large (min 200 MB) initrd image over TFTP. There are
two reasons we can think of why you *wouldn't* want to do this:
(1) "traditional" TFTP is limited to 32 MB max file size, although all
modern TFTP implementations supersede that with a 4 GB limit (RFC 2348).
(2) TFTP uses its own transport layer which might not be able to
back-off as nicely as TCP on busy networks.
However in my testing there was no problem at all using TFTP on large
files over an ethernet LAN.
The other approach which we looked at and partially implemented was to
modify the normal initrd/init so that it could do a separate request to
download the ISO. It could possibly do this over another protocol such
as HTTP (although in Chris's tests he just used a separate TFTP
connection). The implementation of this is considerably more complicated:
(a) The initrd has to carry around dhclient, network scripts, and all
the network programs like '/sbin/ip'.
(b) The initrd has to be able to find the TFTP server again, which
basically involves making another DHCP query. In Chris's original
implementation he also added specific DHCP options to carry the TFTP
server information since it wasn't clear how to get this out of stock
dhclient.
(c) After booting, because of (b), the network is already set up, which
is not how a live CD expects it to be. Therefore the live CD itself
would need to be changed if it does any network configuration.
All in all, I would say that the attached patch is a simpler and better
approach.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
16 years, 2 months
[PATCH version 2] Add support for pxeboot
by Richard W.M. Jones
Second version of the patch.
I have modified it as requested by Jeremy Katz, so that instead of
rebuilding the initrd.img, it appends a cpio archive containing the ISO
file to the end of the initrd.img.
Rich.
--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903
16 years, 2 months
imgcreate/creator.py
by Jeremy Katz
imgcreate/creator.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 2b80ea0024969591d4ef044b68cb31c045d3d2f9
Author: Warren Togami <wtogami(a)redhat.com>
Date: Mon Feb 11 17:59:35 2008 -0500
Fix typos
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 40dcead..c2ed770 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -122,7 +122,7 @@ class ImageCreator(object):
mounting creating and loopback mounting a filesystem image to
_instroot.
- There is no default implmentation.
+ There is no default implementation.
base_on -- this is the value passed to mount() and can be interpreted
as the subclass wishes; it might e.g. be the location of
@@ -138,7 +138,7 @@ class ImageCreator(object):
in _mount_instroot(). For example, if a filesystem image was mounted
onto _instroot, it should be unmounted here.
- There is no default implmentation.
+ There is no default implementation.
"""
pass
@@ -153,7 +153,7 @@ class ImageCreator(object):
packages have been installed and the kickstart configuration has been
applied, but before the %post scripts have been executed.
- There is no default implmentation.
+ There is no default implementation.
"""
pass
@@ -238,7 +238,7 @@ class ImageCreator(object):
A dict should be returned mapping the available kernel types to a list
of the available versions for those kernels.
- The default implementation uses rpm to iterates over everything
+ The default implementation uses rpm to iterate over everything
providing 'kernel', finds /boot/vmlinuz-* and returns the version
obtained from the vmlinuz filename. (This can differ from the kernel
RPM's n-v-r in the case of e.g. xen)
16 years, 2 months
config/livecd-fedora-desktop.ks
by Jeremy Katz
config/livecd-fedora-desktop.ks | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 8a5fe014f981a1d94e3cedda613c6d1176ca35c9
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Mon Feb 11 14:32:43 2008 -0500
Don't install hunspell dicts to save space
diff --git a/config/livecd-fedora-desktop.ks b/config/livecd-fedora-desktop.ks
index 2738126..8726462 100644
--- a/config/livecd-fedora-desktop.ks
+++ b/config/livecd-fedora-desktop.ks
@@ -117,6 +117,7 @@ gnome-blog
# dictionaries are big
-aspell-*
+-hunspell-*
-man-pages-*
-scim-tables-*
-wqy-bitmap-fonts
16 years, 2 months