2 commits - imgcreate/creator.py Makefile
by Brian C. Lane
Makefile | 4 ++--
imgcreate/creator.py | 7 +------
2 files changed, 3 insertions(+), 8 deletions(-)
New commits:
commit 0c848789c596f940cad4a77f37fbc0c63efc5b97
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Mar 21 16:38:14 2011 -0700
Fix image-creator symlink so that it is relative
diff --git a/Makefile b/Makefile
index 04a6c65..98d73f2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 16.2
+VERSION = 16.3
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
@@ -22,7 +22,7 @@ man:
install: man
$(INSTALL_PROGRAM) -D tools/livecd-creator $(DESTDIR)/usr/bin/livecd-creator
- ln -s $(DESTDIR)/usr/bin/livecd-creator $(DESTDIR)/usr/bin/image-creator
+ ln -s ./livecd-creator $(DESTDIR)/usr/bin/image-creator
$(INSTALL_PROGRAM) -D tools/liveimage-mount $(DESTDIR)/usr/bin/liveimage-mount
$(INSTALL_PROGRAM) -D tools/livecd-iso-to-disk.sh $(DESTDIR)/usr/bin/livecd-iso-to-disk
$(INSTALL_PROGRAM) -D tools/livecd-iso-to-pxeboot.sh $(DESTDIR)/usr/bin/livecd-iso-to-pxeboot
commit 9e431a9c86398705ec7b30328dc0981539e15a40
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Mar 21 16:11:05 2011 -0700
symlink /etc/mtab to /proc/self/mounts (#688277)
systemd expects the installed system to have this setup.
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index ec4c1ba..675dcf6 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -536,7 +536,7 @@ class ImageCreator(object):
self.__create_minimal_dev()
- os.symlink("../proc/mounts", self._instroot + "/etc/mtab")
+ os.symlink("/proc/self/mounts", self._instroot + "/etc/mtab")
self.__write_fstab()
@@ -548,11 +548,6 @@ class ImageCreator(object):
from the install root.
"""
- try:
- os.unlink(self._instroot + "/etc/mtab")
- except OSError:
- pass
-
self.__destroy_selinuxfs()
self._undo_bindmounts()
12 years
Makefile
by Brian C. Lane
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 25cd8004b2db9cd9c06d70ddc1373e73802c8179
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Mar 21 09:38:58 2011 -0700
Symlink image-creator instead of hardlink (#689167)
Fixes conflicting selinux contexts between livecd-creator and
image-creator
diff --git a/Makefile b/Makefile
index d4745c9..04a6c65 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ man:
install: man
$(INSTALL_PROGRAM) -D tools/livecd-creator $(DESTDIR)/usr/bin/livecd-creator
- ln $(DESTDIR)/usr/bin/livecd-creator $(DESTDIR)/usr/bin/image-creator
+ ln -s $(DESTDIR)/usr/bin/livecd-creator $(DESTDIR)/usr/bin/image-creator
$(INSTALL_PROGRAM) -D tools/liveimage-mount $(DESTDIR)/usr/bin/liveimage-mount
$(INSTALL_PROGRAM) -D tools/livecd-iso-to-disk.sh $(DESTDIR)/usr/bin/livecd-iso-to-disk
$(INSTALL_PROGRAM) -D tools/livecd-iso-to-pxeboot.sh $(DESTDIR)/usr/bin/livecd-iso-to-pxeboot
12 years
[PATCH] Bug 689360 - livcd-iso-to-disk aborts with empty device and proper SYSLINUXPATH setting
by Frederick Grose
*Bug 689360* <https://bugzilla.redhat.com/show_bug.cgi?id=689360> -
livcd-iso-to-disk
aborts with empty device and proper SYSLINUXPATH setting
>From the bug report:
The new autoexit setting, set -e, caused a runtime error in the case of a zero
value in the arithmetic expression command, ((tbd += <du value>)), that is when
both tbd and the du value were 0.
This occurs when the installation device is empty and there is no /syslinux
directory to size.
The attached patch changes the command to tdb=$((tbd + <du value>)), which
fixes the problem because the assignment operation returns "SUCCESS".
(Changed similar commands to match the assignment style.)
commit f11b6399f4a3266c517d2ce56dec2b18a8139d5d
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Mon Mar 21 03:44:41 2011 -0400
Fix return code failure with zero-valued arithmetic expression.
A runtime zero-valued arithmetic expression returns "FAILURE",
so with the new set -e autoexit setting, the code logic or
command must be adjusted to accommodate.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index deb5473..41d6b28 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -880,18 +880,18 @@ if [[ -d $TGTMNT/$LIVEOS ]]; then
tbd=($(du -B 1M $TGTMNT/$LIVEOS))
if [[ -s $TGTMNT/$LIVEOS/$HOMEFILE ]] && [[ -n $keephome ]]; then
homesize=($(du -B 1M $TGTMNT/$LIVEOS/$HOMEFILE))
- ((tbd -= homesize))
+ tbd=$((tbd - homesize))
fi
else
tbd=0
fi
if [[ live == $srctype ]]; then
- targets="$TGTMNT/$SYSLINUXPATH"
- [[ -n $efi ]] && targets+=" $TGTMNT$EFI_BOOT"
- [[ -n $xo ]] && targets+=" $TGTMNT/BOOT/olpc.fth"
- duTable=($(du -c -B 1M $targets 2> /dev/null || :))
- ((tbd += ${duTable[*]: -2:1}))
+ targets="$TGTMNT/$SYSLINUXPATH"
+ [[ -n $efi ]] && targets+=" $TGTMNT$EFI_BOOT"
+ [[ -n $xo ]] && targets+=" $TGTMNT/BOOT/olpc.fth"
+ duTable=($(du -c -B 1M $targets 2> /dev/null || :))
+ tbd=$((tbd + ${duTable[*]: -2:1}))
fi
if [[ -n $skipcompress ]] && [[ -s $SRCMNT/LiveOS/squashfs.img ]]; then
@@ -923,7 +923,7 @@ if [[ live == $srctype ]]; then
[[ -n $efi ]] && sources+=" $SRCMNT$EFI_BOOT"
[[ -n $xo ]] && sources+=" $SRCMNT/BOOT/olpc.fth"
duTable=($(du -c -B 1M "$thisScriptpath" $sources 2> /dev/null || :))
- ((livesize += ${duTable[*]: -2:1}))
+ livesize=$((livesize + ${duTable[*]: -2:1}))
fi
freespace=($(df -B 1M --total $TGTDEV))
12 years
[PATCH] Bug 689329 - livecd-iso-to-disk installs syslinux files in root directory
by Frederick Grose
*Bug 689329* <https://bugzilla.redhat.com/show_bug.cgi?id=689329> -
livecd-iso-to-disk
installs syslinux files in root directory
>From the bug report:
The new set -o pipefail option, set early, changes a return value in
checkSyslinuxVersion() leading to SYSLINUXPATH being set to "".
The attached patch rewrites the test. The earlier test tested the usage
function in /usr/bin/syslinux.
The replacement checks the the --version output for a general 'syslinux'
response.
This should exercise the installed program like the previous test, but I'm not
familiar with the use case for the failure condition that leads to SYSLINUXPATH
being set to "".
--Fred
commit 56856fab4f5a01e73d96ac7dbfc434f001b401e1
Author: Live System User <liveuser(a)localhost.localdomain>
Date: Mon Mar 21 02:30:40 2011 -0400
Fix pipefailure in checkSyslinuxVersion()
Use a list operation to bypass the erroneous return value.
Alter the test to something that could be used to check the
syslinux version, if desired.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index deb5473..70e80ba 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -559,7 +559,8 @@ checkSyslinuxVersion() {
echo "You need to have syslinux installed to run this script"
exit 1
fi
- if ! syslinux 2>&1 | grep -qe -d; then
+ check=($(syslinux --version 2>&1)) || :
+ if [[ 'syslinux' == $check ]]; then
SYSLINUXPATH=""
elif [ -n "$multi" ]; then
SYSLINUXPATH="$LIVEOS/syslinux"
@@ -1006,7 +1007,6 @@ fi
[ -n "$efi" -a ! -d $TGTMNT$EFI_BOOT ] && mkdir -p $TGTMNT$EFI_BOOT
# Live image copy
-set -o pipefail
if [ "$srctype" = "live" -a -z "$skipcopy" ]; then
echo "Copying live image to target device."
[ ! -d $TGTMNT/$LIVEOS ] && mkdir $TGTMNT/$LIVEOS
12 years
4 commits - tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 82 ++++++++++++++++++++++++++++++++++----------
1 file changed, 65 insertions(+), 17 deletions(-)
New commits:
commit c92dfe621904c6f3770454bcd92c768860a85159
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Mar 17 14:11:43 2011 -0700
Add extracting BOOTX64.efi from iso (#688258)
Some iso's (RHEL6) don't have the BOOTX64.efi binary in /EFI/BOOT,
but it is in the eltorito image, so if it is missing from the iso
extract it from the eltorito using the dumpet utility.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 46f42ab..deb5473 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -1066,6 +1066,34 @@ if [ -n "$efi" ]; then
# this is a little ugly, but it gets the "interesting" named config file
BOOTCONFIG_EFI=$TGTMNT$EFI_BOOT/+(BOOT|boot)?*.conf
rm -f $TGTMNT$EFI_BOOT/grub.conf
+
+ # On some images (RHEL) the BOOT*.efi file isn't in $EFI_BOOT, but is in
+ # the eltorito image, so try to extract it if it is missing
+
+ # test for presence of *.efi grub binary
+ if [ ! -f $TGTMNT$EFI_BOOT/+(BOOT|boot)?*.efi ]; then
+ if [ ! -x /usr/bin/dumpet ]; then
+ echo "No /usr/bin/dumpet tool found. EFI image will not boot."
+ echo "Source media is missing grub binary in /EFI/BOOT/*efi"
+ exitclean
+ else
+ # dump the eltorito image with dumpet, output is $SRC.1
+ dumpet -i $SRC -d
+ EFIMNT=$(mktemp -d /media/srctmp.XXXXXX)
+ mount -o loop $SRC.1 $EFIMNT
+
+ if [ -f $EFIMNT$EFI_BOOT/+(BOOT|boot)?*.efi ]; then
+ cp $EFIMNT$EFI_BOOT/+(BOOT|boot)?*.efi $TGTMNT$EFI_BOOT
+ else
+ echo "No BOOT*.efi found in eltorito image. EFI will not boot"
+ umount $EFIMNT
+ rm $SRC.1
+ exitclean
+ fi
+ umount $EFIMNT
+ rm $SRC.1
+ fi
+ fi
fi
if [[ live == $srctype ]]; then
commit 0023914160f084ff85087d9a90f3fd3dc9f23285
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Mar 17 10:22:41 2011 -0700
Add repo to DVD EFI install config file (#688258)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 47cce30..46f42ab 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -1101,6 +1101,10 @@ fi
if [ "$srctype" = "installer" ]; then
sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG} repo=hd:$TGTLABEL:/;g" $BOOTCONFIG
sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
+ if [ -n "$efi" ]; then
+ # Images are in / now
+ sed -i -e "s;images/pxeboot/;;g" -e "s;vmlinuz;vmlinuz ${LANG:+LANG=$LANG} repo=hd:$TGTLABEL:/;g" $BOOTCONFIG_EFI
+ fi
fi
# DVD Installer for netinst
commit d575b4c2747dd297d0733b77573297626dda211b
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Mar 16 17:22:30 2011 -0700
Add EFI support to netboot (#688258)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 41f7f85..47cce30 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -1099,17 +1099,22 @@ fi
# DVD Installer
if [ "$srctype" = "installer" ]; then
- sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG} repo=hd:$TGTLABEL:/;g" $BOOTCONFIG $BOOTCONFIG_EFI
- sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG} repo=hd:$TGTLABEL:/;g" $BOOTCONFIG
+ sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
fi
# DVD Installer for netinst
if [ "$srctype" = "netinst" ]; then
if [ "$imgtype" = "install" ]; then
- sed -i -e "s;stage2=\S*;stage2=hd:$TGTLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ sed -i -e "s;stage2=\S*;stage2=hd:$TGTLABEL:/images/install.img;g" $BOOTCONFIG
else
# The initrd has everything, so no stage2
- sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
+
+ if [ -n "$efi" ]; then
+ # Images are in / now
+ sed -ie "s;images/pxeboot/;;g" $BOOTCONFIG_EFI
+ fi
fi
fi
commit fbcc2be6f9c70b7ff7d801f07d04a3ea2535b955
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Mar 16 10:42:42 2011 -0700
Support /EFI/BOOT or /EFI/boot (#688258)
Some iso's use lower case. Upper case is correct, but both work.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 454b893..41f7f85 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -647,6 +647,7 @@ copyFile() {
set -e
set -o pipefail
trap exitclean EXIT
+shopt -s extglob
cryptedhome=1
keephome=1
@@ -863,9 +864,15 @@ if [ -f "$TGTMNT/$LIVEOS/$HOMEFILE" -a -n "$keephome" -a "$homesizemb" -gt 0 ];
exitclean
fi
-if [ -n "$efi" -a ! -d $SRCMNT/EFI/boot ]; then
- echo "ERROR: This live image does not support EFI booting"
- exitclean
+if [ -n "$efi" ]; then
+ if [ -d $SRCMNT/EFI/BOOT ]; then
+ EFI_BOOT="/EFI/BOOT"
+ elif [ -d $SRCMNT/EFI/boot ]; then
+ EFI_BOOT="/EFI/boot"
+ else
+ echo "ERROR: This live image does not support EFI booting"
+ exitclean
+ fi
fi
# let's try to make sure there's enough room on the target device
@@ -881,8 +888,8 @@ fi
if [[ live == $srctype ]]; then
targets="$TGTMNT/$SYSLINUXPATH"
- [[ -n $efi ]] && targets+=" $TGTMNT/EFI/boot"
- [[ -n $xo ]] && targets+=" $TGTMNT/boot/olpc.fth"
+ [[ -n $efi ]] && targets+=" $TGTMNT$EFI_BOOT"
+ [[ -n $xo ]] && targets+=" $TGTMNT/BOOT/olpc.fth"
duTable=($(du -c -B 1M $targets 2> /dev/null || :))
((tbd += ${duTable[*]: -2:1}))
fi
@@ -913,8 +920,8 @@ if [[ live == $srctype ]]; then
sources="$SRCMNT/LiveOS/ext3fs.img $SRCMNT/LiveOS/osmin.img"
[[ -z $skipcompress ]] && sources+=" $SRCMNT/LiveOS/squashfs.img"
sources+=" $SRCMNT/isolinux $SRCMNT/syslinux"
- [[ -n $efi ]] && sources+=" $SRCMNT/EFI/boot"
- [[ -n $xo ]] && sources+=" $SRCMNT/boot/olpc.fth"
+ [[ -n $efi ]] && sources+=" $SRCMNT$EFI_BOOT"
+ [[ -n $xo ]] && sources+=" $SRCMNT/BOOT/olpc.fth"
duTable=($(du -c -B 1M "$thisScriptpath" $sources 2> /dev/null || :))
((livesize += ${duTable[*]: -2:1}))
fi
@@ -996,7 +1003,7 @@ fi
# Bootloader is always reconfigured, so keep these out of the if skipcopy stuff.
[ ! -d $TGTMNT/$SYSLINUXPATH ] && mkdir -p $TGTMNT/$SYSLINUXPATH
-[ -n "$efi" -a ! -d $TGTMNT/EFI/boot ] && mkdir -p $TGTMNT/EFI/boot
+[ -n "$efi" -a ! -d $TGTMNT$EFI_BOOT ] && mkdir -p $TGTMNT$EFI_BOOT
# Live image copy
set -o pipefail
@@ -1050,11 +1057,15 @@ BOOTCONFIG=$TGTMNT/$SYSLINUXPATH/isolinux.cfg
# Set this to nothing so sed doesn't care
BOOTCONFIG_EFI=
if [ -n "$efi" ]; then
- cp $SRCMNT/EFI/boot/* $TGTMNT/EFI/boot
+ cp $SRCMNT$EFI_BOOT/* $TGTMNT$EFI_BOOT
+
+ # FIXME
+ # There is a problem here. On older LiveCD's the files are boot?*.conf
+ # They really should be renamed to BOOT?*.conf
# this is a little ugly, but it gets the "interesting" named config file
- BOOTCONFIG_EFI=$TGTMNT/EFI/boot/boot?*.conf
- rm -f $TGTMNT/EFI/boot/grub.conf
+ BOOTCONFIG_EFI=$TGTMNT$EFI_BOOT/+(BOOT|boot)?*.conf
+ rm -f $TGTMNT$EFI_BOOT/grub.conf
fi
if [[ live == $srctype ]]; then
@@ -1229,8 +1240,8 @@ if [ -z "$multi" ]; then
echo "Installing boot loader"
if [ -n "$efi" ]; then
# replace the ia32 hack
- if [ -f "$TGTMNT/EFI/boot/boot.conf" ]; then
- cp -f $TGTMNT/EFI/boot/bootia32.conf $TGTMNT/EFI/boot/boot.conf
+ if [ -f "$TGTMNT$EFI_BOOT/boot.conf" ]; then
+ cp -f $TGTMNT$EFI_BOOT/BOOTia32.conf $TGTMNT$EFI_BOOT/BOOT.conf
fi
fi
12 years
Re: [Fedora-livecd-list] compiling wireless drivers
by wbsec.flive@new.rr.com
This sounds like a good solution if I have a repository to get the RPMs from. What should I do if I cannot find the RPMs but have a tar file? For example, I have not found any RPMs for Realtek drivers but can download the tar files from the Realtek site. How do I compile this before I burn the live CD?
---- James Heather <j.heather(a)surrey.ac.uk> wrote:
> On Tue, 2011-03-01 at 16:57 +0000, Brian C. Lane wrote:
>
> > On Tue, Mar 01, 2011 at 11:25:20AM -0500, wbsec.flive(a)new.rr.com wrote:
> > > I use a USB with Fedora 14 to boot various different Windows computers. The USB is created from a live CD. Sometimes I run into the problem of the wireless card not working. Usually it is because I need the correct driver for that particular brand of wireless card. My current fix for this, is to build a USB with persistence, boot it up and compile the driver on the USB. I would like to make a USB more compatible with the different brands of wireless cards. Does anyone know of a way to compile the drivers before I burn the live CD?
> >
> > Are the wireless drivers included in Fedora or one of the related
> > repositories like rpmfusion? You could make a new livecd that adds those
> > drivers, from whatever source, by adding a new repo line and the driver
> > name to the %package section of the livecd's kickstart.
>
>
> This is what I do, and it works well. The main one to grab is
> broadcom-wl, along with either kmod-wl or akmod-wl. Adding akmod-wl is
> slightly more flexible because it builds the kernel module itself, so it
> doesn't run into problems if Fedora has a new kernel but rpmfusion is
> behind the times, but it does pull in some other packages along with it.
> (It also needs the quick hack I suggested recently in a different thread
> to make sure that livecd-creator doesn't try to compress the live image
> before akmods has finished building the module.)
>
> James
12 years
Makefile
by Brian C. Lane
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit cd06c715100a963ce2755d1210149d353e09f5ec
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Mar 14 08:45:12 2011 -0700
Version 16.2
diff --git a/Makefile b/Makefile
index 0de167f..d4745c9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 16.1
+VERSION = 16.2
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
12 years
tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 67 ++++++++++++++++++++------------------------
1 file changed, 31 insertions(+), 36 deletions(-)
New commits:
commit f798217e9d04ce815a9ec288d3f7e88088771fd6
Author: Lubomir Rintel <lkundrak(a)v3.sk>
Date: Fri Mar 11 14:53:21 2011 -0800
livecd-iso-to-disk: Catch all failures
The utility used to success also in cases where catasthropic failures, such as
failure to install boot loader occured. This turns on shell options to catch
such problems and only tolerates non-zero exit values on case-by-case basis.
The utility with this change applied has received fair amount of testing
(against vfat and ext3 filesystems, with permutations of --format and --efi),
though some more testing might be useful.
(bcl: I modified the patch slightly so that luks encryption on home.img would
work with this change)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 3489d51..454b893 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -277,9 +277,13 @@ cleanup() {
}
exitclean() {
- echo "Cleaning up to exit..."
- cleanup
- exit 1
+ RETVAL=$?
+ if [ -d "$SRCMNT" ] || [ -d "$TGTMNT" ];
+ then
+ [ "$RETVAL" = 0 ] || echo "Cleaning up to exit..."
+ cleanup
+ fi
+ exit $RETVAL
}
isdevloop() {
@@ -398,7 +402,7 @@ checkLVM() {
dev=$1
if [ -x /sbin/pvs -a \
- "$(/sbin/pvs -o vg_name --noheadings $dev* 2>/dev/null)" ]; then
+ "$(/sbin/pvs -o vg_name --noheadings $dev* 2>/dev/null || :)" ]; then
echo "Device, $dev, contains a volume group and cannot be formated!"
echo "You can remove the volume group using vgremove."
exitclean
@@ -413,7 +417,7 @@ createGPTLayout() {
echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
echo "Press Enter to continue or ctrl-c to abort"
read
- umount ${device}* &> /dev/null
+ umount ${device}* &> /dev/null || :
/sbin/parted --script $device mklabel gpt
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
@@ -424,7 +428,7 @@ createGPTLayout() {
sleep 5
getpartition ${device#/dev/}
TGTDEV=${device}${partnum}
- umount $TGTDEV &> /dev/null
+ umount $TGTDEV &> /dev/null || :
/sbin/mkdosfs -n LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
}
@@ -436,7 +440,7 @@ createMSDOSLayout() {
echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
echo "Press Enter to continue or ctrl-c to abort"
read
- umount ${device}* &> /dev/null
+ umount ${device}* &> /dev/null || :
/sbin/parted --script $device mklabel msdos
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
@@ -451,7 +455,7 @@ createMSDOSLayout() {
else
TGTDEV=${device}
fi
- umount $TGTDEV &> /dev/null
+ umount $TGTDEV &> /dev/null || :
/sbin/mkdosfs -n LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
}
@@ -463,7 +467,7 @@ createEXTFSLayout() {
echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
echo "Press Enter to continue or ctrl-c to abort"
read
- umount ${device}* &> /dev/null
+ umount ${device}* &> /dev/null || :
/sbin/parted --script $device mklabel msdos
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
@@ -474,7 +478,7 @@ createEXTFSLayout() {
sleep 5
getpartition ${device#/dev/}
TGTDEV=${device}${partnum}
- umount $TGTDEV &> /dev/null
+ umount $TGTDEV &> /dev/null || :
# Check extlinux version
if extlinux -v 2>&1 | grep -q 'extlinux 3'; then
@@ -516,7 +520,7 @@ checkGPT() {
checkFilesystem() {
dev=$1
- TGTFS=$(/sbin/blkid -s TYPE -o value $dev)
+ TGTFS=$(/sbin/blkid -s TYPE -o value $dev || :)
if [ "$TGTFS" != "vfat" ] && [ "$TGTFS" != "msdos" ]; then
if [ "$TGTFS" != "ext2" ] && [ "$TGTFS" != "ext3" ] && [ "$TGTFS" != "ext4" ] && [ "$TGTFS" != "btrfs" ]; then
echo "Target filesystem must be vfat, ext[234] or btrfs"
@@ -640,6 +644,10 @@ copyFile() {
cp "$1" "$2"
}
+set -e
+set -o pipefail
+trap exitclean EXIT
+
cryptedhome=1
keephome=1
homesizemb=0
@@ -776,8 +784,7 @@ fi
if [ -z "$noverify" ]; then
# verify the image
echo "Verifying image..."
- checkisomd5 --verbose "$SRC"
- if [ $? -ne 0 ]; then
+ if ! checkisomd5 --verbose "$SRC"; then
echo "Are you SURE you want to continue?"
echo "Press Enter to continue or ctrl-c to abort"
read
@@ -876,7 +883,7 @@ if [[ live == $srctype ]]; then
targets="$TGTMNT/$SYSLINUXPATH"
[[ -n $efi ]] && targets+=" $TGTMNT/EFI/boot"
[[ -n $xo ]] && targets+=" $TGTMNT/boot/olpc.fth"
- duTable=($(du -c -B 1M $targets 2> /dev/null))
+ duTable=($(du -c -B 1M $targets 2> /dev/null || :))
((tbd += ${duTable[*]: -2:1}))
fi
@@ -908,7 +915,7 @@ if [[ live == $srctype ]]; then
sources+=" $SRCMNT/isolinux $SRCMNT/syslinux"
[[ -n $efi ]] && sources+=" $SRCMNT/EFI/boot"
[[ -n $xo ]] && sources+=" $SRCMNT/boot/olpc.fth"
- duTable=($(du -c -B 1M "$thisScriptpath" $sources 2> /dev/null))
+ duTable=($(du -c -B 1M "$thisScriptpath" $sources 2> /dev/null || :))
((livesize += ${duTable[*]: -2:1}))
fi
@@ -1052,7 +1059,8 @@ fi
if [[ live == $srctype ]]; then
# Copy this installer script.
- cp -fTp "$thisScriptpath" $TGTMNT/$LIVEOS/livecd-iso-to-disk &> /dev/null
+ cp -fT "$thisScriptpath" $TGTMNT/$LIVEOS/livecd-iso-to-disk
+ chmod +x $TGTMNT/$LIVEOS/livecd-iso-to-disk &> /dev/null || :
# When the source is an installed Live USB/SD image, restore the boot config
# file to a base state before updating.
@@ -1141,29 +1149,16 @@ if [ "$homesizemb" -gt 0 -a -z "$skipcopy" ]; then
else
dd if=/dev/null of=$TGTMNT/$LIVEOS/$HOMEFILE count=1 bs=1M seek=$homesizemb
fi
- if [ $? -gt 0 ]; then
- echo "Error creating $TGTMNT/$LIVEOS/$HOMEFILE"
- exitclean
- fi
if [ -n "$cryptedhome" ]; then
loop=$(losetup -f)
losetup $loop $TGTMNT/$LIVEOS/$HOMEFILE
- if [ $? -gt 0 ]; then
- echo "Error setting up $TGTMNT/$LIVEOS/$HOMEFILE on $loop"
- exitclean
- fi
- 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
+
+ echo "Encrypting persistent /home"
+ while ! cryptsetup luksFormat -y -q $loop; do :; done;
+
+ echo "Please enter the password again to unlock the device"
+ while ! cryptsetup luksOpen $loop EncHomeFoo; do :; done;
+
mkfs.ext4 -j /dev/mapper/EncHomeFoo
tune2fs -c0 -i0 -ouser_xattr,acl /dev/mapper/EncHomeFoo
sleep 2
12 years
2 commits - HACKING tools/livecd-iso-to-disk.sh
by Brian C. Lane
HACKING | 4 ++--
tools/livecd-iso-to-disk.sh | 26 +++++++++++++++++++-------
2 files changed, 21 insertions(+), 9 deletions(-)
New commits:
commit 46f2867369802e38db1d8c9fa2c87dbc33c48371
Author: Lubomir Rintel <lkundrak(a)v3.sk>
Date: Fri Mar 11 12:19:05 2011 -0800
Mailing list address changed
diff --git a/HACKING b/HACKING
index e912112..00fbe3c 100644
--- a/HACKING
+++ b/HACKING
@@ -17,9 +17,9 @@ Change history etc. can be obtained from the web interface
PATCHES
=======
-Send patches to the fedora-livecd-list(a)redhat.com mailing list
+Send patches to the livecd(a)lists.fedoraproject.org mailing list
- http://www.redhat.com/mailman/listinfo/fedora-livecd-list
+ https://lists.fedoraproject.org/mailman/listinfo/livecd
If you have a number of patches and want to have them pulled from a
public git repository, please post a pointer to it as well as sending
commit f3f30ae700ed02be26cd24841d40d9283d62b348
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Fri Mar 11 12:16:44 2011 -0800
Fall back to to msdos format if no extlinux
And fall back to ext3 if an older version of extlinux is being
used (thanks to Lubomir Rintel for this suggestion).
Add --msdos to force --format to use msdos instead of ext4
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 8cdf86e..3489d51 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -26,8 +26,8 @@ shortusage() {
echo "
SYNTAX
- livecd-iso-to-disk [--help] [--noverify] [--format] [--reset-mbr] [--efi]
- [--skipcopy] [--force] [--xo] [--xo-no-home]
+ livecd-iso-to-disk [--help] [--noverify] [--format] [--msdos] [--reset-mbr]
+ [--efi] [--skipcopy] [--force] [--xo] [--xo-no-home]
[--timeout <time>] [--totaltimeout <time>]
[--extra-kernel-args <args>] [--multi] [--livedir <dir>]
[--compress] [--skipcompress] [--swap-size-mb <size>]
@@ -121,6 +121,9 @@ usage() {
Formats the target device and creates an MS-DOS partition table (or GPT
partition table, if the --efi option is passed).
+ --msdos
+ Forces format to use msdos instead of ext4.
+
--reset-mbr
Sets the Master Boot Record (MBR) of the target storage device to the
mbr.bin file from the installation system's syslinux directory. This
@@ -472,7 +475,13 @@ createEXTFSLayout() {
getpartition ${device#/dev/}
TGTDEV=${device}${partnum}
umount $TGTDEV &> /dev/null
- /sbin/mkfs.ext4 -L LIVE $TGTDEV
+
+ # Check extlinux version
+ if extlinux -v 2>&1 | grep -q 'extlinux 3'; then
+ /sbin/mkfs.ext3 -L LIVE $TGTDEV
+ else
+ /sbin/mkfs.ext4 -L LIVE $TGTDEV
+ fi
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
}
@@ -655,6 +664,9 @@ while [ $# -gt 2 ]; do
--format)
format=1
;;
+ --msdos)
+ usemsdos=1
+ ;;
--reset-mbr|--resetmbr)
resetmbr=1
;;
@@ -749,7 +761,6 @@ if [ ! -b "$SRC" -a ! -f "$SRC" ]; then
exit 1
fi
-# FIXME: If --format is given, we shouldn't care and just use /dev/foo1
if [ -z "$TGTDEV" ]; then
echo "Missing target device"
shortusage
@@ -773,15 +784,16 @@ if [ -z "$noverify" ]; then
fi
fi
-#checkFilesystem $TGTDEV
# do some basic sanity checks.
checkMounted $TGTDEV
+
+# Format the device
if [ -n "$format" -a -z "$skipcopy" ]; then
checkLVM $TGTDEV
- # checks for a valid filesystem
+
if [ -n "$efi" ]; then
createGPTLayout $TGTDEV
- elif [ "$TGTFS" == "vfat" -o "$TGTFS" == "msdos" ]; then
+ elif [ -n "$usemsdos" -o ! -x /sbin/extlinux ]; then
createMSDOSLayout $TGTDEV
else
createEXTFSLayout $TGTDEV
12 years
[PATCH 1/3] livecd-iso-to-disk: Create ext3 if extlinux can't boot ext4
by Lubomir Rintel
This makes it possible to successfully use livecd-iso-to-disk with slightly
older syslinux, such as one in Oracle Enterprise Linux 6.
---
tools/livecd-iso-to-disk.sh | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 8cdf86e..8e3b481 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -472,7 +472,7 @@ createEXTFSLayout() {
getpartition ${device#/dev/}
TGTDEV=${device}${partnum}
umount $TGTDEV &> /dev/null
- /sbin/mkfs.ext4 -L LIVE $TGTDEV
+ /sbin/mkfs.$TGTFS -L LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
}
@@ -553,6 +553,13 @@ checkSyslinuxVersion() {
else
SYSLINUXPATH="syslinux"
fi
+ if [ ! -x /sbin/extlinux ]; then
+ TGTFS="vfat"
+ elif extlinux -v 2>&1 | grep -q 'extlinux 3'; then
+ TGTFS="ext3"
+ else
+ TGTFS="ext4"
+ fi
}
checkMounted() {
@@ -773,7 +780,8 @@ if [ -z "$noverify" ]; then
fi
fi
-#checkFilesystem $TGTDEV
+checkSyslinuxVersion
+
# do some basic sanity checks.
checkMounted $TGTDEV
if [ -n "$format" -a -z "$skipcopy" ]; then
@@ -793,7 +801,6 @@ if [ -n "$efi" ]; then
checkGPT $TGTDEV
fi
-checkSyslinuxVersion
# Because we can't set boot flag for EFI Protective on msdos partition tables
[ -z "$efi" ] && checkPartActive $TGTDEV
[ -n "$resetmbr" ] && resetMBR $TGTDEV
--
1.7.1
12 years