6 commits - imgcreate/live.py Makefile tools/livecd-iso-to-disk.sh
by Brian C. Lane
Makefile | 6
imgcreate/live.py | 14 -
tools/livecd-iso-to-disk.sh | 383 +++++++++++++++++++++-----------------------
3 files changed, 203 insertions(+), 200 deletions(-)
New commits:
commit 6250ff24867b99310da630f2ccb75b5b5728f18f
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Nov 15 10:03:10 2010 -0800
Bump version to 0.3.6
diff --git a/Makefile b/Makefile
index 6870e94..ac29b40 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 0.3.5
+VERSION = 0.3.6
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 37951ff9c031672e8f2fb6b6cae21e44209acafc
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Mon Nov 15 10:00:56 2010 -0800
Misc. fixups (#652522)
Move brace position.
Use $() for command substitution
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 5777ff7..caa7bde 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -39,8 +39,7 @@ exitclean() {
exit 1
}
-isdevloop()
-{
+isdevloop() {
[ x"${1#/dev/loop}" != x"$1" ]
}
@@ -65,7 +64,7 @@ getdisk() {
device="/dev/$device"
# FIXME: weird dev names could mess this up I guess
- p=/dev/`basename $p`
+ p=/dev/$(basename $p)
partnum=${p##$device}
}
commit 48db7b80dd05ac1fdfca7fbaf28a52696dec662d
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Mon Nov 15 09:58:46 2010 -0800
Set indentation to 4 spaces (#652522)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index f59ae91..5777ff7 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -48,8 +48,8 @@ getdisk() {
DEV=$1
if isdevloop "$DEV"; then
- device="$DEV"
- return
+ device="$DEV"
+ return
fi
p=$(udevadm info -q path -n $DEV)
@@ -71,36 +71,36 @@ getdisk() {
resetMBR() {
if isdevloop "$DEV"; then
- return
+ 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
+ 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
+ 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 isdevloop "$DEV"; then
- return 0
+ return 0
fi
getdisk $1
@@ -230,9 +230,9 @@ checkGPT() {
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
+ echo "EFI boot requires a GPT partition table."
+ echo "This can be done manually or you can run with --format"
+ exitclean
fi
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "print" |grep ^$partnum:)
@@ -307,12 +307,12 @@ checkSyslinuxVersion() {
checkMounted() {
dev=$1
if grep -q "^$dev " /proc/mounts ; then
- echo "$dev is mounted, please unmount for safety"
- exitclean
+ 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
+ echo "$dev is in use as a swap device, please disable swap"
+ exitclean
fi
}
@@ -501,20 +501,20 @@ fi
# do some basic sanity checks.
checkMounted $USBDEV
if [ -n "$format" -a -z "$skipcopy" ];then
- checkLVM $USBDEV
- # checks for a valid filesystem
- if [ -n "$efi" ];then
- createGPTLayout $USBDEV
- elif [ "$USBFS" == "vfat" -o "$USBFS" == "msdos" ]; then
- createMSDOSLayout $USBDEV
- else
- createEXTFSLayout $USBDEV
- fi
+ checkLVM $USBDEV
+ # checks for a valid filesystem
+ if [ -n "$efi" ];then
+ createGPTLayout $USBDEV
+ elif [ "$USBFS" == "vfat" -o "$USBFS" == "msdos" ]; then
+ createMSDOSLayout $USBDEV
+ else
+ createEXTFSLayout $USBDEV
+ fi
fi
checkFilesystem $USBDEV
if [ -n "$efi" ]; then
- checkGPT $USBDEV
+ checkGPT $USBDEV
fi
checkSyslinuxVersion
@@ -525,24 +525,24 @@ 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
+ 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
+ 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
+ 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
@@ -556,28 +556,28 @@ 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
+ 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
+ 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
+ check=$CDMNT/LiveOS
else
- check=$CDMNT
+ 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))
+ 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
+ tbd=0
fi
livesize=$(du -s -B 1M $check | awk {'print $1;'})
if [ -n "$skipcompress" ]; then
@@ -596,58 +596,58 @@ 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
+ 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
+ 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
+ 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
+ [ -e "$USBMNT/$LIVEOS/$HOMEFILE" -a -n "$keephome" ] && mv $USBMNT/$LIVEOS/$HOMEFILE $USBMNT/$HOMEFILE
+ fi
- rm -rf $USBMNT/$LIVEOS
- fi
+ rm -rf $USBMNT/$LIVEOS
+ fi
fi
# Bootloader is always reconfigured, so keep these out of the if skipcopy stuff.
@@ -656,33 +656,33 @@ fi
# Live image copy
if [ "$isotype" = "live" -a -z "$skipcopy" ]; 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
- copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || (umount $CDMNT ; exitclean)
- umount $CDMNT
- elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
- copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
- elif [ -f $CDMNT/LiveOS/ext3fs.img ]; then
- copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || exitclean
- fi
- if [ -f $CDMNT/LiveOS/osmin.img ]; then
- copyFile $CDMNT/LiveOS/osmin.img $USBMNT/$LIVEOS/osmin.img || exitclean
- fi
- sync
+ 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
+ copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || (umount $CDMNT ; exitclean)
+ umount $CDMNT
+ elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
+ copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
+ elif [ -f $CDMNT/LiveOS/ext3fs.img ]; then
+ copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || exitclean
+ fi
+ if [ -f $CDMNT/LiveOS/osmin.img ]; then
+ copyFile $CDMNT/LiveOS/osmin.img $USBMNT/$LIVEOS/osmin.img || exitclean
+ fi
+ sync
fi
# DVD installer copy
if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) -a -z "$skipcopy" ]; then
- echo "Copying DVD image to USB stick"
- mkdir -p $USBMNT/images/
- copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
- if [ "$isotype" = "installer" ]; then
- cp $ISO $USBMNT/
- fi
- sync
+ echo "Copying DVD image to USB stick"
+ mkdir -p $USBMNT/images/
+ copyFile $CDMNT/images/install.img $USBMNT/images/install.img || exitclean
+ if [ "$isotype" = "installer" ]; then
+ cp $ISO $USBMNT/
+ fi
+ sync
fi
cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
@@ -690,11 +690,11 @@ 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
+ 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
+ # 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"
@@ -708,13 +708,13 @@ if [ "$LIVEOS" != "LiveOS" ]; then sed -i -e "s;liveimg;liveimg live_dir=$LIVEOS
# DVD Installer
if [ "$isotype" = "installer" ]; then
- sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG} repo=hd:$USBLABEL:/;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:$USBLABEL:/;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG $BOOTCONFIG_EFI
fi
# DVD Installer for netinst
if [ "$isotype" = "netinst" ]; then
- sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
+ sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
fi
# Adjust the boot timeouts
@@ -728,21 +728,21 @@ fi
# Use repo if the .iso has the repository on it, otherwise use stage2 which
# will default to using the network mirror
if [ -e "$CDMNT/.discinfo" ]; then
- METHODSTR=repo
+ METHODSTR=repo
else
- METHODSTR=stage2
+ METHODSTR=stage2
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 [ -z "$skipcopy" ]; then
- 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
+ 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
fi
sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG $BOOTCONFIG_EFI
sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG $BOOTCONFIG_EFI
@@ -844,54 +844,54 @@ 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" -o "$USBFS" == "ext4" -o "$USBFS" == "btrfs" ]; 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
- # Starting with syslinux 4 ldlinux.sys is used on all file systems.
- if [ -f "$USBMNT/$SYSLINUXPATH/extlinux.sys" ]; then
- chattr -i $USBMNT/$SYSLINUXPATH/extlinux.sys
- elif [ -f "$USBMNT/$SYSLINUXPATH/ldlinux.sys" ]; then
- chattr -i $USBMNT/$SYSLINUXPATH/ldlinux.sys
+ 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" -o "$USBFS" == "ext4" -o "$USBFS" == "btrfs" ]; 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
+ # Starting with syslinux 4 ldlinux.sys is used on all file systems.
+ if [ -f "$USBMNT/$SYSLINUXPATH/extlinux.sys" ]; then
+ chattr -i $USBMNT/$SYSLINUXPATH/extlinux.sys
+ elif [ -f "$USBMNT/$SYSLINUXPATH/ldlinux.sys" ]; then
+ chattr -i $USBMNT/$SYSLINUXPATH/ldlinux.sys
+ fi
+ cleanup
fi
- 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
+ # 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
echo "USB stick set up as live image!"
commit 454bbe84173d1eefa483af546dacee8293e7c9b8
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Nov 15 09:44:45 2010 -0800
Add a release target
Tag the release and scp it over to fedorahosted.org
diff --git a/Makefile b/Makefile
index 814e239..6870e94 100644
--- a/Makefile
+++ b/Makefile
@@ -47,5 +47,9 @@ uninstall:
dist : all
git archive --format=tar --prefix=livecd-tools-$(VERSION)/ HEAD | bzip2 -9v > livecd-tools-$(VERSION).tar.bz2
+release: dist
+ git tag -s -a -m "Tag as livecd-tools-$(VERSION)" livecd-tools-$(VERSION)
+ scp livecd-tools-$(VERSION).tar.bz2 fedorahosted.org:livecd
+
clean:
rm -f *~ creator/*~ installer/*~ config/*~ docs/*.8
commit c832a6db4a1f916ca2816496f65a790c3f1ab6bb
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Fri Nov 12 13:53:08 2010 -0800
Pass dracut args during check (#589778)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index fe4a256..5e47159 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -530,7 +530,7 @@ menu hiddenrow 5
cfg += self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
- liveargs = kernel_options,
+ liveargs = kern_opts,
long = "Verify and " + long,
short = "rd.live.check" + index,
basicvideo = "",
commit 25528a9b956fd18226119335e88a0d727f23648b
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Fri Nov 12 11:29:05 2010 -0800
Update dracut args (#652484)
http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=commit...
diff --git a/imgcreate/live.py b/imgcreate/live.py
index fcb7198..fe4a256 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -497,7 +497,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 rd_NO_DM"
+ kern_opts = kernel_options + " rd.luks=0 rd.md=0 rd.dm=0"
else:
kern_opts = kernel_options
@@ -532,10 +532,10 @@ menu hiddenrow 5
isofstype = "auto",
liveargs = kernel_options,
long = "Verify and " + long,
- short = "check" + index,
+ short = "rd.live.check" + index,
basicvideo = "",
xdriver = "",
- extra = "check",
+ extra = "rd.live.check",
index = index)
index = str(int(index) + 1)
@@ -638,7 +638,7 @@ hiddenmenu
isofstype = "auto",
liveargs = kernel_options,
long = "Verify and Boot " + name,
- extra = "check",
+ extra = "rd.live.check",
index = index)
break
@@ -777,9 +777,9 @@ image=/ppc/ppc%(bit)s/vmlinuz
if self._has_checkisomd5():
cfg += self.__get_image_stanza(fslabel = self.fslabel,
isofstype = "auto",
- short = "check",
+ short = "rd.live.check",
long = "Verify and run from image",
- extra = "check",
+ extra = "rd.live.check",
bit = bit,
liveargs = kernel_options,
isDracut = isDracut)
13 years, 5 months
Changes to 'refs/tags/livecd-tools-0.3.5'
by Brian C. Lane
Changes since livecd-tools-034:
Alan Pevec (1):
edit-livecd: add new attribute compress_type
Brian C. Lane (1):
Changing version to NVR
Bruno Wolff III (11):
Revise basic video change to fix issue with default menu item
Missing parts of regex fix patch
Fix label for basic video boot menu item
Still needed to fix one /dev/loop* .
Fix bad path brought in using old patch. Thanks Spot!
Note that lzo can be used as a compressor.
setfiles parameter list fix for relabelling.
Starting with syslinux 4 ldlinux.sys is used on all file systems.
Allow image to be put on a btrfs file system on a live usb.
Provide for support for $releasever in repo commands.
Add documentation for repo command extensions.
---
Makefile | 2 +-
docs/livecd-creator.pod | 11 ++++++++++-
imgcreate/kickstart.py | 2 +-
imgcreate/live.py | 31 +++++++++++++++----------------
imgcreate/yuminst.py | 1 +
tools/edit-livecd | 3 +++
tools/livecd-creator | 2 +-
tools/livecd-iso-to-disk.sh | 27 +++++++++++++++++++--------
8 files changed, 51 insertions(+), 28 deletions(-)
---
13 years, 5 months
Detecting changes
by Brian C. Lane
I'd like to try and keep the source tree the same across fedora
releases, without having to manage patches on each release.
The new version of dracut in rawhide changed the names of the
parameters. Anyone have any good ideas as to how to handle this? The
changes are buried in livecd.py
If anything I'm more inclined to make a patch for the older releases
that reverts the parameter change.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
13 years, 5 months
2 commits - tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 338 ++++++++++++++++++++++----------------------
1 file changed, 169 insertions(+), 169 deletions(-)
New commits:
commit 88329bc5dd9ca75ff03204637400867a95898bb7
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Fri Nov 12 11:03:12 2010 -0800
Cleanup tabs (#652522)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 204ed9a..f59ae91 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -54,13 +54,13 @@ getdisk() {
p=$(udevadm info -q path -n $DEV)
if [ -e /sys/$p/device ]; then
- device=$(basename /sys/$p)
+ device=$(basename /sys/$p)
else
- device=$(basename $(readlink -f /sys/$p/../))
+ 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
+ echo "Error finding block device of $DEV. Aborting!"
+ exitclean
fi
device="/dev/$device"
@@ -110,11 +110,11 @@ checkMBR() {
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
+ 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
@@ -127,19 +127,19 @@ checkPartActive() {
# 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
+ return
fi
if isdevloop "$DEV"; 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 "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
+ echo " (parted) toggle N boot"
+ echo " (parted) quit"
+ exitclean
fi
}
@@ -147,10 +147,10 @@ checkLVM() {
dev=$1
if [ -x /sbin/pvs -a \
- "$(/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
+ "$(/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
fi
return 0
}
@@ -239,17 +239,17 @@ checkGPT() {
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
+ 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 "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
+ echo " (parted) toggle N boot"
+ echo " (parted) quit"
+ exitclean
fi
}
@@ -259,48 +259,48 @@ checkFilesystem() {
USBFS=$(/sbin/blkid -s TYPE -o value $dev)
if [ "$USBFS" != "vfat" ] && [ "$USBFS" != "msdos" ]; then
if [ "$USBFS" != "ext2" ] && [ "$USBFS" != "ext3" ] && [ "$USBFS" != "ext4" ] && [ "$USBFS" != "btrfs" ]; then
- echo "USB filesystem must be vfat, ext[234] or btrfs"
- exitclean
+ echo "USB filesystem must be vfat, ext[234] or btrfs"
+ exitclean
fi
fi
USBLABEL=$(/sbin/blkid -s UUID -o value $dev)
if [ -n "$USBLABEL" ]; then
- USBLABEL="UUID=$USBLABEL" ;
+ 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" -o "$USBFS" = "ext4" ]; then
- echo "Label can be set with /sbin/e2label"
- elif [ "$USBFS" = "btrfs" ]; then
+ 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" -o "$USBFS" = "ext4" ]; then
+ echo "Label can be set with /sbin/e2label"
+ elif [ "$USBFS" = "btrfs" ]; then
echo "Eventually you'll be able to use /sbin/btrfs filesystem label to add a label."
- fi
- exitclean
- fi
+ fi
+ exitclean
+ fi
fi
if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
- mountopts="-o shortname=winnt,umask=0077"
+ 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
+ echo "You need to have syslinux installed to run this script"
+ exit 1
fi
if ! syslinux 2>&1 | grep -qe -d; then
- SYSLINUXPATH=""
+ SYSLINUXPATH=""
elif [ -n "$multi" ]; then
- SYSLINUXPATH="$LIVEOS/syslinux"
+ SYSLINUXPATH="$LIVEOS/syslinux"
else
- SYSLINUXPATH="syslinux"
+ SYSLINUXPATH="syslinux"
fi
}
@@ -318,7 +318,7 @@ checkMounted() {
checkint() {
if ! test $1 -gt 0 2>/dev/null ; then
- usage
+ usage
fi
}
@@ -339,40 +339,40 @@ detectisotype() {
else
isotype=netinst
return
- fi
+ fi
fi
echo "ERROR: $ISO does not appear to be a Live image or DVD installer."
exitclean
}
cp_p() {
- 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
+ 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
}
copyFile() {
- if [ -x /usr/bin/gvfs-copy ]; then
- gvfs-copy -p "$1" "$2"
- return
- fi
- if [ -x /usr/bin/strace -a -x /bin/awk ]; then
- cp_p "$1" "$2"
- return
- fi
- cp "$1" "$2"
+ if [ -x /usr/bin/gvfs-copy ]; then
+ gvfs-copy -p "$1" "$2"
+ return
+ fi
+ if [ -x /usr/bin/strace -a -x /bin/awk ]; then
+ cp_p "$1" "$2"
+ return
+ fi
+ cp "$1" "$2"
}
cryptedhome=1
@@ -386,58 +386,58 @@ LIVEOS=LiveOS
HOMEFILE="home.img"
while [ $# -gt 2 ]; do
case $1 in
- --overlay-size-mb)
- checkint $2
- overlaysizemb=$2
- shift
- ;;
- --home-size-mb)
- checkint $2
+ --overlay-size-mb)
+ checkint $2
+ overlaysizemb=$2
+ shift
+ ;;
+ --home-size-mb)
+ checkint $2
homesizemb=$2
shift
- ;;
- --swap-size-mb)
- checkint $2
- swapsizemb=$2
- shift
- ;;
+ ;;
+ --swap-size-mb)
+ checkint $2
+ swapsizemb=$2
+ shift
+ ;;
--crypted-home)
cryptedhome=1
- ;;
+ ;;
--unencrypted-home)
cryptedhome=""
;;
--delete-home)
keephome=""
;;
- --noverify)
- noverify=1
- ;;
- --reset-mbr|--resetmbr)
- resetmbr=1
- ;;
- --efi|--mactel)
- efi=1
- ;;
- --format)
- format=1
- ;;
- --skipcopy)
- skipcopy=1
- ;;
- --xo)
- xo=1
- skipcompress=1
- ;;
- --xo-no-home)
- xonohome=1
- ;;
- --compress)
- skipcompress=""
- ;;
- --skipcompress)
- skipcompress=1
- ;;
+ --noverify)
+ noverify=1
+ ;;
+ --reset-mbr|--resetmbr)
+ resetmbr=1
+ ;;
+ --efi|--mactel)
+ efi=1
+ ;;
+ --format)
+ format=1
+ ;;
+ --skipcopy)
+ skipcopy=1
+ ;;
+ --xo)
+ xo=1
+ skipcompress=1
+ ;;
+ --xo-no-home)
+ xonohome=1
+ ;;
+ --compress)
+ skipcompress=""
+ ;;
+ --skipcompress)
+ skipcompress=1
+ ;;
--extra-kernel-args)
kernelargs=$2
shift
@@ -445,13 +445,13 @@ while [ $# -gt 2 ]; do
--force)
force=1
;;
- --livedir)
- LIVEOS=$2
- shift
- ;;
- --multi)
- multi=1
- ;;
+ --livedir)
+ LIVEOS=$2
+ shift
+ ;;
+ --multi)
+ multi=1
+ ;;
--timeout)
checkint $2
timeout=$2
@@ -462,10 +462,10 @@ while [ $# -gt 2 ]; do
totaltimeout=$2
shift
;;
- *)
- echo "invalid arg -- $1"
- usage
- ;;
+ *)
+ echo "invalid arg -- $1"
+ usage
+ ;;
esac
shift
done
@@ -491,9 +491,9 @@ if [ -z "$noverify" ]; then
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
+ echo "Are you SURE you want to continue?"
+ echo "Press Enter to continue or ctrl-c to abort"
+ read
fi
fi
@@ -582,15 +582,15 @@ 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
+ 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;'})
@@ -700,7 +700,7 @@ fi
echo "Updating boot config file"
# adjust label and fstype
if [ -n "$LANG" ]; then
- kernelargs="$kernelargs LANG=$LANG"
+ kernelargs="$kernelargs LANG=$LANG"
fi
sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" -e "s/LABEL=[^ ]*/$USBLABEL/" $BOOTCONFIG $BOOTCONFIG_EFI
if [ -n "$kernelargs" ]; then sed -i -e "s/liveimg/liveimg ${kernelargs}/" $BOOTCONFIG $BOOTCONFIG_EFI ; fi
@@ -741,7 +741,7 @@ if [ "$overlaysizemb" -gt 0 ]; 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
+ dd if=/dev/null of=$USBMNT/$LIVEOS/$OVERFILE count=1 bs=1M seek=$overlaysizemb
fi
fi
sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG $BOOTCONFIG_EFI
@@ -759,35 +759,35 @@ if [ "$homesizemb" -gt 0 -a -z "$skipcopy" ]; then
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
+ # 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
+ 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
+ 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
+ setupworked=$?
+ done
+ setupworked=1
+ until [ ${setupworked} == 0 ]; do
echo "Please enter the password again to unlock the device"
cryptsetup luksOpen $loop EncHomeFoo
- setupworked=$?
- done
+ setupworked=$?
+ done
mke2fs -j /dev/mapper/EncHomeFoo
- tune2fs -c0 -i0 -ouser_xattr,acl /dev/mapper/EncHomeFoo
- sleep 2
+ 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
+ mke2fs -F -j $USBMNT/$LIVEOS/$HOMEFILE
+ tune2fs -c0 -i0 -ouser_xattr,acl $USBMNT/$LIVEOS/$HOMEFILE
fi
fi
@@ -798,7 +798,7 @@ if [ -n "$xo" ]; then
echo "Setting up /boot/olpc.fth file"
args=$(grep "^ *append" $USBMNT/$SYSLINUXPATH/isolinux.cfg |head -n1 |sed -e 's/.*initrd=[^ ]*//')
if [ -z "$xonohome" -a ! -f $USBMNT/$LIVEOS/$HOMEFILE ]; then
- args="$args persistenthome=mtd0"
+ args="$args persistenthome=mtd0"
fi
args="$args reset_overlay"
xosyspath=$(echo $SYSLINUXPATH | sed -e 's;/;\\;')
commit 5e3d20373109063f55eff7c7ffc453fa147456bb
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Fri Nov 12 09:50:59 2010 -0800
Cleanup EOL spaces (#652522)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 8d40f69..204ed9a 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -106,7 +106,7 @@ checkMBR() {
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
@@ -123,8 +123,8 @@ checkMBR() {
checkPartActive() {
dev=$1
getdisk $dev
-
- # if we're installing to whole-disk and not a partition, then we
+
+ # 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
@@ -263,15 +263,15 @@ checkFilesystem() {
exitclean
fi
fi
-
+
USBLABEL=$(/sbin/blkid -s UUID -o value $dev)
- if [ -n "$USBLABEL" ]; then
- USBLABEL="UUID=$USBLABEL" ;
+ if [ -n "$USBLABEL" ]; then
+ USBLABEL="UUID=$USBLABEL" ;
else
USBLABEL=$(/sbin/blkid -s LABEL -o value $dev)
- if [ -n "$USBLABEL" ]; then
- USBLABEL="LABEL=$USBLABEL"
+ 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
@@ -279,7 +279,7 @@ checkFilesystem() {
elif [ "$USBFS" = "ext2" -o "$USBFS" = "ext3" -o "$USBFS" = "ext4" ]; then
echo "Label can be set with /sbin/e2label"
elif [ "$USBFS" = "btrfs" ]; then
- echo "Eventually you'll be able to use /sbin/btrfs filesystem label to add a label."
+ echo "Eventually you'll be able to use /sbin/btrfs filesystem label to add a label."
fi
exitclean
fi
@@ -498,7 +498,7 @@ if [ -z "$noverify" ]; then
fi
#checkFilesystem $USBDEV
-# do some basic sanity checks.
+# do some basic sanity checks.
checkMounted $USBDEV
if [ -n "$format" -a -z "$skipcopy" ];then
checkLVM $USBDEV
@@ -612,7 +612,7 @@ if [ $tba -gt $(($free + $tbd)) ]; then
fi
fi
-# Verify available space for DVD installer
+# 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;'})
@@ -634,7 +634,7 @@ fi
if [ -z "$skipcopy" ] && [ "$isotype" = "live" ]; then
if [ -d $USBMNT/$LIVEOS -a -z "$force" ]; then
- echo "Already set up as live image."
+ 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"
13 years, 5 months
tools/livecd-iso-to-disk.sh
by Bruno Wolff III
tools/livecd-iso-to-disk.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit e16358cabadefde0b476d944ecb9a2f8dca89b79
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Fri Nov 12 12:05:19 2010 -0600
Typo. Need space before ].
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 2303209..8d40f69 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -258,7 +258,7 @@ checkFilesystem() {
USBFS=$(/sbin/blkid -s TYPE -o value $dev)
if [ "$USBFS" != "vfat" ] && [ "$USBFS" != "msdos" ]; then
- if [ "$USBFS" != "ext2" ] && [ "$USBFS" != "ext3" ] && [ "$USBFS" != "ext4" ] && [ "$USBFS" != "btrfs"]; then
+ if [ "$USBFS" != "ext2" ] && [ "$USBFS" != "ext3" ] && [ "$USBFS" != "ext4" ] && [ "$USBFS" != "btrfs" ]; then
echo "USB filesystem must be vfat, ext[234] or btrfs"
exitclean
fi
13 years, 5 months
[PATCH] Remove Verify and Boot (#571578)
by Brian C. Lane
The check kernel argument doesn't actually do anything. Anaconda doesn't
check it, nor does the livecd.
---
imgcreate/live.py | 19 -------------------
1 files changed, 0 insertions(+), 19 deletions(-)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index fcb7198..1ca6471 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -526,18 +526,6 @@ menu hiddenrow 5
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,
- basicvideo = "",
- xdriver = "",
- extra = "check",
- index = index)
-
index = str(int(index) + 1)
return cfg
@@ -633,13 +621,6 @@ hiddenmenu
liveargs = kernel_options,
long = name,
extra = "", index = index)
- if checkisomd5:
- cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
- isofstype = "auto",
- liveargs = kernel_options,
- long = "Verify and Boot " + name,
- extra = "check",
- index = index)
break
return cfg
--
1.7.3.2
13 years, 5 months
docs/livecd-iso-to-disk.pod tools/livecd-iso-to-disk.sh
by Brian C. Lane
docs/livecd-iso-to-disk.pod | 8 ++++++++
tools/livecd-iso-to-disk.sh | 22 ++++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
New commits:
commit 0df0c8c27d9aa44c313aea24a240e22ff5db571d
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Nov 9 16:39:57 2010 -0800
Add support for timeout and totaltimeout to livecd-iso-to-disk (#531566)
Allow editing of the bootloader config file's timeout and totaltimeout
settings.
diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
index bbb54f2..1ccab66 100644
--- a/docs/livecd-iso-to-disk.pod
+++ b/docs/livecd-iso-to-disk.pod
@@ -52,6 +52,14 @@ The intended use of this option is to speed up testing of the boot configuration
Create a GPT partition table when --format is passed, and install an hybrid EFI/MBR bootloader on the disk. This is necessary for most Intel Macs.
+=item --timeout
+
+Modify the bootloader's timeout value. This overrides the value set during iso creation. Units are 1/10s
+
+=item --totaltimeout
+
+Add a totaltimeout to the bootloader config. This is used to force and automatic boot. This cannot be canceled by the user. Units are 1/10s
+
=back
=head1 CONTRIBUTORS
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 72211d2..2303209 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -23,7 +23,7 @@
export PATH=/sbin:/usr/sbin:$PATH
usage() {
- echo "$0 [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb <size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick device>"
+ echo "$0 [--timeout <time>] [--totaltimeout <time>] [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb <size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick device>"
exit 1
}
@@ -452,6 +452,16 @@ while [ $# -gt 2 ]; do
--multi)
multi=1
;;
+ --timeout)
+ checkint $2
+ timeout=$2
+ shift
+ ;;
+ --totaltimeout)
+ checkint $2
+ totaltimeout=$2
+ shift
+ ;;
*)
echo "invalid arg -- $1"
usage
@@ -487,7 +497,7 @@ if [ -z "$noverify" ]; then
fi
fi
-checkFilesystem $USBDEV
+#checkFilesystem $USBDEV
# do some basic sanity checks.
checkMounted $USBDEV
if [ -n "$format" -a -z "$skipcopy" ];then
@@ -707,6 +717,14 @@ if [ "$isotype" = "netinst" ]; then
sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
fi
+# Adjust the boot timeouts
+if [ -n "$timeout" ]; then
+ sed -i -e "s/^timeout.*$/timeout\ $timeout/" $BOOTCONFIG
+fi
+if [ -n "$totaltimeout" ]; then
+ sed -i -e "/^timeout.*$/a\totaltimeout\ $totaltimeout" $BOOTCONFIG
+fi
+
# Use repo if the .iso has the repository on it, otherwise use stage2 which
# will default to using the network mirror
if [ -e "$CDMNT/.discinfo" ]; then
13 years, 5 months
[PATCH] Add support for timeout and totaltimeout to livecd-iso-to-disk (#531566)
by Brian C. Lane
Allow editing of the bootloader config file's timeout and totaltimeout
settings.
---
tools/livecd-iso-to-disk.sh | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 72211d2..2303209 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -23,7 +23,7 @@
export PATH=/sbin:/usr/sbin:$PATH
usage() {
- echo "$0 [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb <size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick device>"
+ echo "$0 [--timeout <time>] [--totaltimeout <time>] [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb <size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick device>"
exit 1
}
@@ -452,6 +452,16 @@ while [ $# -gt 2 ]; do
--multi)
multi=1
;;
+ --timeout)
+ checkint $2
+ timeout=$2
+ shift
+ ;;
+ --totaltimeout)
+ checkint $2
+ totaltimeout=$2
+ shift
+ ;;
*)
echo "invalid arg -- $1"
usage
@@ -487,7 +497,7 @@ if [ -z "$noverify" ]; then
fi
fi
-checkFilesystem $USBDEV
+#checkFilesystem $USBDEV
# do some basic sanity checks.
checkMounted $USBDEV
if [ -n "$format" -a -z "$skipcopy" ];then
@@ -707,6 +717,14 @@ if [ "$isotype" = "netinst" ]; then
sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
fi
+# Adjust the boot timeouts
+if [ -n "$timeout" ]; then
+ sed -i -e "s/^timeout.*$/timeout\ $timeout/" $BOOTCONFIG
+fi
+if [ -n "$totaltimeout" ]; then
+ sed -i -e "/^timeout.*$/a\totaltimeout\ $totaltimeout" $BOOTCONFIG
+fi
+
# Use repo if the .iso has the repository on it, otherwise use stage2 which
# will default to using the network mirror
if [ -e "$CDMNT/.discinfo" ]; then
--
1.7.3.2
13 years, 5 months
bz#624028 livecd-creator creates iso that doesn't boot
by Brian C. Lane
I was going to post this on the bug, but I think the list is a better
place for this discussion. And I think it probably relates to a couple
of other bugs.
https://bugzilla.redhat.com/show_bug.cgi?id=624028
I am not sure that these problems are actually livecd-creator problems.
I think they are related to:
1) The mix of packages being selected for your install, and the
repositories providing them
2) The fact that install media is 'frozen', as is anaconda, after an
extensive testing cycle and that packages involved have moved forward,
but are now only tested against running systems, not recreating boot
media.
Because of #2 using the updates and testing-updates repositories can
result in building systems that won't boot.
I think that as a a baseline, things ought to work correctly if only the
base repo is used in the creation. If other packages need to be added
(and that is kinda the point, isn't it?) then making a local repo with
just those hand-selected packages makes sense to me.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
13 years, 5 months
imgcreate/creator.py imgcreate/kickstart.py
by Brian C. Lane
imgcreate/creator.py | 6 ++++--
imgcreate/kickstart.py | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 0ac87803f3ff5cbdf0ba08d9975f2b3006b9e310
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Nov 3 16:06:07 2010 -0700
Add proxy support to livecd-creator (#649546)
This changes the previous return value for kickstart.get_repos to add
the proxy info.
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 20be148..1f1e5b8 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -638,13 +638,15 @@ class ImageCreator(object):
ayum.setup(yum_conf, self._instroot)
for repo in kickstart.get_repos(self.ks, repo_urls):
- (name, baseurl, mirrorlist, inc, exc) = repo
-
+ (name, baseurl, mirrorlist, proxy, inc, exc) = repo
+
yr = ayum.addRepository(name, baseurl, mirrorlist)
if inc:
yr.includepkgs = inc
if exc:
yr.exclude = exc
+ if proxy:
+ yr.proxy = proxy
if kickstart.exclude_docs(self.ks):
rpm.addMacro("_excludedocs", "1")
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 9a2145a..33859d6 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -502,14 +502,15 @@ def get_repos(ks, repo_urls = {}):
baseurl = repo.baseurl
mirrorlist = repo.mirrorlist
-
+ proxy = repo.proxy
+
if repo.name in repo_urls:
baseurl = repo_urls[repo.name]
mirrorlist = None
if repos.has_key(repo.name):
logging.warn("Overriding already specified repo %s" %(repo.name,))
- repos[repo.name] = (repo.name, baseurl, mirrorlist, inc, exc)
+ repos[repo.name] = (repo.name, baseurl, mirrorlist, proxy, inc, exc)
return repos.values()
13 years, 5 months