update to fedora 18

This commit is contained in:
root 2012-10-01 16:19:38 +04:00
parent d46ddf5f6c
commit ffcecdb0c4
25 changed files with 461 additions and 2243 deletions

View file

@ -1,2 +1,2 @@
sources:
"livecd-tools-031.tar.bz2": 4e9d76742318e350c8acee4cb1cacb6a54f4c9c7
"livecd-tools-18.8.tar.bz2": 3e8ba40944b677f9ee1340ffff9c099df43682b6

View file

@ -1,26 +0,0 @@
From c7b333bcf57819d8c624445dfa2074a6004b55f4 Mon Sep 17 00:00:00 2001
From: Jesse Keating <jkeating@redhat.com>
Date: Sun, 8 Nov 2009 13:02:01 -0800
Subject: [PATCH] Disable iswmd on live images for now
This can lead to corrupt Intel raid arrays (533739)
---
imgcreate/live.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 78cbff7..c4d2025 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -465,7 +465,7 @@ menu hiddenrow 5
# tell dracut not to ask for LUKS passwords or activate mdraid sets
if isDracut:
- kern_opts = kernel_options + " rd_NO_LUKS rd_NO_MD"
+ kern_opts = kernel_options + " rd_NO_LUKS rd_NO_MD noiswmd"
else:
kern_opts = kernel_options
--
1.6.5.2

View file

@ -1,18 +0,0 @@
Index: Makefile
===================================================================
--- Makefile
+++ Makefile 2009-01-15 14:45:38.000000000 +0100
@@ -11,9 +11,11 @@
python -c "import compileall as c; c.compile_dir('$(1)', force=1)"
python -O -c "import compileall as c; c.compile_dir('$(1)', force=1)"
endef
-PYTHONDIR := $(shell python -c "import distutils.sysconfig as d; print d.get_python_lib()")
+LIBNAME := $(shell python -c "import sys as d; print d.lib")
+# TODO : Must fix python version
+PYTHONDIR := /usr/$(LIBNAME)/python2.7/site-packages/
-all:
+all:
man:
pod2man --section=8 --release="livecd-tools $(VERSION)" --center "LiveCD Tools" docs/livecd-creator.pod > docs/livecd-creator.8

View file

@ -1,39 +0,0 @@
diff -Nur livecd-tools-031.orig/tools/livecd-iso-to-disk-oem.sh livecd-tools-031/tools/livecd-iso-to-disk-oem.sh
--- livecd-tools-031.orig/tools/livecd-iso-to-disk-oem.sh 2011-03-15 12:54:56.000000000 +0300
+++ livecd-tools-031/tools/livecd-iso-to-disk-oem.sh 2011-03-15 13:06:39.639928232 +0300
@@ -336,6 +336,26 @@
}
+cp_p()
+{
+#add progress bar to copy process
+ strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
+ | awk '{
+ count += $NF
+ if (count % 10 == 0) {
+ percent = count / total_size * 100
+ printf "%3d%% [", percent
+ for (i=0;i<=percent;i++)
+ printf "="
+ printf ">"
+ for (i=percent;i<100;i++)
+ printf " "
+ printf "]\r"
+ }
+ }
+ END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
+}
+
cryptedhome=1
keephome=1
homesizemb=0
@@ -577,7 +597,7 @@
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
+ cp_p $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

View file

@ -1,52 +0,0 @@
diff -ur livecd-tools-031.orig/imgcreate/creator.py livecd-tools-031/imgcreate/creator.py
--- livecd-tools-031.orig/imgcreate/creator.py 2011-01-26 11:01:32.000000000 +0300
+++ livecd-tools-031/imgcreate/creator.py 2011-01-25 12:25:12.000000000 +0300
@@ -757,10 +757,10 @@
kickstart.NetworkConfig(self._instroot).apply(ksh.network)
kickstart.RPMMacroConfig(self._instroot).apply(self.ks)
- self._create_bootconfig()
-
self.__run_post_scripts()
+ self._create_bootconfig()
+
def launch_shell(self):
"""Launch a shell in the install root.
diff -ur livecd-tools-031.orig/imgcreate/errors.py livecd-tools-031/imgcreate/errors.py
--- livecd-tools-031.orig/imgcreate/errors.py 2009-10-30 00:26:09.000000000 +0300
+++ livecd-tools-031/imgcreate/errors.py 2011-01-26 10:55:38.000000000 +0300
@@ -54,3 +54,5 @@
pass
class ResizeError(CreatorError):
pass
+class InitramfsError(CreatorError):
+ pass
Только в livecd-tools-031/imgcreate: errors.py~
diff -ur livecd-tools-031.orig/imgcreate/live.py livecd-tools-031/imgcreate/live.py
--- livecd-tools-031.orig/imgcreate/live.py 2011-01-26 11:01:32.000000000 +0300
+++ livecd-tools-031/imgcreate/live.py 2011-01-26 10:59:15.000000000 +0300
@@ -385,14 +385,18 @@
shutil.copyfile(bootdir + "/vmlinuz-" + version,
isodir + "/isolinux/vmlinuz" + index)
+ subprocess.call(["/sbin/dracut", "/boot/initramfs-" + version + ".img", version],
+ preexec_fn = self._chroot)
+
isDracut = False
if os.path.exists(bootdir + "/initramfs-" + version + ".img"):
shutil.copyfile(bootdir + "/initramfs-" + version + ".img",
isodir + "/isolinux/initrd" + index + ".img")
isDracut = True
else:
- shutil.copyfile(bootdir + "/initrd-" + version + ".img",
- isodir + "/isolinux/initrd" + index + ".img")
+ raise InitramfsError("Unable to create initramfs-" + version + ".img")
+ #shutil.copyfile(bootdir + "/initrd-" + version + ".img",
+ #isodir + "/isolinux/initrd" + index + ".img")
is_xen = False
if os.path.exists(bootdir + "/xen.gz-" + version[:-3]):
Только в livecd-tools-031/imgcreate: live.py~
Только в livecd-tools-031/imgcreate: live.py.orig

View file

@ -1,21 +0,0 @@
diff -Nur livecd-tools-031.orig/tools/livecd-iso-to-disk-oem.sh livecd-tools-031/tools/livecd-iso-to-disk-oem.sh
--- livecd-tools-031.orig/tools/livecd-iso-to-disk-oem.sh 2011-04-05 11:43:52.000000000 +0400
+++ livecd-tools-031/tools/livecd-iso-to-disk-oem.sh 2011-04-05 12:53:51.752192945 +0400
@@ -295,7 +295,7 @@
createpartitions () {
#cyl_size=$(/usr/sbin/parted $device -sm unit cyl p | awk {'FS=":"; if (FNR==3) print $4'}| sed -e 's/kB;$//')
- cyl_size=$(( $(/sbin/fdisk -l $device | awk '{ if (FNR==4) print $9 }')/1024 ))
+ cyl_size=$(( $(/sbin/fdisk -u=cylinders -l $device | awk '{ if (FNR==4) print $9 }')/1024 ))
devinfo=$(/usr/sbin/parted --script -m $device "unit MB print" |grep ^$device:)
devsize=$(echo $devinfo |cut -d : -f 2 |sed -e 's/MB$//')
@@ -311,7 +311,7 @@
if [ "$systemsize" -le "$devsize" ]
then
- /sbin/fdisk $device 2>/dev/null 1>/dev/null << EOF
+ /sbin/fdisk -u=cylinders $device 2>/dev/null 1>/dev/null << EOF
o
n
p

View file

@ -1,53 +0,0 @@
diff -Nur livecd-tools-031.orig/docs/livecd-iso-to-disk.pod livecd-tools-031/docs/livecd-iso-to-disk.pod
--- livecd-tools-031.orig/docs/livecd-iso-to-disk.pod 2009-10-30 00:26:09.000000000 +0300
+++ livecd-tools-031/docs/livecd-iso-to-disk.pod 2011-02-16 16:47:46.427623627 +0300
@@ -6,45 +6,21 @@
=head1 SYNOPSIS
-B<livecd-iso-to-disk> [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [\-\-home\-size\-mb <size>] [\-\-unencrypted\-home] [\-\-skipcopy] <path-to-iso> <usb storage device>
+B<livecd-iso-to-disk> [--verify] <path-to-iso> <usb storage device>
=head1 DESCRIPTION
B<livecd-iso-to-disk> installs a live CD or DVD image(ISO image) onto a USB storage device. The USB storage device can then boot the installed operating system on systems which support booting via USB. B<livecd-iso-to-disk> requires an ISO image and a USB storage device. ISO images can be created with B<livecd-creator>.
-B<livecd-iso-to-disk> is not a destructive process; any data you currently have on your USB stick is preserved.
+B<livecd-iso-to-disk> is a destructive process; any data you currently have on your USB stick is lost.
=head1 OPTIONS
=over 4
-=item --format
+=item --verify
-Formats the USB stick and creates a GPT partition table.
-
-=item --reset-mbr
-
-Sets the Master Boot Record(MBR) of the USB storage device to the mbr.bin file from the image's syslinux directory.
-
-=item --noverify
-
-Disables the image validation process which occurs before the image is installed. When this option is enabled the image is not verified before installation on the USB storage device.
-
-=item --overlay-size-mb
-
-This option sets the overlay size in megabytes. The overlay is additional storage available to the live operating system if the operating system supports it. The USB storage device must have enough free space for the image and the overlay.
-
-=item --home-size-mb
-
-Sets the home directory size in megabytes.
-
-=item --unencrypted-home
-
-Disables the encryption of the home directory.
-
-=item --skipcopy
-
-Skips the copy of the live image to the USB stick.
+Enables the image validation process which occurs before the image is installed. When this option is enabled the image is not verified before installation on the USB storage device.
=back

View file

@ -1,790 +0,0 @@
diff -Nur livecd-tools-031.orig/Makefile livecd-tools-031/Makefile
--- livecd-tools-031.orig/Makefile 2011-02-14 18:10:38.000000000 +0300
+++ livecd-tools-031/Makefile 2011-02-14 18:11:03.565196123 +0300
@@ -25,7 +25,7 @@
install: man
$(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-disk-oem.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_DATA) -D AUTHORS $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/AUTHORS
$(INSTALL_DATA) -D COPYING $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/COPYING
diff -Nur livecd-tools-031.orig/tools/livecd-iso-to-disk-oem.sh livecd-tools-031/tools/livecd-iso-to-disk-oem.sh
--- livecd-tools-031.orig/tools/livecd-iso-to-disk-oem.sh 1970-01-01 03:00:00.000000000 +0300
+++ livecd-tools-031/tools/livecd-iso-to-disk-oem.sh 2011-02-14 18:21:53.077445005 +0300
@@ -0,0 +1,774 @@
+#!/bin/bash
+# Convert a live CD iso so that it's bootable off of a USB stick
+# Copyright 2007 Red Hat, Inc.
+# Jeremy Katz <katzj@redhat.com>
+#
+# overlay/persistence enhancements by Douglas McClendon <dmc@viros.org>
+# GPT+MBR hybrid enhancements by Stewart Adam <s.adam@diffingo.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 "$0 [--verify] <isopath> <usbstick device>"
+ exit 1
+}
+
+cleanup() {
+ sleep 2
+ [ -d "$CDMNT" ] && umount $CDMNT && rmdir $CDMNT
+ [ -d "$USBMNT" ] && umount $USBMNT && rmdir $USBMNT
+}
+
+exitclean() {
+ echo "Cleaning up to exit..."
+ cleanup
+ exit 1
+}
+
+getdisk() {
+ DEV=$1
+
+ if [[ "$DEV" =~ "/dev/loop*" ]]; then
+ device="$DEV"
+ return
+ fi
+
+ p=$(udevadm info -q path -n $DEV)
+ if [ -e /sys/$p/device ]; then
+ device=$(basename /sys/$p)
+ else
+ device=$(basename $(readlink -f /sys/$p/../))
+ fi
+ if [ ! -e /sys/block/$device -o ! -e /dev/$device ]; then
+ echo "Error finding block device of $DEV. Aborting!"
+ exitclean
+ fi
+
+ device="/dev/$device"
+ # FIXME: weird dev names could mess this up I guess
+ p=/dev/`basename $p`
+ partnum=${p##$device}
+}
+
+resetMBR() {
+ if [[ "$DEV" =~ "/dev/loop*" ]]; then
+ return
+ fi
+ getdisk $1
+ # if efi, we need to use the hybrid MBR
+ if [ -n "$efi" ];then
+ if [ -f /usr/lib/syslinux/gptmbr.bin ]; then
+ gptmbr='/usr/lib/syslinux/gptmbr.bin'
+ elif [ -f /usr/share/syslinux/gptmbr.bin ]; then
+ gptmbr='/usr/share/syslinux/gptmbr.bin'
+ else
+ echo "Could not find gptmbr.bin (syslinux)"
+ exitclean
+ fi
+ # our magic number is LBA-2, offset 16 - (512+512+16)/$bs
+ dd if=$device bs=16 skip=65 count=1 | cat $gptmbr - > $device
+ else
+ if [ -f /usr/lib/syslinux/mbr.bin ]; then
+ cat /usr/lib/syslinux/mbr.bin > $device
+ elif [ -f /usr/share/syslinux/mbr.bin ]; then
+ cat /usr/share/syslinux/mbr.bin > $device
+ else
+ echo "Could not find mbr.bin (syslinux)"
+ exitclean
+ fi
+ fi
+}
+
+checkMBR() {
+ if [[ "$DEV" =~ "/dev/loop*" ]]; then
+ return 0
+ fi
+ getdisk $1
+
+ bs=$(mktemp /tmp/bs.XXXXXX)
+ dd if=$device of=$bs bs=512 count=1 2>/dev/null || exit 2
+
+ mbrword=$(hexdump -n 2 $bs |head -n 1|awk {'print $2;'})
+ rm -f $bs
+ if [ "$mbrword" = "0000" ]; then
+ echo "MBR appears to be blank."
+ echo "Do you want to replace the MBR on this device?"
+ echo "Press Enter to continue or ctrl-c to abort"
+ read
+ resetMBR $1
+ fi
+
+ return 0
+}
+
+checkPartActive() {
+ dev=$1
+ getdisk $dev
+
+ # if we're installing to whole-disk and not a partition, then we
+ # don't need to worry about being active
+ if [ "$dev" = "$device" ]; then
+ return
+ fi
+ if [[ "$dev" =~ "/dev/loop*" ]]; then
+ return
+ fi
+
+ if [ "$(/sbin/fdisk -l $device 2>/dev/null |grep $dev |awk {'print $2;'})" != "*" ]; then
+ echo "Partition isn't marked bootable!"
+ echo "You can mark the partition as bootable with "
+ echo " # /usr/sbin/parted $device"
+ echo " (parted) toggle N boot"
+ echo " (parted) quit"
+ exitclean
+ fi
+}
+
+createGPTLayout() {
+ dev=$1
+ getdisk $dev
+
+ echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
+ echo "Press Enter to continue or ctrl-c to abort"
+ read
+ umount ${device}? &> /dev/null
+ /usr/sbin/parted --script $device mklabel gpt
+ partinfo=$(/usr/sbin/parted --script -m $device "unit b print" |grep ^$device:)
+ size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
+ /usr/sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 17408 $(($size - 17408)) set 1 boot on
+ USBDEV=${device}1
+ # Sometimes automount can be _really_ annoying.
+ echo "Waiting for devices to settle..."
+ /sbin/udevadm settle
+ sleep 5
+ umount $USBDEV &> /dev/null
+ /sbin/mkdosfs -n LIVE $USBDEV
+ USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
+}
+
+createMSDOSLayout() {
+ dev=$1
+ getdisk $dev
+
+ echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
+ echo "Press Enter to continue or ctrl-c to abort"
+ read
+ umount ${device}? &> /dev/null
+ /usr/sbin/parted --script $device mklabel msdos
+ partinfo=$(/usr/sbin/parted --script -m $device "unit b print" |grep ^$device:)
+ size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
+ /usr/sbin/parted --script $device unit b mkpart primary fat32 17408 $(($size - 17408)) set 1 boot on
+ USBDEV=${device}1
+ # Sometimes automount can be _really_ annoying.
+ echo "Waiting for devices to settle..."
+ /sbin/udevadm settle
+ sleep 5
+ umount $USBDEV &> /dev/null
+ /sbin/mkdosfs -n LIVE $USBDEV
+ USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
+}
+
+checkGPT() {
+ dev=$1
+ getdisk $dev
+
+ if [ "$(/sbin/fdisk -l $device 2>/dev/null |grep -c GPT)" -eq "0" ]; then
+ echo "EFI boot requires a GPT partition table."
+ echo "This can be done manually or you can run with --format"
+ exitclean
+ fi
+
+ partinfo=$(/usr/sbin/parted --script -m $device "print" |grep ^$partnum:)
+ volname=$(echo $partinfo |cut -d : -f 6)
+ flags=$(echo $partinfo |cut -d : -f 7)
+ if [ "$volname" != "EFI System Partition" ]; then
+ echo "Partition name must be 'EFI System Partition'"
+ echo "This can be set in parted or you can run with --reset-mbr"
+ exitclean
+ fi
+ if [ "$(echo $flags |grep -c boot)" = "0" ]; then
+ echo "Partition isn't marked bootable!"
+ echo "You can mark the partition as bootable with "
+ echo " # /usr/sbin/parted $device"
+ echo " (parted) toggle N boot"
+ echo " (parted) quit"
+ exitclean
+ fi
+}
+
+checkFilesystem() {
+ dev=$1
+
+ USBFS=$(/sbin/blkid -s TYPE -o value $dev)
+ if [ "$USBFS" != "vfat" -a "$USBFS" != "msdos" -a "$USBFS" != "ext2" -a "$USBFS" != "ext3" ]; then
+ echo "USB filesystem must be vfat or ext[23]"
+ exitclean
+ fi
+
+ USBLABEL=$(/sbin/blkid -s UUID -o value $dev)
+ if [ -n "$USBLABEL" ]; then
+ USBLABEL="UUID=$USBLABEL" ;
+ else
+ USBLABEL=$(/sbin/blkid -s LABEL -o value $dev)
+ if [ -n "$USBLABEL" ]; then
+ USBLABEL="LABEL=$USBLABEL"
+ else
+ echo "Need to have a filesystem label or UUID for your USB device"
+ if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
+ echo "Label can be set with /sbin/dosfslabel"
+ elif [ "$USBFS" = "ext2" -o "$USBFS" = "ext3" ]; then
+ echo "Label can be set with /sbin/e2label"
+ fi
+ exitclean
+ fi
+ fi
+
+ if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
+ mountopts="-o shortname=winnt,umask=0077"
+ fi
+}
+
+checkSyslinuxVersion() {
+ if [ ! -x /usr/bin/syslinux ]; then
+ echo "You need to have syslinux installed to run this script"
+ exit 1
+ fi
+ if ! syslinux 2>&1 | grep -qe -d; then
+ SYSLINUXPATH=""
+ elif [ -n "$multi" ]; then
+ SYSLINUXPATH="$LIVEOS/syslinux"
+ else
+ SYSLINUXPATH="syslinux"
+ fi
+}
+
+checkMounted() {
+ dev=$1
+ if grep -q "^$dev" /proc/mounts ; then
+ echo "$dev is mounted, please unmount for safety"
+ exitclean
+ fi
+ if grep -q "^$dev " /proc/swaps; then
+ echo "$dev is in use as a swap device, please disable swap"
+ exitclean
+ fi
+}
+
+checkint() {
+ if ! test $1 -gt 0 2>/dev/null ; then
+ usage
+ fi
+}
+
+if [ $(id -u) != 0 ]; then
+ echo "You need to be root to run this script"
+ exit 1
+fi
+
+detectisotype() {
+ if [ -e $CDMNT/LiveOS/squashfs.img ]; then
+ isotype=live
+ return
+ fi
+ if [ -e $CDMNT/images/install.img ]; then
+ isotype=installer
+ return
+ fi
+ echo "ERROR: $ISO does not appear to be a Live image or DVD installer."
+ exitclean
+}
+
+createpartitions () {
+
+ #cyl_size=$(/usr/sbin/parted $device -sm unit cyl p | awk {'FS=":"; if (FNR==3) print $4'}| sed -e 's/kB;$//')
+ cyl_size=$(( $(/sbin/fdisk -l $device | awk '{ if (FNR==4) print $9 }')/1024 ))
+
+ devinfo=$(/usr/sbin/parted --script -m $device "unit MB print" |grep ^$device:)
+ devsize=$(echo $devinfo |cut -d : -f 2 |sed -e 's/MB$//')
+ devsize_cyl=$(( $devsize*1000/$cyl_size ))
+
+ partnumber=$(( $(/usr/sbin/parted --script -m $device print | wc -l) - 2 ))
+
+ livesize=$(du -s -B 1MB $CDMNT | awk {'print $1;'})
+
+ systemsize=$(($overlaysizemb + $homesizemb + $livesize + $swapsizemb + 100))
+ systemsize_cyl=$(( $systemsize*1024/$cyl_size ))
+
+ if [ "$systemsize" -le "$devsize" ]
+ then
+
+ /sbin/fdisk $device 2>/dev/null 1>/dev/null << EOF
+ o
+ n
+ p
+ 1
+
+ $systemsize_cyl
+ n
+ p
+ 2
+
+
+ w
+EOF
+
+ /usr/sbin/parted --script $device set 1 boot on
+ fi
+
+ /sbin/mkfs.ext2 -L SYSTEM ${device}1
+ /sbin/mkfs.ext2 -L DATA ${device}2
+
+ DATA_UUID=$(blkid -s UUID -o value ${device}2)
+
+}
+
+cryptedhome=1
+keephome=1
+homesizemb=0
+swapsizemb=0
+overlaysizemb=0
+isotype=
+LIVEOS=LiveOS
+
+HOMEFILE="home.img"
+while [ $# -gt 2 ]; do
+ case $1 in
+ --verify)
+ verify=1
+ ;;
+ *)
+ echo "invalid arg -- $1"
+ usage
+ ;;
+ esac
+ shift
+done
+
+#use resetmbr by default
+resetmbr=1
+
+if [ ! -e "$1" ]; then
+ echo "Check isopath..."
+ usage
+fi
+
+if [ ! -e "$2" ]; then
+ echo "Check usbstick device..."
+ usage
+fi
+
+ISO=$(readlink -f "$1")
+device="$2"
+USBDEV=${device}1
+
+checkMounted $device
+
+if [ -z "$ISO" ]; then
+ usage
+fi
+
+if [ ! -b "$ISO" -a ! -f "$ISO" ]; then
+ usage
+fi
+
+# FIXME: If --format is given, we shouldn't care and just use /dev/foo1
+if [ -z "$USBDEV" -o ! -b "$USBDEV" ]; then
+ usage
+fi
+
+if [ -n "$verify" ]; then
+ # verify the image
+ echo "Verifying image..."
+ checkisomd5 --verbose "$ISO"
+ if [ $? -ne 0 ]; then
+ echo "Are you SURE you want to continue?"
+ echo "Press Enter to continue or ctrl-c to abort"
+ read
+ fi
+fi
+
+CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
+mount -o loop,ro "$ISO" $CDMNT || exitclean
+
+createpartitions
+sleep 5
+checkFilesystem $USBDEV
+
+# do some basic sanity checks.
+#checkMounted $USBDEV
+if [ -n "$format" ];then
+ # checks for a valid filesystem
+ if [ -n "$efi" ];then
+ createGPTLayout $USBDEV
+ else
+ createMSDOSLayout $USBDEV
+ fi
+fi
+#checkFilesystem $USBDEV
+if [ -n "$efi" ]; then
+ checkGPT $USBDEV
+fi
+checkSyslinuxVersion
+# Because we can't set boot flag for EFI Protective on msdos partition tables
+[ -z "$efi" ] && checkPartActive $USBDEV
+[ -n "$resetmbr" ] && resetMBR $USBDEV
+checkMBR $USBDEV
+
+
+if [ "$overlaysizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
+ if [ "$overlaysizemb" -gt 2047 ]; then
+ echo "Can't have an overlay of 2048MB or greater on VFAT"
+ exitclean
+ fi
+fi
+
+if [ "$homesizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
+ if [ "$homesizemb" -gt 2047 ]; then
+ echo "Can't have a home overlay greater than 2048MB on VFAT"
+ exitclean
+ fi
+fi
+
+if [ "$swapsizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
+ if [ "$swapsizemb" -gt 2047 ]; then
+ echo "Can't have a swap file greater than 2048MB on VFAT"
+ exitclean
+ fi
+fi
+
+# FIXME: would be better if we had better mountpoints
+#CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
+#mount -o loop,ro "$ISO" $CDMNT || exitclean
+
+#createpartitions
+
+#checkFilesystem ${device}1
+
+USBMNT=$(mktemp -d /media/usbdev.XXXXXX)
+mount $mountopts $USBDEV $USBMNT || exitclean
+#USBDEV=${device}1
+#mount $mountopts ${device}1 $USBMNT || exitclean
+
+trap exitclean SIGINT SIGTERM
+
+detectisotype
+
+if [ -f "$USBMNT/$LIVEOS/$HOMEFILE" -a -n "$keephome" -a "$homesizemb" -gt 0 ]; then
+ echo "ERROR: Requested keeping existing /home and specified a size for /home"
+ echo "Please either don't specify a size or specify --delete-home"
+ exitclean
+fi
+
+if [ -n "$efi" -a ! -d $CDMNT/EFI/boot ]; then
+ echo "ERROR: This live image does not support EFI booting"
+ exitclean
+fi
+
+# let's try to make sure there's enough room on the stick
+if [ -d $CDMNT/LiveOS ]; then
+ check=$CDMNT/LiveOS
+else
+ check=$CDMNT
+fi
+if [ -d $USBMNT/$LIVEOS ]; then
+ tbd=$(du -s -B 1M $USBMNT/$LIVEOS | awk {'print $1;'})
+ [ -f $USBMNT/$LIVEOS/$HOMEFILE ] && homesz=$(du -s -B 1M $USBMNT/$LIVEOS/$HOMEFILE | awk {'print $1;'})
+ [ -n "$homesz" -a -n "$keephome" ] && tbd=$(($tbd - $homesz))
+else
+ tbd=0
+fi
+livesize=$(du -s -B 1M $check | awk {'print $1;'})
+if [ -n "$skipcompress" ]; then
+ if [ -e $CDMNT/LiveOS/squashfs.img ]; then
+ if mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT; then
+ livesize=$(du -s -B 1M $CDMNT/LiveOS/ext3fs.img | awk {'print $1;'})
+ umount $CDMNT
+ else
+ echo "WARNING: --skipcompress or --xo was specified but the currently"
+ echo "running kernel can not mount the squashfs from the ISO file to extract"
+ echo "it. The compressed squashfs will be copied to the USB stick."
+ skipcompress=""
+ fi
+ fi
+fi
+free=$(df -B1M $USBDEV |tail -n 1 |awk {'print $4;'})
+
+if [ "$isotype" = "live" ]; then
+tba=$(($overlaysizemb + $homesizemb + $livesize + $swapsizemb))
+if [ $tba -gt $(($free + $tbd)) ]; then
+ echo "Unable to fit live image + overlay on available space on USB stick"
+ echo "+ Size of live image: $livesize"
+ [ "$overlaysizemb" -gt 0 ] && echo "+ Overlay size: $overlaysizemb"
+ [ "$homesizemb" -gt 0 ] && echo "+ Home overlay size: $homesizemb"
+ [ "$swapsizemb" -gt 0 ] && echo "+ Swap overlay size: $swapsizemb"
+ echo "---------------------------"
+ echo "= Requested: $tba"
+ echo "- Available: $(($free + $tbd))"
+ echo "---------------------------"
+ echo "= To fit, free or decrease requested size total by: $(($tba - $free - $tbd))"
+ exitclean
+fi
+fi
+
+# Verify available space for DVD installer
+if [ "$isotype" = "installer" ]; then
+ isosize=$(du -s -B 1M $ISO | awk {'print $1;'})
+ installimgsize=$(du -s -B 1M $CDMNT/images/install.img | awk {'print $1;'})
+ tbd=0
+ if [ -e $USBMNT/images/install.img ]; then
+ tbd=$(du -s -B 1M $USBMNT/images/install.img | awk {'print $1;'})
+ fi
+ if [ -e $USBMNT/$(basename $ISO) ]; then
+ tbd=$(($tbd + $(du -s -B 1M $USBMNT/$(basename $ISO) | awk {'print $1;'})))
+ fi
+ echo "Size of DVD image: $isosize"
+ echo "Size of install.img: $installimgsize"
+ echo "Available space: $(($free + $tbd))"
+ if [ $(($isosize + $installimgsize)) -gt $(($free + $tbd)) ]; then
+ echo "ERROR: Unable to fit DVD image + install.img on available space on USB stick"
+ exitclean
+ fi
+fi
+
+
+if [ -z "$skipcopy" ] && [ "$isotype" = "live" ]; then
+ if [ -d $USBMNT/$LIVEOS -a -z "$force" ]; then
+ echo "Already set up as live image."
+ if [ -z "$keephome" -a -e $USBMNT/$LIVEOS/$HOMEFILE ]; then
+ echo "WARNING: Persistent /home will be deleted!!!"
+ echo "Press Enter to continue or ctrl-c to abort"
+ read
+ else
+ echo "Deleting old OS in fifteen seconds..."
+ sleep 15
+
+ [ -e "$USBMNT/$LIVEOS/$HOMEFILE" -a -n "$keephome" ] && mv $USBMNT/$LIVEOS/$HOMEFILE $USBMNT/$HOMEFILE
+ fi
+
+ rm -rf $USBMNT/$LIVEOS
+ fi
+fi
+
+#Bootloader is always reconfigured, so keep these out of the if skipcopy stuff.
+[ ! -d $USBMNT/$SYSLINUXPATH ] && mkdir -p $USBMNT/$SYSLINUXPATH
+[ -n "$efi" -a ! -d $USBMNT/EFI/boot ] && mkdir -p $USBMNT/EFI/boot
+
+#Live image copy
+if [ -z "$skipcopy" ] && [ "$isotype" = "live" ]; then
+ echo "Copying live image to USB stick"
+ [ ! -d $USBMNT/$LIVEOS ] && mkdir $USBMNT/$LIVEOS
+ [ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/$LIVEOS/$HOMEFILE
+ 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
+ if [ -f $CDMNT/LiveOS/osmin.img ]; then
+ cp $CDMNT/LiveOS/osmin.img $USBMNT/$LIVEOS/osmin.img || exitclean
+ fi
+fi
+
+# DVD installer copy
+if [ "$isotype" = "installer" ] && [ -z "$skipcopy" ]; then
+ echo "Copying DVD image to USB stick"
+ mkdir -p $USBMNT/images/
+ cp $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
+ cp $ISO $USBMNT/
+fi
+
+cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
+BOOTCONFIG=$USBMNT/$SYSLINUXPATH/isolinux.cfg
+# Set this to nothing so sed doesn't care
+BOOTCONFIG_EFI=
+if [ -n "$efi" ];then
+ cp $CDMNT/EFI/boot/* $USBMNT/EFI/boot
+
+ # this is a little ugly, but it gets the "interesting" named config file
+ BOOTCONFIG_EFI=$USBMNT/EFI/boot/boot?*.conf
+ rm -f $USBMNT/EFI/boot/grub.conf
+fi
+
+echo "Updating boot config file"
+# adjust label and fstype
+sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL data=UUID=$DATA_UUID/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" $BOOTCONFIG $BOOTCONFIG_EFI
+if [ -n "$kernelargs" ]; then sed -i -e "s/liveimg/liveimg ${kernelargs}/" $BOOTCONFIG $BOOTCONFIG_EFI ; fi
+if [ "$LIVEOS" != "LiveOS" ]; then sed -i -e "s;liveimg;liveimg live_dir=$LIVEOS;" $BOOTCONFIG $BOOTCONFIG_EFI ; fi
+
+# DVD Installer
+if [ "$isotype" = "installer" ]; then
+ sed -i -e "s;initrd=initrd.img;initrd=initrd.img repo=hd:$USBLABEL:/;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI
+fi
+
+if [ "$overlaysizemb" -gt 0 ]; then
+ echo "Initializing persistent overlay file"
+ OVERFILE="overlay-$( /sbin/blkid -s LABEL -o value $USBDEV )-$( /sbin/blkid -s UUID -o value $USBDEV )"
+ if [ "$USBFS" = "vfat" ]; then
+ # vfat can't handle sparse files
+ dd if=/dev/zero of=$USBMNT/$LIVEOS/$OVERFILE count=$overlaysizemb bs=1M
+ else
+ dd if=/dev/null of=$USBMNT/$LIVEOS/$OVERFILE count=1 bs=1M seek=$overlaysizemb
+ fi
+ 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
+ echo "Initializing swap file"
+ dd if=/dev/zero of=$USBMNT/$LIVEOS/swap.img count=$swapsizemb bs=1M
+ mkswap -f $USBMNT/$LIVEOS/swap.img
+fi
+
+if [ "$homesizemb" -gt 0 ]; then
+ echo "Initializing persistent /home"
+ homesource=/dev/zero
+ [ -n "$cryptedhome" ] && homesource=/dev/urandom
+ if [ "$USBFS" = "vfat" ]; then
+ # vfat can't handle sparse files
+ dd if=${homesource} of=$USBMNT/$LIVEOS/$HOMEFILE count=$homesizemb bs=1M
+ else
+ dd if=/dev/null of=$USBMNT/$LIVEOS/$HOMEFILE count=1 bs=1M seek=$homesizemb
+ fi
+ if [ -n "$cryptedhome" ]; then
+ loop=$(losetup -f)
+ losetup $loop $USBMNT/$LIVEOS/$HOMEFILE
+ setupworked=1
+ until [ ${setupworked} == 0 ]; do
+ echo "Encrypting persistent /home"
+ cryptsetup luksFormat -y -q $loop
+ setupworked=$?
+ done
+ setupworked=1
+ until [ ${setupworked} == 0 ]; do
+ echo "Please enter the password again to unlock the device"
+ cryptsetup luksOpen $loop EncHomeFoo
+ setupworked=$?
+ done
+ mke2fs -j /dev/mapper/EncHomeFoo
+ tune2fs -c0 -i0 -ouser_xattr,acl /dev/mapper/EncHomeFoo
+ sleep 2
+ cryptsetup luksClose EncHomeFoo
+ losetup -d $loop
+ else
+ echo "Formatting unencrypted /home"
+ mke2fs -F -j $USBMNT/$LIVEOS/$HOMEFILE
+ tune2fs -c0 -i0 -ouser_xattr,acl $USBMNT/$LIVEOS/$HOMEFILE
+ fi
+fi
+
+# create the forth files for booting on the XO if requested
+# we'd do this unconditionally, but you have to have a kernel that will
+# boot on the XO anyway.
+if [ -n "$xo" ]; then
+ echo "Setting up /boot/olpc.fth file"
+ args=$(egrep "^[ ]*append" $USBMNT/$SYSLINUXPATH/isolinux.cfg |head -n1 |sed -e 's/.*initrd=[^ ]*//')
+ if [ -z "$xonohome" -a ! -f $USBMNT/$LIVEOS/$HOMEFILE ]; then
+ args="$args persistenthome=mtd0"
+ fi
+ args="$args reset_overlay"
+ xosyspath=$(echo $SYSLINUXPATH | sed -e 's;/;\\;')
+ if [ ! -d $USBMNT/boot ]; then mkdir -p $USBMNT/boot ; fi
+ cat > $USBMNT/boot/olpc.fth <<EOF
+\ Boot script for USB boot
+hex rom-pa fffc7 + 4 \$number drop h# 2e19 < [if]
+ patch 2drop erase claim-params
+ : high-ramdisk ( -- )
+ cv-load-ramdisk
+ h# 22c +lp l@ 1+ memory-limit umin /ramdisk - ffff.f000 and ( new-ramdisk-adr )
+ ramdisk-adr over /ramdisk move ( new-ramdisk-adr )
+ to ramdisk-adr
+ ;
+ ' high-ramdisk to load-ramdisk
+[then]
+
+: set-bootpath-dev ( -- )
+ " /chosen" find-package if ( phandle )
+ " bootpath" rot get-package-property 0= if ( propval$ )
+ get-encoded-string ( bootpath$ )
+ [char] \ left-parse-string 2nip ( dn$ )
+ dn-buf place ( )
+ then
+ then
+
+ " /sd" dn-buf count sindex 0>= if
+ " sd:"
+ else
+ " u:"
+ then
+ " BOOTPATHDEV" \$set-macro
+;
+
+set-bootpath-dev
+" $args" to boot-file
+" \${BOOTPATHDEV}$xosyspath\initrd0.img" expand$ to ramdisk
+" \${BOOTPATHDEV}$xosyspath\vmlinuz0" expand$ to boot-device
+unfreeze
+boot
+EOF
+
+fi
+
+if [ -z "$multi" ]; then
+ echo "Installing boot loader"
+ if [ -n "$efi" ]; then
+ # replace the ia32 hack
+ if [ -f "$USBMNT/EFI/boot/boot.conf" ]; then cp -f $USBMNT/EFI/boot/bootia32.conf $USBMNT/EFI/boot/boot.conf ; fi
+ fi
+
+ # this is a bit of a kludge, but syslinux doesn't guarantee the API for its com32 modules :/
+ if [ -f $USBMNT/$SYSLINUXPATH/vesamenu.c32 -a -f /usr/share/syslinux/vesamenu.c32 ]; then
+ cp /usr/share/syslinux/vesamenu.c32 $USBMNT/$SYSLINUXPATH/vesamenu.c32
+ elif [ -f $USBMNT/$SYSLINUXPATH/vesamenu.c32 -a -f /usr/lib/syslinux/vesamenu.c32 ]; then
+ cp /usr/lib/syslinux/vesamenu.c32 $USBMNT/$SYSLINUXPATH/vesamenu.c32
+ elif [ -f $USBMNT/$SYSLINUXPATH/menu.c32 -a -f /usr/share/syslinux/menu.c32 ]; then
+ cp /usr/share/syslinux/menu.c32 $USBMNT/$SYSLINUXPATH/menu.c32
+ elif [ -f $USBMNT/$SYSLINUXPATH/menu.c32 -a -f /usr/lib/syslinux/menu.c32 ]; then
+ cp /usr/lib/syslinux/menu.c32 $USBMNT/$SYSLINUXPATH/menu.c32
+ fi
+
+ if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
+ # syslinux expects the config to be named syslinux.cfg
+ # and has to run with the file system unmounted
+ mv $USBMNT/$SYSLINUXPATH/isolinux.cfg $USBMNT/$SYSLINUXPATH/syslinux.cfg
+ # deal with mtools complaining about ldlinux.sys
+ if [ -f $USBMNT/$SYSLINUXPATH/ldlinux.sys ] ; then rm -f $USBMNT/$SYSLINUXPATH/ldlinux.sys ; fi
+ cleanup
+ if [ -n "$SYSLINUXPATH" ]; then
+ syslinux -d $SYSLINUXPATH $USBDEV
+ else
+ syslinux $USBDEV
+ fi
+ elif [ "$USBFS" = "ext2" -o "$USBFS" = "ext3" ]; then
+ # extlinux expects the config to be named extlinux.conf
+ # and has to be run with the file system mounted
+ mv $USBMNT/$SYSLINUXPATH/isolinux.cfg $USBMNT/$SYSLINUXPATH/extlinux.conf
+ extlinux -i $USBMNT/$SYSLINUXPATH
+ chattr -i $USBMNT/$SYSLINUXPATH/extlinux.sys
+ cleanup
+ fi
+else
+ # we need to do some more config file tweaks for multi-image mode
+ sed -i -e "s;kernel vm;kernel /$LIVEOS/syslinux/vm;" $USBMNT/$SYSLINUXPATH/isolinux.cfg
+ sed -i -e "s;initrd=i;initrd=/$LIVEOS/syslinux/i;" $USBMNT/$SYSLINUXPATH/isolinux.cfg
+ mv $USBMNT/$SYSLINUXPATH/isolinux.cfg $USBMNT/$SYSLINUXPATH/syslinux.cfg
+ cleanup
+fi
+

View file

@ -1,13 +0,0 @@
diff -ur livecd-tools-031.orig/imgcreate/fs.py livecd-tools-031/imgcreate/fs.py
--- livecd-tools-031.orig/imgcreate/fs.py 2011-01-11 16:17:37.000000000 +0300
+++ livecd-tools-031/imgcreate/fs.py 2011-01-11 16:18:27.728339365 +0300
@@ -351,7 +351,7 @@
def unmount(self):
if self.mounted:
logging.debug("Unmounting directory %s" % self.mountdir)
- rc = subprocess.call(["/bin/umount", self.mountdir])
+ rc = subprocess.call(["/bin/umount", "-l", self.mountdir])
if rc == 0:
self.mounted = False
else:
Только в livecd-tools-031/imgcreate: fs.py~

View file

@ -1,438 +0,0 @@
diff -dNur livecd-tools-031.old/imgcreate/fs.py livecd-tools-031/imgcreate/fs.py
--- livecd-tools-031.old/imgcreate/fs.py 2010-07-29 16:37:04.436014560 +0400
+++ livecd-tools-031/imgcreate/fs.py 2010-07-30 16:31:26.228738761 +0400
@@ -41,7 +41,8 @@
raise
def mksquashfs(in_img, out_img):
- args = ["/sbin/mksquashfs", in_img, out_img]
+ #args = ["/sbin/mksquashfs", in_img, out_img]
+ args = ["/usr/bin/mksquashfs", in_img, out_img]
if not sys.stdout.isatty():
args.append("-no-progress")
@@ -89,6 +90,7 @@
if not dest:
dest = src
+
self.dest = self.root + "/" + dest
self.mounted = False
@@ -108,7 +110,7 @@
if not self.mounted:
return
- rc = subprocess.call(["/bin/umount", self.dest])
+ rc = subprocess.call(["/bin/umount", "-l", self.dest])
if rc != 0:
raise MountError("Unable to unmount filesystem at %s" % self.dest)
self.mounted = False
diff -dNur livecd-tools-031.old/imgcreate/kickstart.py livecd-tools-031/imgcreate/kickstart.py
--- livecd-tools-031.old/imgcreate/kickstart.py 2010-07-29 16:37:04.425011240 +0400
+++ livecd-tools-031/imgcreate/kickstart.py 2010-07-30 16:31:26.229738761 +0400
@@ -472,7 +472,7 @@
return default
return int(ks.handler.bootloader.timeout)
-def get_kernel_args(ks, default = "ro liveimg quiet"):
+def get_kernel_args(ks, default = "ro liveimg"):
if not hasattr(ks.handler.bootloader, "appendLine"):
return default
if ks.handler.bootloader.appendLine is None:
diff -dNur livecd-tools-031.old/imgcreate/live.py livecd-tools-031/imgcreate/live.py
--- livecd-tools-031.old/imgcreate/live.py 2010-07-29 16:37:04.436014560 +0400
+++ livecd-tools-031/imgcreate/live.py 2010-07-30 16:44:30.853739041 +0400
@@ -1,4 +1,4 @@
-#
+# -*- coding: utf-8 -*-
# live.py : LiveImageCreator class for creating Live CD images
#
# Copyright 2007, Red Hat Inc.
@@ -18,10 +18,12 @@
import os
import os.path
+import sys
import glob
import shutil
import subprocess
import logging
+from menuconfig import MenuConfig
from imgcreate.errors import *
from imgcreate.fs import *
@@ -98,9 +100,9 @@
"""
r = kickstart.get_kernel_args(self.ks)
if os.path.exists(self._instroot + "/usr/bin/rhgb"):
- r += " rhgb"
+ r += ""
if os.path.exists(self._instroot + "/usr/bin/plymouth"):
- r += " rhgb"
+ r += ""
return r
def _get_mkisofs_options(self, isodir):
@@ -212,7 +214,7 @@
makedirs(os.path.dirname(path))
f = open(path, "a")
- f.write('LIVEOS="yes"\n')
+ #f.write('LIVEOS="yes"\n')
f.write('PROBE="no"\n')
f.write('MODULES+="squashfs ext4 ext3 ext2 vfat msdos "\n')
f.write('MODULES+="sr_mod sd_mod ide-cd cdrom "\n')
@@ -301,6 +303,13 @@
class x86LiveImageCreator(LiveImageCreatorBase):
"""ImageCreator for x86 machines"""
+
+ def __init__(self, *args, **kwargs):
+ if 'menu_cfg_path' in kwargs:
+ self.menu_config = MenuConfig(kwargs["menu_cfg_path"])
+
+ LiveImageCreatorBase.__init__(self, *args)
+
def _get_mkisofs_options(self, isodir):
return [ "-b", "isolinux/isolinux.bin",
"-c", "isolinux/boot.cat",
@@ -331,6 +340,9 @@
return "mboot.c32"
+ def __copy_rus_font(self, isodir, font_path):
+ shutil.copy(font_path, isodir + "/isolinux/")
+
def __copy_syslinux_files(self, isodir, menu, mboot = None):
files = ["isolinux.bin", menu]
if mboot:
@@ -348,9 +360,18 @@
shutil.copy(path, isodir + "/isolinux/")
def __copy_syslinux_background(self, isodest):
- background_path = self._instroot + \
- "/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg"
+ if self.menu_config:
+ if self.menu_config.menu_background_path:
+ background_path = self.menu_config.menu_background_path
+ else:
+ background_path = self._instroot + \
+ "/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg"
+ else:
+
+ background_path = self._instroot + \
+ "/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg"
+
if not os.path.exists(background_path):
return False
@@ -394,12 +417,25 @@
return False
def __get_basic_syslinux_config(self, **args):
+ if self.ks.handler.lang.lang == "ru_RU.UTF-8":
+ args.update({'tabmsg': u"Нажмите [Tab] чтобы изменить опции.",
+ 'autobootmsg': u"Автоматическая загрузка через # секунд{у,ы,}",
+ 'passprompt': u"Введите пароль"})
+ else:
+ args.update({'tabmsg': u"Press [Tab] to edit options",
+ 'autobootmsg': u"Automatic boot in # second{,s}...",
+ 'passprompt': u"Password required"})
+
return """
default %(menu)s
+font %(font_name)s
timeout %(timeout)d
%(background)s
-menu title Welcome to %(name)s!
+menu title %(welcome_message)s %(name)s!
+menu tabmsg %(tabmsg)s
+menu passprompt %(passprompt)s
+menu autoboot %(autobootmsg)s
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
@@ -410,8 +446,6 @@
menu color timeout_msg 0 #ffffffff #00000000
menu color timeout 0 #ffffffff #00000000
menu color cmdline 0 #ffffffff #00000000
-menu hidden
-menu hiddenrow 5
""" % args
def __get_image_stanza(self, is_xen, isDracut, **args):
@@ -455,41 +489,54 @@
default = self.__is_default_kernel(kernel, kernels)
- if default:
- long = "Boot"
- elif kernel.startswith("kernel-"):
- long = "Boot %s(%s)" % (self.name, kernel[7:])
+ if self.menu_config:
+
+ extra_items = self.menu_config.menu_lst
+ for label, extra_options in extra_items:
+ cfg += self.__get_image_stanza(is_xen, isDracut, fslabel = self.fslabel,
+ isofstype = "auto",
+ liveargs = kernel_options,
+ long = label,
+ short = "linux" + index,
+ extra = extra_options,
+ index = index)
else:
- long = "Boot %s(%s)" % (self.name, kernel)
+ if default:
+ long = "Boot"
+ elif kernel.startswith("kernel-"):
+ long = "Boot %s(%s)" % (self.name, kernel[7:])
+ else:
+ long = "Boot %s(%s)" % (self.name, kernel)
- # tell dracut not to ask for LUKS passwords or activate mdraid sets
- if isDracut:
- kern_opts = kernel_options + " rd_NO_LUKS rd_NO_MD noiswmd"
- else:
- kern_opts = kernel_options
- cfg += self.__get_image_stanza(is_xen, isDracut,
- fslabel = self.fslabel,
- isofstype = "auto",
- liveargs = kern_opts,
- long = long,
- short = "linux" + index,
- extra = "",
- index = index)
+ # tell dracut not to ask for LUKS passwords or activate mdraid sets
+ if isDracut:
+ kern_opts = kernel_options + " rd_NO_LUKS rd_NO_MD noiswmd"
+ else:
+ kern_opts = kernel_options
- if default:
- cfg += "menu default\n"
+ cfg += self.__get_image_stanza(is_xen, isDracut,
+ fslabel = self.fslabel,
+ isofstype = "auto",
+ liveargs = kern_opts,
+ long = long,
+ short = "linux" + index,
+ extra = "",
+ index = index)
- if checkisomd5:
- cfg += self.__get_image_stanza(is_xen, isDracut,
- fslabel = self.fslabel,
- isofstype = "auto",
- liveargs = kernel_options,
- long = "Verify and " + long,
- short = "check" + index,
- extra = "check",
- index = index)
+ if default:
+ cfg += "menu default\n"
+
+ if checkisomd5:
+ cfg += self.__get_image_stanza(is_xen, isDracut,
+ fslabel = self.fslabel,
+ isofstype = "auto",
+ liveargs = kernel_options,
+ long = "Verify and " + long,
+ short = "check" + index,
+ extra = "check",
+ index = index)
index = str(int(index) + 1)
@@ -517,6 +564,22 @@
"""configure the boot loader"""
makedirs(isodir + "/isolinux")
+ if self.menu_config.rus_font_path:
+ self.__copy_rus_font(isodir, self.menu_config.rus_font_path)
+ font_name = self.menu_config.rus_font_path.split('/')[-1]
+ else:
+ font_name = ""
+
+ if self.menu_config.product_name:
+ product_name = self.menu_config.product_name
+ else:
+ product_name = self.name
+
+ if self.menu_config.welcome_message:
+ welcome_message = self.menu_config.welcome_message
+ else:
+ welcome_message = "Welcome to"
+
menu = self.__find_syslinux_menu()
self.__copy_syslinux_files(isodir, menu,
@@ -528,16 +591,20 @@
cfg = self.__get_basic_syslinux_config(menu = menu,
background = background,
- name = self.name,
- timeout = self._timeout * 10)
+ name = product_name,
+ timeout = self._timeout * 10,
+ font_name = font_name,
+ welcome_message = welcome_message )
+
cfg += self.__get_image_stanzas(isodir)
cfg += self.__get_memtest_stanza(isodir)
- cfg += self.__get_local_stanza(isodir)
+ #cfg += self.__get_local_stanza(isodir)
cfg += self._get_isolinux_stanzas(isodir)
cfgf = open(isodir + "/isolinux/isolinux.cfg", "w")
- cfgf.write(cfg)
+ #cfgf.write(cfg.encode(sys.stdout.encoding))
+ cfgf.write(cfg.encode("cp866"))
cfgf.close()
def __copy_efi_files(self, isodir):
@@ -680,7 +747,7 @@
shutil.copyfile(bootdir + "/vmlinuz-" + version,
destdir + "/vmlinuz")
-
+
if os.path.exists(bootdir + "/initramfs-" + version + ".img"):
shutil.copyfile(bootdir + "/initramfs-" + version + ".img",
destdir + "/initrd.img")
@@ -758,15 +825,15 @@
default=linux
image=/ppc/ppc64/vmlinuz
- label=linux64
- alias=linux
- initrd=/ppc/ppc64/initrd.img
- read-only
+ label=linux64
+ alias=linux
+ initrd=/ppc/ppc64/initrd.img
+ read-only
image=/ppc/ppc32/vmlinuz
- label=linux32
- initrd=/ppc/ppc32/initrd.img
- read-only
+ label=linux32
+ initrd=/ppc/ppc32/initrd.img
+ read-only
""" % args
f = open(isodir + "/etc/yaboot.conf", "w")
diff -dNur livecd-tools-031.old/imgcreate/menuconfig.py livecd-tools-031/imgcreate/menuconfig.py
--- livecd-tools-031.old/imgcreate/menuconfig.py 1970-01-01 03:00:00.000000000 +0300
+++ livecd-tools-031/imgcreate/menuconfig.py 2010-07-30 16:31:26.230738881 +0400
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+
+import xml.parsers.expat
+
+class MenuConfig:
+ def __init__(self, menu_path):
+ self.menu_path = menu_path
+ self.xml_parser = xml.parsers.expat.ParserCreate()
+ self.tmp_menu_label = self.tmp_menu_extra_opts = self.menu_background_path =\
+ self.rus_font_path = self.product_name = self.welcome_message = ""
+ self.menu_lst = []
+ self.parse()
+
+ def _start_element(self, name, attrs):
+ if name == "item":
+ self.tmp_menu_label = attrs["name"]
+ self.xml_parser.CharacterDataHandler = self._char_data_item
+ elif name == "background_img_path":
+ self.xml_parser.CharacterDataHandler = self._char_data_image_path
+ elif name == "font_path":
+ self.xml_parser.CharacterDataHandler = self._char_data_rus_font_path
+ elif name == "product_name":
+ self.xml_parser.CharacterDataHandler = self._char_data_product_name
+ elif name == "welcome_message":
+ self.xml_parser.CharacterDataHandler = self._char_data_welcome_message
+
+
+ def _end_element(self, name):
+ if name == "item":
+ self.menu_lst.append((self.tmp_menu_label , self.tmp_menu_extra_opts))
+ self.tmp_menu_extra_opts = ""
+ self.tmp_menu_label = ""
+
+ def _char_data_item(self, data):
+ data = data.strip()
+ if (data != ''):
+ self.tmp_menu_extra_opts += (" " + data)
+
+ def _char_data_image_path(self, data):
+ data = data.strip()
+ if (data != ''):
+ self.menu_background_path = data
+
+ def _char_data_rus_font_path(self, data):
+ data = data.strip()
+ if (data != ''):
+ self.rus_font_path = data
+
+ def _char_data_product_name(self, data):
+ data = data.strip()
+ if (data != ''):
+ self.product_name = data
+
+ def _char_data_welcome_message(self, data):
+ data = data.strip()
+ if (data != ''):
+ self.welcome_message = data
+
+ def parse(self):
+ self.xml_parser.StartElementHandler = self._start_element
+ self.xml_parser.EndElementHandler = self._end_element
+ self.xml_parser.ParseFile(open(self.menu_path))
+
+
+if __name__ == "__main__":
+ menu_parser = MenuConfig("menu_config.xml")
+ print menu_parser.menu_lst
+ print menu_parser.menu_background_path
diff -dNur livecd-tools-031.old/tools/livecd-creator livecd-tools-031/tools/livecd-creator
--- livecd-tools-031.old/tools/livecd-creator 2010-07-29 16:37:04.412016040 +0400
+++ livecd-tools-031/tools/livecd-creator 2010-07-30 16:31:26.231738641 +0400
@@ -41,6 +41,9 @@
help="Add packages to an existing live CD iso9660 image.")
imgopt.add_option("-f", "--fslabel", type="string", dest="fs_label",
help="File system label (default based on config name)")
+ imgopt.add_option("-m", "--menu-config", type="string", dest="menu_cfg",
+ help="Extra options for LiveCD menu")
+
parser.add_option_group(imgopt)
# options related to the config of your system
@@ -96,6 +99,11 @@
print >> sys.stderr, "You must run livecd-creator as root"
return 1
+ if options.menu_cfg:
+ menu_cfg_path = options.menu_cfg
+ else:
+ menu_cfg_path = ""
+
if options.fs_label:
fs_label = options.fs_label
name = fs_label
@@ -111,7 +119,8 @@
ks = imgcreate.read_kickstart(options.kscfg)
- creator = imgcreate.LiveImageCreator(ks, name, fs_label)
+ #creator = imgcreate.LiveImageCreator(ks, name, fs_label)
+ creator = imgcreate.LiveImageCreator(ks, name, fs_label, menu_cfg_path=menu_cfg_path)
creator.tmpdir = os.path.abspath(options.tmpdir)
creator.skip_compression = options.skip_compression
creator.skip_minimize = options.skip_minimize
diff -dNur livecd-tools-031.old/tools/livecd-iso-to-disk.sh livecd-tools-031/tools/livecd-iso-to-disk.sh

View file

@ -1,13 +0,0 @@
diff -ur livecd-tools-031.orig/imgcreate/fs.py livecd-tools-031/imgcreate/fs.py
--- livecd-tools-031.orig/imgcreate/fs.py 2010-12-08 18:43:29.000000000 +0300
+++ livecd-tools-031/imgcreate/fs.py 2010-12-08 18:44:53.486771013 +0300
@@ -42,7 +42,7 @@
def mksquashfs(in_img, out_img):
#args = ["/sbin/mksquashfs", in_img, out_img]
- args = ["/usr/bin/mksquashfs", in_img, out_img]
+ args = ["/usr/bin/mksquashfs", in_img, out_img, "-comp", "lzma"]
if not sys.stdout.isatty():
args.append("-no-progress")
Только в livecd-tools-031/imgcreate: fs.py~

View file

@ -1,11 +0,0 @@
--- livecd-tools-031/imgcreate/fs.py.dmsetup 2011-06-28 15:17:57.000000000 -0300
+++ livecd-tools-031/imgcreate/fs.py 2011-06-28 15:18:03.000000000 -0300
@@ -552,7 +552,7 @@ class DeviceMapperSnapshot(object):
# where C is the number of 512 byte sectors in use
#
try:
- return int((out.split()[3]).split('/')[0]) * 512
+ return int((out.split()[4]).split('/')[0]) * 512
except ValueError:
raise SnapshotError("Failed to parse dmsetup status: " + out)

View file

@ -1,15 +0,0 @@
--- livecd-tools-031/imgcreate/creator.py.no-verify 2011-03-01 10:30:23.000000000 +0100
+++ livecd-tools-031/imgcreate/creator.py 2011-03-01 10:36:22.000000000 +0100
@@ -640,10 +640,10 @@
#for package in self.ks.handler.packages.packageList:
#subprocess.call(["/usr/sbin/urpmi", "--auto", "--urpmi-root", urpmi_conf, "--root", self._instroot, package])
- subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages)
+ subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-verify-rpm", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages)
if packages_post:
- subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages_post)
+ subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-verify-rpm", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages_post)
#def install(self, repo_urls = {}):
#"""Install packages into the install root.

View file

@ -1,45 +0,0 @@
Только в livecd-tools-031.orig: debugfiles.list
Только в livecd-tools-031.orig: debuglinks.list
Только в livecd-tools-031.orig: debugsources.list
Только в livecd-tools-031.orig/docs: livecd-creator.8
Только в livecd-tools-031.orig/docs: livecd-iso-to-disk.8
Только в livecd-tools-031/imgcreate: creator.py~
diff -ur livecd-tools-031.orig/imgcreate/kickstart.py livecd-tools-031/imgcreate/kickstart.py
--- livecd-tools-031.orig/imgcreate/kickstart.py 2010-09-20 15:11:26.000000000 +0400
+++ livecd-tools-031/imgcreate/kickstart.py 2010-09-27 17:01:35.330554335 +0400
@@ -24,10 +24,10 @@
import logging
import urlgrabber
-try:
- import system_config_keyboard.keyboard as keyboard
-except ImportError:
- import rhpl.keyboard as keyboard
+#try:
+ #import system_config_keyboard.keyboard as keyboard
+#except ImportError:
+ #import rhpl.keyboard as keyboard
import pykickstart.commands as kscommands
import pykickstart.constants as ksconstants
@@ -135,10 +135,16 @@
class KeyboardConfig(KickstartConfig):
"""A class to apply a kickstart keyboard configuration to a system."""
def apply(self, kskeyboard):
- k = keyboard.Keyboard()
+ #k = keyboard.Keyboard()
+
if kskeyboard.keyboard:
- k.set(kskeyboard.keyboard)
- k.write(self.instroot)
+ f = open(self.path("/etc/sysconfig/keyboard"), "w+")
+ f.write("KEYBOARD=\"" + kskeyboard.keyboard + "\"\n")
+ f.close()
+
+ #if kskeyboard.keyboard:
+ #k.set(kskeyboard.keyboard)
+ #k.write(self.instroot)
class TimezoneConfig(KickstartConfig):
"""A class to apply a kickstart timezone configuration to a system."""
Только в livecd-tools-031/imgcreate: kickstart.py~

View file

@ -1,59 +0,0 @@
diff -ur livecd-tools-031.orig/tools/livecd-iso-to-disk.sh livecd-tools-031/tools/livecd-iso-to-disk.sh
--- livecd-tools-031.orig/tools/livecd-iso-to-disk.sh 2009-10-30 00:26:09.000000000 +0300
+++ livecd-tools-031/tools/livecd-iso-to-disk.sh 2010-10-21 11:50:36.057388883 +0400
@@ -131,7 +131,7 @@
if [ "$(/sbin/fdisk -l $device 2>/dev/null |grep $dev |awk {'print $2;'})" != "*" ]; then
echo "Partition isn't marked bootable!"
echo "You can mark the partition as bootable with "
- echo " # /sbin/parted $device"
+ echo " # /usr/sbin/parted $device"
echo " (parted) toggle N boot"
echo " (parted) quit"
exitclean
@@ -146,10 +146,10 @@
echo "Press Enter to continue or ctrl-c to abort"
read
umount ${device}? &> /dev/null
- /sbin/parted --script $device mklabel gpt
- partinfo=$(/sbin/parted --script -m $device "unit b print" |grep ^$device:)
+ /usr/sbin/parted --script $device mklabel gpt
+ partinfo=$(/usr/sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
- /sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 17408 $(($size - 17408)) set 1 boot on
+ /usr/sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 17408 $(($size - 17408)) set 1 boot on
USBDEV=${device}1
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
@@ -168,10 +168,10 @@
echo "Press Enter to continue or ctrl-c to abort"
read
umount ${device}? &> /dev/null
- /sbin/parted --script $device mklabel msdos
- partinfo=$(/sbin/parted --script -m $device "unit b print" |grep ^$device:)
+ /usr/sbin/parted --script $device mklabel msdos
+ partinfo=$(/usr/sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
- /sbin/parted --script $device unit b mkpart primary fat32 17408 $(($size - 17408)) set 1 boot on
+ /usr/sbin/parted --script $device unit b mkpart primary fat32 17408 $(($size - 17408)) set 1 boot on
USBDEV=${device}1
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
@@ -192,7 +192,7 @@
exitclean
fi
- partinfo=$(/sbin/parted --script -m $device "print" |grep ^$partnum:)
+ partinfo=$(/usr/sbin/parted --script -m $device "print" |grep ^$partnum:)
volname=$(echo $partinfo |cut -d : -f 6)
flags=$(echo $partinfo |cut -d : -f 7)
if [ "$volname" != "EFI System Partition" ]; then
@@ -203,7 +203,7 @@
if [ "$(echo $flags |grep -c boot)" = "0" ]; then
echo "Partition isn't marked bootable!"
echo "You can mark the partition as bootable with "
- echo " # /sbin/parted $device"
+ echo " # /usr/sbin/parted $device"
echo " (parted) toggle N boot"
echo " (parted) quit"
exitclean
Только в livecd-tools-031/tools: livecd-iso-to-disk.sh~

View file

@ -1,20 +0,0 @@
diff -ur livecd-tools-031.orig/imgcreate/creator.py livecd-tools-031/imgcreate/creator.py
--- livecd-tools-031.orig/imgcreate/creator.py 2011-02-16 18:32:44.000000000 +0300
+++ livecd-tools-031/imgcreate/creator.py 2011-02-16 18:34:48.473734235 +0300
@@ -636,11 +636,15 @@
subprocess.call(["/usr/sbin/urpmi.addmedia", "--urpmi-root", urpmi_conf, name, baseurl])
packages = self.ks.handler.packages.packageList
+ packages_post = self.ks.handler.packages_post.packageList
#for package in self.ks.handler.packages.packageList:
#subprocess.call(["/usr/sbin/urpmi", "--auto", "--urpmi-root", urpmi_conf, "--root", self._instroot, package])
subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages)
+ if packages_post:
+ subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages_post)
+
#def install(self, repo_urls = {}):
#"""Install packages into the install root.
Только в livecd-tools-031/imgcreate: creator.py~

View file

@ -1,12 +0,0 @@
diff -ur livecd-tools-031.orig/imgcreate/fs.py livecd-tools-031/imgcreate/fs.py
--- livecd-tools-031.orig/imgcreate/fs.py 2011-01-11 17:06:56.000000000 +0300
+++ livecd-tools-031/imgcreate/fs.py 2011-01-11 17:07:46.503095232 +0300
@@ -279,6 +279,7 @@
if self.device is None:
return
logging.debug("Losetup remove %s" % self.device)
+ time.sleep(3)
rc = subprocess.call(["/sbin/losetup", "-d", self.device])
self.device = None
Только в livecd-tools-031/imgcreate: fs.py~

View file

@ -1,17 +0,0 @@
diff -ru livecd-tools-031.orig/imgcreate/creator.py livecd-tools-031/imgcreate/creator.py
--- livecd-tools-031.orig/imgcreate/creator.py 2011-03-30 15:40:36.486597560 +0000
+++ livecd-tools-031/imgcreate/creator.py 2011-03-30 15:41:45.646156329 +0000
@@ -640,10 +640,10 @@
#for package in self.ks.handler.packages.packageList:
#subprocess.call(["/usr/sbin/urpmi", "--auto", "--urpmi-root", urpmi_conf, "--root", self._instroot, package])
- subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-verify-rpm", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages)
+ subprocess.call(["/usr/sbin/urpmi", "--auto", "--split-length", "0", "--no-verify-rpm", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages)
if packages_post:
- subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-verify-rpm", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages_post)
+ subprocess.call(["/usr/sbin/urpmi", "--auto", "--split-length", "0", "--no-verify-rpm", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages_post)
#def install(self, repo_urls = {}):
#"""Install packages into the install root.
Only in livecd-tools-031.orig/imgcreate: creator.py.patched

View file

@ -1,60 +0,0 @@
diff -ur livecd-tools-031.orig/imgcreate/creator.py livecd-tools-031/imgcreate/creator.py
--- livecd-tools-031.orig/imgcreate/creator.py 2010-10-05 11:13:26.000000000 +0400
+++ livecd-tools-031/imgcreate/creator.py 2010-10-05 11:23:00.259235979 +0400
@@ -16,6 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import time
import os
import os.path
import stat
@@ -623,6 +624,23 @@
if not kickstart.selinux_enabled(self.ks) and os.path.exists("/selinux/enforce") and not ayum.installHasFile(file):
raise CreatorError("Unable to disable SELinux because the installed package set did not include the file %s" % (file))
+ def install_urpmi(self, repo_urls = {}):
+
+ #urpmi_conf = self._instroot + "/urpmi-conf"
+ urpmi_conf = self.__builddir + "/urpmi_conf"
+ print urpmi_conf
+ time.sleep(5)
+
+ for repo in kickstart.get_repos(self.ks, repo_urls):
+ (name, baseurl, mirrorlist, inc, exc) = repo
+ subprocess.call(["/usr/sbin/urpmi.addmedia", "--urpmi-root", urpmi_conf, name, baseurl])
+
+ packages = self.ks.handler.packages.packageList
+
+ #for package in self.ks.handler.packages.packageList:
+ #subprocess.call(["/usr/sbin/urpmi", "--auto", "--urpmi-root", urpmi_conf, "--root", self._instroot, package])
+ subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages)
+
def install(self, repo_urls = {}):
"""Install packages into the install root.
Только в livecd-tools-031/imgcreate: creator.py~
diff -ur livecd-tools-031.orig/imgcreate/live.py livecd-tools-031/imgcreate/live.py
--- livecd-tools-031.orig/imgcreate/live.py 2010-10-05 11:13:26.000000000 +0400
+++ livecd-tools-031/imgcreate/live.py 2010-10-05 11:19:59.971988213 +0400
@@ -478,7 +478,7 @@
checkisomd5 = self._has_checkisomd5()
cfg = ""
-
+ print "++++++++++++++++++++++++", versions
index = "0"
for version in versions:
(is_xen, isDracut) = self.__copy_kernel_and_initramfs(isodir, version, index)
diff -ur livecd-tools-031.orig/tools/livecd-creator livecd-tools-031/tools/livecd-creator
--- livecd-tools-031.orig/tools/livecd-creator 2010-10-05 11:13:26.000000000 +0400
+++ livecd-tools-031/tools/livecd-creator 2010-10-05 11:19:59.971988213 +0400
@@ -129,7 +129,7 @@
try:
creator.mount(options.base_on, options.cachedir)
- creator.install()
+ creator.install_urpmi()
creator.configure()
if options.give_shell:
print "Launching shell. Exit to continue."

View file

@ -1,13 +0,0 @@
diff -ur livecd-tools-031.orig/imgcreate/creator.py livecd-tools-031/imgcreate/creator.py
--- livecd-tools-031.orig/imgcreate/creator.py 2010-11-29 17:53:37.000000000 +0300
+++ livecd-tools-031/imgcreate/creator.py 2010-11-29 17:53:57.233005234 +0300
@@ -740,7 +740,7 @@
"""
ksh = self.ks.handler
- kickstart.LanguageConfig(self._instroot).apply(ksh.lang)
+ #kickstart.LanguageConfig(self._instroot).apply(ksh.lang)
kickstart.KeyboardConfig(self._instroot).apply(ksh.keyboard)
kickstart.TimezoneConfig(self._instroot).apply(ksh.timezone)
kickstart.AuthConfig(self._instroot).apply(ksh.authconfig)
Только в livecd-tools-031/imgcreate: creator.py~

View file

@ -1,11 +0,0 @@
--- livecd-tools-031/imgcreate/fs.py.xz 2011-02-11 13:39:10.000000000 -0200
+++ livecd-tools-031/imgcreate/fs.py 2011-02-11 13:39:16.000000000 -0200
@@ -42,7 +42,7 @@ def makedirs(dirname):
def mksquashfs(in_img, out_img):
#args = ["/sbin/mksquashfs", in_img, out_img]
- args = ["/usr/bin/mksquashfs", in_img, out_img, "-comp", "lzma"]
+ args = ["/usr/bin/mksquashfs", in_img, out_img, "-comp", "xz"]
if not sys.stdout.isatty():
args.append("-no-progress")

View file

@ -1,290 +0,0 @@
diff -ur livecd-tools-031.orig/imgcreate/creator.py livecd-tools-031/imgcreate/creator.py
--- livecd-tools-031.orig/imgcreate/creator.py 2010-10-05 14:29:24.000000000 +0400
+++ livecd-tools-031/imgcreate/creator.py 2010-10-05 14:37:04.000000000 +0400
@@ -26,12 +26,12 @@
import logging
import selinux
-import yum
+#import yum
import rpm
from imgcreate.errors import *
from imgcreate.fs import *
-from imgcreate.yuminst import *
+#from imgcreate.yuminst import *
from imgcreate import kickstart
FSLABEL_MAXLEN = 32
@@ -581,48 +581,48 @@
shutil.rmtree(self.__builddir, ignore_errors = True)
self.__builddir = None
- def __select_packages(self, ayum):
- skipped_pkgs = []
- for pkg in kickstart.get_packages(self.ks,
- self._get_required_packages()):
- try:
- ayum.selectPackage(pkg)
- except yum.Errors.InstallError, e:
- if kickstart.ignore_missing(self.ks):
- skipped_pkgs.append(pkg)
- else:
- raise CreatorError("Failed to find package '%s' : %s" %
- (pkg, e))
-
- for pkg in skipped_pkgs:
- logging.warn("Skipping missing package '%s'" % (pkg,))
-
- def __select_groups(self, ayum):
- skipped_groups = []
- for group in kickstart.get_groups(self.ks):
- try:
- ayum.selectGroup(group.name, group.include)
- except (yum.Errors.InstallError, yum.Errors.GroupsError), e:
- if kickstart.ignore_missing(self.ks):
- raise CreatorError("Failed to find group '%s' : %s" %
- (group.name, e))
- else:
- skipped_groups.append(group)
-
- for group in skipped_groups:
- logging.warn("Skipping missing group '%s'" % (group.name,))
-
- def __deselect_packages(self, ayum):
- for pkg in kickstart.get_excluded(self.ks,
- self._get_excluded_packages()):
- ayum.deselectPackage(pkg)
-
- # if the system is running selinux and the kickstart wants it disabled
- # we need /usr/sbin/lokkit
- def __can_handle_selinux(self, ayum):
- file = "/usr/sbin/lokkit"
- if not kickstart.selinux_enabled(self.ks) and os.path.exists("/selinux/enforce") and not ayum.installHasFile(file):
- raise CreatorError("Unable to disable SELinux because the installed package set did not include the file %s" % (file))
+ #def __select_packages(self, ayum):
+ #skipped_pkgs = []
+ #for pkg in kickstart.get_packages(self.ks,
+ #self._get_required_packages()):
+ #try:
+ #ayum.selectPackage(pkg)
+ #except yum.Errors.InstallError, e:
+ #if kickstart.ignore_missing(self.ks):
+ #skipped_pkgs.append(pkg)
+ #else:
+ #raise CreatorError("Failed to find package '%s' : %s" %
+ #(pkg, e))
+
+ #for pkg in skipped_pkgs:
+ #logging.warn("Skipping missing package '%s'" % (pkg,))
+
+ #def __select_groups(self, ayum):
+ #skipped_groups = []
+ #for group in kickstart.get_groups(self.ks):
+ #try:
+ #ayum.selectGroup(group.name, group.include)
+ #except (yum.Errors.InstallError, yum.Errors.GroupsError), e:
+ #if kickstart.ignore_missing(self.ks):
+ #raise CreatorError("Failed to find group '%s' : %s" %
+ #(group.name, e))
+ #else:
+ #skipped_groups.append(group)
+
+ #for group in skipped_groups:
+ #logging.warn("Skipping missing group '%s'" % (group.name,))
+
+ #def __deselect_packages(self, ayum):
+ #for pkg in kickstart.get_excluded(self.ks,
+ #self._get_excluded_packages()):
+ #ayum.deselectPackage(pkg)
+
+ ## if the system is running selinux and the kickstart wants it disabled
+ ## we need /usr/sbin/lokkit
+ #def __can_handle_selinux(self, ayum):
+ #file = "/usr/sbin/lokkit"
+ #if not kickstart.selinux_enabled(self.ks) and os.path.exists("/selinux/enforce") and not ayum.installHasFile(file):
+ #raise CreatorError("Unable to disable SELinux because the installed package set did not include the file %s" % (file))
def install_urpmi(self, repo_urls = {}):
@@ -641,64 +641,64 @@
#subprocess.call(["/usr/sbin/urpmi", "--auto", "--urpmi-root", urpmi_conf, "--root", self._instroot, package])
subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-suggests", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages)
- def install(self, repo_urls = {}):
- """Install packages into the install root.
+ #def install(self, repo_urls = {}):
+ #"""Install packages into the install root.
- This function installs the packages listed in the supplied kickstart
- into the install root. By default, the packages are installed from the
- repository URLs specified in the kickstart.
+ #This function installs the packages listed in the supplied kickstart
+ #into the install root. By default, the packages are installed from the
+ #repository URLs specified in the kickstart.
- repo_urls -- a dict which maps a repository name to a repository URL;
- if supplied, this causes any repository URLs specified in
- the kickstart to be overridden.
+ #repo_urls -- a dict which maps a repository name to a repository URL;
+ #if supplied, this causes any repository URLs specified in
+ #the kickstart to be overridden.
- """
- yum_conf = self._mktemp(prefix = "yum.conf-")
+ #"""
+ #yum_conf = self._mktemp(prefix = "yum.conf-")
- ayum = LiveCDYum()
- ayum.setup(yum_conf, self._instroot)
+ #ayum = LiveCDYum()
+ #ayum.setup(yum_conf, self._instroot)
- for repo in kickstart.get_repos(self.ks, repo_urls):
- (name, baseurl, mirrorlist, inc, exc) = repo
+ #for repo in kickstart.get_repos(self.ks, repo_urls):
+ #(name, baseurl, mirrorlist, inc, exc) = repo
- yr = ayum.addRepository(name, baseurl, mirrorlist)
- if inc:
- yr.includepkgs = inc
- if exc:
- yr.exclude = exc
-
- if kickstart.exclude_docs(self.ks):
- rpm.addMacro("_excludedocs", "1")
- if not kickstart.selinux_enabled(self.ks):
- rpm.addMacro("__file_context_path", "%{nil}")
- if kickstart.inst_langs(self.ks) != None:
- rpm.addMacro("_install_langs", kickstart.inst_langs(self.ks))
-
- try:
- self.__select_packages(ayum)
- self.__select_groups(ayum)
- self.__deselect_packages(ayum)
-
- self.__can_handle_selinux(ayum)
-
- ayum.runInstall()
- except yum.Errors.RepoError, e:
- raise CreatorError("Unable to download from repo : %s" % (e,))
- except yum.Errors.YumBaseError, e:
- raise CreatorError("Unable to install: %s" % (e,))
- finally:
- ayum.closeRpmDB()
- ayum.close()
- os.unlink(yum_conf)
-
- # do some clean up to avoid lvm info leakage. this sucks.
- for subdir in ("cache", "backup", "archive"):
- lvmdir = self._instroot + "/etc/lvm/" + subdir
- try:
- for f in os.listdir(lvmdir):
- os.unlink(lvmdir + "/" + f)
- except:
- pass
+ #yr = ayum.addRepository(name, baseurl, mirrorlist)
+ #if inc:
+ #yr.includepkgs = inc
+ #if exc:
+ #yr.exclude = exc
+
+ #if kickstart.exclude_docs(self.ks):
+ #rpm.addMacro("_excludedocs", "1")
+ #if not kickstart.selinux_enabled(self.ks):
+ #rpm.addMacro("__file_context_path", "%{nil}")
+ #if kickstart.inst_langs(self.ks) != None:
+ #rpm.addMacro("_install_langs", kickstart.inst_langs(self.ks))
+
+ #try:
+ #self.__select_packages(ayum)
+ #self.__select_groups(ayum)
+ #self.__deselect_packages(ayum)
+
+ #self.__can_handle_selinux(ayum)
+
+ #ayum.runInstall()
+ #except yum.Errors.RepoError, e:
+ #raise CreatorError("Unable to download from repo : %s" % (e,))
+ #except yum.Errors.YumBaseError, e:
+ #raise CreatorError("Unable to install: %s" % (e,))
+ #finally:
+ #ayum.closeRpmDB()
+ #ayum.close()
+ #os.unlink(yum_conf)
+
+ ## do some clean up to avoid lvm info leakage. this sucks.
+ #for subdir in ("cache", "backup", "archive"):
+ #lvmdir = self._instroot + "/etc/lvm/" + subdir
+ #try:
+ #for f in os.listdir(lvmdir):
+ #os.unlink(lvmdir + "/" + f)
+ #except:
+ #pass
def __run_post_scripts(self):
for s in kickstart.get_post_scripts(self.ks):
diff -ur livecd-tools-031.orig/imgcreate/__init__.py livecd-tools-031/imgcreate/__init__.py
--- livecd-tools-031.orig/imgcreate/__init__.py 2009-10-30 00:26:09.000000000 +0300
+++ livecd-tools-031/imgcreate/__init__.py 2010-10-05 14:42:10.000000000 +0400
@@ -18,7 +18,7 @@
from imgcreate.live import *
from imgcreate.creator import *
-from imgcreate.yuminst import *
+#from imgcreate.yuminst import *
from imgcreate.kickstart import *
from imgcreate.fs import *
from imgcreate.debug import *
diff -ur livecd-tools-031.orig/imgcreate/live.py livecd-tools-031/imgcreate/live.py
--- livecd-tools-031.orig/imgcreate/live.py 2010-10-05 14:29:24.000000000 +0400
+++ livecd-tools-031/imgcreate/live.py 2010-10-05 14:49:45.000000000 +0400
@@ -684,15 +684,15 @@
cfgf.close()
# first gen mactel machines get the bootloader name wrong apparently
- if rpmUtils.arch.getBaseArch() == "i386":
- os.link(isodir + "/EFI/boot/grub.efi", isodir + "/EFI/boot/boot.efi")
- os.link(isodir + "/EFI/boot/grub.conf", isodir + "/EFI/boot/boot.conf")
-
- # for most things, we want them named boot$efiarch
- efiarch = {"i386": "ia32", "x86_64": "x64"}
- efiname = efiarch[rpmUtils.arch.getBaseArch()]
- os.rename(isodir + "/EFI/boot/grub.efi", isodir + "/EFI/boot/boot%s.efi" %(efiname,))
- os.link(isodir + "/EFI/boot/grub.conf", isodir + "/EFI/boot/boot%s.conf" %(efiname,))
+ #if rpmUtils.arch.getBaseArch() == "i386":
+ #os.link(isodir + "/EFI/boot/grub.efi", isodir + "/EFI/boot/boot.efi")
+ #os.link(isodir + "/EFI/boot/grub.conf", isodir + "/EFI/boot/boot.conf")
+
+ ## for most things, we want them named boot$efiarch
+ #efiarch = {"i386": "ia32", "x86_64": "x64"}
+ #efiname = efiarch[rpmUtils.arch.getBaseArch()]
+ #os.rename(isodir + "/EFI/boot/grub.efi", isodir + "/EFI/boot/boot%s.efi" %(efiname,))
+ #os.link(isodir + "/EFI/boot/grub.conf", isodir + "/EFI/boot/boot%s.conf" %(efiname,))
def _configure_bootloader(self, isodir):
@@ -894,12 +894,14 @@
return ["kernel.ppc"] + \
ppcLiveImageCreator._get_excluded_packages(self)
-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!")
+LiveImageCreator = x86LiveImageCreator
+
+#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!")

View file

@ -1,25 +0,0 @@
diff -ur livecd-tools-031.orig/tools/livecd-creator livecd-tools-031/tools/livecd-creator
--- livecd-tools-031.orig/tools/livecd-creator 2010-11-12 14:12:28.000000000 +0300
+++ livecd-tools-031/tools/livecd-creator 2010-11-12 14:21:39.517648703 +0300
@@ -43,6 +43,8 @@
help="File system label (default based on config name)")
imgopt.add_option("-m", "--menu-config", type="string", dest="menu_cfg",
help="Extra options for LiveCD menu")
+ imgopt.add_option("", "--yum", action="store_true", dest="yum",
+ help="Use yum instead of urpmi")
parser.add_option_group(imgopt)
@@ -129,7 +131,10 @@
try:
creator.mount(options.base_on, options.cachedir)
- creator.install_urpmi()
+ if options.yum:
+ creator.install()
+ else:
+ creator.install_urpmi()
creator.configure()
if options.give_shell:
print "Launching shell. Exit to continue."
Только в livecd-tools-031/tools: livecd-creator~

View file

@ -0,0 +1,420 @@
diff -Nur livecd-tools-18.8.orig/imgcreate/creator.py livecd-tools-18.8/imgcreate/creator.py
--- livecd-tools-18.8.orig/imgcreate/creator.py 2012-08-06 22:49:20.000000000 +0400
+++ livecd-tools-18.8/imgcreate/creator.py 2012-09-19 19:32:11.000000000 +0400
@@ -17,6 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os
+import time
import os.path
import stat
import sys
@@ -608,6 +609,23 @@
if not kickstart.selinux_enabled(self.ks) and selinux.is_selinux_enabled() and not ayum.installHasFile(file):
raise CreatorError("Unable to disable SELinux because the installed package set did not include the file %s" % (file))
+ def install_urpmi(self, repo_urls = {}):
+
+ urpmi_conf = self.__builddir + "/urpmi_conf"
+ print urpmi_conf
+ time.sleep(5)
+
+ for repo in kickstart.get_repos(self.ks, repo_urls):
+ (name, baseurl, mirrorlist, proxy, inc, exc, cost) = repo
+ subprocess.call(["/usr/sbin/urpmi.addmedia", "--urpmi-root", urpmi_conf, name, baseurl])
+
+ packages = self.ks.handler.packages.packageList
+
+ #for package in self.ks.handler.packages.packageList:
+ #subprocess.call(["/usr/sbin/urpmi", "--auto", "--urpmi-root", urpmi_conf, "--root", self._instroot, package])
+ subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-suggests", "--no-verify", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages)
+
+
def install(self, repo_urls = {}):
"""Install packages into the install root.
@@ -729,9 +747,9 @@
kickstart.NetworkConfig(self._instroot).apply(ksh.network)
kickstart.RPMMacroConfig(self._instroot).apply(self.ks)
- self._create_bootconfig()
self._run_post_scripts()
+ self._create_bootconfig()
kickstart.SelinuxConfig(self._instroot).apply(ksh.selinux)
def launch_shell(self):
diff -Nur livecd-tools-18.8.orig/imgcreate/errors.py livecd-tools-18.8/imgcreate/errors.py
--- livecd-tools-18.8.orig/imgcreate/errors.py 2012-08-06 22:49:20.000000000 +0400
+++ livecd-tools-18.8/imgcreate/errors.py 2012-09-19 19:24:22.000000000 +0400
@@ -54,3 +54,5 @@
pass
class ResizeError(CreatorError):
pass
+class InitramfsError(CreatorError):
+ pass
\ В конце файла нет новой строки
diff -Nur livecd-tools-18.8.orig/imgcreate/fs.py livecd-tools-18.8/imgcreate/fs.py
--- livecd-tools-18.8.orig/imgcreate/fs.py 2012-08-06 22:49:20.000000000 +0400
+++ livecd-tools-18.8/imgcreate/fs.py 2012-09-18 14:02:48.000000000 +0400
@@ -73,9 +73,9 @@
def mksquashfs(in_img, out_img, compress_type):
# Allow gzip to work for older versions of mksquashfs
if compress_type == "gzip":
- args = ["/sbin/mksquashfs", in_img, out_img]
+ args = ["/usr/bin/mksquashfs", in_img, out_img]
else:
- args = ["/sbin/mksquashfs", in_img, out_img, "-comp", compress_type]
+ args = ["/usr/bin/mksquashfs", in_img, out_img, "-comp", compress_type]
if not sys.stdout.isatty():
args.append("-no-progress")
@@ -605,7 +605,7 @@
# where C is the number of 512 byte sectors in use
#
try:
- return int((out.split()[3]).split('/')[0]) * 512
+ return int((out.split()[4]).split('/')[0]) * 512
except ValueError:
raise SnapshotError("Failed to parse dmsetup status: " + out)
diff -Nur livecd-tools-18.8.orig/imgcreate/kickstart.py livecd-tools-18.8/imgcreate/kickstart.py
--- livecd-tools-18.8.orig/imgcreate/kickstart.py 2012-08-06 22:49:20.000000000 +0400
+++ livecd-tools-18.8/imgcreate/kickstart.py 2012-09-18 15:30:33.000000000 +0400
@@ -25,10 +25,10 @@
import urlgrabber
import selinux
-try:
- import system_config_keyboard.keyboard as keyboard
-except ImportError:
- import rhpl.keyboard as keyboard
+#try:
+# import system_config_keyboard.keyboard as keyboard
+#except ImportError:
+# import rhpl.keyboard as keyboard
import pykickstart.commands as kscommands
import pykickstart.constants as ksconstants
@@ -138,10 +138,13 @@
class KeyboardConfig(KickstartConfig):
"""A class to apply a kickstart keyboard configuration to a system."""
def apply(self, kskeyboard):
- k = keyboard.Keyboard()
- if kskeyboard.keyboard:
- k.set(kskeyboard.keyboard)
- k.write(self.instroot)
+# k = keyboard.Keyboard()
+ f = open(self.path("/etc/sysconfig/keyboard"), "w+")
+ f.write("KEYBOARD=\"" + kskeyboard.keyboard + "\"\n")
+ f.close()
+# if kskeyboard.keyboard:
+# k.set(kskeyboard.keyboard)
+# k.write(self.instroot)
class TimezoneConfig(KickstartConfig):
"""A class to apply a kickstart timezone configuration to a system."""
diff -Nur livecd-tools-18.8.orig/imgcreate/live.py livecd-tools-18.8/imgcreate/live.py
--- livecd-tools-18.8.orig/imgcreate/live.py 2012-08-06 22:49:20.000000000 +0400
+++ livecd-tools-18.8/imgcreate/live.py 2012-09-24 15:08:38.000000000 +0400
@@ -159,7 +159,7 @@
# Copy the initrd%d.img and xen%d.gz files over to /isolinux
# This is because the originals in /boot are removed when the
# original .iso was created.
- src = isoloop.mountdir + "/isolinux/"
+ src = isoloop.mountdir + "/boot/"
dest = self.__ensure_isodir() + "/isolinux/"
makedirs(dest)
pattern = re.compile(r"(initrd\d+\.img|xen\d+\.gz)")
@@ -230,15 +230,15 @@
def _generate_efiboot(self, isodir):
"""Generate EFI boot images."""
- if not os.path.exists(self._instroot + "/boot/efi/EFI/redhat/grub.efi"):
+ if not os.path.exists(self._instroot + "/boot/efi/EFI/rosa/grub.efi"):
return False
subprocess.call(["mkefiboot", isodir + "/EFI/BOOT",
isodir + "/isolinux/efiboot.img"])
- subprocess.call(["mkefiboot", "-a", isodir + "/EFI/BOOT",
- isodir + "/isolinux/macboot.img", "-l", self.product,
- "-n", "/usr/share/pixmaps/bootloader/fedora-media.vol",
- "-i", "/usr/share/pixmaps/bootloader/fedora.icns",
- "-p", self.product])
+# subprocess.call(["mkefiboot", "-a", isodir + "/EFI/BOOT",
+# isodir + "/isolinux/macboot.img", "-l", self.product,
+# "-n", "/usr/share/pixmaps/bootloader/fedora-media.vol",
+# "-i", "/usr/share/pixmaps/bootloader/fedora.icns",
+# "-p", self.product])
def _create_bootconfig(self):
"""Configure the image so that it's bootable."""
@@ -382,9 +382,6 @@
if os.path.exists(isodir + "/isolinux/efiboot.img"):
options.extend([ "-eltorito-alt-boot",
"-e", "isolinux/efiboot.img",
- "-no-emul-boot",
- "-eltorito-alt-boot",
- "-e", "isolinux/macboot.img",
"-no-emul-boot"])
return options
@@ -430,12 +427,12 @@
def __copy_syslinux_background(self, isodest):
background_path = self._instroot + \
- "/usr/share/anaconda/boot/syslinux-vesa-splash.jpg"
+ "/welcome.jpg"
if not os.path.exists(background_path):
# fallback to F13 location
background_path = self._instroot + \
- "/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg"
+ "/welcome.jpg"
if not os.path.exists(background_path):
return False
@@ -449,17 +446,21 @@
shutil.copyfile(bootdir + "/vmlinuz-" + version,
isodir + "/isolinux/vmlinuz" + index)
+ subprocess.call(["/usr/sbin/dracut", "/boot/initramfs-" + version + ".img", version],
+ preexec_fn = self._chroot)
isDracut = False
if os.path.exists(bootdir + "/initramfs-" + version + ".img"):
shutil.copyfile(bootdir + "/initramfs-" + version + ".img",
isodir + "/isolinux/initrd" + index + ".img")
isDracut = True
- elif os.path.exists(bootdir + "/initrd-" + version + ".img"):
- shutil.copyfile(bootdir + "/initrd-" + version + ".img",
- isodir + "/isolinux/initrd" + index + ".img")
- elif not self.base_on:
- logging.error("No initrd or initramfs found for %s" % (version,))
+ else:
+ raise InitramfsError("Unable to create initramfs-" + version + ".img")
+# elif os.path.exists(bootdir + "/initrd-" + version + ".img"):
+# shutil.copyfile(bootdir + "/initrd-" + version + ".img",
+# isodir + "/isolinux/initrd" + index + ".img")
+# elif not self.base_on:
+# logging.error("No initrd or initramfs found for %s" % (version,))
is_xen = False
if os.path.exists(bootdir + "/xen.gz-" + version[:-3]):
@@ -486,7 +487,7 @@
default %(menu)s
timeout %(timeout)d
menu background %(background)s
-menu autoboot Starting %(title)s in # second{,s}. Press any key to interrupt.
+menu autoboot Starting ROSA Linux in # second{,s}. Press any key to interrupt.
menu clear
menu title %(title)s
@@ -499,10 +500,10 @@
menu color border * #00000000 #00000000 none
menu color sel 0 #ffffffff #00000000 none
-menu color title 0 #ff7ba3d0 #00000000 none
-menu color tabmsg 0 #ff3a6496 #00000000 none
-menu color unsel 0 #84b8ffff #00000000 none
-menu color hotsel 0 #84b8ffff #00000000 none
+menu color title 0 #ffffffff #00000000 none
+menu color tabmsg 0 #ffffffff #00000000 none
+menu color unsel 0 #ffffffff #00000000 none
+menu color hotsel 0 #ff000000 #ffffffff none
menu color hotkey 0 #ffffffff #00000000 none
menu color help 0 #ffffffff #00000000 none
menu color scrollbar 0 #ffffffff #ff355594 none
@@ -586,11 +587,18 @@
extra = "",
help = "",
index = index))
+ kern_opts = kernel_options + " install"
- if default:
- linux[-1] += " menu default\n"
-
- basic.append(self.__get_image_stanza(is_xen, isDracut,
+ linux.append(self.__get_image_stanza(is_xen, isDracut,
+ fslabel = self.fslabel,
+ isofstype = "auto",
+ liveargs = kern_opts,
+ long = "^Install " + long,
+ short = "linux" + index,
+ extra = "",
+ help = "",
+ index = index))
+ linux.append(self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kern_opts,
@@ -599,6 +607,23 @@
extra = "xdriver=vesa nomodeset",
help = "Try this option out if you're having trouble starting.",
index = index))
+ linux.append(self.__get_image_stanza(is_xen, isDracut,
+ fslabel = self.fslabel,
+ isofstype = "auto",
+ liveargs = kern_opts,
+ long = "Install " + long + " in ^basic graphics mode.",
+ short = "basic" + index,
+ extra = "xdriver=vesa nomodeset install",
+ help = "Try this option out if you're having trouble installing.",
+ index = index))
+ kern_opts = kernel_options
+
+ if default:
+ linux[-1] += " menu default\n"
+
+
+
+
if checkisomd5:
check.append(self.__get_image_stanza(is_xen, isDracut,
@@ -610,6 +635,7 @@
extra = "rd.live.check",
help = "",
index = index))
+
else:
check.append(None)
@@ -669,10 +695,13 @@
menu title Troubleshooting
"""
# Add basic video and check to submenu
- for b, c in zip(basic, check):
+ # my test
+# for s in basic:
+# cfg += s
+ for b in basic:
cfg += b
- if c:
- cfg += c
+ for c in check:
+ cfg += c
cfg += self.__get_memtest_stanza(isodir)
cfg += "menu separator\n"
@@ -691,9 +720,9 @@
cfgf.close()
def __copy_efi_files(self, isodir):
- if not os.path.exists(self._instroot + "/boot/efi/EFI/redhat/grub.efi"):
+ if not os.path.exists(self._instroot + "/boot/efi/EFI/rosa/grub.efi"):
return False
- shutil.copy(self._instroot + "/boot/efi/EFI/redhat/grub.efi",
+ shutil.copy(self._instroot + "/boot/efi/EFI/rosa/grub.efi",
isodir + "/EFI/BOOT/grub.efi")
# Should exist, but if it doesn't we should fail
@@ -829,14 +858,17 @@
shutil.copyfile(bootdir + "/vmlinuz-" + version,
destdir + "/vmlinuz")
+ subprocess.call(["/usr/sbin/dracut", "/boot/initramfs-" + version + ".img", version],
+ preexec_fn = self._chroot)
if os.path.exists(bootdir + "/initramfs-" + version + ".img"):
shutil.copyfile(bootdir + "/initramfs-" + version + ".img",
destdir + "/initrd.img")
isDracut = True
else:
- shutil.copyfile(bootdir + "/initrd-" + version + ".img",
- destdir + "/initrd.img")
+ raise InitramfsError("Unable to create initramfs-" + version + ".img")
+# shutil.copyfile(bootdir + "/initrd-" + version + ".img",
+# destdir + "/initrd.img")
return isDracut
diff -Nur livecd-tools-18.8.orig/tools/livecd-iso-to-disk.sh livecd-tools-18.8/tools/livecd-iso-to-disk.sh
--- livecd-tools-18.8.orig/tools/livecd-iso-to-disk.sh 2012-08-06 22:49:20.000000000 +0400
+++ livecd-tools-18.8/tools/livecd-iso-to-disk.sh 2012-09-18 14:02:48.000000000 +0400
@@ -389,7 +389,7 @@
if [ "$(/sbin/fdisk -l $device 2>/dev/null |grep -m1 $dev |awk {'print $2;'})" != "*" ]; then
echo "Partition isn't marked bootable!"
echo "You can mark the partition as bootable with "
- echo " # /sbin/parted $device"
+ echo " # /usr/sbin/parted $device"
echo " (parted) toggle N boot"
echo " (parted) quit"
exitclean
@@ -417,8 +417,8 @@
read
umount ${device}* &> /dev/null || :
wipefs -a ${device}
- /sbin/parted --script $device mklabel gpt
- partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:)
+ /usr/sbin/parted --script $device mklabel gpt
+ partinfo=$(LC_ALL=C /usr/sbin/parted --script -m $device "unit MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
p1_size=$(($dev_size - 3))
@@ -429,7 +429,7 @@
fi
p1_start=1
p1_end=$(($p1_size + 1))
- /sbin/parted -s $device u MB mkpart '"EFI System Partition"' fat32 $p1_start $p1_end set 1 boot on
+ /usr/sbin/parted -s $device u MB mkpart '"EFI System Partition"' fat32 $p1_start $p1_end set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -449,8 +449,8 @@
read
umount ${device}* &> /dev/null || :
wipefs -a ${device}
- /sbin/parted --script $device mklabel msdos
- partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:)
+ /usr/sbin/parted --script $device mklabel msdos
+ partinfo=$(LC_ALL=C /usr/sbin/parted --script -m $device "unit MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
p1_size=$(($dev_size - 3))
@@ -461,7 +461,7 @@
fi
p1_start=1
p1_end=$(($p1_size + 1))
- /sbin/parted -s $device u MB mkpart primary fat32 $p1_start $p1_end set 1 boot on
+ /usr/sbin/parted -s $device u MB mkpart primary fat32 $p1_start $p1_end set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -485,8 +485,8 @@
read
umount ${device}* &> /dev/null || :
wipefs -a ${device}
- /sbin/parted -s $device mklabel msdos
- partinfo=$(LC_ALL=C /sbin/parted -s -m $device "u MB print" |grep ^$device:)
+ /usr/sbin/parted -s $device mklabel msdos
+ partinfo=$(LC_ALL=C /usr/sbin/parted -s -m $device "u MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
p1_size=$(($dev_size - 3))
@@ -497,7 +497,7 @@
fi
p1_start=1
p1_end=$(($p1_size + 1))
- /sbin/parted -s $device u MB mkpart primary ext2 $p1_start $p1_end set 1 boot on
+ /usr/sbin/parted -s $device u MB mkpart primary ext2 $p1_start $p1_end set 1 boot on
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -525,7 +525,7 @@
exitclean
fi
- partinfo=$(LC_ALL=C /sbin/parted --script -m $device "print" |grep ^$partnum:)
+ partinfo=$(LC_ALL=C /usr/sbin/parted --script -m $device "print" |grep ^$partnum:)
volname=$(echo $partinfo |cut -d : -f 6)
flags=$(echo $partinfo |cut -d : -f 7)
if [ "$volname" != "EFI System Partition" ]; then
@@ -536,7 +536,7 @@
if [ "$(echo $flags |grep -c boot)" = "0" ]; then
echo "Partition isn't marked bootable!"
echo "You can mark the partition as bootable with "
- echo " # /sbin/parted $device"
+ echo " # /usr/sbin/parted $device"
echo " (parted) toggle N boot"
echo " (parted) quit"
exitclean

View file

@ -1,114 +1,69 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "import distutils.sysconfig as d; print d.get_python_lib()")}
%define debug_package %{nil}
Summary: Tools for building live CDs
Name: livecd-tools
Version: 031
Release: %mkrel 50
Version: 18.8
Release: 3
Epoch: 1
License: GPLv2
Group: System/Base
Buildarch: noarch
URL: http://git.fedoraproject.org/?p=hosted/livecd
Source0: %{name}-%{version}.tar.bz2
Patch100: fix-libdir-in-python.patch
Group: System Environment/Base
URL: http://git.fedorahosted.org/git/livecd
# To make source tar ball:
# git clone git://git.fedorahosted.org/livecd
# cd livecd
# make dist
# scp livecd*.tar.bz2 fedorahosted.org:livecd
Source0: http://fedorahosted.org/releases/l/i/livecd/%{name}-%{version}.tar.bz2
Patch0: livecd-tools-18.8.urpmi.rosa.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: python-imgcreate = %{version}-%{release}
Requires: python-rpm python-selinux
Requires: python-imgcreate = %{epoch}:%{version}-%{release}
Requires: mkisofs
Requires: isomd5sum
Requires: parted
Requires: pyparted
Requires: util-linux
Requires: dosfstools
Requires: e2fsprogs
Requires: lorax >= 18.3
%ifarch %{ix86} x86_64
Requires: syslinux
%endif
%ifarch ppc
Requires: yaboot
%endif
Requires: dumpet
BuildRequires: python
BuildRequires: perl
Patch0: 0001-Disable-iswmd-on-live-images-for-now.patch
Patch10: livecd-tools-031-menu-config.patch
Patch11: livecd-tools-031-dracut.patch
Patch12: livecd-tools-031-not-use-rhpl-python.patch
Patch13: livecd-tools-031-use-urpmi.patch
Patch14: livecd-tools-031-yum-not-needed.patch
Patch15: livecd-tools-031-parted-path.patch
Patch16: livecd-tools-031-yum-option.patch
Patch17: livecd-tools-031-without-language-config.patch
Patch18: livecd-tools-031-mksquashfs-lzma.patch
Patch19: livecd-tools-031-iso-to-disk-oem.patch
Patch20: livecd-tools-031-post-packages.patch
Patch21: livecd-tools-031-lazy-umount.patch
Patch22: livecd-tools-031-timeout-before-losetup-d.patch
Patch23: livecd-tools-031-xz.patch
Patch24: livecd-tools-031-iso-to-disk-oem-man.patch
# (eugeni) a temporary workaround to allow mixing packages from different repos
Patch25: livecd-tools-031-no-verify.patch
Patch26: livecd-tools-031-urpmi-split-length.patch
BuildRequires: /usr/bin/pod2man
#next patch
Patch27: livecd-tools-031-fdisk-unit-cylinder.patch
Patch28: livecd-tools-031-cp-progress-bar.patch
# (eugeni) fix format change in dmsetup output parsing
Patch29: livecd-tools-031-new_dmsetup.patch
%description
Tools for generating live CDs on Fedora based systems including
derived distributions such as RHEL, CentOS and others. See
http://fedoraproject.org/wiki/FedoraLiveCD for more details.
This package contains the patches required to allow building live images on
Mandriva systems.
%package -n python-imgcreate
Summary: Python modules for building system images
Group: System/Base
Group: System Environment/Base
Requires: util-linux
Requires: coreutils
Requires: e2fsprogs
#Requires: yum >= 3.2.18
Requires: yum >= 3.2.18
Requires: squashfs-tools
#Requires: python-kickstart >= 0.96
Requires: pykickstart >= 1.77-3
Requires: pykickstart >= 0.96
Requires: dosfstools >= 2.11-8
#Requires: system-config-keyboard >= 1.3.0
Requires: python-urlgrabber
Requires: python-selinux
Requires: dbus-python
Conflicts: livecd-tools < 0.31
Requires: policycoreutils
%description -n python-imgcreate
Python modules that can be used for building images for things
like live image or appliances.
%package -n livecd-iso-to-disk
Summary: Script for copy iso to disk
%description -n livecd-iso-to-disk
Convert a live CD iso so that it's bootable off of a USB stick
%prep
%setup -q
#%patch100 -p0
%patch0 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
#%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1 -F 5
# (eugeni) urpmi/rpm are fixed, reenabling transactions
#%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%build
make
@ -117,8 +72,6 @@ make
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
mv %{buildroot}/%{_docdir}/%{name}-%{version}/ %{buildroot}/%{_docdir}/%{name}/
%clean
rm -rf $RPM_BUILD_ROOT
@ -128,137 +81,23 @@ rm -rf $RPM_BUILD_ROOT
%doc config/livecd-fedora-minimal.ks
%{_mandir}/man*/*
%{_bindir}/livecd-creator
%{_bindir}/livecd-iso-to-disk
%{_bindir}/livecd-iso-to-pxeboot
%{_bindir}/image-creator
%{_bindir}/liveimage-mount
%{_bindir}/edit-livecd
%{_bindir}/mkbiarch
/usr/share/doc*
%files -n python-imgcreate
%defattr(-,root,root,-)
%doc API
%dir %{py_sitedir}/imgcreate
%{py_sitedir}/imgcreate/*.py
%{py_sitedir}/imgcreate/*.pyo
%{py_sitedir}/imgcreate/*.pyc
%files -n livecd-iso-to-disk
%{_bindir}/livecd-iso-to-disk
%doc API COPYING
%dir %{python_sitelib}/imgcreate
%{python_sitelib}/imgcreate/*.py
%{python_sitelib}/imgcreate/*.pyo
%{python_sitelib}/imgcreate/*.pyc
%changelog
* Wed Jun 29 2011 Eugeni Dodonov <eugeni@mandriva.com> 031-48mdv2011.0
+ Revision: 688161
- Apply dmsetup patch
* Tue Jun 28 2011 Eugeni Dodonov <eugeni@mandriva.com> 031-47
+ Revision: 687966
- Bump release
* Tue Jun 28 2011 Eugeni Dodonov <eugeni@mandriva.com> 031-46
+ Revision: 687962
- Support new dmsetup output format
* Tue May 03 2011 Antoine Ginies <aginies@mandriva.com> 031-45
+ Revision: 663929
- add missing requires
* Tue Apr 05 2011 Eugeni Dodonov <eugeni@mandriva.com> 031-44
+ Revision: 650706
- Re-enable transactions for package installing.
* Tue Apr 05 2011 Alex Burmashev <burmashev@mandriva.org> 031-43
+ Revision: 650668
- added cp bar\n rebuild on new fdisk
- added cp bar\n rebuild on new fdisk
* Wed Mar 30 2011 Antoine Ginies <aginies@mandriva.com> 031-42
+ Revision: 649222
- add split-length 0 option
- revert, will use a patch instead
- bump release
- add --split-length 0 option until a bug relative to concurrent access rpmdb is fixed
* Tue Mar 01 2011 Alex Burmashev <burmashev@mandriva.org> 031-41
+ Revision: 641163
- Fixed yum requires
* Thu Feb 24 2011 Alex Burmashev <burmashev@mandriva.org> 031-40
+ Revision: 639677
- Removed yum requires
* Mon Feb 14 2011 Thomas Backlund <tmb@mandriva.org> 031-37
+ Revision: 637707
- re-enable lzma and xz support as kernel-2.6.37-3mnb is out
+ Eugeni Dodonov <eugeni@mandriva.com>
- Disable usage of lzma or xz by default until cooker kernel is able to use them.
- P23: use xz compression instead of lzma to comply with mksquashfs
P24: allow mixing packages from different repos
* Mon Jan 31 2011 Eugeni Dodonov <eugeni@mandriva.com> 031-35
+ Revision: 634425
- Improve package description.
* Mon Jan 31 2011 Eugeni Dodonov <eugeni@mandriva.com> 031-34
+ Revision: 634414
- Imported patches from ROSA Lab by Pavel Fokin <pavel.fokin@rosalab.ru>:
- P10: added extra configuration for syslinux menu
- P11: added initramfs generation by the dracut
- P12: drop not used functionality of the python-rhpl package
- P13: added using of the urpmi
- P14: yum not used
- P15: fixed parted path
- P16: add special --yum option to the livecd-creator(urpmi used by default)
- P17: language not configured by the livecd-tools
- P18: added -comp lzma option for making squashfs
- P19: added livecd-iso-to-disk-oem script
- P20: added using of the %%post_packages section in the kickstart
- P21: added lazy unmount option
- P22: added timeout before calling "losetup -d"
* Sun Nov 21 2010 Funda Wang <fwang@mandriva.org> 031-7mdv2011.0
+ Revision: 599402
- fix file list
* Wed Mar 31 2010 Thierry Vignaud <tv@mandriva.org> 031-7mdv2010.1
+ Revision: 530504
- Conflicts: livecd-tools < 0.31
* Wed Mar 31 2010 Thierry Vignaud <tv@mandriva.org> 031-6mdv2010.1
+ Revision: 530496
- Requires s/pykickstart/python-kickstart/
* Tue Mar 30 2010 Thierry Vignaud <tv@mandriva.org> 031-5mdv2010.1
+ Revision: 530064
- remove Requires on system-config-keyboard
* Tue Mar 30 2010 Thierry Vignaud <tv@mandriva.org> 031-4mdv2010.1
+ Revision: 529955
- remove Requires on libselinux-python
* Mon Mar 29 2010 Thierry Vignaud <tv@mandriva.org> 031-3mdv2010.1
+ Revision: 528800
- fix build on x86_64 (fsck rh)
- new release (use blkid instead of vol_id)
- rename patch 0 as 100
- resync with RH
* Thu Feb 25 2010 Ahmad Samir <ahmadsamir@mandriva.org> 022-3mdv2010.1
+ Revision: 511255
- fix requires
* Mon Sep 14 2009 Thierry Vignaud <tv@mandriva.org> 022-2mdv2010.0
+ Revision: 439559
- rebuild
* Mon Mar 16 2009 Jérôme Soyer <saispo@mandriva.org> 022-1mdv2009.1
+ Revision: 355845
- New upstream release
* Thu Jan 22 2009 Jérôme Soyer <saispo@mandriva.org> 021-1mdv2009.1
+ Revision: 332459
- New upstream release
* Thu Jan 15 2009 Jérôme Soyer <saispo@mandriva.org> 019-1mdv2009.1
+ Revision: 329794
- import livecd-tools
* Mon Aug 06 2012 Brian C. Lane <bcl@redhat.com> 18.8-1
- Version 18.8 (bcl)
- dracut needs to load vfat and msdos filesystems (bcl)