auto-biarch (x86_64 + i686) LiveDVD patch + ISO
by Jan Kratochvil
Hi,
finally created a LiveDVD ISO automatically booting x86_64 OS on x86_64
(and i686 otherwise). Regular users will not notice there exists any new arch
while they will benefit from the full performance of their PC:
http://people.redhat.com/jkratoch/x86bilive-2009062000.tar.gz (71KB)
It uses live_dir=LiveOS-x86_64 vs. live_dir=LiveOS-i686 to boot the image.
The syslinux patch provides "default-{x86_64,i386}" keywords in isolinux.cfg.
livecd-iso-to-disk is not patched/compatible with such image.
livecd-creator should create such ISO on a single run, not by merging the
output of two livecd-creator runs by a 3rd party app.
Regards,
Jan
Reasons:
* I still did not understand why I have to carry with me two media - both
x86_64 and i386 - when all the data perfectly fit on a single media.
* Why I have to try to boot x86_64 first to find out if the specific machine
is x86_64? Even common programmers do not know it, "Windows XP works here".
* The OS must "just work", it must be fun and easy. Requiring a special
technical decision before even starting the OS download is a showstopper.
* Checked that a regular user will on http://fedoraproject.org/get-fedora
still download terrible performance degradation of 32-bit OS although her
hadware is in 70%-95%(?) of cases x86_64. x86_64 is here for 6 years now.
* Arguing x86 may be faster than x86_64... I did not find any such case,
x86_64 is a more modern arch (more registers, PIC for free, better ABI).
We already hit the 2GB address space limitations. x86_64 is the future.
* All the friends of mine have 8Mbit+ ADSL and TB disks downloading many DVD
disks so some several more hundreds of MB are not something to notice.
mkisofs -f -J -r -hide-rr-moved -hide-joliet-trans-tbl -V Fedora-11-x86bi-Live -o ../x86bilive.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-info-table -boot-load-size 4 .
mount -r -o loop Fedora-11-x86_64-Live.iso x86_64/
mount -r -o loop Fedora-11-i686-Live.iso i686/
x86bilive:
total 4
lrwxrwxrwx 1 root root 13 2009-06-18 21:10 GPL -> ../x86_64/GPL
lrwxrwxrwx 1 root root 14 2009-06-18 21:11 LiveOS-i686 -> ../i686/LiveOS/
lrwxrwxrwx 1 root root 16 2009-06-18 21:10 LiveOS-x86_64 -> ../x86_64/LiveOS/
lrwxrwxrwx 1 root root 16 2009-06-18 21:10 README -> ../x86_64/README
drwxr-xr-x 2 root root 4096 2009-06-20 21:44 isolinux/
x86bilive/isolinux:
total 184
lrwxrwxrwx 1 root root 30 2009-06-18 21:13 boot.cat -> ../../x86_64/isolinux/boot.cat
lrwxrwxrwx 1 root root 31 2009-06-18 21:17 ii686 -> ../../i686/isolinux/initrd0.img
-rw-r--r-- 1 root root 14336 2009-06-20 21:45 isolinux.bin
-r--r--r-- 1 root root 1411 2009-06-20 21:44 isolinux.cfg
lrwxrwxrwx 1 root root 33 2009-06-18 21:13 ix8664 -> ../../x86_64/isolinux/initrd0.img
lrwxrwxrwx 1 root root 28 2009-06-18 21:17 ki686 -> ../../i686/isolinux/vmlinuz0
lrwxrwxrwx 1 root root 30 2009-06-18 21:13 kx8664 -> ../../x86_64/isolinux/vmlinuz0
lrwxrwxrwx 1 root root 29 2009-06-18 21:13 memtest -> ../../x86_64/isolinux/memtest
lrwxrwxrwx 1 root root 32 2009-06-18 21:13 splash.jpg -> ../../x86_64/isolinux/splash.jpg
-r--r--r-- 1 root root 159888 2009-06-20 20:48 vesamenu.c32
isolinux.cfg:
default vesamenu.c32
timeout 100
menu background splash.jpg
menu title Welcome to Fedora-11-x86bi-Live!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color timeout_msg 0 #ffffffff #00000000
menu color timeout 0 #ffffffff #00000000
menu color cmdline 0 #ffffffff #00000000
menu hidden
menu hiddenrow 5
label linux0
menu label x86_64 Boot
kernel kx8664
append initrd=ix8664 root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto live_dir=LiveOS-x86_64 ro liveimg quiet rhgb
menu default-x86_64
label check0
menu label x86_64 Verify and Boot
kernel kx8664
append initrd=ix8664 root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto live_dir=LiveOS-x86_64 ro liveimg quiet rhgb check
label linux1
menu label i686 Boot
kernel ki686
append initrd=ii686 root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto live_dir=LiveOS-i686 ro liveimg quiet rhgb
menu default-i386
label check1
menu label i686 Verify and Boot
kernel ki686
append initrd=ii686 root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto live_dir=LiveOS-i686 ro liveimg quiet rhgb check
label memtest
menu label Memory Test
kernel memtest
label local
menu label Boot from local drive
localboot 0xffff
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ defaults.patch 20 Jun 2009 20:10:46 -0000
@@ -0,0 +1,175 @@
+--- syslinux-3.75-orig/com32/menu/Makefile 2009-04-16 06:42:14.000000000 +0200
++++ syslinux-3.75-defaults/com32/menu/Makefile 2009-06-20 19:21:32.000000000 +0200
+@@ -24,7 +24,7 @@ MODULES = menu.c32 vesamenu.c32
+ TESTFILES =
+
+ COMMONOBJS = menumain.o readconfig.o passwd.o drain.o printmsg.o colors.o \
+- background.o refstr.o execute.o
++ background.o refstr.o execute.o verify_cpu.o
+
+ all: $(MODULES) $(TESTFILES)
+
+--- syslinux-3.75-orig/com32/menu/menu.h 2009-04-16 06:42:14.000000000 +0200
++++ syslinux-3.75-defaults/com32/menu/menu.h 2009-06-20 19:21:32.000000000 +0200
+@@ -224,4 +224,9 @@ void execute(const char *cmdline, enum k
+ /* drain.c */
+ void drain_keyboard(void);
+
++/* verify_cpu.S */
++#if defined(__i386__) || defined(__x86_64__)
++int verify_cpu(void);
++#endif
++
+ #endif /* MENU_H */
+--- syslinux-3.75-orig/com32/menu/readconfig.c 2009-04-16 06:42:14.000000000 +0200
++++ syslinux-3.75-defaults/com32/menu/readconfig.c 2009-06-20 20:23:24.000000000 +0200
+@@ -656,11 +656,22 @@ static void parse_config_file(FILE *f)
+ m->parent_entry->displayname = refstr_get(m->title);
+ }
+ }
+- } else if ( looking_at(p, "default") ) {
+- if (ld.label) {
+- ld.menudefault = 1;
+- } else if (m->parent_entry) {
+- m->parent->defentry = m->parent_entry->entry;
++ } else if ( looking_at(p, "default")
++#if defined(__i386__) || defined(__x86_64__)
++ || looking_at(p, "default-i386")
++ || looking_at(p, "default-x86_64")
++#endif
++ ) {
++#if defined(__i386__) || defined(__x86_64__)
++ if (! ( ( looking_at(p, "default-i386") && verify_cpu () == 0 ) ||
++ ( looking_at(p, "default-x86_64") && verify_cpu () != 0 ) ) )
++#endif
++ {
++ if (ld.label) {
++ ld.menudefault = 1;
++ } else if (m->parent_entry) {
++ m->parent->defentry = m->parent_entry->entry;
++ }
+ }
+ } else if ( looking_at(p, "hide") ) {
+ ld.menuhide = 1;
+--- syslinux-3.75-orig/com32/menu/verify_cpu.S 1970-01-01 01:00:00.000000000 +0100
++++ syslinux-3.75-defaults/com32/menu/verify_cpu.S 2009-06-20 20:30:27.000000000 +0200
+@@ -0,0 +1,119 @@
++/* https://lists.linux-foundation.org/pipermail/fastboot/2006-November/01188... */
++#if defined(__i386__) || defined(__x86_64__)
++ .globl verify_cpu
++verify_cpu:
++ push %ebx
++ push %esi
++ push %edi
++ push %ebp
++ call Xverify_cpu
++ pop %ebp
++ pop %edi
++ pop %esi
++ pop %ebx
++ ret
++
++/*
++ *
++ * verify_cpu.S
++ *
++ * 14 Nov 2006 Vivek Goyal: Created the file
++ *
++ * This is a common code for verification whether CPU supports
++ * long mode and SSE or not. It is not called directly instead this
++ * file is included at various places and compiled in that context.
++ * Following are the current usage.
++ *
++ * This file is included by both 16bit and 32bit code.
++ *
++ * arch/x86_64/boot/setup.S : Boot cpu verification (16bit)
++ * arch/x86_64/boot/compressed/head.S: Boot cpu verification (32bit)
++ * arch/x86_64/kernel/trampoline.S: secondary processor verfication (16bit)
++ * arch/x86_64/kernel/acpi/wakeup.S:Verfication at resume (16bit)
++ *
++ * verify_cpu, returns the status of cpu check in register %eax.
++ * 0: Success 1: Failure
++ *
++ * The caller needs to check for the error code and take the action
++ * appropriately. Either display a message or halt.
++ */
++
++Xverify_cpu:
++
++ pushfl # Save caller passed flags
++ pushl $0 # Kill any dangerous flags
++ popfl
++
++ /* minimum CPUID flags for x86-64 */
++ /* see http://www.x86-64.org/lists/discuss/msg02971.html */
++#define SSE_MASK ((1<<25)|(1<<26))
++#define REQUIRED_MASK1 ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|\
++ (1<<13)|(1<<15)|(1<<24))
++#define REQUIRED_MASK2 (1<<29)
++ pushfl # standard way to check for cpuid
++ popl %eax
++ movl %eax,%ebx
++ xorl $0x200000,%eax
++ pushl %eax
++ popfl
++ pushfl
++ popl %eax
++ cmpl %eax,%ebx
++ jz verify_cpu_no_longmode # cpu has no cpuid
++
++ movl $0x0,%eax # See if cpuid 1 is implemented
++ cpuid
++ cmpl $0x1,%eax
++ jb verify_cpu_no_longmode # no cpuid 1
++
++ xor %di,%di
++ cmpl $0x68747541,%ebx # AuthenticAMD
++ jnz verify_cpu_noamd
++ cmpl $0x69746e65,%edx
++ jnz verify_cpu_noamd
++ cmpl $0x444d4163,%ecx
++ jnz verify_cpu_noamd
++ mov $1,%di # cpu is from AMD
++
++verify_cpu_noamd:
++ movl $0x1,%eax # Does the cpu have what it takes
++ cpuid
++ andl $REQUIRED_MASK1,%edx
++ xorl $REQUIRED_MASK1,%edx
++ jnz verify_cpu_no_longmode
++
++ movl $0x80000000,%eax # See if extended cpuid is implemented
++ cpuid
++ cmpl $0x80000001,%eax
++ jb verify_cpu_no_longmode # no extended cpuid
++
++ movl $0x80000001,%eax # Does the cpu have what it takes
++ cpuid
++ andl $REQUIRED_MASK2,%edx
++ xorl $REQUIRED_MASK2,%edx
++ jnz verify_cpu_no_longmode
++
++verify_cpu_sse_test:
++ movl $1,%eax
++ cpuid
++ andl $SSE_MASK,%edx
++ cmpl $SSE_MASK,%edx
++ je verify_cpu_sse_ok
++ test %di,%di
++ jz verify_cpu_no_longmode # only try to force SSE on AMD
++ movl $0xc0010015,%ecx # HWCR
++ rdmsr
++ btr $15,%eax # enable SSE
++ wrmsr
++ xor %di,%di # don't loop
++ jmp verify_cpu_sse_test # try again
++
++verify_cpu_no_longmode:
++ popfl # Restore caller passed flags
++ movl $1,%eax
++ ret
++verify_cpu_sse_ok:
++ popfl # Restore caller passed flags
++ xorl %eax, %eax
++ ret
++#endif
--- syslinux.spec 16 Apr 2009 18:11:30 -0000 1.59
+++ syslinux.spec 20 Jun 2009 20:10:46 -0000
@@ -7,6 +7,7 @@ License: GPLv2+
Group: Applications/System
URL: http://syslinux.zytor.com/
Source0: ftp://ftp.kernel.org/pub/linux/utils/boot/syslinux/%{name}-%{tarball_vers...
+Patch9: defaults.patch
ExclusiveArch: %{ix86} x86_64
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: nasm >= 0.98.38-1, perl, netpbm-progs
@@ -33,12 +34,18 @@ MEMDISK, which loads legacy operating sy
%prep
%setup -q -n syslinux-%{tarball_version}
+%patch9 -p1
%build
CFLAGS="-Werror -Wno-unused -finline-limit=2000"
export CFLAGS
# If you make clean here, we lose the provided syslinux.exe
#make clean
+rm -f com32/menu/vesamenu.c32
+make -C com32/lib libcom32.a
+make -C com32/gpllib libcom32gpl.a
+make -C com32/menu vesamenu.c32
+test -f com32/menu/vesamenu.c32
make installer
make -C sample tidy
13 years, 4 months
[PATCH] add edit-livecd script for editing livecd based images
by Joey Boggs
Resubmitting the edit-livecd script with the latest updates.
edit-livecd is used for opening up livecd images to add and/or edit files with out having to rebuild the iso image.
This script is useful for people who don't have the development and yum infrastructure/repos set up to build livecd's from scratch. This is especially useful for custom livecd images, like the ovirt-node project[1].
We agree that changes to packaging and binaries should always be done by modifying kickstart and rebuilding the image via livecd-creator. But if all you want to do is add/edit a config file, public key for SSH, or change the root password this can be done with the edit-livecd script.
This is the second generation of the edit-livecd tool that replaces our original bash script with a python version and aims to reuse as much as the livecd-creator libraries as possible. The main reason for the new creator class is to avoid the need for a kisckstart file in order to edit an existing livecd image.
[1] http://ovirt.org
---
Makefile | 2 +
tools/edit-livecd | 350 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 352 insertions(+), 0 deletions(-)
create mode 100755 tools/edit-livecd
diff --git a/Makefile b/Makefile
index 991b27b..62e7fd8 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,7 @@ install: man
$(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/edit-livecd $(DESTDIR)/usr/bin/edit-livecd
$(INSTALL_DATA) -D AUTHORS $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/AUTHORS
$(INSTALL_DATA) -D COPYING $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/COPYING
$(INSTALL_DATA) -D README $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/README
@@ -40,6 +41,7 @@ uninstall:
rm -f $(DESTDIR)/usr/bin/livecd-creator
rm -rf $(DESTDIR)/usr/lib/livecd-creator
rm -rf $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)
+ rm -f $(DESTDIR)/usr/bin/edit-livecd
dist : all
git archive --format=tar --prefix=livecd-tools-$(VERSION)/ HEAD | bzip2 -9v > livecd-tools-$(VERSION).tar.bz2
diff --git a/tools/edit-livecd b/tools/edit-livecd
new file mode 100755
index 0000000..920522c
--- /dev/null
+++ b/tools/edit-livecd
@@ -0,0 +1,350 @@
+#!/usr/bin/python -tt
+#
+# edit livecd: Edit a livecd to insert files
+#
+# Copyright 2009, Red Hat Inc.
+# Written by Perry Myers <pmyers(a)redhat.com> & David Huff <dhuff(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.
+
+import os
+import sys
+import tempfile
+import shutil
+import subprocess
+import optparse
+import logging
+
+from imgcreate.debug import *
+from imgcreate.fs import *
+from imgcreate.live import *
+
+class ExistingSparseLoopbackDisk(SparseLoopbackDisk):
+ """don't want to expand the disk"""
+ def __init__(self, lofile, size):
+ SparseLoopbackDisk.__init__(self, lofile, size)
+
+ def create(self):
+ #self.expand(create = True)
+ LoopbackDisk.create(self)
+
+class LiveImageEditor(LiveImageCreator):
+ """class for editing LiveCD images.
+
+ We need an instance of LiveImageCreator however we do not have a kickstart
+ file nor do we need to create a new image. We just want to reuse some of
+ LiveImageCreators methods on an existing livecd image.
+
+ """
+
+ def __init__(self, name):
+ """Initialize a LiveImageEditor instance.
+
+ creates a dummy instance of LiveImageCreator
+ We do not initialize any sub classes b/c we have no ks file.
+
+ """
+ self.name = name
+
+ self.tmpdir = "/var/tmp"
+ """The directory in which all temporary files will be created."""
+
+ self.skip_compression = False
+ """Controls whether to use squashfs to compress the image."""
+
+ self.skip_minimize = False
+ """Controls whether an image minimizing snapshot should be created."""
+
+ self._isofstype = "iso9660"
+ self.__isodir = None
+
+ self._ImageCreator__builddir = None
+ """working directory"""
+
+ self._ImageCreator_instroot = None
+ """where the extfs.img is mounted for modification"""
+
+ self._ImageCreator_outdir = None
+ """where final iso gets written"""
+
+ self._ImageCreator__bindmounts = []
+
+ self._LoopImageCreator__imagedir = None
+ """dir for the extfs.img"""
+
+ self._LoopImageCreator__blocksize = 4096
+ self._LoopImageCreator__fslabel = None
+ self._LoopImageCreator__instloop = None
+ self._LoopImageCreator__fstype = None
+ self._LoopImageCreator__image_size = None
+
+ self._LiveImageCreatorBase__isodir = None
+ """directory where the iso is staged"""
+
+ # properties
+ def __get_image(self):
+ if self._LoopImageCreator__imagedir is None:
+ self.__ensure_builddir()
+ self._LoopImageCreator__imagedir = tempfile.mkdtemp(dir = os.path.abspath(self.tmpdir), prefix = self.name + "-")
+ return self._LoopImageCreator__imagedir + "/ext3fs.img"
+ _image = property(__get_image)
+ """The location of the image file"""
+
+
+ def _get_fstype(self):
+ dev_null = os.open("/dev/null", os.O_WRONLY)
+ try:
+ out = subprocess.Popen(["/sbin/blkid", self._image],
+ stdout = subprocess.PIPE,
+ stderr = dev_null).communicate()[0]
+ for word in out.split():
+ if word.startswith("TYPE"):
+ self._LoopImageCreator__fstype = word.split("=")[1].strip("\"")
+
+ except IOError, e:
+ raise CreatorError("Failed to determine fsimage TYPE: %s" % e )
+
+
+ def _get_fslable(self):
+ dev_null = os.open("/dev/null", os.O_WRONLY)
+ try:
+ out = subprocess.Popen(["/sbin/e2label", self._image],
+ stdout = subprocess.PIPE,
+ stderr = dev_null).communicate()[0]
+
+ self._LoopImageCreator__fslable = out.strip()
+
+ except IOError, e:
+ raise CreatorError("Failed to determine fsimage TYPE: %s" % e )
+
+
+ def __ensure_builddir(self):
+ if not self._ImageCreator__builddir is None:
+ return
+
+ try:
+ self._ImageCreator__builddir = tempfile.mkdtemp(dir = os.path.abspath(self.tmpdir),
+ prefix = "edit-livecd-")
+ except OSError, (err, msg):
+ raise CreatorError("Failed create build directory in %s: %s" %
+ (self.tmpdir, msg))
+
+
+ def _run_script(self, script):
+
+ (fd, path) = tempfile.mkstemp(prefix = "script-",
+ dir = self._instroot + "/tmp")
+
+ logging.debug("copying script to install root: %s" % path)
+ shutil.copy(os.path.abspath(script), path)
+ os.close(fd)
+ os.chmod(path, 0700)
+
+ script = "/tmp/" + os.path.basename(path)
+
+
+ try:
+ subprocess.call([script], preexec_fn = self._chroot)
+ except OSError, e:
+ raise CreatorError("Failed to execute script %s, %s " % (script, e))
+ finally:
+ os.unlink(path)
+
+
+ def mount(self, base_on, cachedir = None):
+ """mount existing file system.
+
+ we have to override mount b/c we are not creating an new install root
+ nor do we need to setup the file system, ie makedirs(/etc/, /boot, ...),
+ nor do we want to overwrite fstab, or create selinuxfs
+
+ We also need to get some info about the image before we
+ can mount it.
+
+ """
+
+ if not base_on:
+ raise CreatorError("No base livecd image specified")
+
+ self.__ensure_builddir()
+
+ self._ImageCreator_instroot = self._ImageCreator__builddir + "/install_root"
+ self._LoopImageCreator__imagedir = self._ImageCreator__builddir + "/ex"
+ self._ImageCreator_outdir = self._ImageCreator__builddir + "/out"
+
+ makedirs(self._ImageCreator_instroot)
+ makedirs(self._LoopImageCreator__imagedir)
+ makedirs(self._ImageCreator_outdir)
+
+ LiveImageCreator._base_on(self, base_on)
+
+ self._LoopImageCreator__image_size = os.stat(self._image)[stat.ST_SIZE]
+ self._get_fstype()
+ self._get_fslable()
+ self.fslabel = self._LoopImageCreator__fslable
+
+ self._LoopImageCreator__instloop = ExtDiskMount(ExistingSparseLoopbackDisk(self._image,
+ self._LoopImageCreator__image_size),
+ self._ImageCreator_instroot,
+ self._fstype,
+ self._LoopImageCreator__blocksize,
+ self.fslabel)
+ try:
+ self._LoopImageCreator__instloop.mount()
+ except MountError, e:
+ raise CreatorError("Failed to loopback mount '%s' : %s" %
+ (self._image, e))
+
+ cachesrc = cachedir or (self._ImageCreator__builddir + "/yum-cache")
+ makedirs(cachesrc)
+
+ for (f, dest) in [("/sys", None), ("/proc", None),
+ ("/dev/pts", None), ("/dev/shm", None),
+ (cachesrc, "/var/cache/yum")]:
+ self._ImageCreator__bindmounts.append(BindChrootMount(f, self._instroot, dest))
+
+ self._do_bindmounts()
+
+ os.symlink("../proc/mounts", self._instroot + "/etc/mtab")
+
+ self.__copy_cd_root(base_on)
+
+
+ def __copy_cd_root(self, base_on):
+ """helper function to root content of the base liveCD to ISOdir"""
+
+ isoloop = DiskMount(LoopbackDisk(base_on, 0), self._mkdtemp())
+ self._LiveImageCreatorBase__isodir = self._ImageCreator__builddir + "/iso"
+
+ try:
+ isoloop.mount()
+ # legacy LiveOS filesystem layout support, remove for F9 or F10
+ if os.path.exists(isoloop.mountdir + "/squashfs.img"):
+ squashimg = isoloop.mountdir + "/squashfs.img"
+ else:
+ squashimg = isoloop.mountdir + "/LiveOS/squashfs.img"
+
+ #copy over everything but squashimg
+ shutil.copytree(isoloop.mountdir,
+ self._LiveImageCreatorBase__isodir,
+ ignore=shutil.ignore_patterns("squashfs.img", "osmin.img"))
+ except MountError, e:
+ raise CreatorError("Failed to loopback mount '%s' : %s" %
+ (base_on, e))
+
+ finally:
+ isoloop.cleanup()
+
+
+def parse_options(args):
+ parser = optparse.OptionParser(usage = "%prog [-s=<script.sh>] <LIVECD.iso>")
+
+ parser.add_option("-n", "--name", type="string", dest="name",
+ help="name of new livecd (don't include .iso will be added)")
+
+ parser.add_option("-o", "--output", type="string", dest="output",
+ help="specify the output dir")
+
+ parser.add_option("-s", "--script", type="string", dest="script",
+ help="specify script to run chrooted in the livecd fsimage")
+
+ parser.add_option("-t", "--tmpdir", type="string",
+ dest="tmpdir", default="/var/tmp",
+ help="Temporary directory to use (default: /var/tmp)")
+
+ parser.add_option("", "--skip-compression", action="store_true", dest="skip_compression")
+
+ parser.add_option("", "--skip-minimize", action="store_true", dest="skip_minimize")
+
+ setup_logging(parser)
+
+ (options, args) = parser.parse_args()
+
+ if len(args) != 1:
+ parser.print_usage()
+ sys.exit(1)
+
+ return (args[0], options)
+
+def rebuild_iso_symlinks(isodir):
+ # remove duplicate files and rebuild symlinks to reduce iso size
+ efi_vmlinuz = "%s/EFI/boot/vmlinuz0" % isodir
+ isolinux_vmlinuz = "%s/isolinux/vmlinuz0" % isodir
+ efi_initrd = "%s/EFI/boot/initrd0.img" % isodir
+ isolinux_initrd = "%s/isolinux/initrd0.img" % isodir
+
+ os.remove(efi_vmlinuz)
+ os.remove(efi_initrd)
+ os.symlink(isolinux_vmlinuz,efi_vmlinuz)
+ os.symlink(isolinux_initrd,efi_initrd)
+
+
+def main():
+ (livecd, options) = parse_options(sys.argv[1:])
+
+ if os.geteuid () != 0:
+ print >> sys.stderr, "You must run edit-livecd as root"
+ return 1
+
+ if options.name:
+ name = options.name
+ else:
+ name = os.path.basename(livecd) + ".edited"
+
+ if options.output:
+ output = options.output
+ else:
+ output = os.path.dirname(livecd)
+
+
+ editor = LiveImageEditor(name)
+ editor.tmpdir = os.path.abspath(options.tmpdir)
+ editor.skip_compression = options.skip_compression
+ editor.skip_minimize = options.skip_minimize
+
+ try:
+ editor.mount(livecd, cachedir = None)
+ 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)
+ except CreatorError, e:
+ logging.error(u"Error editing Live CD : %s" % e)
+ return 1
+ finally:
+ editor.cleanup()
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
+
+
+arch = rpmUtils.arch.getBaseArch()
+if arch in ("i386", "x86_64"):
+ LiveImageCreator = x86LiveImageCreator
+elif arch in ("ppc",):
+ LiveImageCreator = ppcLiveImageCreator
+elif arch in ("ppc64",):
+ LiveImageCreator = ppc64LiveImageCreator
+else:
+ raise CreatorError("Architecture not supported!")
--
1.6.6.1
13 years, 11 months
[PATCH v2] Implement %post --erroronfail
by Daniel Drake
This flag is documented and parsed, but not acted upon.
---
imgcreate/creator.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 909f616..4deb49e 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -23,6 +23,7 @@ import sys
import tempfile
import shutil
import logging
+import subprocess
import selinux
import yum
@@ -702,11 +703,17 @@ class ImageCreator(object):
script = "/tmp/" + os.path.basename(path)
try:
- subprocess.call([s.interp, script],
- preexec_fn = preexec, env = env)
+ subprocess.check_call([s.interp, script],
+ preexec_fn = preexec, env = env)
except OSError, (err, msg):
raise CreatorError("Failed to execute %%post script "
"with '%s' : %s" % (s.interp, msg))
+ except subprocess.CalledProcessError, err:
+ if s.errorOnFail:
+ raise CreatorError("%%post script failed with code %d "
+ % err.returncode)
+ logging.warning("ignoring %%post failure (code %d)"
+ % err.returncode)
finally:
os.unlink(path)
--
1.6.2.5
13 years, 12 months
Re: [Fedora-livecd-list] [SoaS] Call for Testing: Duplicating SoaS via CMD
by Frederick Grose
On Sun, Mar 28, 2010 at 12:55 PM, Sebastian Dziallas <sebastian(a)when.com> wrote:
>
> Hi all,
>
> it would be great if somebody could give this standard procedure a try
> and confirm whether it works or not, so that we can react appropriately
> upon a ticket. You'll need two USB keys for this.
>
> (1) use Fedora's LiveUSB Creator to prepare the first key with SoaS
>
> (2) boot the first key and apply some changes as in:
>
> (a) change the language
> (b) download a number of activities
>
> (3) plug in the second USB key and determine its mount point
>
> (4) run as root on the first key: yum install livecd-tools (might or
> might not be already present, depending on which SoaS version you use)
>
> (5) execute the following command from the terminal on the first key:
>
> livecd-iso-to-disk --overlay-size-mb 300 /dev/sr0 /dev/sdc1
>
> (in which case /dev/sdc1 would be the mount point of the second key)
>
> Does this [ ] WORK or [ ] FAIL? Please let us know!
>
> Thanks,
> --Sebastian
> _______________________________________________
> SoaS mailing list
> SoaS(a)lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/soas
I've tested a different approach with some success for customizing and
replicating a LiveUSB image:
1. Downloaded http://alt.fedoraproject.org/pub/alt/nightly-composes/soas/soas-i386-2010...
2. In Fedora13 (32-bit), ran this script:
modified_livecd-iso-to-disk --overlay-size-mb 400 --delete-home
--extra-kernel-args selinux=0 /path_to_soas-i386-20100327.19.iso
/dev/sdb1
3. Booted the LiveUSB device1 and made a few changes.
4. Mounted a second USB device2 on an extended USB port on my monitor,
confirmed its partition name as /dev/sdc1, then unmounted it.
5. Mounted my Fedora13 partition (/dev/sda1) onto the device1 LiveUSB
image, and ran this script in the Sugar Terminal:
/mnt/F13/home/account/.../ modified_livecd-iso-to-disk --noverify
--delete-home --extra-kernel-args selinux=0 --copy-overlay /dev/live
/dev/sdc1
6. Shutdown and swapped USB devices in order to boot device2 from the
motherboard USB port.
7. Confirmed that I had a replicated image with the copied overlay file.
8. More testing needed.
The modified script is attached.
Here is the diff from the current tools_livecd-iso-to-disk:
--- tools_livecd-iso-to-disk.sh
+++ modified_livecd-iso-to-disk
@@ -308,6 +308,9 @@
overlaysizemb=$2
shift
;;
+ --copy-overlay)
+ copyoverlay=1
+ ;;
--home-size-mb)
checkint $2
homesizemb=$2
@@ -481,6 +484,13 @@
tbd=0
fi
livesize=$(du -s -B 1M $check | awk {'print $1;'})
+if [ ! -n "$copyoverlay" ]; then
+ OVERLAYFILE="overlay-$( /sbin/blkid -s LABEL -o value $ISO )-$(
/sbin/blkid -s UUID -o value $ISO )"
+ if [ -f $check/$OVERLAYFILE ]; then
+ copyoverlaysize=$(du -s -B 1M $check/$OVERLAYFILE | awk {'print $1;'})
+ livesize=$(($livesize - $copyoverlaysize))
+ fi
+fi
if [ -n "$skipcompress" ]; then
if [ -e $CDMNT/LiveOS/squashfs.img ]; then
if mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT; then
@@ -572,8 +582,16 @@
if [ -f $CDMNT/LiveOS/osmin.img ]; then
cp $CDMNT/LiveOS/osmin.img $USBMNT/$LIVEOS/osmin.img || exitclean
fi
+ if [ -n "$copyoverlay" ]; then
+ OVERLAYFILE="overlay-$( /sbin/blkid -s LABEL -o value $ISO )-$(
/sbin/blkid -s UUID -o value $ISO )"
+ cp $CDMNT/LiveOS/$OVERLAYFILE $USBMNT/$LIVEOS/$OVERLAYFILE || exitclean
+ fi
fi
+# copy this installer script to enable the new installation to
replicate the image
+SCRIPT=$(readlink -f $0)
+cp -f $SCRIPT $USBMNT/$LIVEOS/livecd-iso-to-disk
+
# DVD installer copy
if [ "$isotype" = "installer" ] && [ -z "$skipcopy" ]; then
echo "Copying DVD image to USB stick"
@@ -582,7 +600,18 @@
cp $ISO $USBMNT/
fi
-cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
+# adjust syslinux sources for replication of installed images between
filesystem types
+if [ -d $CDMNT/isolinux/ ]; then
+ cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
+elif [ -d $CDMNT/syslinux/ ]; then
+ cp $CDMNT/syslinux/* $USBMNT/$SYSLINUXPATH
+ if [ -f $CDMNT/syslinux/extlinux.conf ]; then
+ mv $USBMNT/$SYSLINUXPATH/extlinux.conf
$USBMNT/$SYSLINUXPATH/isolinux.cfg
+ elif [ -f $CDMNT/syslinux/syslinux.cfg ]; then
+ mv $USBMNT/$SYSLINUXPATH/syslinux.cfg
$USBMNT/$SYSLINUXPATH/isolinux.cfg
+ fi
+fi
+
BOOTCONFIG=$USBMNT/$SYSLINUXPATH/isolinux.cfg
# Set this to nothing so sed doesn't care
BOOTCONFIG_EFI=
@@ -594,6 +623,9 @@
rm -f $USBMNT/EFI/boot/grub.conf
fi
+# restore boot config file to base state before updating
+sed -i -e "s/root=[^ ]*/root=CDLABEL=name/" -e "s/liveimg .*
quiet/liveimg quiet/" $BOOTCONFIG $BOOTCONFIG_EFI
+
echo "Updating boot config file"
# adjust label and fstype
sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^
]*/rootfstype=$USBFS/" -e "s/LABEL=[^ ]*/$USBLABEL/" $BOOTCONFIG
$BOOTCONFIG_EFI
@@ -617,6 +649,11 @@
fi
sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG
$BOOTCONFIG_EFI
sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG $BOOTCONFIG_EFI
+elif [ -n "$copyoverlay" ]; then
+ OVERFILE="overlay-$( /sbin/blkid -s LABEL -o value $USBDEV )-$(
/sbin/blkid -s UUID -o value $USBDEV )"
+ mv $USBMNT/$LIVEOS/$OVERLAYFILE $USBMNT/$LIVEOS/$OVERFILE
+ sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG
$BOOTCONFIG_EFI
+ sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG $BOOTCONFIG_EFI
fi
if [ "$swapsizemb" -gt 0 ]; then
*********************End of diff***************************
Notes:
The script changes deal with the different location and names
(syslinux.cfg/extlinux.conf/isolinux.cfg) used by the syslinux
convention that would confuse an installation from one LiveUSB
filesystem type to another, for example, vfat to ext23.
(I'm not familiar with the sources for the configuration files, so
there may be some better way to address this.)
This script allows one to use the optional installation parameters of
livecd-iso-to-disk to customize the new installation structure. I
have examined or tested all the possible code paths, so close
examination and testing is needed before it could be accepted
upstream.
Note, there is a --skipcompress option that might be of interest to
those who would rather have a full ext23 embedded on the LiveUSB. The
relavent code is here:
if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
cp $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img ||
(umount $CDMNT ; exitclean)
umount $CDMNT
elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
cp $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
elif [ -f $CDMNT/LiveOS/ext3fs.img ]; then
cp $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || exitclean
fi
More work is needed to protect the
/home/liveuser/.sugar/default/owner.key files from the copy.
Hope this helps advance the easy customization and replication of
LiveUSB images.
--Fred
14 years, 1 month
mounting a persistent overlay
by James Heather
Can anyone tell me how to mount the squashfs / persistent overlay on a
live USB stick, without booting it up?
Context: I gave someone a live USB stick with something
in /etc/rc.d/rc.local to log some diagnostics when he booted it up on a
machine in China. Now I want to get the logs off the USB stick, but I am
just realising in my amateurish way that when I boot it up I will
overwrite the logs... Such is the problem with operating under time
pressure...
James
14 years, 1 month
tools/liveimage-mount
by Colin Walters
tools/liveimage-mount | 47 +++++++++++++++++++++++++++--------------------
1 file changed, 27 insertions(+), 20 deletions(-)
New commits:
commit befb1751f9a5f97897d11ac756b6acf841bcf928
Author: Colin Walters <walters(a)verbum.org>
Date: Wed Mar 24 14:50:03 2010 -0400
Rename --proc to --mount-hacks, strip whitespace
diff --git a/tools/liveimage-mount b/tools/liveimage-mount
index 272c702..76602a7 100755
--- a/tools/liveimage-mount
+++ b/tools/liveimage-mount
@@ -1,8 +1,8 @@
#!/usr/bin/python -tt
#
# livecd-mount: Mount a live CD at the specified point, and log
-# into a shell.
-#
+# into a shell.
+#
# Copyright 2010, Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -30,42 +30,47 @@ def usage(ecode):
def main():
try:
- opts,args = getopt.getopt(sys.argv[1:], 'h', ['help', 'chroot', 'proc'])
+ opts,args = getopt.getopt(sys.argv[1:], 'h', ['help', 'chroot', 'mount-hacks'])
except getopt.GetoptError, e:
usage(1)
-
+
+ rw = False
chroot = False
- proc = False
+ mount_hacks = False
for o,a in opts:
if o in ('-h', '--help'):
usage(0)
elif o in ('--chroot', ):
chroot = True
- elif o in ('--proc', ):
- proc = True
-
+ elif o in ('--mount-hacks', ):
+ mount_hacks = True
+
if len(args) < 2:
usage(1)
-
+
isopath = args[0]
destmnt = args[1]
-
+
command = args[2:]
verbose = not command
-
+
isomnt = tempfile.mkdtemp(prefix='livemnt-iso')
squashmnt = tempfile.mkdtemp(prefix='livemnt-squash')
-
+
+ mountflags = ['loop', 'ro']
+ mountflags_str = ','.join(mountflags)
+
try:
- subprocess.check_call(['mount', '-o', 'loop,ro', isopath, isomnt], stderr=sys.stderr)
+ subprocess.check_call(['mount', '-o', mountflags_str, isopath, isomnt], stderr=sys.stderr)
squash_img_path = os.path.join(isomnt, 'LiveOS', 'squashfs.img')
- subprocess.check_call(['mount', '-o', 'loop,ro', squash_img_path, squashmnt], stderr=sys.stderr)
+ subprocess.check_call(['mount', '-o', mountflags_str, squash_img_path, squashmnt], stderr=sys.stderr)
ext3_img_path = os.path.join(squashmnt, 'LiveOS', 'ext3fs.img')
- subprocess.check_call(['mount', '-o', 'loop,ro', ext3_img_path, destmnt], stderr=sys.stderr)
-
- if proc:
+ subprocess.check_call(['mount', '-o', mountflags_str, ext3_img_path, destmnt], stderr=sys.stderr)
+
+ if mount_hacks:
subprocess.check_call(['mount', '-t', 'proc', 'proc', os.path.join(destmnt, 'proc')], stderr=sys.stderr)
-
+ subprocess.check_call(['mount', '-t', 'tmpfs', 'tmpfs', os.path.join(destmnt, 'var', 'run')], stderr=sys.stderr)
+
if len(command) > 0:
args = ['chroot', destmnt]
args.extend(command)
@@ -79,7 +84,9 @@ def main():
finally:
if verbose:
print "Cleaning up..."
- subprocess.call(['umount', os.path.join(destmnt, 'proc')])
+ if mount_hacks:
+ subprocess.call(['umount', os.path.join(destmnt, 'var', 'run')])
+ subprocess.call(['umount', os.path.join(destmnt, 'proc')])
subprocess.call(['umount', destmnt])
subprocess.call(['umount', squashmnt])
os.rmdir(squashmnt)
@@ -87,7 +94,7 @@ def main():
os.rmdir(isomnt)
if verbose:
print "Cleanup complete"
-
+
sys.exit(ecode)
if __name__ == '__main__':
14 years, 1 month
how to modify a livecd
by bill pemberton
i would like to modify a live cd to have a root and user account and to
mount a home directory for the user. i have taken a fedora 12 iso, broken
it apart, made my changes and need to create the bootable iso image. that
is where i'm running into a problem. i have tried using the grub
stage2_eltorito file but that didn't work (maybe the command i copied was
incorrect). i have thought about snagging the first sector (i think that is
right) of a good iso and merging that with what i have but i have a feeling
that won't work. from what i can tell i need a boot image file to use but i
have not been able to locate one of the correct size (per the mkisofs man
page) in the files i have for the iso. the docs i have been reading today
so far haven't indicated where i can find this file and web searches haven't
been very fruitful. since i'm not changing the packages but just the
contents of the passwd, shadow, and fstab i would think this would be an
easy thing to accomplish. i have looked into using a persistent image but
after waiting nearly an hour for the image to be written (using
livecd-creator) i felt that that must not be working correctly either. i
can get an sd card to boot via writing the iso using dd and so far that is
the only way to get an sd card or usb drive to boot. so i must be missing
something with this livecd-creator (and i think the livecd-iso-to-disk
script as well).
the main idea is to have a bootable livecd on an sdcard, use a usb drive for
the home dir for a user and this way have a dual boot machine and be able to
test different distros from time to time.
would someone mind pointing me in the right direction to accomplish this
goal?
--
wapembe
14 years, 1 month
Makefile tools/liveimage-mount
by Colin Walters
Makefile | 1
tools/liveimage-mount | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 95 insertions(+)
New commits:
commit 55f624dc1e7509c568f517f1d032c52a500fc527
Author: Colin Walters <walters(a)verbum.org>
Date: Tue Mar 23 17:33:52 2010 -0400
Add tools/liveimage-mount
diff --git a/Makefile b/Makefile
index 991b27b..341d0ca 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ man:
install: man
$(INSTALL_PROGRAM) -D tools/livecd-creator $(DESTDIR)/usr/bin/livecd-creator
+ $(INSTALL_PROGRAM) -D tools/liveimage-mount $(DESTDIR)/usr/bin/liveimage-mount
$(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
diff --git a/tools/liveimage-mount b/tools/liveimage-mount
new file mode 100755
index 0000000..272c702
--- /dev/null
+++ b/tools/liveimage-mount
@@ -0,0 +1,94 @@
+#!/usr/bin/python -tt
+#
+# livecd-mount: Mount a live CD at the specified point, and log
+# into a shell.
+#
+# Copyright 2010, Red Hat Inc.
+#
+# 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.
+
+import os
+import sys
+import getopt
+import tempfile
+import subprocess
+
+def usage(ecode):
+ print "Usage: %s ISO.iso MOUNTPOINT [COMMAND] [ARGS]"
+ sys.exit(ecode)
+
+def main():
+ try:
+ opts,args = getopt.getopt(sys.argv[1:], 'h', ['help', 'chroot', 'proc'])
+ except getopt.GetoptError, e:
+ usage(1)
+
+ chroot = False
+ proc = False
+ for o,a in opts:
+ if o in ('-h', '--help'):
+ usage(0)
+ elif o in ('--chroot', ):
+ chroot = True
+ elif o in ('--proc', ):
+ proc = True
+
+ if len(args) < 2:
+ usage(1)
+
+ isopath = args[0]
+ destmnt = args[1]
+
+ command = args[2:]
+ verbose = not command
+
+ isomnt = tempfile.mkdtemp(prefix='livemnt-iso')
+ squashmnt = tempfile.mkdtemp(prefix='livemnt-squash')
+
+ try:
+ subprocess.check_call(['mount', '-o', 'loop,ro', isopath, isomnt], stderr=sys.stderr)
+ squash_img_path = os.path.join(isomnt, 'LiveOS', 'squashfs.img')
+ subprocess.check_call(['mount', '-o', 'loop,ro', squash_img_path, squashmnt], stderr=sys.stderr)
+ ext3_img_path = os.path.join(squashmnt, 'LiveOS', 'ext3fs.img')
+ subprocess.check_call(['mount', '-o', 'loop,ro', ext3_img_path, destmnt], stderr=sys.stderr)
+
+ if proc:
+ subprocess.check_call(['mount', '-t', 'proc', 'proc', os.path.join(destmnt, 'proc')], stderr=sys.stderr)
+
+ if len(command) > 0:
+ args = ['chroot', destmnt]
+ args.extend(command)
+ ecode = subprocess.call(args, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr)
+ elif chroot:
+ print "Starting subshell in chroot, press Ctrl-D to exit..."
+ ecode = subprocess.call(['chroot', destmnt], stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr)
+ else:
+ print "Starting subshell, press Ctrl-D to exit..."
+ ecode = subprocess.call([os.environ['SHELL']], cwd=destmnt, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr)
+ finally:
+ if verbose:
+ print "Cleaning up..."
+ subprocess.call(['umount', os.path.join(destmnt, 'proc')])
+ subprocess.call(['umount', destmnt])
+ subprocess.call(['umount', squashmnt])
+ os.rmdir(squashmnt)
+ subprocess.call(['umount', isomnt])
+ os.rmdir(isomnt)
+ if verbose:
+ print "Cleanup complete"
+
+ sys.exit(ecode)
+
+if __name__ == '__main__':
+ main()
14 years, 1 month
Fedora 11 live cd hangs on logout...
by James Heather
Can anyone else confirm that building the standard F11 live cd, against
the current F11-updates repo, results in something that hangs when you
try to log out of GNOME?
Attached are the F11 live cd kickstart files. The only changes I've made
are to enable the updates repo (and an inconsequential slight increase
to the partition size).
I've done the following:
1. Create the 64-bit live cd
2. livecd-iso-to-disk -> usb stick
3. Boot up
4. Log in
5. Log out
6. Sob for mummy
Would be interested to know if others have the same issue. I presume
this is a gdm bug, but it is very hard to track down since it's a system
hang. (It's not actually a complete system hang, it's just that keyboard
and mouse are unresponsive; but one can log in over the network.)
This is killing me. I've spent several days trying to bugfix my custom
stuff, only to discover that it's not my bug at all, and it's in the
standard F11 build.
James
14 years, 2 months
FAT32 vs ext2 on USB stick
by James Heather
Does anyone have any strong views about whether one should use FAT32 or
ext[23] for the base filesystem for a bootable USB stick?
I was using FAT32, but it occurs to me that creating the USB sticks is
much quicker if it's ext2 because it supports sparse files and so the
overlay and persistent home don't need to be completely overwritten with
zeros. Creation time is now 5m rather than 15m.
Are there downsides (other than it not being readable in Windows, which
I don't care about)?
Looks like I'm not allowed ext4, because the livecd-iso-to-disk script
complains! (That's presumably a bug, since ext4 ought to work fine.) Are
there reasons to go for ext3 rather than ext2? I'm not quite sure what
the journalling achieves--the number and size of the files on the
partition isn't going to change, but obviously the data inside the
overlay and persistent home will change.
James
14 years, 2 months