Recursive livecd-creator problem
by Warren Togami
I am trying to create a Live LTSP Server image. This is pretty much
just livecd-fedora-9-desktop.ks plus the ltsp-server package added, then
ltsp-build-client runs in %post. ltsp-build-client itself runs an
internal instance of imagecreator to install the client chroot. The
chroot has another chroot installed within it, then it is all smashed
into a single image.
This should be straightforward, except I ran into a problem.
The chroot created by livecd-creator has a blank /etc/resolv.conf, so
the inner imagecreator trying to create a chroot fails as it cannot
download repo metadata.
I cannot simply copy /etc/resolv.conf from the host to the first level
chroot in %post since it is already running within the chroot at this
point. I then tried to use both %post --nochroot and %post in the same
kickstart file.
It seems that %post --nochroot is ignored when you also have a %post?
Are both supposed to run (in what order?), or only %post?
Similarly %pre and %post in the same kickstart script, %pre seems to be
ignored.
Anybody have any idea how I can achieve my goal of copying
/etc/resolv.conf from the host and into the chroot, before or during %post?
Warren Togami
wtogami(a)redhat.com
15 years, 8 months
Live CD ACPI
by jean.rousseau@ssq.ca
Hi,
Is it possible to put a script somewhere in the KS file who is gonna fix my live CD to always boot with ACPI=OFF
If yes, can you tell me how.
Regards
</pre><hr>Ce message et tous les fichiers attachés sont confidentiels et s'adressent exclusivement au(x) destinataire(s) indiqué(s) ci-dessus. Si vous recevez ce message par erreur, veuillez le retourner à l'expéditeur et le détruire. Tout usage, copie ou distribution non autorisés de ce courriel sont strictement interdits.<p>This message and any attachments are confidential and intended solely for the above-mentioned recipient(s). If you have received this message in error, please return it to the sender and delete it from your files. Unauthorized use, copying or distribution of this e-mail is strictly prohibited.<pre>
15 years, 8 months
[PATCH] Refactor disk/mount classes to allow multi-partition/fs layouts
by David Huff
From: Daniel P. Berrange <berrange(a)redhat.com>
---
imgcreate/creator.py | 17 ++--
imgcreate/fs.py | 247 ++++++++++++++++++++++++++++++++-----------------
imgcreate/live.py | 6 +-
3 files changed, 174 insertions(+), 96 deletions(-)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 0d22b56..979e1b9 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -208,7 +208,11 @@ class ImageCreator(object):
"""
s = "/dev/root / %s defaults,noatime 0 0\n" %(self._fstype)
- s += "devpts /dev/pts devpts gid=5,mode=620 0 0\n"
+ s += self._get_fstab_special()
+ return s
+
+ def _get_fstab_special(self):
+ s = "devpts /dev/pts devpts gid=5,mode=620 0 0\n"
s += "tmpfs /dev/shm tmpfs defaults 0 0\n"
s += "proc /proc proc defaults 0 0\n"
s += "sysfs /sys sysfs defaults 0 0\n"
@@ -817,12 +821,11 @@ class LoopImageCreator(ImageCreator):
if not base_on is None:
shutil.copyfile(base_on, self._image)
- self.__instloop = SparseExtLoopbackMount(self._image,
- self._instroot,
- self.__image_size,
- self.__fstype,
- self.__blocksize,
- self.fslabel)
+ self.__instloop = ExtDiskMount(SparseLoopbackDisk(self._image, self.__image_size),
+ self._instroot,
+ self.__fstype,
+ self.__blocksize,
+ self.fslabel)
try:
self.__instloop.mount()
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index 9ca3a3e..e53cfa9 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -24,6 +24,7 @@ import stat
import subprocess
import random
import string
+import logging
from imgcreate.errors import *
@@ -86,42 +87,51 @@ class BindChrootMount:
subprocess.call(["/bin/umount", self.dest])
self.mounted = False
-class LoopbackMount:
- def __init__(self, lofile, mountdir, fstype = None):
- self.lofile = lofile
- self.mountdir = mountdir
- self.fstype = fstype
+class Disk:
+ def __init__(self, size, device = None):
+ self._device = device
+ self._size = size
- self.mounted = False
- self.losetup = False
- self.rmdir = False
- self.loopdev = None
+ def create(self):
+ pass
def cleanup(self):
- self.unmount()
- self.lounsetup()
+ pass
- def unmount(self):
- if self.mounted:
- rc = subprocess.call(["/bin/umount", self.mountdir])
- if rc == 0:
- self.mounted = False
+ def get_device(self):
+ return self._device
+ def set_device(self, path):
+ self._device = path
+ device = property(get_device, set_device)
- if self.rmdir and not self.mounted:
- try:
- os.rmdir(self.mountdir)
- except OSError, e:
- pass
- self.rmdir = False
+ def get_size(self):
+ return self._size
+ size = property(get_size)
+
+
+class RawDisk(Disk):
+ def __init__(self, size, device):
+ Disk.__init__(self, size, device)
+
+ def fixed(self):
+ return True
+
+ def exists(self):
+ return True
+
+class LoopbackDisk(Disk):
+ def __init__(self, lofile, size):
+ Disk.__init__(self, size)
+ self.lofile = lofile
+
+ def fixed(self):
+ return False
- def lounsetup(self):
- if self.losetup:
- rc = subprocess.call(["/sbin/losetup", "-d", self.loopdev])
- self.losetup = False
- self.loopdev = None
+ def exists(self):
+ return os.path.exists(self.lofile)
- def loopsetup(self):
- if self.losetup:
+ def create(self):
+ if self.device is not None:
return
losetupProc = subprocess.Popen(["/sbin/losetup", "-f"],
@@ -132,40 +142,27 @@ class LoopbackMount:
raise MountError("Failed to allocate loop device for '%s'" %
self.lofile)
- self.loopdev = losetupOutput.split()[0]
+ device = losetupOutput.split()[0]
- rc = subprocess.call(["/sbin/losetup", self.loopdev, self.lofile])
+ logging.debug("Losetup add %s mapping to %s" % (device, self.lofile))
+ rc = subprocess.call(["/sbin/losetup", device, self.lofile])
if rc != 0:
raise MountError("Failed to allocate loop device for '%s'" %
self.lofile)
+ self.device = device
- self.losetup = True
-
- def mount(self):
- if self.mounted:
+ def cleanup(self):
+ if self.device is None:
return
+ logging.debug("Losetup remove %s" % self.device)
+ rc = subprocess.call(["/sbin/losetup", "-d", self.device])
+ self.device = None
- self.loopsetup()
- if not os.path.isdir(self.mountdir):
- os.makedirs(self.mountdir)
- self.rmdir = True
- args = [ "/bin/mount", self.loopdev, self.mountdir ]
- if self.fstype:
- args.extend(["-t", self.fstype])
-
- rc = subprocess.call(args)
- if rc != 0:
- raise MountError("Failed to mount '%s' to '%s'" %
- (self.loopdev, self.mountdir))
-
- self.mounted = True
-
-class SparseLoopbackMount(LoopbackMount):
- def __init__(self, lofile, mountdir, size, fstype = None):
- LoopbackMount.__init__(self, lofile, mountdir, fstype)
- self.size = size
+class SparseLoopbackDisk(LoopbackDisk):
+ def __init__(self, lofile, size):
+ LoopbackDisk.__init__(self, lofile, size)
def expand(self, create = False, size = None):
flags = os.O_WRONLY
@@ -176,6 +173,7 @@ class SparseLoopbackMount(LoopbackMount):
if size is None:
size = self.size
+ logging.debug("Extending sparse file %s to %d" % (self.lofile, size))
fd = os.open(self.lofile, flags)
os.lseek(fd, size, 0)
@@ -185,36 +183,107 @@ class SparseLoopbackMount(LoopbackMount):
def truncate(self, size = None):
if size is None:
size = self.size
+
+ logging.debug("Truncating sparse file %s to %d" % (self.lofile, size))
fd = os.open(self.lofile, os.O_WRONLY)
os.ftruncate(fd, size)
os.close(fd)
def create(self):
self.expand(create = True)
+ LoopbackDisk.create(self)
+
+class Mount:
+ def __init__(self, mountdir):
+ self.mountdir = mountdir
+
+ def cleanup(self):
+ self.unmount()
+
+ def mount(self):
+ pass
+
+ def unmount(self):
+ pass
+
+class DiskMount(Mount):
+ def __init__(self, disk, mountdir, fstype = None, rmmountdir = True):
+ Mount.__init__(self, mountdir)
+
+ self.disk = disk
+ self.fstype = fstype
+ self.rmmountdir = rmmountdir
+
+ self.mounted = False
+ self.rmdir = False
+
+ def cleanup(self):
+ Mount.cleanup(self)
+ self.disk.cleanup()
+
+ def unmount(self):
+ if self.mounted:
+ logging.debug("Unmounting directory %s" % self.mountdir)
+ rc = subprocess.call(["/bin/umount", self.mountdir])
+ if rc == 0:
+ self.mounted = False
+
+ if self.rmdir and not self.mounted:
+ try:
+ os.rmdir(self.mountdir)
+ except OSError, e:
+ pass
+ self.rmdir = False
+
+
+ def __create(self):
+ self.disk.create()
+
-class SparseExtLoopbackMount(SparseLoopbackMount):
- def __init__(self, lofile, mountdir, size, fstype, blocksize, fslabel):
- SparseLoopbackMount.__init__(self, lofile, mountdir, size, fstype)
+ def mount(self):
+ if self.mounted:
+ return
+
+ if not os.path.isdir(self.mountdir):
+ logging.debug("Creating mount point %s" % self.mountdir)
+ os.makedirs(self.mountdir)
+ self.rmdir = self.rmmountdir
+
+ self.__create()
+
+ logging.debug("Mounting %s at %s" % (self.disk.device, self.mountdir))
+ args = [ "/bin/mount", self.disk.device, self.mountdir ]
+ if self.fstype:
+ args.extend(["-t", self.fstype])
+
+ rc = subprocess.call(args)
+ if rc != 0:
+ raise MountError("Failed to mount '%s' to '%s'" %
+ (self.disk.device, self.mountdir))
+
+ self.mounted = True
+
+class ExtDiskMount(DiskMount):
+ def __init__(self, disk, mountdir, fstype, blocksize, fslabel, rmmountdir=True):
+ DiskMount.__init__(self, disk, mountdir, fstype, rmmountdir)
self.blocksize = blocksize
self.fslabel = fslabel
def __format_filesystem(self):
+ logging.debug("Formating %s filesystem on %s" % (self.fstype, self.disk.device))
rc = subprocess.call(["/sbin/mkfs." + self.fstype,
"-F", "-L", self.fslabel,
"-m", "1", "-b", str(self.blocksize),
- self.lofile,
- str(self.size / self.blocksize)])
+ self.disk.device])
+ # str(self.disk.size / self.blocksize)])
if rc != 0:
raise MountError("Error creating %s filesystem" % (self.fstype,))
+ logging.debug("Tuning filesystem on %s" % self.disk.device)
subprocess.call(["/sbin/tune2fs", "-c0", "-i0", "-Odir_index",
- "-ouser_xattr,acl", self.lofile])
-
- def create(self):
- SparseLoopbackMount.create(self)
- self.__format_filesystem()
+ "-ouser_xattr,acl", self.disk.device])
- def resize(self, size = None):
- current_size = os.stat(self.lofile)[stat.ST_SIZE]
+ def __resize_filesystem(self, size = None):
+ current_size = os.stat(self.disk.lofile)[stat.ST_SIZE]
if size is None:
size = self.size
@@ -227,21 +296,28 @@ class SparseExtLoopbackMount(SparseLoopbackMount):
self.__fsck()
- resize2fs(self.lofile, size)
-
- if size < current_size:
- self.truncate(size)
+ resize2fs(self.disk.lofile, size)
return size
- def mount(self):
- if not os.path.isfile(self.lofile):
- self.create()
+ def __create(self):
+ resize = False
+ if not self.disk.fixed() and self.disk.exists():
+ resize = True
+
+ self.disk.create()
+
+ if resize:
+ self.__resize_filesystem()
else:
- self.resize()
- return SparseLoopbackMount.mount(self)
+ self.__format_filesystem()
+
+ def mount(self):
+ self.__create()
+ DiskMount.mount(self)
def __fsck(self):
- subprocess.call(["/sbin/e2fsck", "-f", "-y", self.lofile])
+ logging.debug("Checking filesystem %s" % self.disk.lofile)
+ subprocess.call(["/sbin/e2fsck", "-f", "-y", self.disk.lofile])
def __get_size_from_filesystem(self):
def parse_field(output, field):
@@ -253,7 +329,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount):
dev_null = os.open("/dev/null", os.O_WRONLY)
try:
- out = subprocess.Popen(['/sbin/dumpe2fs', '-h', self.lofile],
+ out = subprocess.Popen(['/sbin/dumpe2fs', '-h', self.disk.lofile],
stdout = subprocess.PIPE,
stderr = dev_null).communicate()[0]
finally:
@@ -273,7 +349,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount):
while top != (bot + 1):
t = bot + ((top - bot) / 2)
- if not resize2fs(self.lofile, t):
+ if not resize2fs(self.disk.lofile, t):
top = t
else:
bot = t
@@ -306,8 +382,8 @@ class DeviceMapperSnapshot(object):
if self.__created:
return
- self.imgloop.loopsetup()
- self.cowloop.loopsetup()
+ self.imgloop.create()
+ self.cowloop.create()
self.__name = "imgcreate-%d-%d" % (os.getpid(),
random.randint(0, 2**16))
@@ -315,8 +391,8 @@ class DeviceMapperSnapshot(object):
size = os.stat(self.imgloop.lofile)[stat.ST_SIZE]
table = "0 %d snapshot %s %s p 8" % (size / 512,
- self.imgloop.loopdev,
- self.cowloop.loopdev)
+ self.imgloop.device,
+ self.cowloop.device)
args = ["/sbin/dmsetup", "create", self.__name, "--table", table]
if subprocess.call(args) != 0:
@@ -382,15 +458,14 @@ class DeviceMapperSnapshot(object):
# 8) Create a squashfs of the COW
#
def create_image_minimizer(path, image, minimal_size):
- imgloop = LoopbackMount(image, "None")
+ imgloop = LoopbackDisk(image, None) # Passing bogus size - doesn't matter
- cowloop = SparseLoopbackMount(os.path.join(os.path.dirname(path), "osmin"),
- None, 64L * 1024L * 1024L)
+ cowloop = SparseLoopbackDisk(os.path.join(os.path.dirname(path), "osmin"),
+ 64L * 1024L * 1024L)
snapshot = DeviceMapperSnapshot(imgloop, cowloop)
try:
- cowloop.create()
snapshot.create()
resize2fs(snapshot.path, minimal_size)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 03a5466..e25e8cd 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -131,7 +131,7 @@ class LiveImageCreatorBase(LoopImageCreator):
#
def __base_on_iso(self, base_on):
"""helper function to extract ext3 file system from a live CD ISO"""
- isoloop = LoopbackMount(base_on, self._mkdtemp())
+ isoloop = Mount(LoopbackDisk(base_on), self._mkdtemp())
try:
isoloop.mount()
@@ -145,10 +145,10 @@ class LiveImageCreatorBase(LoopImageCreator):
else:
squashimg = isoloop.mountdir + "/LiveOS/squashfs.img"
- squashloop = LoopbackMount(squashimg, self._mkdtemp(), "squashfs")
+ squashloop = Mount(LoopbackDisk(squashimg), self._mkdtemp(), "squashfs")
try:
- if not os.path.exists(squashloop.lofile):
+ if not squashloop.disk.exists():
raise CreatorError("'%s' is not a valid live CD ISO : "
"squashfs.img doesn't exist" % base_on)
--
1.5.4.3
15 years, 8 months
Re: livecd-creator unmounting temp image, running daemons.
by Jeremy Katz
On Mon, 2008-07-28 at 11:44 +1200, Martin Langhoff wrote:
> On Mon, Jul 28, 2008 at 4:52 AM, Jerry Vonau <jvonau(a)shaw.ca> wrote:
> > Your cc to the livecd list are not appearing there, are you subscribed?
>
> No - I thought it was an open list. I'll sub...
Due to a ridiculous amount of spam, posts are limited to members only
and everything else just gets dropped. Anything else is just not
practical at this point for most lists :-/
Jeremy
15 years, 8 months
Some questions from a livecd newer
by Pollux Su
Hi,all friends:
I was assigned a linux livecd task,but I am not familiar with linux. I
have finished a simple fedora livecd following the basic information I got
from here. Now,I have to build a minimal livecd with firefox, I think I want
to write ks file by myself base on kde ks file and add a firefox package.
But this iso file is very large for me. How can I do?
Thanks for your time? Where can I find the details of package which I
have to install and remove when I build a minimal firefox livecd.
15 years, 8 months
Re: livecd-creator unmounting temp image, running daemons.
by Jerry Vonau
Martin:
Your cc to the livecd list are not appearing there, are you subscribed?
Martin Langhoff wrote:
> On Sun, Jul 27, 2008 at 8:45 PM, Martin Langhoff
> <martin.langhoff(a)gmail.com> wrote:
>> Sounds complex. I will try going in the opposite direction: downgrade
>> the package on F9 or pass flags to disable the new fanciness.
>
> Right - with the following patch to fs.py the F7 kernel won't panic
> anymore, and a basic F8 will boot. The mkfs tweak is probably
> unneeded, the main difference seems to come from -no-sparse:
>
Think the issue is going to be how the kernel modules differ from
version 3.2 and 3.3 of squashfs-tools.
So lets get this clear, F7 is using the 2.6.23.?? and does not boot,
F8 is now booting correctly? with which kernel?
> --- a/imgcreate/fs.py
> +++ b/imgcreate/fs.py
> @@ -38,7 +38,7 @@ def makedirs(dirname):
> raise
>
> def mksquashfs(in_img, out_img):
> - args = ["/sbin/mksquashfs", in_img, out_img]
> + args = ["/sbin/mksquashfs", in_img, out_img, '-no-sparse', '-b',
'131072']
>
> if not sys.stdout.isatty():
> args.append("-no-progress")
> @@ -200,7 +200,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount):
>
> def __format_filesystem(self):
> rc = subprocess.call(["/sbin/mkfs." + self.fstype,
> - "-F", "-L", self.fslabel,
> + '-I', '128', "-F", "-L", self.fslabel,
> "-m", "1", "-b", str(self.blocksize),
> self.lofile,
> str(self.size / self.blocksize)])
>
>
> On F7 - my actual target ATM - the problem is not gone through. Init
> is dropping me to a panic shell, and I cannot figure out how to get
> something I can mount there. When I get dropped in the shell, lsmod
> makes it seem like no interesting modules have been loaded.
> modprobe-ing libata, cdrom and other modules works. I don't know the
> major/minor numbers enough to mknod my way around here.
>
see above
> So I suspect of the initrd, but I am unsure of what to do next. The
> mayflower initrd seems to work though it does throw some (IMO)
> meaningless errors - complaining about old module names that are not
> relevant to the 2.6.23 kernel I have:
>
> Building an initramfs at /boot/initrd-2.6.23.1-21.fc7.img for kernel
> 2.6.23.1-21.fc7
> FATAL: Module ide_cd not found.
> FATAL: Module =ata not found.
> FATAL: Module usbhid not found.
> FATAL: Module ieee1394 not found.
> Done; initramfs is 4.2M.
>
> any more hints on this track?
>
Think the only way you'll get this to fly is to get the source for
squashfs-tools3.3 http://www.squashfs-lzma.org/dl/squashfs3.3.tar.gz
and patch your 2.6.23 kernel and recompile the module and replace the
module in the initrd. There is a good post on the livecd list about
patching squashfs for lsma support and covers all the steps, perhaps you
could adapt the steps(leave out the lzma patches).
https://www.redhat.com/archives/fedora-livecd-list/2008-July/msg00007.html
https://www.redhat.com/archives/fedora-livecd-list/2008-July/msg00005.html
Repacking is initrd and iso are not that hard, but I have some notes
around if you need them.
Jerry
15 years, 9 months
Re: livecd-creator unmounting temp image, running daemons.
by Jerry Vonau
Martin Langhoff wrote:
> On Sun, Jul 27, 2008 at 3:25 PM, Martin Langhoff
> <martin.langhoff(a)gmail.com> wrote:
>> After a bit more investigation. the livecd-tools package in F9
>> (017.1-1.fc9) can only build F9 correctly, and the problem boils down
>> to incorrect placement of the .ko files in the initrd. Here is how to
>> repro with F9 vs F7. In my testing, F8 shows the same problems.
>
> I tracked this down to the switch from mayflower to mkinitrd, which
> lead me to commit
> 11dbd0bb5ba4b845e80109e990e4e780ca402218 where mayflower gets
> installed and called during %post.
>
> So I updated my ks file as below. This still fails to build a bootable
> F8 or F7, both drop to an emergency shell after failing to find root
> (see below for more details). I am using git's master for these
> builds.
>
> Current kickstart file
>
> --8<----8<----8<--
> lang en_US.UTF-8
> keyboard us
> timezone US/Eastern
> auth --useshadow --enablemd5
> selinux --disabled
> firewall --disabled
> part / --size 1024
>
> repo --name=released
>
--mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-8&arch=$basearch
>
> %packages
> @core
> bash
> kernel
> passwd
> policycoreutils
> chkconfig
> authconfig
> rootfiles
>
> # for live initrd
> livecd-tools
> # livecd bits to set up the livecd and be able to install
> anaconda
> #isomd5sum
>
> %end
>
> %post
> # make the initrd we care about
> rm -f /boot/initrd*.img
> cp /etc/sysconfig/mkinitrd /etc/mayflower.conf
> ver=`ls /boot/vmlinuz* |head -n 1 |sed -e 's;/boot/vmlinuz-;;'`
> /usr/lib/livecd-creator/mayflower -f /boot/initrd-$ver.img $ver
> rm -f /etc/mayflower.conf
> %end
>
> %post --nochroot
> # move the initrd we created to be the booted one
> mv $INSTALL_ROOT/boot/initrd-*.img $LIVE_ROOT/isolinux/initrd0.img
> %end
> --8<----8<----8<--
>
> With this ks file, the initrd is now built correctly. But during boot
> with F8 I see all sorts of odd errors:
>
> WARNING: Bogus /etc/fstab file - cannot have /dev/root as the device
for /
> ...
> starting udevd
> creating devices
> waiting for system to settle
> ...
> SQUASHFS error: Major/Minor mismatch, trying to mount newer 3.1
filesystem
> SQUASHFS error: Please update your kernel
> mount: wrong fstype ...
>
The squsashfs-tools/kernel module on the fc7/8 live disks is to old to
mount the squashfs.img created on the newer f9 box.
> Once on the shell, the dmesg output looks normal except for the
> Squashfs errors, and ls /dev/ does not contain anything that looks
> like a usable block device. Trying to mount /dev/loop0 gives me the
> same squashfs error as before.
>
> hmmmm? hints?
>
>
>
> m
Think you would need to include, maybe recompile, the squashfs-tools rpm
from the f9. Then I think you'll need to recompile the kernel module and
include it in the initrd. I can't recall when this update to squashfs
occurred, but I believe it was tied to a kernel update between fedora
releases 8-9. so I'm not sure if the above will even work.
Jerry
15 years, 9 months
Re: How do I save and restore my overlay?
by martin.x.long@jpmchase.com
Douglas -
Thanks again for the reply.
Douglas McClendon <dmc.fedora(a)filteredperception.org> wrote:
> Message: 1
> Date: Fri, 25 Jul 2008 23:53:41 -0700
> From: Douglas McClendon <dmc.fedora(a)filteredperception.org>
> Subject: Re: [Fedora-livecd-list] Re: How do I save and restore my
> overlay?
> To: fedora-livecd-list(a)redhat.com
> Message-ID: <488AC9F5.5060905(a)filteredperception.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> martin.x.long(a)jpmchase.com wrote:
> > Douglas McClendon <dmc.fedora(a)filteredperception.or wrote:
> >
> > >If that doesn't help or answer you question, try to add more detail
to
> > >your question.
> >
> > Douglas -
> >
> > Thanks for the reply.
> >
> > I use the live usb tools to create my live USB stick with a 2047 MB
> > overlay. I boot from it and let it run updates. I reboot the LiveUSB
to
> > make sure it still boots, then I shut down. I boot a system on a copy
> > of Fedora 9 on the hard drive and plug in my Live USB so I can see the
> > files on my USB stick.
> >
> > I see 2 folders:
> > LiveOS
> > and
> > syslinux
> >
> > in the LiveOS folder I see three files:
> > osmin.img
> > overlay-FEDORA-3099-53F2
> > and
> > squashfs.img
> >
> > ======
> > assumptions
> >
> > squashfs.img looks to be the size of the live iso
> > overlay-FEDORA-3099-53F2 looks to be the size of the overlay and has
> > overlay in the file name
> > osmin.img is only 8k probably a boot strap, I'm not sure.
>
> osmin.img is part of an optimization used during the install-to-disk
> process. Interesting long story, but should not be relevant here.
>
> > =======
> >
> > I'm sorry, I can't find anything on the LiveUSB file structure on the
> > WiKi. I've signed on as a writer for the Fedore project so I'd like
to
> > write it once I figure out what it is.
>
> Sounds like a good plan. I don't have the free time I used to when I
> was happily unemployed, but I'll try to help.
>
>
> > I was hoping that I could backup the overlay file and the syslinux
> > folder from my completely updated LiveUSB stick and restore them to a
> > newly built LiveUSB from my backup.
>
> I think this should work, but there may be some subtle wording here.
> What you said almost sounds like boiling down to doing a straight
> duplication of a LiveUSB, which AFAIK should work. To the extent that
> it doesn't work, we should focus on how what you are doing is different
> than a pure duplication.
>
> >
> > > I'm not entirely sure what you mean. One thing that is possible is
to
> > > copy the overlay file from one liveusb and put it on another.
Though
> > > the format of the overlay file is inherently tied to the specific
liveos
> > > it was originally with. I.e. you won't be able to copy an overlay
file
> > > from an f9-x86 liveusb onto an f9-x64 or f10-x86 liveusb. Or even
a
> > > customized f9-x86 liveusb that you created with
livecd-creator/tools.
> >
> > Nothing fancy - The same USB stick, built in the same way with the
same
> > iso and the same overlay size.
> >
> > The overlay file name changes. I've given the updated file (the
overlay
> > that was part of the LiveUSB for all of the updates) the same name as
> > the new file that is created and left the updated file with its
original
> > name. I've overwritten just the overlay itself and the overlay and
every
> > combinarion of the osmin.img and squashfs.img files.
>
> This sounds reasonable. Now, if this is a new LiveUSB built from the
> same LiveCD, the osmin.img and squashfs.img should be 100% identical.
> Same file sizes, same md5sums. If they aren't, mention that.
>
I always build from the same .iso using a script so everything is built
identically. The overlay file name does change every time though.
>
> >
> > I could never get it to boot. The boot starts but then hangs.
>
> What is the last thing you see when it hangs?
>
=================================================
Decompressing Linux... done.
Booting the kernel.
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sdb] Assuming drive cache: write through
----------------------------------------------------------
WARNING: Cannot find root file system!
----------------------------------------------------------
Create symlink /dev/root and then exit this shell to continue the boot
sequence.
bash-3.2#
=================================================
I can't find the symlink command anywhere in this limited recovery shell.
I don't know where this little root directory is so I can move commands
and scripts into it (before I back up) to help me recover or avoid banging
out to this shell.
>
> > Ideally, it would be great to specify the overlay and the syslinyx
> > folder that goes with that overlay in the command line to build the
> > LiveUSB.
>
> Unfortunately the syslinux folder is hard coded and is a limitation of
> syslinux (actually you get 2 or 3 choices, but not an arbitrary choice).
> The overlay file name is part of our code, and is keyed off of the
> UUID of the usb disk (in this case). I can't say off the top of my head
> (it's been awhile) whether making the filename specifiable on the
> commandline is trivial or not.
>
> >
> > At this point I would be thrilled if I could get a set of manual steps
> > together to have an updated system without going through the update
> > process. I loose a day each time.
>
> If I find the time, I'll try to reproduce your problem. An absolute
> brute-force method that should work for identical sized usbsticks would
> be a bit for bit copy. I.e. if you set up one 4G LiveUSB and it works,
> you should be able to plug it in, and if it is seen as perhaps /dev/sdX
> and then you plug in another 4G usbstick seen as /dev/sdY, you should be
> able to run
>
> dd if=/dev/sdX of=/dev/sdY
I actually started with something like this only created an output file of
/usr/MLONG01/usbiso. This was ok with my 1 gig stick but it was to small
to install apps and run updates, so I upgraded.
I could actually restore a bootable USB from that file which would work in
a pinch. The problem is that I'm using a 16Gig USB stick and my back up
files would be 16Gig each and take hours to create and restore. It
actually takes longer than building the bootable USB and running the
updates. On the plus side I can do a restore without an internet
connection or interaction. Unfortunately, these files are just too big to
work with.
>
> and get a working clone. (note, you may have the partition visible as
> /dev/sdX1, but use the whole device as above for the duplication).
>
> >
> > > From an engineering standpoint, of course anything is possible. One
> > > use case I see, is to use the persistence feature to add an entry
to
> > > fstab, such that say, /mnt/data mounts to a ext3fs image located on
a
> > > file on your liveusb. You can then add a user that has a home
directory
> > > under there, and perhaps install applications under there. In this
way,
> > > you could then copy that ext3fs image file to an f10 liveusb, and
then
> > > only have to re-do the fstab and passwd modifications, such that
> > > everything now pretty much looks the same.
> >
> > Your suggestion of building a file structure that would transcend
> > different releases would be awesome but alas I need to crawl before I
> > can run.
> >
> > Any help would be greatly appreciated.
>
> Hope the above helps. And as mentioned, if I find the time, I'll try to
> reproduce your less brute-force method of copying, which sounds pretty
> reasonable, but clearly isn't working for some reason or another.
>
> And just post any wiki/work-in-progress and I'll be happy to provide
> feedback.
What I know of the LiveUSB file structure is not yet WiKiworthy.
Are my assumptions correct regarding squashfs.img and
overlay-FEDORA-3099-53F2?
>
> -dmc
>
Thanks Again
Martin
-----------------------------------------
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.
Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.
15 years, 9 months
Re: How do I save and restore my overlay?
by martin.x.long@jpmchase.com
Douglas McClendon <dmc.fedora(a)filteredperception.or wrote:
>If that doesn't help or answer you question, try to add more detail to
>your question.
Douglas -
Thanks for the reply.
I use the live usb tools to create my live USB stick with a 2047 MB
overlay. I boot from it and let it run updates. I reboot the LiveUSB to
make sure it still boots, then I shut down. I boot a system on a copy of
Fedora 9 on the hard drive and plug in my Live USB so I can see the files
on my USB stick.
I see 2 folders:
LiveOS
and
syslinux
in the LiveOS folder I see three files:
osmin.img
overlay-FEDORA-3099-53F2
and
squashfs.img
======
assumptions
squashfs.img looks to be the size of the live iso
overlay-FEDORA-3099-53F2 looks to be the size of the overlay and has
overlay in the file name
osmin.img is only 8k probably a boot strap, I'm not sure.
=======
I'm sorry, I can't find anything on the LiveUSB file structure on the
WiKi. I've signed on as a writer for the Fedore project so I'd like to
write it once I figure out what it is.
I was hoping that I could backup the overlay file and the syslinux folder
from my completely updated LiveUSB stick and restore them to a newly built
LiveUSB from my backup.
> I'm not entirely sure what you mean. One thing that is possible is to
> copy the overlay file from one liveusb and put it on another. Though
> the format of the overlay file is inherently tied to the specific liveos
> it was originally with. I.e. you won't be able to copy an overlay file
> from an f9-x86 liveusb onto an f9-x64 or f10-x86 liveusb. Or even a
> customized f9-x86 liveusb that you created with livecd-creator/tools.
Nothing fancy - The same USB stick, built in the same way with the same
iso and the same overlay size.
The overlay file name changes. I've given the updated file (the overlay
that was part of the LiveUSB for all of the updates) the same name as the
new file that is created and left the updated file with its original name.
I've overwritten just the overlay itself and the overlay and every
combinarion of the osmin.img and squashfs.img files.
I could never get it to boot. The boot starts but then hangs.
Ideally, it would be great to specify the overlay and the syslinyx folder
that goes with that overlay in the command line to build the LiveUSB.
At this point I would be thrilled if I could get a set of manual steps
together to have an updated system without going through the update
process. I loose a day each time.
> From an engineering standpoint, of course anything is possible. One
> use case I see, is to use the persistence feature to add an entry to
> fstab, such that say, /mnt/data mounts to a ext3fs image located on a
> file on your liveusb. You can then add a user that has a home directory
> under there, and perhaps install applications under there. In this way,
> you could then copy that ext3fs image file to an f10 liveusb, and then
> only have to re-do the fstab and passwd modifications, such that
> everything now pretty much looks the same.
Your suggestion of building a file structure that would transcend
different releases would be awesome but alas I need to crawl before I can
run.
Any help would be greatly appreciated.
Thanks again
Martin
-----------------------------------------
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.
Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.
15 years, 9 months