tools/livecd-iso-to-disk.sh
by Bruno Wolff III
tools/livecd-iso-to-disk.sh | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 2ddb25964e181b033022c77bdd90f00cf2e9a3f7
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Sat Sep 11 20:45:16 2010 -0500
Allow use of stage2 for repos to help with netinst ISOs.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 872ebee..1347aa5 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -701,6 +701,13 @@ if [ "$isotype" = "netinst" ]; then
sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG $BOOTCONFIG_EFI
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
+else
+ METHODSTR=stage2
+fi
if [ "$overlaysizemb" -gt 0 ]; then
echo "Initializing persistent overlay file"
13 years, 7 months
tools/livecd-iso-to-disk.sh
by Bruno Wolff III
tools/livecd-iso-to-disk.sh | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
New commits:
commit 407d7dfc2d1680eb9a6d35c3632665e810286a32
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Sat Sep 11 20:36:29 2010 -0500
Fix issue with using netinst ISOs.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 03efc7e..872ebee 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -327,8 +327,13 @@ detectisotype() {
return
fi
if [ -e $CDMNT/images/install.img ]; then
- isotype=installer
- return
+ if [ -e $CDMNT/Packages ]; then
+ isotype=installer
+ return
+ else
+ isotype=netinst
+ return
+ fi
fi
echo "ERROR: $ISO does not appear to be a Live image or DVD installer."
exitclean
@@ -650,14 +655,18 @@ if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
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" ] && [ -z "$skipcopy" ]; then
+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
- copyFile $ISO $USBMNT/
+ if [ "$isotype" = "installer" ]; then
+ cp $ISO $USBMNT/
+ fi
+ sync
fi
cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
@@ -687,6 +696,12 @@ if [ "$isotype" = "installer" ]; then
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
+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 )"
13 years, 7 months
tools/livecd-iso-to-disk.sh
by Bruno Wolff III
tools/livecd-iso-to-disk.sh | 44 +++++++++++++++++++++++++++++++++++++-------
1 file changed, 37 insertions(+), 7 deletions(-)
New commits:
commit 35a1a5675216ea0528509b0401719ddf4108a945
Author: Jasper Hartline <jasper.hartline(a)gmail.com>
Date: Sat Sep 11 20:07:29 2010 -0500
Add support for ext4 now that syslinux supports it.
Signed-off-by: Bruno Wolff III <bruno(a)wolff.to>
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 1519594..03efc7e 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -199,6 +199,28 @@ createMSDOSLayout() {
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
}
+createEXTFSLayout() {
+ dev=$1
+ getdisk $dev
+
+ echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
+ echo "Press Enter to continue or ctrl-c to abort"
+ read
+ umount ${device}? &> /dev/null
+ /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$//')
+ /sbin/parted --script $device unit b mkpart primary ext2 17408 $(($size - 17408)) set 1 boot on
+ USBDEV=${device}1
+ # Sometimes automount can be _really_ annoying.
+ echo "Waiting for devices to settle..."
+ /sbin/udevadm settle
+ sleep 5
+ umount $USBDEV &> /dev/null
+ /sbin/mkfs.ext4 -L LIVE $USBDEV
+ USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
+}
+
checkGPT() {
dev=$1
getdisk $dev
@@ -231,10 +253,13 @@ checkFilesystem() {
dev=$1
USBFS=$(/sbin/blkid -s TYPE -o value $dev)
- if [ "$USBFS" != "vfat" -a "$USBFS" != "msdos" -a "$USBFS" != "ext2" -a "$USBFS" != "ext3" ]; then
- echo "USB filesystem must be vfat or ext[23]"
- exitclean
+ if [ "$USBFS" != "vfat" ] && [ "$USBFS" != "msdos" ]; then
+ if [ "$USBFS" != "ext2" ] && [ "$USBFS" != "ext3" ] && [ "$USBFS" != "ext4" ]; then
+ echo "USB filesystem must be vfat or ext[234]"
+ exitclean
+ fi
fi
+
USBLABEL=$(/sbin/blkid -s UUID -o value $dev)
if [ -n "$USBLABEL" ]; then
@@ -247,7 +272,7 @@ checkFilesystem() {
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
+ elif [ "$USBFS" = "ext2" -o "$USBFS" = "ext3" -o "$USBFS" = "ext4" ]; then
echo "Label can be set with /sbin/e2label"
fi
exitclean
@@ -451,6 +476,7 @@ if [ -z "$noverify" ]; then
fi
fi
+checkFilesystem $USBDEV
# do some basic sanity checks.
checkMounted $USBDEV
if [ -n "$format" -a -z "$skipcopy" ];then
@@ -458,14 +484,18 @@ if [ -n "$format" -a -z "$skipcopy" ];then
# checks for a valid filesystem
if [ -n "$efi" ];then
createGPTLayout $USBDEV
- else
+ elif [ "$USBFS" == "vfat" -o "$USBFS" == "msdos" ]; then
createMSDOSLayout $USBDEV
+ else
+ createEXTFSLayout $USBDEV
fi
fi
+
checkFilesystem $USBDEV
if [ -n "$efi" ]; then
checkGPT $USBDEV
fi
+
checkSyslinuxVersion
# Because we can't set boot flag for EFI Protective on msdos partition tables
[ -z "$efi" ] && checkPartActive $USBDEV
@@ -785,7 +815,7 @@ if [ -z "$multi" ]; then
cp /usr/lib/syslinux/menu.c32 $USBMNT/$SYSLINUXPATH/menu.c32
fi
- if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
+ 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
@@ -797,7 +827,7 @@ if [ -z "$multi" ]; then
else
syslinux $USBDEV
fi
- elif [ "$USBFS" = "ext2" -o "$USBFS" = "ext3" ]; then
+ elif [ "$USBFS" == "ext2" -o "$USBFS" == "ext3" -o "$USBFS" == "ext4" ]; 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
13 years, 7 months
tools/livecd-iso-to-disk.sh
by Bruno Wolff III
tools/livecd-iso-to-disk.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit c4a13f4a8ab0f5f593b12e57d4f91b1976e17be8
Author: Marc Herbert <Marc.Herbert(a)gmail.com>
Date: Sat Sep 11 19:57:57 2010 -0500
Fix for enumerating loop devices using bash 4.1.7.
Signed-off-by: Bruno Wolff III <bruno(a)wolff.to>
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index fdfb5e3..1519594 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -39,10 +39,15 @@ exitclean() {
exit 1
}
+isdevloop()
+{
+ [ x"${1#/dev/loop}" != x"$1" ]
+}
+
getdisk() {
DEV=$1
- if [[ "$DEV" =~ "/dev/loop*" ]]; then
+ if isdevloop "$DEV"; then
device="$DEV"
return
fi
13 years, 7 months
docs/livecd-iso-to-disk.pod tools/livecd-iso-to-disk.sh
by Bruno Wolff III
docs/livecd-iso-to-disk.pod | 4 +++-
tools/livecd-iso-to-disk.sh | 18 ++++++++++--------
2 files changed, 13 insertions(+), 9 deletions(-)
New commits:
commit 5ec830d5a4977a6391ab5795e9f820b8fdccd079
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Sat Sep 11 16:53:10 2010 -0500
Change --skipcopy to not overwrite other large areas.
This will allow faster boot configuration testing when there are
home dorectory, overlay or swap areas on the device.
diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
index c673eef..bbb54f2 100644
--- a/docs/livecd-iso-to-disk.pod
+++ b/docs/livecd-iso-to-disk.pod
@@ -44,7 +44,9 @@ Disables the encryption of the home directory.
=item --skipcopy
-Skips the copy of the live image to the USB stick.
+Skips the copy of the live image to the USB stick and disables the --forma, --home-size-mb, and --swap-size-mb options. The --overlay-size-mb option is changed to only reinitialize the existing overlay area, to recreate it from scratch.
+
+The intended use of this option is to speed up testing of the boot configuration of live images.
=item --efi
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 007348a..fdfb5e3 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -448,7 +448,7 @@ fi
# do some basic sanity checks.
checkMounted $USBDEV
-if [ -n "$format" ];then
+if [ -n "$format" -a -z "$skipcopy" ];then
checkLVM $USBDEV
# checks for a valid filesystem
if [ -n "$efi" ];then
@@ -599,7 +599,7 @@ fi
[ -n "$efi" -a ! -d $USBMNT/EFI/boot ] && mkdir -p $USBMNT/EFI/boot
# Live image copy
-if [ -z "$skipcopy" ] && [ "$isotype" = "live" ]; then
+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
@@ -655,23 +655,25 @@ fi
if [ "$overlaysizemb" -gt 0 ]; then
echo "Initializing persistent overlay file"
OVERFILE="overlay-$( /sbin/blkid -s LABEL -o value $USBDEV )-$( /sbin/blkid -s UUID -o value $USBDEV )"
- if [ "$USBFS" = "vfat" ]; then
- # vfat can't handle sparse files
- dd if=/dev/zero of=$USBMNT/$LIVEOS/$OVERFILE count=$overlaysizemb bs=1M
- else
+ 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
fi
sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG $BOOTCONFIG_EFI
sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG $BOOTCONFIG_EFI
fi
-if [ "$swapsizemb" -gt 0 ]; then
+if [ "$swapsizemb" -gt 0 -a -z "$skipcopy" ]; then
echo "Initializing swap file"
dd if=/dev/zero of=$USBMNT/$LIVEOS/swap.img count=$swapsizemb bs=1M
mkswap -f $USBMNT/$LIVEOS/swap.img
fi
-if [ "$homesizemb" -gt 0 ]; then
+if [ "$homesizemb" -gt 0 -a -z "$skipcopy" ]; then
echo "Initializing persistent /home"
homesource=/dev/zero
[ -n "$cryptedhome" ] && homesource=/dev/urandom
13 years, 7 months
imgcreate/live.py
by Bruno Wolff III
imgcreate/live.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
New commits:
commit 2216a1aba6b3122f8e3cddfad51cdf3348c2470c
Author: Jasper O'neal Hartline <Jasper.Hartline(a)Gmail.com>
Date: Sat Sep 11 13:55:05 2010 -0500
Add basic video driver option to syslinux/isolinux configuration.
Signed-off-by: Bruno Wolff III <bruno(a)wolff.to>
diff --git a/imgcreate/live.py b/imgcreate/live.py
index f349a1f..1e0f117 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -453,12 +453,24 @@ menu hiddenrow 5
menu label %(long)s
kernel vmlinuz%(index)s
append initrd=initrd%(index)s.img root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s
+
+
+ label %(short)s
+ menu label %(long)s %(basicvideo)s
+ kernel vmlinuz%(index)s
+ append initrd=initrd%(index)s.img root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(xdriver)s %(extra)s
"""
else:
template = """label %(short)s
menu label %(long)s
kernel mboot.c32
append xen%(index)s.gz --- vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s --- initrd%(index)s.img
+
+
+ label %(short)s
+ menu label %(long)s %(basicvideo)s
+ kernel mboot.c32
+ append xen%(index)s.gz --- vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(xdriver)s %(extra)s --- initrd%(index)s.img
"""
return template % args
@@ -490,6 +502,10 @@ menu hiddenrow 5
else:
long = "Boot %s(%s)" % (self.name, kernel)
+ # Basic video driver
+ basic = "system with basic video driver"
+ xdriver = "xdriver=vesa"
+
# tell dracut not to ask for LUKS passwords or activate mdraid sets
if isDracut:
@@ -503,6 +519,8 @@ menu hiddenrow 5
liveargs = kern_opts,
long = long,
short = "linux" + index,
+ basicvideo = basic,
+ xdriver = xdriver,
extra = "",
index = index)
@@ -516,6 +534,8 @@ menu hiddenrow 5
liveargs = kernel_options,
long = "Verify and " + long,
short = "check" + index,
+ basicvideo = "",
+ xdriver = "",
extra = "check",
index = index)
13 years, 7 months
imgcreate/fs.py
by Bruno Wolff III
imgcreate/fs.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit a5c394bb526de9090bb82c2703e29785ec3f254f
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Sat Sep 11 13:32:53 2010 -0500
Don't create sparse files one byte too large.
Bug 579769.
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index c8df085..9f9d8ea 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -310,7 +310,9 @@ class SparseLoopbackDisk(LoopbackDisk):
logging.debug("Extending sparse file %s to %d" % (self.lofile, size))
fd = os.open(self.lofile, flags)
- os.lseek(fd, size, 0)
+ if size <= 0:
+ size = 1
+ os.lseek(fd, size-1, 0)
os.write(fd, '\x00')
os.close(fd)
13 years, 7 months