/dev/live, /mnt/live, LiveOS/home.img unavailable in Fedora-17
by Frederick Grose
Please note that the current Fedora-17-Beta-TC2-Live images lack
some traditional Live CD/USB features.
See this bug report.
https://bugzilla.redhat.com/show_bug.cgi?id=740280
/dev/live was a link to the installation partition on the Live USB, such as
/dev/sdc1,
or /dev/sr0 on a Live CD/DVD.
How would a script determine this partition without human input?
/mnt/live was a convenient mounting of the installation partition
filesystem.
It allowed easy access to pre-existing content on the Live USB device or to
the /LiveOS and /syslinux directories.
The --home-size-mb NNN option of livecd-iso-to-disk produced a
/LiveOS/home.img
filesystem for the liveuser's home directory.
This feature made possible the --encrypted-home option, which would secure
the privacy of a user directory on a Live USB system.
The home.img filesystem was also read/write/delete without consuming the
LiveOS overlay. This is important for non-short-term Live USB deployments,
such as Sugar on a Stick, where overlay exhaustion can be a significant
problem.
Is there a workaround for these (missing) features?
--Fred
11 years, 10 months
Fedora livecd-creator broken ?
by Valent Turkovic
Just tried respinning fedora-livecd-desktop.ks and
fedora-live-desktop.ks on my Fedora 16 machine and they failed both :(
This is the command used to respin iso image:
livecd-creator -v -t /livecd/tmp/ --cache=/livecd/yum-cache/ -f
Fedora-16-64bit-2012-04 -c fedora-livecd-desktop.ks
and this is how it fails:
Installing: ivtv-firmware ################### [1135/1137]
Installing: iwl4965-firmware ################### [1136/1137]
Installing: ipw2100-firmware ################### [1137/1137]
2278 blocks
Removing password for user root.
passwd: Success
Note: Forwarding request to 'systemctl enable NetworkManager.service'.
Note: Forwarding request to 'systemctl disable sshd.service'.
rm '/etc/systemd/system/multi-user.target.wants/sshd.service'
Unmounting directory /home/fusion-linux/temp/imgcreate-2S8P8p/install_root
Losetup remove /dev/loop0
Traceback (most recent call last):
File "/usr/bin/livecd-creator", line 210, in <module>
sys.exit(main())
File "/usr/bin/livecd-creator", line 194, in main
creator.configure()
File "/usr/lib/python2.7/site-packages/imgcreate/creator.py", line
724, in configure
self._create_bootconfig()
File "/usr/lib/python2.7/site-packages/imgcreate/live.py", line 242,
in _create_bootconfig
self._generate_efiboot(self.__ensure_isodir())
File "/usr/lib/python2.7/site-packages/imgcreate/live.py", line 235,
in _generate_efiboot
isodir + "/isolinux/efiboot.img"])
File "/usr/lib64/python2.7/subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Can somebody confirm that it works for you or that it also fails? Is
this a known issue?
Cheers,
Valent.
--
follow me - www.twitter.com/valentt & http://kernelreloaded.blog385.com
linux, anime, spirituality, wireless, scuba, linuxmce smart home, zwave
ICQ: 2125241, Skype: valent.turkovic, MSN: valent.turkovic(a)hotmail.com
11 years, 11 months
Fedora livecd 16
by Teresa Millan Fernandez
Hi,
I have to update the firmware on an HP server where there is currently a virtunalization product installed. I was told I should install RedHat 6 update 2, update the firmware, and then reinstall the virtualization environment. This solution is not viable. All this, because a RedHat or Oracle Linux livecd is nowhere to be found.
I was wondering if the Fedora livecd v.16 contains the ld-linux.so.2 library, which is where the Oracle Linux 6 update 2 "boot disk" is failing currently.
How compatible is Fedora with Red Hat and (Oracle Linux)?
I guess it is worth a try, but wanted an opinion from you experts. :o)
Thanks!
T.
11 years, 11 months
Re: [Fedora-livecd-list] A note about /etc/skel
by J.Heather@surrey.ac.uk
Is this on a USB stick with persistent /home? If so, then you'll also hit problems if the file is too big to fit into there.
But the most likely is that the in-memory overlay is being exhausted. Fedora will create a temporary overlay in memory to handle writes to the filesystem.
James
Bruno Wolff III <bruno(a)wolff.to> wrote:
On Sun, Apr 29, 2012 at 07:49:55 -0400,
john <selmys(a)lotuspond.ca> wrote:
>Hello
>
>I noticed that when I copy a large file into /etc/skel during %post
>my ISO is created correctly but crashes on boot up. The crash happens
>when liveuser is being created and the large file in /etc/skel is
>copied to /home/liveuser. If I boot into single user mode first and
>delete the large file from /etc/skel and then "telinit 5", liveuser
>is created and everything works correctly. I tried to rebuild the ISO
>using a larger root partition but still got the same problem. If I
>copy the large file to /usr/local there is no problem.
>Does anyone know if there is some sort of size restrictions on files
>added to /etc/skel ?
If the file is so large that copying it runs you out of memory, that could
potentially be your problem.
--
livecd mailing list
livecd(a)lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/livecd
11 years, 11 months
fsck after resize returned an error
by john
Hello
I'm using F17 Beta (i686) inside a VM with Virtual box. My host is F16
(x86_64).
I'm trying to build a remix for Android development with Eclipse.
But creating an ISO fails just after resizing the file system. fsck
returns an error.
I set my root partition to 10GB which should be enough but still get the
error.
If I reduce the number of files I add during the POST it works so this
suggests
that my file system is too small but I suspect this is misleading. I've
looked at
other spins that generated an ISO over 2GB and they used 10GB for root.
My ISO, when it works, is usually around 1.3GB. When it goes over that
it fails
with the fsck check.
This has happened, and continues to happen, even using F16 as my build
system.
I have attached the log file and my kickstart.
Any pointers for a newbie would be appreciated.
John
====
11 years, 11 months
Changes to 'refs/tags/livecd-tools-16.14'
by Brian C. Lane
Tag 'livecd-tools-16.14' created by Brian C. Lane <bcl(a)redhat.com> at 2012-04-26 22:13 +0000
Tag as livecd-tools-16.14
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAT5nIlxF+jBaO/jp/AQLqZwf/TSEDGFobv4EQzrbE4r7jyR6znfIuKFAv
fBGZc1OTU4Q74y8Ap1PEgR0ujlTQFMOff8gMGl3Ef+VzrRRGPFnDFtr9+AzAt4zC
6lg/c6Y7cyQ960HSiDoyET/atHEAsTXjFRiJjZVk+Oz19JBFg3lzAGHwM5iWb9PZ
ZTUPGnyvahJkiB5g1271GsriIXU/FckjPDnC+eJkersYQ79n5X/eU7V+NKyymSkW
/LN3xEIJBaWP4o7hITtdpDck6vTMjf67AX2OozcMUAKQIEC5OcuyGm/IZ9xAtYo/
eYBdjssjqRXzW8lDUsAjdtSEKWTs/eVGt0jcRT/EBzZk3lQRsixCHA==
=5Gt6
-----END PGP SIGNATURE-----
Changes since livecd-tools-16.13:
Brian C. Lane (2):
copy repo data to USB for F17 (#806166)
Version 16.14
---
Makefile | 2
tools/livecd-iso-to-disk.sh | 170 +++++++++++---------------------------------
2 files changed, 44 insertions(+), 128 deletions(-)
---
11 years, 11 months
Branch 'f16-branch' - 2 commits - Makefile tools/livecd-iso-to-disk.sh
by Brian C. Lane
Makefile | 2
tools/livecd-iso-to-disk.sh | 170 +++++++++++---------------------------------
2 files changed, 44 insertions(+), 128 deletions(-)
New commits:
commit 1b6c8fa6d39cae100fe382ea6940560587ef9307
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Apr 26 15:13:39 2012 -0700
Version 16.14
diff --git a/Makefile b/Makefile
index f9a927e..52821b8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 16.13
+VERSION = 16.14
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit c3c1a01674c2a734ea057658f90a20a2f270e4fc
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Apr 26 14:43:41 2012 -0700
copy repo data to USB for F17 (#806166)
Fedora 17 runs from the media so repo= cannot be used to mount the same
device for access to the repo so we now copy the repodata from the iso
over to the / of the USB. This requires anaconda-17.23-1 or later.
For releases before F17 the iso is still copied and repo= is setup to
point to it.
This reverts the use of 2 partitions that was used to work around this.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 37abae0..15de42d 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -276,14 +276,11 @@ cleanup() {
sleep 2
[ -d "$SRCMNT" ] && umount $SRCMNT && rmdir $SRCMNT
[ -d "$TGTMNT" ] && umount $TGTMNT && rmdir $TGTMNT
- if [ -n "$REPOMNT" ]; then
- [ -d "$REPOMNT" ] && umount $REPOMNT && rmdir $REPOMNT
- fi
}
exitclean() {
RETVAL=$?
- if [ -d "$SRCMNT" ] || [ -d "$TGTMNT" ] || [ -n "$REPOMNT" ];
+ if [ -d "$SRCMNT" ] || [ -d "$TGTMNT" ];
then
[ "$RETVAL" = 0 ] || echo "Cleaning up to exit..."
cleanup
@@ -423,16 +420,7 @@ createGPTLayout() {
/sbin/parted --script $device mklabel gpt
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -442,11 +430,6 @@ createGPTLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart '"EFI System Partition"' fat32 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart '"LIVE REPO"' fat32 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -455,12 +438,6 @@ createGPTLayout() {
umount $TGTDEV &> /dev/null || :
/sbin/mkdosfs -n LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- /sbin/mkdosfs -n LIVE-REPO $REPODEV
- fi
}
createMSDOSLayout() {
@@ -475,16 +452,7 @@ createMSDOSLayout() {
/sbin/parted --script $device mklabel msdos
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -494,11 +462,6 @@ createMSDOSLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart primary fat32 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart primary fat32 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -511,12 +474,6 @@ createMSDOSLayout() {
umount $TGTDEV &> /dev/null || :
/sbin/mkdosfs -n LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- /sbin/mkdosfs -n LIVE-REPO $REPODEV
- fi
}
createEXTFSLayout() {
@@ -531,16 +488,7 @@ createEXTFSLayout() {
/sbin/parted -s $device mklabel msdos
partinfo=$(LC_ALL=C /sbin/parted -s -m $device "u MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -550,11 +498,6 @@ createEXTFSLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart primary ext2 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart primary ext2 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -570,12 +513,6 @@ createEXTFSLayout() {
fi
$mkfs -L LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- $mkfs -L LIVE-REPO $REPODEV
- fi
}
checkGPT() {
@@ -650,25 +587,6 @@ checkFilesystem() {
fi
}
-# Check partition 2 to see if it has been setup as LIVE-REPO
-# Setup REPODEV for later use
-findLIVEREPO() {
- dev=$1
- getdisk $dev
-
- if [ -b ${device}2 ]; then
- label=$(/sbin/blkid -s LABEL -o value ${device}2)
- if [ "$label" == "LIVE-REPO" ]; then
- echo "Found LIVE-REPO on ${device}2"
- REPODEV=${device}2
- return
- fi
- fi
- echo "DVD installs need a second partition labeled LIVE-REPO."
- echo "This is setup when you use --format"
- exitclean
-}
-
checkSyslinuxVersion() {
if [ ! -x /usr/bin/syslinux ]; then
echo "You need to have syslinux installed to run this script"
@@ -710,9 +628,7 @@ fi
detectsrctype() {
if [[ -e "$SRCMNT/Packages" ]]; then
- # This will cause the source .iso to be copied to a second partiton
- # on the target and the boot args to have repo=... pointing to the iso
- echo "/Packages found, will copy source .iso to target"
+ echo "/Packages found, will copy source packages to target"
packages=1
fi
if [[ -e "$SRCMNT/LiveOS/squashfs.img" ]]; then
@@ -947,9 +863,6 @@ if [ -n "$format" -a -z "$skipcopy" ]; then
else
createEXTFSLayout $TGTDEV
fi
-elif [ -n "$packages" ]; then
- # Need the LIVE-REPO partition to copy the .iso to
- findLIVEREPO $TGTDEV
fi
checkFilesystem $TGTDEV
@@ -993,11 +906,6 @@ fi
TGTMNT=$(mktemp -d /media/tgttmp.XXXXXX)
mount $mountopts $TGTDEV $TGTMNT || exitclean
-if [ -n "$REPODEV" ]; then
- REPOLABEL="UUID=$(/sbin/blkid -s UUID -o value $REPODEV)"
- REPOMNT=$(mktemp -d /media/repotmp.XXXXXX)
- mount $mountopts $REPODEV $REPOMNT || exitclean
-fi
trap exitclean SIGINT SIGTERM
@@ -1163,27 +1071,6 @@ if [ "$srctype" = "live" -a -z "$skipcopy" ]; then
sync
fi
-# DVD installer copy
-# Also copies over the source .iso if the image is a new-style LiveOS DVD (F17+)
-if [ -z "$skipcopy" -a \( "$srctype" = "installer" -o "$srctype" = "netinst" \) ]; then
- echo "Copying DVD image to target device."
- mkdir -p $TGTMNT/images/
- if [ "$imgtype" = "install" ]; then
- for img in install.img updates.img product.img; do
- if [ -e $SRCMNT/images/$img ]; then
- copyFile $SRCMNT/images/$img $TGTMNT/images/$img || exitclean
- fi
- done
- fi
-fi
-
-# Copy source .iso to repo partition
-if [ -n "$packages" -a -z "$skipcopy" -a -n "$REPOMNT" ]; then
- echo "Copying $SRC"
- copyFile "$SRC" $REPOMNT/
- sync
-fi
-
# Adjust syslinux sources for replication of installed images
# between filesystem types.
if [[ -d $SRCMNT/isolinux/ ]]; then
@@ -1201,6 +1088,7 @@ BOOTCONFIG=$TGTMNT/$SYSLINUXPATH/isolinux.cfg
# Set this to nothing so sed doesn't care
BOOTCONFIG_EFI=
if [ -n "$efi" ]; then
+ echo "Setting up $EFI_BOOT"
cp $SRCMNT$EFI_BOOT/* $TGTMNT$EFI_BOOT
# FIXME
@@ -1240,7 +1128,43 @@ if [ -n "$efi" ]; then
fi
fi
-if [[ live == $srctype ]]; then
+# DVD installer copy
+if [ -z "$skipcopy" -a \( "$srctype" = "installer" -o "$srctype" = "netinst" \) ]; then
+ echo "Copying DVD image to target device."
+ mkdir -p $TGTMNT/images/
+ if [ "$imgtype" = "install" ]; then
+ for img in install.img updates.img product.img; do
+ if [ -e $SRCMNT/images/$img ]; then
+ copyFile $SRCMNT/images/$img $TGTMNT/images/$img || exitclean
+ fi
+ done
+ fi
+fi
+
+# Copy packages over.
+# Before Fedora17 we could copy the .iso and setup a repo=
+# F17 and later look for repodata on the source media.
+# The presence of packages and LiveOS indicates F17 or later.
+if [ -n "$packages" -a -z "$skipcopy" ]; then
+ if [ "$srctype" != "live" ]; then
+ echo "Copying $SRC to device"
+ copyFile "$SRC" "$TGTMNT/"
+
+ # Setup a repo= to point to the .iso
+ sed -i -e "s;initrd.img;initrd.img repo=hd:$TGTLABEL:/;g" $BOOTCONFIG
+ if [ -n "$efi" ]; then
+ sed -i -e "s;vmlinuz;vmlinuz repo=hd:$TGTLABEL:/;g" $BOOTCONFIG_EFI
+ fi
+ else
+ echo "Copying package data from $SRC to device"
+ rsync --inplace -rLDP --exclude EFI/ --exclude images/ --exclude isolinux/ \
+ --exclude TRANS.TBL --exclude LiveOS/ "$SRCMNT/" "$TGTMNT/"
+ fi
+ echo "Waiting for device to finish writing"
+ sync
+fi
+
+if [ "$srctype" = "live" ]; then
# Copy this installer script.
cp -fT "$thisScriptpath" $TGTMNT/$LIVEOS/livecd-iso-to-disk
chmod +x $TGTMNT/$LIVEOS/livecd-iso-to-disk &> /dev/null || :
@@ -1278,14 +1202,6 @@ if [ -n "$efi" ]; then
sed -i -e "s;findiso;;g" $BOOTCONFIG_EFI
fi
-# Add repo= to point to the source .iso with the packages
-if [[ -n "$packages" ]]; then
- sed -i -e "s;initrd.img;initrd.img repo=hd:$REPOLABEL:/;g" $BOOTCONFIG
- if [ -n "$efi" ]; then
- sed -i -e "s;vmlinuz;vmlinuz repo=hd:$REPOLABEL:/;g" $BOOTCONFIG_EFI
- fi
-fi
-
# DVD Installer for netinst
if [ "$srctype" != "live" ]; then
if [ "$imgtype" = "install" ]; then
11 years, 11 months
Changes to 'refs/tags/livecd-tools-17.10'
by Brian C. Lane
Tag 'livecd-tools-17.10' created by Brian C. Lane <bcl(a)redhat.com> at 2012-04-26 21:57 +0000
Tag as livecd-tools-17.10
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEVAwUAT5nEwBF+jBaO/jp/AQI/iAf9FQBiNXRRpwdAhYi7J3AklMlUKUNH7lwD
RBYI4GbJYDvLstdzBl74vhRxUuVFVqgxGZk/9MmR1EdNXVKJL+MaQeQHnjFAYyb0
pXaZlEKtnKYKvLxtm4GKR+XYlZRlr+xdA46vAwbgYvKT36ew9OEAFGn7VF9AEhAF
pvN7cP0kJ9eNBOqJSxyuhbUIZrFCmbwBMabguyzTyYWPW8A94LMOfh/gEdtcXcRk
JWVkRttHy6sALFx4ktqwenGJMF5/vx50l0gfRBS51hJ25NIh0iTYxFQmAN/MejE7
1TNrAHobQK9qxMOk/Y5aBqsXc7CJNYUdJCWaUa0XnHW3/MQ2sM8UZw==
=lvKv
-----END PGP SIGNATURE-----
Changes since livecd-tools-17.9:
Brian C. Lane (2):
copy repo data to USB for F17 (#806166)
Version 17.10
---
Makefile | 2
tools/livecd-iso-to-disk.sh | 170 +++++++++++---------------------------------
2 files changed, 44 insertions(+), 128 deletions(-)
---
11 years, 11 months
Branch 'f17-branch' - Makefile
by Brian C. Lane
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 7cd22cda37b7e52114cda6cccbc1c9024fada4d8
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Apr 26 14:57:01 2012 -0700
Version 17.10
diff --git a/Makefile b/Makefile
index 0667a0b..4f2ddfe 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 17.9
+VERSION = 17.10
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
11 years, 11 months
Branch 'f17-branch' - tools/livecd-iso-to-disk.sh
by Brian C. Lane
tools/livecd-iso-to-disk.sh | 170 +++++++++++---------------------------------
1 file changed, 43 insertions(+), 127 deletions(-)
New commits:
commit 2a85f65f0988a30ff5f869aa5410f9b3af148241
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Thu Apr 26 14:43:41 2012 -0700
copy repo data to USB for F17 (#806166)
Fedora 17 runs from the media so repo= cannot be used to mount the same
device for access to the repo so we now copy the repodata from the iso
over to the / of the USB. This requires anaconda-17.23-1 or later.
For releases before F17 the iso is still copied and repo= is setup to
point to it.
This reverts the use of 2 partitions that was used to work around this.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 95f0fae..7df49c2 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -276,14 +276,11 @@ cleanup() {
sleep 2
[ -d "$SRCMNT" ] && umount $SRCMNT && rmdir $SRCMNT
[ -d "$TGTMNT" ] && umount $TGTMNT && rmdir $TGTMNT
- if [ -n "$REPOMNT" ]; then
- [ -d "$REPOMNT" ] && umount $REPOMNT && rmdir $REPOMNT
- fi
}
exitclean() {
RETVAL=$?
- if [ -d "$SRCMNT" ] || [ -d "$TGTMNT" ] || [ -n "$REPOMNT" ];
+ if [ -d "$SRCMNT" ] || [ -d "$TGTMNT" ];
then
[ "$RETVAL" = 0 ] || echo "Cleaning up to exit..."
cleanup
@@ -423,16 +420,7 @@ createGPTLayout() {
/sbin/parted --script $device mklabel gpt
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -442,11 +430,6 @@ createGPTLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart '"EFI System Partition"' fat32 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart '"LIVE REPO"' fat32 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -455,12 +438,6 @@ createGPTLayout() {
umount $TGTDEV &> /dev/null || :
/sbin/mkdosfs -n LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- /sbin/mkdosfs -n LIVE-REPO $REPODEV
- fi
}
createMSDOSLayout() {
@@ -475,16 +452,7 @@ createMSDOSLayout() {
/sbin/parted --script $device mklabel msdos
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -494,11 +462,6 @@ createMSDOSLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart primary fat32 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart primary fat32 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -511,12 +474,6 @@ createMSDOSLayout() {
umount $TGTDEV &> /dev/null || :
/sbin/mkdosfs -n LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- /sbin/mkdosfs -n LIVE-REPO $REPODEV
- fi
}
createEXTFSLayout() {
@@ -531,16 +488,7 @@ createEXTFSLayout() {
/sbin/parted -s $device mklabel msdos
partinfo=$(LC_ALL=C /sbin/parted -s -m $device "u MB print" |grep ^$device:)
dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//')
-
- # Is a 2nd partition needed for package iso?
- if [ -n "$packages" ]; then
- src_size=$(du -s -B 1MB "$SRC" | awk {'print $1;'})
- # iso size + 7% of slop for filesystem metadata
- p2_size=$(($src_size * 107 / 100))
- else
- p2_size=0
- fi
- p1_size=$(($dev_size - 3 - $p2_size))
+ p1_size=$(($dev_size - 3))
if [ $p1_size -le 0 ]; then
echo "Your device isn't big enough to hold $SRC"
@@ -550,11 +498,6 @@ createEXTFSLayout() {
p1_start=1
p1_end=$(($p1_size + 1))
/sbin/parted -s $device u MB mkpart primary ext2 $p1_start $p1_end set 1 boot on
- if [ $p2_size -gt 0 ]; then
- p2_start=$p1_end
- p2_end=$(($p2_size + $p2_start))
- /sbin/parted -s $device u MB mkpart primary ext2 $p2_start $p2_end
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
@@ -570,12 +513,6 @@ createEXTFSLayout() {
fi
$mkfs -L LIVE $TGTDEV
TGTLABEL="UUID=$(/sbin/blkid -s UUID -o value $TGTDEV)"
-
- if [ $p2_size -gt 0 ]; then
- REPODEV=${device}2
- umount $REPODEV &> /dev/null || :
- $mkfs -L LIVE-REPO $REPODEV
- fi
}
checkGPT() {
@@ -650,25 +587,6 @@ checkFilesystem() {
fi
}
-# Check partition 2 to see if it has been setup as LIVE-REPO
-# Setup REPODEV for later use
-findLIVEREPO() {
- dev=$1
- getdisk $dev
-
- if [ -b ${device}2 ]; then
- label=$(/sbin/blkid -s LABEL -o value ${device}2)
- if [ "$label" == "LIVE-REPO" ]; then
- echo "Found LIVE-REPO on ${device}2"
- REPODEV=${device}2
- return
- fi
- fi
- echo "DVD installs need a second partition labeled LIVE-REPO."
- echo "This is setup when you use --format"
- exitclean
-}
-
checkSyslinuxVersion() {
if [ ! -x /usr/bin/syslinux ]; then
echo "You need to have syslinux installed to run this script"
@@ -710,9 +628,7 @@ fi
detectsrctype() {
if [[ -e "$SRCMNT/Packages" ]]; then
- # This will cause the source .iso to be copied to a second partiton
- # on the target and the boot args to have repo=... pointing to the iso
- echo "/Packages found, will copy source .iso to target"
+ echo "/Packages found, will copy source packages to target"
packages=1
fi
if [[ -e "$SRCMNT/LiveOS/squashfs.img" ]]; then
@@ -947,9 +863,6 @@ if [ -n "$format" -a -z "$skipcopy" ]; then
else
createEXTFSLayout $TGTDEV
fi
-elif [ -n "$packages" ]; then
- # Need the LIVE-REPO partition to copy the .iso to
- findLIVEREPO $TGTDEV
fi
checkFilesystem $TGTDEV
@@ -993,11 +906,6 @@ fi
TGTMNT=$(mktemp -d /media/tgttmp.XXXXXX)
mount $mountopts $TGTDEV $TGTMNT || exitclean
-if [ -n "$REPODEV" ]; then
- REPOLABEL="UUID=$(/sbin/blkid -s UUID -o value $REPODEV)"
- REPOMNT=$(mktemp -d /media/repotmp.XXXXXX)
- mount $mountopts $REPODEV $REPOMNT || exitclean
-fi
trap exitclean SIGINT SIGTERM
@@ -1163,27 +1071,6 @@ if [ "$srctype" = "live" -a -z "$skipcopy" ]; then
sync
fi
-# DVD installer copy
-# Also copies over the source .iso if the image is a new-style LiveOS DVD (F17+)
-if [ -z "$skipcopy" -a \( "$srctype" = "installer" -o "$srctype" = "netinst" \) ]; then
- echo "Copying DVD image to target device."
- mkdir -p $TGTMNT/images/
- if [ "$imgtype" = "install" ]; then
- for img in install.img updates.img product.img; do
- if [ -e $SRCMNT/images/$img ]; then
- copyFile $SRCMNT/images/$img $TGTMNT/images/$img || exitclean
- fi
- done
- fi
-fi
-
-# Copy source .iso to repo partition
-if [ -n "$packages" -a -z "$skipcopy" -a -n "$REPOMNT" ]; then
- echo "Copying $SRC"
- copyFile "$SRC" $REPOMNT/
- sync
-fi
-
# Adjust syslinux sources for replication of installed images
# between filesystem types.
if [[ -d $SRCMNT/isolinux/ ]]; then
@@ -1201,6 +1088,7 @@ BOOTCONFIG=$TGTMNT/$SYSLINUXPATH/isolinux.cfg
# Set this to nothing so sed doesn't care
BOOTCONFIG_EFI=
if [ -n "$efi" ]; then
+ echo "Setting up $EFI_BOOT"
cp $SRCMNT$EFI_BOOT/* $TGTMNT$EFI_BOOT
# FIXME
@@ -1240,7 +1128,43 @@ if [ -n "$efi" ]; then
fi
fi
-if [[ live == $srctype ]]; then
+# DVD installer copy
+if [ -z "$skipcopy" -a \( "$srctype" = "installer" -o "$srctype" = "netinst" \) ]; then
+ echo "Copying DVD image to target device."
+ mkdir -p $TGTMNT/images/
+ if [ "$imgtype" = "install" ]; then
+ for img in install.img updates.img product.img; do
+ if [ -e $SRCMNT/images/$img ]; then
+ copyFile $SRCMNT/images/$img $TGTMNT/images/$img || exitclean
+ fi
+ done
+ fi
+fi
+
+# Copy packages over.
+# Before Fedora17 we could copy the .iso and setup a repo=
+# F17 and later look for repodata on the source media.
+# The presence of packages and LiveOS indicates F17 or later.
+if [ -n "$packages" -a -z "$skipcopy" ]; then
+ if [ "$srctype" != "live" ]; then
+ echo "Copying $SRC to device"
+ copyFile "$SRC" "$TGTMNT/"
+
+ # Setup a repo= to point to the .iso
+ sed -i -e "s;initrd.img;initrd.img repo=hd:$TGTLABEL:/;g" $BOOTCONFIG
+ if [ -n "$efi" ]; then
+ sed -i -e "s;vmlinuz;vmlinuz repo=hd:$TGTLABEL:/;g" $BOOTCONFIG_EFI
+ fi
+ else
+ echo "Copying package data from $SRC to device"
+ rsync --inplace -rLDP --exclude EFI/ --exclude images/ --exclude isolinux/ \
+ --exclude TRANS.TBL --exclude LiveOS/ "$SRCMNT/" "$TGTMNT/"
+ fi
+ echo "Waiting for device to finish writing"
+ sync
+fi
+
+if [ "$srctype" = "live" ]; then
# Copy this installer script.
cp -fT "$thisScriptpath" $TGTMNT/$LIVEOS/livecd-iso-to-disk
chmod +x $TGTMNT/$LIVEOS/livecd-iso-to-disk &> /dev/null || :
@@ -1278,14 +1202,6 @@ if [ -n "$efi" ]; then
sed -i -e "s;findiso;;g" $BOOTCONFIG_EFI
fi
-# Add repo= to point to the source .iso with the packages
-if [[ -n "$packages" ]]; then
- sed -i -e "s;initrd.img;initrd.img repo=hd:$REPOLABEL:/;g" $BOOTCONFIG
- if [ -n "$efi" ]; then
- sed -i -e "s;vmlinuz;vmlinuz repo=hd:$REPOLABEL:/;g" $BOOTCONFIG_EFI
- fi
-fi
-
# DVD Installer for netinst
if [ "$srctype" != "live" ]; then
if [ "$imgtype" = "install" ]; then
11 years, 11 months