Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Fedora Release Engineering | 42b6ae05c7 | |
Bill Nottingham | 15eb548089 | |
Robert Scheck | 33eeb4a4a5 | |
Jeremy Katz | 57e02ad7cb | |
Jeremy Katz | 3f2e975949 | |
Jeremy Katz | daa9d047a4 | |
Bill Nottingham | d2e94d1d9a |
|
@ -1 +0,0 @@
|
|||
livecd-tools-008.tar.bz2
|
|
@ -0,0 +1 @@
|
|||
livecd-tools-009.tar.bz2
|
21
Makefile
21
Makefile
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: livecd-tools
|
||||
# $Id$
|
||||
NAME := livecd-tools
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attept a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
|
@ -0,0 +1,251 @@
|
|||
#!/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>
|
||||
#
|
||||
# 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 [--reset-mbr] [--noverify] <isopath> <usbstick device>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
[ -d "$CDMNT" ] && umount $CDMNT && rmdir $CDMNT
|
||||
[ -d "$USBMNT" ] && umount $USBMNT && rmdir $USBMNT
|
||||
}
|
||||
|
||||
exitclean() {
|
||||
echo "Cleaning up to exit..."
|
||||
cleanup
|
||||
exit 1
|
||||
}
|
||||
|
||||
getdisk() {
|
||||
DEV=$1
|
||||
|
||||
p=$(udevinfo -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"
|
||||
}
|
||||
|
||||
resetMBR() {
|
||||
getdisk $1
|
||||
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
|
||||
exitclean
|
||||
fi
|
||||
}
|
||||
|
||||
checkMBR() {
|
||||
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 [ "$(/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 " (parted) toggle N boot"
|
||||
echo " (parted) quit"
|
||||
exitclean
|
||||
fi
|
||||
}
|
||||
|
||||
checkFilesystem() {
|
||||
dev=$1
|
||||
|
||||
USBFS=$(/lib/udev/vol_id -t $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=$(/lib/udev/vol_id -u $dev)
|
||||
if [ -n "$USBLABEL" ]; then
|
||||
USBLABEL="UUID=$USBLABEL" ;
|
||||
else
|
||||
USBLABEL=$(/lib/udev/vol_id -l $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
|
||||
}
|
||||
|
||||
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=""
|
||||
else
|
||||
SYSLINUXPATH="syslinux"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $(id -u) != 0 ]; then
|
||||
echo "You need to be root to run this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while [ $# -gt 2 ]; do
|
||||
case $1 in
|
||||
--noverify)
|
||||
noverify=1
|
||||
;;
|
||||
--reset-mbr|--resetmbr)
|
||||
resetmbr=1
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
ISO=$1
|
||||
USBDEV=$2
|
||||
|
||||
if [ -z "$ISO" -o ! -e "$ISO" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -z "$USBDEV" -o ! -b "$USBDEV" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -z "$noverify" -a -x /usr/lib/anaconda-runtime/checkisomd5 ]; then
|
||||
# verify the image
|
||||
echo "Verifying image..."
|
||||
/usr/lib/anaconda-runtime/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
|
||||
|
||||
# do some basic sanity checks.
|
||||
checkSyslinuxVersion
|
||||
checkFilesystem $USBDEV
|
||||
checkPartActive $USBDEV
|
||||
checkMBR $USBDEV
|
||||
[ -n $resetmbr ] && resetMBR $USBDEV
|
||||
|
||||
# FIXME: would be better if we had better mountpoints
|
||||
CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
|
||||
mount -o loop $ISO $CDMNT || exitclean
|
||||
USBMNT=$(mktemp -d /media/usbdev.XXXXXX)
|
||||
mount $USBDEV $USBMNT || exitclean
|
||||
|
||||
trap exitclean SIGINT SIGTERM
|
||||
|
||||
if [ -d $USBMNT/LiveOS ]; then
|
||||
echo "Already set up as live image. Deleting old in fifteen seconds..."
|
||||
sleep 15
|
||||
|
||||
rm -rf $USBMNT/LiveOS
|
||||
fi
|
||||
|
||||
echo "Copying live image to USB stick"
|
||||
if [ ! -d $USBMNT/$SYSLINUXPATH ]; then mkdir $USBMNT/$SYSLINUXPATH ; fi
|
||||
if [ ! -d $USBMNT/LiveOS ]; then mkdir $USBMNT/LiveOS ; fi
|
||||
# cases without /LiveOS are legacy detection, remove for F10
|
||||
if [ -f $CDMNT/LiveOS/squashfs.img ]; then
|
||||
cp $CDMNT/LiveOS/squashfs.img $USBMNT/LiveOS/squashfs.img || exitclean
|
||||
elif [ -f $CDMNT/squashfs.img ]; then
|
||||
cp $CDMNT/squashfs.img $USBMNT/LiveOS/squashfs.img || exitclean
|
||||
elif [ -f $CDMNT/LiveOS/ext3fs.img ]; then
|
||||
cp $CDMNT/LiveOS/ext3fs.img $USBMNT/LiveOS/ext3fs.img || exitclean
|
||||
elif [ -f $CDMNT/ext3fs.img ]; then
|
||||
cp $CDMNT/ext3fs.img $USBMNT/LiveOS/ext3fs.img || exitclean
|
||||
fi
|
||||
if [ -f $CDMNT/osmin.img ]; then
|
||||
cp $CDMNT/osmin.img $USBMNT/LiveOS/osmin.img || exitclean
|
||||
fi
|
||||
|
||||
cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
|
||||
|
||||
echo "Updating boot config file"
|
||||
# adjust label and fstype
|
||||
sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" $USBMNT/$SYSLINUXPATH/isolinux.cfg
|
||||
|
||||
echo "Installing boot loader"
|
||||
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
|
||||
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/syslinux
|
||||
cleanup
|
||||
fi
|
||||
|
||||
echo "USB stick set up as live image!"
|
|
@ -0,0 +1,72 @@
|
|||
Patch by Robert Scheck <robert@fedoraproject.org> for livecd-tools = 009 to set the correct default
|
||||
paths for the repositories, as Fedora 7 was the first merged release without Core and Extras.
|
||||
|
||||
--- livecd-tools-009/config/livecd-fedora-desktop.ks 2007-05-30 22:12:54.000000000 +0200
|
||||
+++ livecd-tools-009/config/livecd-fedora-desktop.ks.repository 2008-05-31 10:13:53.000000000 +0200
|
||||
@@ -4,8 +4,8 @@
|
||||
auth --useshadow --enablemd5
|
||||
selinux --enforcing
|
||||
firewall --disabled
|
||||
-repo --name=d7 --baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/os
|
||||
-repo --name=e7 --baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/development/i386
|
||||
+repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-7&arch=i386
|
||||
+repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f7&arch=i386
|
||||
xconfig --startxonboot
|
||||
services --enabled=NetworkManager,dhcdbd --disabled=network,sshd
|
||||
|
||||
@@ -33,9 +33,8 @@
|
||||
-scim-bridge-qt
|
||||
-scim-skk
|
||||
-scim-tomoe
|
||||
--scim-tables-chinese
|
||||
+-scim-tables*
|
||||
-scim-fcitx*
|
||||
--scim-tables-additional
|
||||
-scim-skk
|
||||
|
||||
m17n-lib
|
||||
--- livecd-tools-009/config/livecd-fedora-kde.ks 2007-05-30 22:12:54.000000000 +0200
|
||||
+++ livecd-tools-009/config/livecd-fedora-kde.ks.repository 2008-05-31 10:18:56.000000000 +0200
|
||||
@@ -8,8 +8,8 @@
|
||||
xconfig --startxonboot
|
||||
services --enabled=NetworkManager,dhcdbd --disabled=network,sshd
|
||||
|
||||
-repo --name=d7 --baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/os
|
||||
-repo --name=e7 --baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/development/i386
|
||||
+repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-7&arch=i386
|
||||
+repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f7&arch=i386
|
||||
|
||||
%packages
|
||||
# Basic packages
|
||||
--- livecd-tools-009/config/livecd-fedora-minimal.ks 2007-05-30 22:12:54.000000000 +0200
|
||||
+++ livecd-tools-009/config/livecd-fedora-minimal.ks.repository 2008-05-31 10:19:10.000000000 +0200
|
||||
@@ -5,14 +5,8 @@
|
||||
selinux --enforcing
|
||||
firewall --disabled
|
||||
|
||||
-# TODO: how to replace i386 with $basearch
|
||||
-
|
||||
-# TODO: apparently calling it fedora-dev instead of a-dev makes things
|
||||
-# not work. Perhaps it has something to do with the default repos in
|
||||
-# /etc/yum.repos.d not getting properly disabled?
|
||||
-
|
||||
-repo --name=a-dev --baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/os
|
||||
-repo --name=a-extras-dev --baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/development/i386
|
||||
+repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-7&arch=$basearch
|
||||
+repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f7&arch=$basearch
|
||||
|
||||
%packages
|
||||
bash
|
||||
--- livecd-tools-009/config/livedvd-fedora-kde.ks 2007-05-30 22:12:54.000000000 +0200
|
||||
+++ livecd-tools-009/config/livedvd-fedora-kde.ks.repository 2008-05-31 10:17:51.000000000 +0200
|
||||
@@ -8,8 +8,8 @@
|
||||
xconfig --startxonboot
|
||||
services --enabled=NetworkManager,dhcdbd --disabled=network,sshd
|
||||
|
||||
-repo --name=d7 --baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/os
|
||||
-repo --name=e7 --baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/development/i386
|
||||
+repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-7&arch=$basearch
|
||||
+repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f7&arch=$basearch
|
||||
|
||||
%packages
|
||||
# Basic packages
|
|
@ -1,11 +1,13 @@
|
|||
Summary: Tools for building live CD's
|
||||
Name: livecd-tools
|
||||
Version: 008
|
||||
Release: 1%{?dist}
|
||||
Version: 009
|
||||
Release: 4%{?dist}
|
||||
License: GPL
|
||||
Group: System Environment/Base
|
||||
URL: http://git.fedoraproject.org/?p=hosted/livecd
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
Source1: isotostick.sh
|
||||
Patch: livecd-tools-009-repository.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
Requires: util-linux
|
||||
Requires: coreutils
|
||||
|
@ -26,6 +28,7 @@ http://fedoraproject.org/wiki/FedoraLiveCD for more details.
|
|||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch -p1
|
||||
|
||||
%build
|
||||
make
|
||||
|
@ -34,6 +37,8 @@ make
|
|||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir}/livecd-iso-to-disk
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
@ -48,6 +53,19 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%{_datadir}/livecd-tools/*
|
||||
|
||||
%changelog
|
||||
* Sun May 31 2008 Robert Scheck <robert@fedoraproject.org> - 009-4
|
||||
- Updated outdated kickstart files (#318811, Christoph Wickert)
|
||||
|
||||
* Mon Nov 5 2007 Jeremy Katz <katzj@redhat.com> - 009-3
|
||||
- And fix to actually work with F7
|
||||
|
||||
* Mon Nov 5 2007 Jeremy Katz <katzj@redhat.com> - 009-2
|
||||
- Push new livecd-iso-to-disk that works with Fedora 8 live images
|
||||
|
||||
* Wed May 30 2007 Jeremy Katz <katzj@redhat.com> - 009-1
|
||||
- miscellaneous live config changes
|
||||
- fix isomd5 checking syntax error
|
||||
|
||||
* Fri May 4 2007 Jeremy Katz <katzj@redhat.com> - 008-1
|
||||
- disable screensaver with default config
|
||||
- add aic7xxx and sym53c8xx drivers to default initramfs
|
||||
|
|
Loading…
Reference in New Issue