F7 general question about livecd-creator and timezones
by Skunk Worx
My ks scripts have the timezone set to PDT (America/Los_Angeles).
Installation to a hard drive works as expected. PDT in startup and in
shells, etc.
Creating a livecd-creator iso with the same tz setting, then booting,
shows A/L_A in the /etc/sysconfig/clock file, as expected.
However the date is always EDT in the boot messages, shells, etc.
During startup I see :
(lvm)
Press I to enter interactive startup
Setting clock (utc) Mon Jun 4 00:12:59 EDT 2007
(udev)
I'm not clear on what is happening between lvm and udev in the Linux
startup sequence.
If someone could give me a hint about what to look for and where to look
for it I would appreciate the help.
---
John
14 years, 10 months
Kickstart ignored?
by Gary Thomas
Running a system built with anaconda-11.4.0.40 (and friends), the
kickstart commands seem to be ignored when run from liveinst.
# liveinst --text ks=/tmp/ks.cfg
or
# liveinst --text ksdev=eth0 ks=nfs:192.168.1.101:/tmp/ks.cfg
Am I doing something wrong?
I really want to get this working so I can do [scripted] installs
from a livecd image.
Thanks
16 years
3 commits - config/livecd-fedora-8-base-desktop.ks imgcreate/live.py tools/mayflower
by Jeremy Katz
config/livecd-fedora-8-base-desktop.ks | 15
imgcreate/live.py | 54 --
tools/mayflower | 805 ---------------------------------
3 files changed, 21 insertions(+), 853 deletions(-)
New commits:
commit 0812e699f503f8ac1a63ecf7d9ee9874fb7ea168
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue Feb 26 17:56:25 2008 -0500
Remove mayflower
diff --git a/tools/mayflower b/tools/mayflower
deleted file mode 100755
index 162d4d4..0000000
--- a/tools/mayflower
+++ /dev/null
@@ -1,805 +0,0 @@
-#!/bin/bash
-
-# mayflower - flexible mkinitrd replacement
-#
-# Copyright 2006 David Zeuthen <davidz(a)redhat.com>
-#
-# Licensed under the GPLv2. See the file COPYING for details.
-# Inspired by similar programs from a bunch of other distributions.
-#
-
-# Override any TMPDIR setting from the environment, since this script is
-# run in a chroot: a nonstandard $TMPDIR setting would make mktemp fail.
-export TMPDIR=/tmp
-
-usage() {
- echo "$0 [--help] <out-initrd-image> <kernel-version>"
- echo
- echo "example: $0 /boot/myinitramfs.img \`uname -r\`"
-}
-
-opt_allow_overwrite=0
-opt_verbose=0
-INITRAMFS_TARGET=""
-KERNEL=""
-while [ $# -gt 0 ] ; do
- case $1 in
- --help)
- usage
- exit 0
- ;;
- -f)
- opt_allow_overwrite=1
- ;;
- --allow-missing)
- echo "Ignore option $1 for /sbin/mkinitrd compatibility"
- ;;
- -v|--verbose)
- opt_verbose=1
- ;;
- *)
- if [ -z "$INITRAMFS_TARGET" ] ; then
- INITRAMFS_TARGET=$1
- elif [ -z "$KERNEL" ] ; then
- KERNEL=$1
- else
- echo "Unknown option or parameter \"$1\""
- echo
- usage
- exit 1
- fi
- ;;
- *)
- ;;
- esac
-
- shift
-done
-
-if [ -z "$INITRAMFS_TARGET" -o -z "$KERNEL" ] ; then
- usage
- exit 1
-fi
-
-if [ "$opt_allow_overwrite" == "0" ] ; then
- if [ -e $INITRAMFS_TARGET ] ; then
- echo "Image $INITRAMFS_TARGET already exists. Use -f to overwrite"
- exit 1
- fi
-fi
-
-echo "Building an initramfs at $INITRAMFS_TARGET for kernel $KERNEL"
-
-TEMPDIR=`mktemp -d` || exit 1
-pushd $TEMPDIR > /dev/null
-mkdir initramfs_dir
-cd initramfs_dir
-
-# Make directory structure
-mkdir bin sbin dev sys proc lib lib/udev sysroot etc etc/udev etc/udev/rules.d
-
-cp /sbin/losetup sbin
-cp /sbin/blockdev sbin
-cp /sbin/dmsetup sbin
-cp /bin/dd bin
-cp /bin/cut bin
-
-# we explicitly load these, so should be sure they're present
-MODULES="loop dm_snapshot "
-
-if [ -e /etc/mayflower.conf ] ; then
- source /etc/mayflower.conf
-fi
-
-# TODO: right now we only recognize MODULES... add support for more
-# options such as 'include all modules neccessary to mount the mount
-# point /mnt/temp_os_install' etc.
-
-MODULES+=" "
-
-if [ "$opt_verbose" == "1" ] ; then
- echo "Kernel modules requested: $MODULES"
- echo
-fi
-rm -f modules
-
-for m in $MODULES ; do
- char=$(echo $m | cut -c1)
- if [ $char = '=' ]; then
- NAME=$(echo $m | cut -c2-)
- if [ "$NAME" = "ata" ]; then
- if [ -f /lib/modules/$KERNEL/modules.libata ]; then
- MODS="$MODS $(cat /lib/modules/$KERNEL/modules.libata |sed -e 's/.ko//')"
- else
- MODS="$MODS $(cat /lib/modules/$KERNEL/modules.block |egrep '(ata|ahci)' |sed -e 's/.ko//')"
- fi
- else
- MODS="$MODS $(cat /lib/modules/$KERNEL/modules.$NAME |sed -e 's/.ko//')"
- fi
- else
- MODS="$MODS $m"
- fi
-done
-
-for m in $MODS ; do
- /sbin/modprobe --set-version $KERNEL --show-depends $m >> modules 2>/dev/null
-done
-
-cat modules | awk '{ print $2 }' | sort -u > modules2
-rm -f modules
-MODULES_FILES=`cat modules2`
-rm -f modules2
-
-mkdir -p lib/modules/$KERNEL/
-
-# Copy kernel modules over
-for f in $MODULES_FILES ; do
- if [ "$opt_verbose" == "1" ] ; then
- echo "Copying kernel module $f"
- fi
- cp $f lib/modules/$KERNEL/
-done
-
-# Build module deps file so we can use modprobe
-if [ "$opt_verbose" == "1" ] ; then
- /sbin/depmod -b `pwd` -v $KERNEL
-else
- /sbin/depmod -b `pwd` -v $KERNEL > /dev/null
-fi
-
-# Copy /etc/fstab over
-cp /etc/fstab etc
-
-# Copy modprobe.conf and friends over
-if [ -e /etc/modprobe.conf ] ; then
- cp /etc/modprobe.conf etc
-fi
-cp -R /etc/modprobe.d etc
-
-# Copy binaries over
-cp /bin/echo bin
-cp /bin/sleep bin
-cp /bin/bash bin
-cp /bin/mount bin
-cp /bin/umount bin
-[ -x /usr/sbin/eject ] && cp /usr/sbin/eject sbin
-cp /bin/ls bin
-cp /bin/mknod bin
-cp /bin/mkdir bin
-cp /bin/chmod bin
-cp /bin/ln bin
-cp /bin/cat bin
-cp /usr/bin/kill bin
-cp /bin/rm bin
-
-cp /sbin/udevsettle sbin
-cp /sbin/udevtrigger sbin
-cp /sbin/udevd sbin
-cp /sbin/insmod sbin
-cp /sbin/modprobe sbin
-cp /sbin/pidof sbin
-cp /sbin/killall5 sbin
-cp /sbin/nash sbin
-
-cp /lib/udev/vol_id lib/udev
-
-# symlink niceties
-ln -s bash bin/sh
-
-# Not really required but nice
-[ -x /usr/bin/tree ] && cp /usr/bin/tree bin
-[ -x /usr/bin/less ] && cp /usr/bin/less bin
-cp /bin/env bin
-cp /bin/grep bin
-cp /bin/dmesg bin
-cp /sbin/lsmod sbin
-
-# if we have the iso checker, we want it
-[ -x /usr/lib/anaconda-runtime/checkisomd5 ] && cp /usr/lib/anaconda-runtime/checkisomd5 bin
-[ -x /usr/bin/checkisomd5 ] && cp /usr/bin/checkisomd5 bin
-
-# Copy all required shared libs
-for i in bin/* sbin/* lib/udev/*; do
- ldd $i | sed 's|.*=>||g' | awk '/\// { print $1 }' | while read lib ; do
- if [ "$opt_verbose" == "1" ] ; then
- echo "Copying DSO $l"
- fi
- cp --parents $lib .
- done
-done
-
-cat > sbin/run-init <<'EOF'
-#!/sbin/nash
-setuproot
-switchroot
-EOF
-chmod 755 sbin/run-init
-
-# Write out init
-cat > init <<'EOF'
-#!/bin/bash
-
-emergency_shell()
-{
- echo "Bug in initramfs /init detected. Dropping to a shell. Good luck!"
- echo
- bash
-}
-trap "emergency_shell" 0 2
-
-# exit immediately if a command fails
-set -e
-
-export PATH=/sbin:/bin
-
-exec < /dev/console > /dev/console 2>&1
-
-mount -n -t tmpfs -o mode=0755 udev /dev
-mknod /dev/console c 5 1
-mknod /dev/null c 1 3
-mknod /dev/kmsg c 1 11
-mkdir /dev/pts
-mkdir -m 1777 /dev/shm
-ln -s /proc/self/fd /dev/fd
-ln -s fd/0 /dev/stdin
-ln -s fd/1 /dev/stdout
-ln -s fd/2 /dev/stderr
-
-mount -n -t proc proc /proc
-mount -n -t sysfs sysfs /sys
-
-echo "" > /proc/sys/kernel/hotplug
-
-# Declare all variables here.. mostly for housekeeping
-#
-init="/sbin/init"
-root_ro=0
-root_rw=0
-root=""
-rootflags=""
-rootfstype=""
-quiet=0
-shell=0
-eshell=0
-live_ram=0
-check_iso=0
-live_locale=""
-
-# Parse kernel commandline options
-#
-for o in `cat /proc/cmdline` ; do
- case $o in
- init=*)
- init=${o#init=}
- ;;
- ro)
- root_ro=1
- ;;
- rw)
- root_rw=1
- ;;
- quiet)
- quiet=1
- ;;
- shell)
- shell=1
- ;;
- eshell)
- eshell=1
- ;;
- live_ram)
- live_ram=1
- ;;
- live_locale=*)
- live_locale=${o#live_locale=}
- ;;
- check)
- check_iso=1
- ;;
- blacklist=*)
- blacklist=${o#blacklist=}
- echo "blacklist $blacklist" >> /etc/modprobe.conf
- ;;
- *)
- m=$(echo $o |cut -s -d . -f 1)
- opt=$(echo $o |cut -s -d . -f 2-)
- if [ -z "$m" -o -z "$opt" ]; then
- continue
- fi
- p=$(echo $opt |cut -s -d = -f 1)
- v=$(echo $opt |cut -s -d = -f 2-)
- if [ -z "$p" -o -z "$v" ]; then
- continue
- fi
- echo "options $m $p=$v" >> /etc/modprobe.conf
- ;;
- esac
-done
-
-if [ "$quiet" != "1" ] ; then
- echo "kernel commandline: `cat /proc/cmdline`"
-fi
-
-# First, read rootfs target from embedded /etc/fstab file
-#
-if [ -f /etc/fstab ] ; then
- root=$(cat /etc/fstab | while read d m f o r; do if [ "$m" == "/" ] ; then echo $d; fi; done)
- rootflags=$(cat /etc/fstab | while read d m f o r; do if [ "$m" == "/" ] ; then echo $o; fi; done)
- rootfstype=$(cat /etc/fstab | while read d m f o r; do if [ "$m" == "/" ] ; then echo $f; fi; done)
- if [ "$quiet" != "1" ] ; then
- echo "fstab suggests root=$root"
- echo "fstab suggests rootflags=$rootflags"
- echo "fstab suggests rootfstype=$rootfstype"
- # Handle the case with bogus /etc/fstab pointing to /dev/root
- # which by definition does not exist...
- #
- if [ "$root" == "/dev/root" ] ; then
- echo "WARNING: Bogus /etc/fstab file - cannot have /dev/root as the device for /"
- root=""
- rootflags=""
- rootfstype=""
- fi
- fi
-fi
-
-# Users can override rootfs target on the kernel commandline
-#
-for o in `cat /proc/cmdline` ; do
- case $o in
- root=*)
- root=${o#root=}
- ;;
- rootflags=*)
- rootflags=${o#rootflags=}
- ;;
- rootfstype=*)
- rootfstype=${o#rootfstype=}
- ;;
- esac
-done
-
-# Print out what we are going to do
-#
-if [ "$quiet" != "1" ] ; then
- echo "init=$init"
- echo "root=$root"
- echo "rootflags=$rootflags"
- echo "rootfstype=$rootfstype"
- echo "root_ro=$root_ro"
- echo "root_rw=$root_rw"
-fi
-
-waitforsymlink=0
-# generate udev rules to generate /dev/root symlink
-if [ -z $root ] ; then
- root=/dev/something
-else
- case $root in
- /dev/disk/by-label/*)
- LABEL=${root#/dev/disk/by-label/}
- echo "SUBSYSTEM==\"block\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$LABEL\", SYMLINK+=\"root\"" > /etc/udev/rules.d/00-label.rules
- if [ "$quiet" != "1" ] ; then
- echo "Added udev rule 00-label.rules:"
- cat /etc/udev/rules.d/00-label.rules
- fi
- waitforsymlink=1
- thingtomount=/dev/root
- ;;
- CDLABEL=*)
- CDLABEL=${root#CDLABEL=}
- echo "KERNEL==\"hd[a-z]\", BUS==\"ide\", SYSFS{removable}==\"1\", ATTRS{media}==\"cdrom\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"root\"" > /etc/udev/rules.d/00-cdlabel.rules
- echo "KERNEL==\"sr[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/00-cdlabel.rules
- echo "KERNEL==\"scd[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/00-cdlabel.rules
- echo "KERNEL==\"pcd[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/00-cdlabel.rules
- if [ "$quiet" != "1" ] ; then
- echo "Added udev rule 00-cdlabel.rules:"
- cat /etc/udev/rules.d/00-cdlabel.rules
- fi
- waitforsymlink=1
- thingtomount=/dev/root
- ;;
- LABEL=*)
- LABEL=${root#LABEL=}
- echo "SUBSYSTEM==\"block\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$LABEL\", SYMLINK+=\"root\"" > /etc/udev/rules.d/00-label.rules
- if [ "$quiet" != "1" ] ; then
- echo "Added udev rule 00-label.rules:"
- cat /etc/udev/rules.d/00-label.rules
- fi
- waitforsymlink=1
- thingtomount=/dev/root
- ;;
- /dev/disk/by-id/*)
- UUID=${root#/dev/disk/by-id/}
- echo "SUBSYSTEM==\"block\", PROGRAM=\"/lib/udev/vol_id -u %N\", RESULT==\"$UUID\", SYMLINK+=\"root\"" > /etc/udev/rules.d/01-uuid.rules
- if [ "$quiet" != "1" ] ; then
- echo "Added udev rule 01-uuid.rules:"
- cat /etc/udev/rules.d/01-uuid.rules
- fi
- waitforsymlink=1
- thingtomount=/dev/root
- ;;
- UUID=*)
- UUID=${root#UUID=}
- echo "SUBSYSTEM==\"block\", PROGRAM=\"/lib/udev/vol_id -u %N\", RESULT==\"$UUID\", SYMLINK+=\"root\"" > /etc/udev/rules.d/01-uuid.rules
- if [ "$quiet" != "1" ] ; then
- echo "Added udev rule 01-uuid.rules:"
- cat /etc/udev/rules.d/01-uuid.rules
- fi
- waitforsymlink=1
- thingtomount=/dev/root
- ;;
- /dev/*)
- ln -s $root /dev/root
- thingtomount=$root
- ;;
- *)
- thingtomount=$root
- ;;
- esac
-fi
-
-echo "udev_log=\"error\"" >> /etc/udev/udev.conf
-
-# rules for loading modules
-#
-echo -n "ACTION==\"add\", SUBSYSTEM==\"?*\", ENV{MODALIAS}==\"?*\", RUN+=\"/sbin/modprobe $" >> /etc/udev/rules.d/10-modprobe.rules
-echo "env{MODALIAS}\"" >> /etc/udev/rules.d/10-modprobe.rules
-echo "ACTION==\"add\", SUBSYSTEM==\"scsi_device\" RUN+=\"/sbin/modprobe sg\"" >> /etc/udev/rules.d/10-modprobe.rules
-echo "ACTION==\"add\", SUBSYSTEM==\"scsi_device\", SYSFS{type}==\"0|7|14\", RUN+=\"/sbin/modprobe sd_mod\"" >> /etc/udev/rules.d/10-modprobe.rules
-echo "ACTION==\"add\", SUBSYSTEM==\"scsi_device\", SYSFS{type}==\"[45]\", RUN+=\"/sbin/modprobe sr_mod\"" >> /etc/udev/rules.d/10-modprobe.rules
-echo "SUBSYSTEM==\"mmc\", RUN+=\"/sbin/modprobe mmc_block\"" >> /etc/udev/rules.d/10-modprobe.rules
-
-# FIXME: hack since sr_mod seems to fail to get loaded sometimes (#239657)
-/sbin/modprobe sr_mod
-
-/sbin/modprobe loop max_loop=16
-
-if [ "$quiet" != "1" ] ; then
- echo "starting udevd"
-fi
-/sbin/udevd --daemon
-
-if [ "$quiet" != "1" ] ; then
- echo "creating devices"
-fi
-/sbin/udevtrigger
-
-if [ "$quiet" != "1" ] ; then
- echo "waiting for system to settle"
-fi
-/sbin/udevsettle --timeout=30 || :
-
-
-if [ "$shell" == "1" ] ; then
- echo "Shell requested on kernel commandline. Exit to continue booting."
- echo
- bash
-fi
-
-# don't wait for "mtd0" as no device file will appear
-# 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
- if [ ! -L /dev/root ] ; then
- echo
- echo "--------------------------------------"
- echo "WARNING: Cannot find root file system!"
- echo "--------------------------------------"
- echo
- echo "Create symlink /dev/root and then exit this shell to continue"
- echo "the boot sequence."
- echo
- bash
- fi
- fi
-
- # udevsettle might return before slow devices such as USB are in shape
- # Wait up to 60 seconds for them to appear...
- #
- if [ ! -b /dev/root ] ; then
- if [ "$quiet" != "1" ] ; then
- echo "no root yet, udev rule will write symlink..."
- echo
- echo "waiting up to 60 seconds before dropping to emergency shell."
- fi
- COUNTDOWN=60
- while [ "x$COUNTDOWN" != "x0" ] ; do
- if [ "$quiet" != "1" ] ; then
- echo -n "."
- fi
- COUNTDOWN=$(($COUNTDOWN - 1))
- /bin/sleep 1
- if [ -e /dev/root ] ; then
- COUNTDOWN=0
- fi
- done
- fi
-
- if [ ! -b /dev/root ] ; then
- echo
- echo "--------------------------------------"
- echo "WARNING: Cannot find root file system!"
- echo "--------------------------------------"
- echo
- echo "Create symlink /dev/root and then exit this shell to continue"
- echo "the boot sequence."
- echo
- bash
- fi
-
- if [ "$quiet" != "1" ] ; then
- echo "mounting /dev/root"
- ls -l /dev/root
- fi
-
- if [ -z $rootfstype ] ; then
- rootfstype=auto
- fi
-
-fi
-
-if [ "x$check_iso" == "x1" -a -x /bin/checkisomd5 -a "x$rootfstype" == "xiso9660" ]; then
- echo "Verifying ISO image..."
- /bin/checkisomd5 --verbose /dev/root
- if [ $? -ne 0 ]; then
- echo "Are you SURE you want to continue?"
- echo "Press Enter to continue or ctrl-alt-del to reboot."
- read
- fi
-fi
-
-if [ "x$root_ro" == "x1" ] ; then
- if [ -z $rootflags ] ; then
- rootflags="ro"
- else
- rootflags="$rootflags,ro"
- fi
-fi
-
-if [ "x$root_rw" == "x1" ] ; then
- if [ -z $rootflags ] ; then
- rootflags="rw"
- else
- rootflags="$rootflags,rw"
- fi
-fi
-
-if [ -z $rootflags ] ; then
- mountoptions=""
-else
- mountoptions=" -o$rootflags"
-fi
-
-mount -n -t $rootfstype $mountoptions $thingtomount /sysroot
-RES=$?
-
-if [ "$RES" != "0" ] ; then
- echo "---------------------------------"
- echo "WARNING: Cannot mount rootfs!"
- echo "---------------------------------"
- echo
- echo "Dropping to a shell. "
- echo "Mount rootfs at /sysroot and exit shell to continue. Good luck!"
- echo
- bash
-fi
-
-# Now get ready to leave the initramfs
-#
-
-# only pass kernel command line if we're launching /sbin/init
-if [ "$init" == "/sbin/init" ] ; then
- initargs=$(cat /proc/cmdline)
-else
- initargs=""
-fi
-
-# live cd helper function
-do_live_from_base_loop() {
- # create a sparse file for the overlay
- dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((512*1024)) 2> /dev/null
- OVERLAY_LOOPDEV=$( losetup -f )
- losetup $OVERLAY_LOOPDEV /overlay
-
- # set up the snapshot
- echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
-
- # set up new /dev/root symlink
- rm -f /dev/root
- ln -s /dev/mapper/live-rw /dev/root
-
- mount -n /dev/mapper/live-rw /sysroot
- # here you can modify the rw ext3 fs for testing if you don't want to
- # respin the entire rootfs (which takes ages). Example
- #
- # echo foo > /sysroot/etc/bar.conf
- #
- # We also use it to dynamically set the system locale from the boot
- # menu on live cd's.
- #
- if [ "$live_locale" != "" ] ; then
- echo "LANG=$live_locale" > /sysroot/etc/sysconfig/i18n
- fi
-
- # copy over module options
- [ -f /etc/modprobe.conf ] && cat /etc/modprobe.conf >> /sysroot/etc/modprobe.conf
-
- # create rule so udev creates /dev/live symlink on real rootfs
- if [ -n "$CDLABEL" ]; then
- echo "KERNEL==\"hd[a-z]\", BUS==\"ide\", SYSFS{removable}==\"1\", ATTRS{media}==\"cdrom\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"sr[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"scd[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"pcd[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- elif [ -n "$LABEL" ]; then
- echo "KERNEL==\"hd[a-z]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$LABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"hd[a-z][0-9]*\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$LABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"sd[a-z]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$LABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"sd[a-z][0-9]*\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$LABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- elif [ -n "$UUID" ]; then
- echo "KERNEL==\"hd[a-z]\", PROGRAM=\"/lib/udev/vol_id -u %N\", RESULT==\"$UUID\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"hd[a-z][0-9]*\", PROGRAM=\"/lib/udev/vol_id -u %N\", RESULT==\"$UUID\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"sd[a-z]\", PROGRAM=\"/lib/udev/vol_id -u %N\", RESULT==\"$UUID\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"sd[a-z][0-9]*\", PROGRAM=\"/lib/udev/vol_id -u %N\", RESULT==\"$UUID\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*
- fi
-
- # add rules for loop devices created by this mayflower generated init
- # i.e. /dev/live-osimg, /dev/live-osmin, /dev/live-overlay,
- # and /dev/live-squashed
- if [ -b "$SQUASHED_LOOPDEV" ]; then
- echo "KERNEL==\"${SQUASHED_LOOPDEV#/dev/}\" SYMLINK+=\"live-squashed\"" >> /sysroot/etc/udev/rules.d/50-udev*
- fi
- if [ -b "$OSMIN_SQUASHED_LOOPDEV" ]; then
- echo "KERNEL==\"${OSMIN_SQUASHED_LOOPDEV#/dev/}\" SYMLINK+=\"live-squashed-osmin\"" >> /sysroot/etc/udev/rules.d/50-udev*
- fi
- if [ -b "$OSMIN_LOOPDEV" ]; then
- echo "KERNEL==\"${OSMIN_LOOPDEV#/dev/}\" SYMLINK+=\"live-osmin\"" >> /sysroot/etc/udev/rules.d/50-udev*
- fi
- echo "KERNEL==\"${BASE_LOOPDEV#/dev/}\" SYMLINK+=\"live-osimg\"" >> /sysroot/etc/udev/rules.d/50-udev*
- echo "KERNEL==\"${OVERLAY_LOOPDEV#/dev/}\" SYMLINK+=\"live-overlay\"" >> /sysroot/etc/udev/rules.d/50-udev*
-
- mount -n -o ro,remount /sysroot
-}
-
-# we might have a genMinInstDelta delta file for anaconda to take advantage of
-if [ -e /sysroot/LiveOS/osmin.img ]; then
- OSMINSQFS=/sysroot/LiveOS/osmin.img
-fi
-
-if [ -n "$OSMINSQFS" ]; then
- # decompress the delta data
- dd if=$OSMINSQFS of=/osmin.img 2> /dev/null
- OSMIN_SQUASHED_LOOPDEV=$( losetup -f )
- losetup $OSMIN_SQUASHED_LOOPDEV /osmin.img
- mkdir -p /squashfs.osmin
- mount -n -t squashfs -o ro $OSMIN_SQUASHED_LOOPDEV /squashfs.osmin
- OSMIN_LOOPDEV=$( losetup -f )
- losetup $OSMIN_LOOPDEV /squashfs.osmin/osmin
- umount -l /squashfs.osmin
-fi
-
-# we might have an uncompressed embedded ext3 to use as rootfs (uncompressed live)
-#
-if [ -e /sysroot/LiveOS/ext3fs.img ]; then
- EXT3FS="/sysroot/LiveOS/ext3fs.img"
-fi
-
-if [ -n "$EXT3FS" ] ; then
- if [ "$quiet" != "1" ] ; then
- echo "setting up embedded ext3 fs "
- fi
-
- mkdir -p /dev/mapper
- mknod /dev/mapper/control c 10 63
- modprobe dm_snapshot
-
- BASE_LOOPDEV=$( losetup -f )
- losetup $BASE_LOOPDEV $EXT3FS
- umount -l /sysroot
-
- do_live_from_base_loop
-fi
-
-# we might have an embedded ext3 on squashfs to use as rootfs (compressed live)
-#
-if [ -e /sysroot/LiveOS/squashfs.img ]; then
- SQUASHED="/sysroot/LiveOS/squashfs.img"
-fi
-
-if [ -e "$SQUASHED" ] ; then
-
- if [ "$quiet" != "1" ] ; then
- echo "setting up embedded squash -> ext3 fs "
- fi
-
- mkdir -p /dev/mapper
- mknod /dev/mapper/control c 10 63
- modprobe dm_snapshot
-
- if [ "$live_ram" == "1" ] ; then
- echo "Copying live image to RAM..."
- echo "(this may take a few minutes)"
- dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
- umount -n /sysroot
- echo "Done copying live image to RAM."
- eject -p /dev/root
- SQUASHED="/squashed.img"
- fi
-
- SQUASHED_LOOPDEV=$( losetup -f )
- losetup $SQUASHED_LOOPDEV $SQUASHED
- mkdir -p /squashfs
- mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /squashfs
-
- BASE_LOOPDEV=$( losetup -f )
- losetup $BASE_LOOPDEV /squashfs/LiveOS/ext3fs.img
-
- umount -l /squashfs
- if [ "$live_ram" == "0" ] ; then
- umount -l /sysroot
- fi
-
- do_live_from_base_loop
-fi
-
-if [ -b "$OSMIN_LOOPDEV" ]; then
- # set up the devicemapper snapshot device, which will merge
- # the normal live fs image, and the delta, into a minimzied fs image
- echo "0 $( blockdev --getsize $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
-fi
-
-if [ "$eshell" == "1" ] ; then
- echo "Shell requested on kernel commandline."
- echo "Rootfs is mounted ro on /sysroot. Exit to continue booting."
- echo
- bash
-fi
-
-if [ -x /sysroot$init ] ; then
-
- # Leave initramfs and transition to rootfs
- kill `pidof udevd`
- if [ "$quiet" != "1" ] ; then
- echo "transfering control to $init"
- fi
-
- exec /sbin/run-init
- echo "---------------------------------"
- echo "WARNING: Error switching to real rootfs!"
- echo "---------------------------------"
- echo
- echo "Dropping to a shell. Good luck!"
- echo
- bash
-else
- echo "---------------------------------------------------------"
- echo "WARNING: Requested $init binary does not exist on rootfs."
- echo "---------------------------------------------------------"
- echo
- echo "Dropping to a shell. Good luck!"
- echo
- bash
-fi
-
-EOF
-
-chmod a+x init
-
-if [ "$opt_verbose" == "1" ] ; then
- tree -s .
- echo
- cat -n init
- echo
-fi
-
-
-find . | cpio --quiet -o -H newc | gzip -9 > ../initramfs
-popd > /dev/null
-rm -f $INITRAMFS_TARGET
-cp $TEMPDIR/initramfs $INITRAMFS_TARGET
-rm -rf $TEMPDIR
-
-echo "Done; initramfs is $(du -h $INITRAMFS_TARGET | awk '{print $1}')."
-echo
-exit 0
commit 11dbd0bb5ba4b845e80109e990e4e780ca402218
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue Feb 26 17:56:16 2008 -0500
Fix up Fedora 8 configs to still be able to boot
We need to run mayflower in the config now rather than depending on
livecd-creator running it itself
diff --git a/config/livecd-fedora-8-base-desktop.ks b/config/livecd-fedora-8-base-desktop.ks
index 2cf42b5..febfc97 100644
--- a/config/livecd-fedora-8-base-desktop.ks
+++ b/config/livecd-fedora-8-base-desktop.ks
@@ -22,6 +22,9 @@ repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?rep
kernel
memtest86+
+# for live initrd
+livecd-tools
+
# save some space
-specspo
-esc
@@ -158,11 +161,16 @@ chmod 755 /etc/rc.d/init.d/fedora-live
/sbin/restorecon /etc/rc.d/init.d/fedora-live
/sbin/chkconfig --add fedora-live
-# save a little bit of space at least...
-rm -f /boot/initrd*
# make sure there aren't core files lying around
rm -f /core*
+# make the initrd we care about
+rm -f /boot/initrd*.img
+cp /etc/sysconfig/mkinitrd /etc/mayflower.conf
+ver=`ls /boot/vmlinuz* |head -n 1 |sed -e 's;/boot/vmlinuz-;;'`
+/usr/lib/livecd-creator/mayflower -f /boot/initrd-$ver.img $ver
+rm -f /etc/mayflower.conf
+
%end
@@ -175,4 +183,7 @@ if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi
cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS
fi
+
+# move the initrd we created to be the booted one
+mv $INSTALL_ROOT/boot/initrd-*.img $LIVE_ROOT/isolinux/initrd0.img
%end
commit 2d81880202d017bc802316cc60354597391e1030
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue Feb 26 17:54:54 2008 -0500
Stop using mayflower for building the live initrd
mkinitrd is starting to gain some support for building initrds for live
systems. We should just use that initrd rather than creating our own and
carrying our own infrastructure for this.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index bbb17ef..13dd84d 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -26,8 +26,6 @@ from imgcreate.errors import *
from imgcreate.fs import *
from imgcreate.creator import *
-MAYFLOWER_PATH = "/usr/lib/livecd-creator/mayflower"
-
class LiveImageCreatorBase(LoopImageCreator):
"""A base class for LiveCD image creators.
@@ -177,6 +175,7 @@ class LiveImageCreatorBase(LoopImageCreator):
if not base_on is None:
self.__base_on_iso(base_on)
LoopImageCreator._mount_instroot(self)
+ self.__write_initrd_conf(self._instroot + "/etc/sysconfig/mkinitrd")
def __ensure_isodir(self):
if self.__isodir is None:
@@ -185,7 +184,6 @@ class LiveImageCreatorBase(LoopImageCreator):
def _create_bootconfig(self):
"""Configure the image so that it's bootable."""
- self.__create_initramfs()
self._configure_bootloader(self.__ensure_isodir())
def _get_post_scripts_env(self, in_chroot):
@@ -196,26 +194,13 @@ class LiveImageCreatorBase(LoopImageCreator):
return env
- #
- # Try to use mayflower if running from git tree
- #
- def __mayflower_path(self):
- if not globals().has_key("__file__"):
- return MAYFLOWER_PATH
-
- pydir = os.path.abspath(os.path.dirname(__file__))
- if pydir.startswith("/usr/lib"):
- return MAYFLOWER_PATH
-
- git_mayflower = os.path.join(pydir, "../tools/mayflower")
- if not os.path.exists(git_mayflower):
- return MAYFLOWER_PATH
-
- return git_mayflower
-
- def __write_mayflower_conf(self, path):
+ def __write_initrd_conf(self, path):
+ if not os.path.exists(os.path.dirname(path)):
+ makedirs(os.path.dirname(path))
f = open(path, "a")
+ f.write('LIVEOS="yes"\n')
+ f.write('PROBE="no"\n')
f.write('MODULES+="squashfs ext3 ext2 vfat msdos "\n')
f.write('MODULES+="sr_mod sd_mod ide-cd "\n')
@@ -233,27 +218,6 @@ class LiveImageCreatorBase(LoopImageCreator):
f.close()
- def __create_initramfs(self):
- mayflower = self.__mayflower_path()
- if not os.path.isfile(mayflower):
- raise CreatorError("livecd-creator not correctly installed : "
- "%s not found" % MAYFLOWER_PATH)
-
- shutil.copy(mayflower, self._instroot + "/sbin")
-
- self.__write_mayflower_conf(self._instroot + "/etc/mayflower.conf")
-
- kernels = self._get_kernel_versions()
- for kernel in kernels:
- for version in kernels[kernel]:
- subprocess.call(["/sbin/mayflower", "-f",
- "/boot/livecd-initramfs-%s.img" % (version,),
- version],
- preexec_fn=self._chroot),
-
- os.unlink(self._instroot + "/sbin/mayflower")
- os.unlink(self._instroot + "/etc/mayflower.conf")
-
def __create_iso(self, isodir):
iso = self._outdir + "/" + self.name + ".iso"
@@ -371,9 +335,8 @@ class x86LiveImageCreator(LiveImageCreatorBase):
shutil.copyfile(bootdir + "/vmlinuz-" + version,
isodir + "/isolinux/vmlinuz" + index)
- shutil.copyfile(bootdir + "/livecd-initramfs-" + version + ".img",
+ shutil.copyfile(bootdir + "/initrd-" + version + ".img",
isodir + "/isolinux/initrd" + index + ".img")
- os.unlink(bootdir + "/livecd-initramfs-" + version + ".img")
is_xen = False
if os.path.exists(bootdir + "/boot/xen.gz-" + version[:-3]):
@@ -572,9 +535,8 @@ class ppcLiveImageCreator(LiveImageCreatorBase):
shutil.copyfile(bootdir + "/vmlinuz-" + version,
destdir + "/vmlinuz")
- shutil.copyfile(bootdir + "/livecd-initramfs-" + version + ".img",
+ shutil.copyfile(bootdir + "/initrd-" + version + ".img",
destdir + "/initrd.img")
- os.unlink(bootdir + "/livecd-initramfs-" + version + ".img")
def __get_basic_yaboot_config(self, **args):
return """
16 years
liveinst failed on my own live iso
by jie sun
I try to run liveinst after I run livecd-creator to create a live cd iso on fc7.
And I got the following errror:
[root@localhost tmp]# liveinst
FATAL: Module md not found.
/usr/sbin/setenforce: SELinux is disabled
Probing for video card: ATI Technologies Inc Rage XL
Graphical installation not available... Starting text mode.
Traceback (most recent call first):
File "/usr/lib/anaconda/livecd.py", line 289, in doPostInstall
f.close()
File "/usr/lib/anaconda/backend.py", line 233, in doPostInstall
anaconda.backend.doPostInstall(anaconda)
File "/usr/lib/anaconda/dispatch.py", line 203, in moveStep
rc = stepFunc(self.anaconda)
File "/usr/lib/anaconda/dispatch.py", line 126, in gotoNext
self.moveStep()
File "/usr/lib/anaconda/text.py", line 605, in run
anaconda.dispatch.gotoNext()
File "/usr/sbin/anaconda", line 955, in <module>
anaconda.intf.run(anaconda)
IOError: [Errno 22] Invalid argument
/usr/sbin/setenforce: SELinux is disabled
[root@localhost tmp]#
Any idea?
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
16 years
livecd-creator in fc7 can't access /etc/hosts and /etc/sysconfig/network
by jie sun
Hi,
when I put cp /etc/hosts /etc/hosts.me in %post section in my ks file and run livecd-creator --config=my ks, I always got error message saying cannot stat /etc/hosts: no such file or directory. The same for /etc/sysconfig/network file.
It seems livecd-creator in fc7 can not access both /etc/hosts and /etc/sysconfig/network file.
In fc8, I had no such problem.
Any idea why livecd-creator in fc7 can not access /etc/hosts file?
Regards,
Jie
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
16 years
imgcreate/live.py
by Jeremy Katz
imgcreate/live.py | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 48a7de783beb7a28d6ed4deadbacee5aa91c6831
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Wed Feb 27 17:59:41 2008 -0500
Remove our /etc/sysconfig/mkinitrd
Leaving our /etc/sysconfig/mkinitrd around breaks later installs, so we should
just remove it
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 13dd84d..0474d59 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -177,6 +177,13 @@ class LiveImageCreatorBase(LoopImageCreator):
LoopImageCreator._mount_instroot(self)
self.__write_initrd_conf(self._instroot + "/etc/sysconfig/mkinitrd")
+ def _unmount_instroot(self):
+ try:
+ os.unlink(self._instroot + "/etc/sysconfig/mkinitrd")
+ except:
+ pass
+ LoopImageCreator._unmount_instroot(self)
+
def __ensure_isodir(self):
if self.__isodir is None:
self.__isodir = self._mkdtemp("iso-")
16 years
liveinst won't run
by Miroslav Tomic
Dear list members,
I'm using livecd-creator for the first time, and for a
test, I've used livecd-fedora-8-desktop.ks. The only
thing I've changed in the kickstart file is setting
the local repo and setting the different language (and
not the keyboard) in livecd-fedora-8-base-desktop.ks.
Everything went just fine during build. I've burnt the
LiveCD.iso that I've got, tested the media and let the
system boot. The first thing I've noticed are some
misspelled characters during boot, which are language
specific, but it's something that doesn't bother me at
all. After the system has booted, I've noticed that
there was no icon on the desktop that should let me
install the distro. So I've ran /usr/bin/liveinst but
it failed to install. The output is attached and I
have no idea what could be wrong. The way I see it, it
has something to do with indexes, as far as regarding
the last line, stating "Index error: list index out of
range"... Have looked at scripts and lines mentioned
in the error output, but have not noticed anything
anusual... but then again, I'm not that good at
python...
One more thing: I've built two Live CD's - one of them
has used only packages from Everything repo (which
should be the packages Fedora's LiveCD i686 is build
upon) and another one was using both Everything and
Updates repo's packages (so it had updated packages) -
but the result was the same, giving me the same
error...
Any ideas where to look?
Thank you in advance!
Regards.
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
16 years
RFC: Remove explicit initrd creation from livecd creation
by Jeremy Katz
I've made the first step[1] towards actually getting the initrd for
livecds to be created as part of the "normal" mkinitrd that gets run
when the kernel is installed in rawhide. This, though, means that
running mayflower from livecd-creator is fairly overkill and even likely
to cause problems as the two are unlikely to be kept in sync.
Therefore, I'd like to propose removing mayflower and the calls to use
it from the livecd build process. This, though, would mean that
pre-Fedora 9 images would need a little bit of config work to continue
building them with git livecd-tools. Basically, for those configs, we'd
likely end up just wanting to pull livecd-tools into their manifest and
then have the %post of the config run mayflower. I'll fix up the F8
configs when doing so, but will probably drop the < F8 configs from the
package.
Anyone see any real problems with this?
Jeremy
[1] At this point, it's pretty crude but it at least moves us in the
right direction and gets us to stop thinking "oh we can just change
livecd-tools and change the boot"
16 years
Corrupted RPMs
by Tim Wood
The LiveCDs I've been trying to create today are all failing. In each
case I'm getting what looks like corrupted rpms from official repositories.
I've forced it to use three different repositories with similar
results All of the RPMs in question are either release or update
fedora 8 rpms. The only solutions I can think of vis-a-vis the RPMs is
to some variant of rebuilding, trying all the mirrors or
waaaaiiiitttting. Any other suggestions?
Tim
[snip]
Retrieving
http://linux.nssl.noaa.gov/fedora/linux/releases/8/Everything/i386/os/Pac...
...OK
Retrieving
http://mirror.cc.vt.edu/pub/fedora/linux/updates/8/i386/rarian-0.6.0-3.fc...
...OK
Retrieving
http://mirror.cc.vt.edu/pub/fedora/linux/updates/8/i386/rarian-compat-0.6...
...OK
Retrieving
http://linux.nssl.noaa.gov/fedora/linux/releases/8/Everything/i386/os/Pac...
...OK
Reducing None to included packages only
[snip]
warning: setup-2.6.10-1.fc8: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Installing: setup ##################### [ 2/800]
[snip]
Installing: bluecurve-icon-theme ##################### [266/800]
/var/tmp/rpm-tmp.74071: line 1: touch: command not found
Installing: fedora-release-notes ##################### [267/800]
[snip]
Installing: rarian-compat ##################### [364/800]
add command failed
could not open /etc/xml/catalog for saving
add command failed
could not open /etc/xml/catalog for saving
error: %post(rarian-compat-0.6.0-3.fc8.i386) scriptlet failed, exit status 2
[snip]
Pass 5: Checking group summary information
tdw-sw-gateway-0: 91674/262144 files (0.3% non-contiguous), 517402/517402 blocks
Traceback (most recent call last):
File "/usr/bin/livecd-creator", line 132, in <module>
sys.exit(main())
File "/usr/bin/livecd-creator", line 122, in main
creator.package()
File "/usr/lib/python2.5/site-packages/imgcreate/creator.py", line 655, in package
self._stage_final_image()
File "/usr/lib/python2.5/site-packages/imgcreate/live.py", line 295, in _stage_final_image
self._image, minimal_size)
File "/usr/lib/python2.5/site-packages/imgcreate/fs.py", line 393, in create_image_minimizer
cowloop.create()
File "/usr/lib/python2.5/site-packages/imgcreate/fs.py", line 193, in create
self.expand(create = True)
File "/usr/lib/python2.5/site-packages/imgcreate/fs.py", line 179, in expand
fd = os.open(self.lofile, flags)
OSError: [Errno 20] Not a directory: '/var/tmp/imgcreate-zO-jIc/iso-HB_7Wh/LiveOS/osmin'
16 years