Red Hat Bugzilla – Bug 448030
RFE: create a bootable Live USB stick from the running livecd
Last modified: 2013-03-13 01:43:28 EDT
Description of problem:
This would be a very nice enhancement. Refer http://klik.atekon.de/liveusb/ for
a potential implementation.
This actually would work today in the basic case -- just livecd-iso-to-disk
/dev/live /path/to/usb/stick. Doing more would be more suited for Luke's tool
rather than the main livecd-tools
/me seconds the request.
Jeremy, is this still supposed to work? I can't seem to get it to work, as livecd-iso-to-disk just displays the help.
Can you run with sh -x and show how it fails?
(although again, liveusb-creator should be preferred -- not the shell script)
From what I remember, we did not want to include the liveusb-creator on the live images due to it pulling in the fairly large PyQt. Since it looks like we're not longer targeting normal CD-R's for Fedora 13, we could potentially add the liveusb-creator to do the default image.
Please see http://lists.sugarlabs.org/archive/soas/2010-April/000998.html
for a method based on a modified livecd-iso-to-disk.
Review and testing needed.
Created attachment 404761 [details]
a modified livecd-iso-to-disk script
See also comments in this post to the livecd list:
Created attachment 406157 [details]
newer version with expanded usage sections and some bug fixes (will submit them as individual patches to tools_livecd-iso-to-disk.sh to make review easier.)
Created attachment 406158 [details]
This is an updated help file in .pod format.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Created attachment 432663 [details]
Add --copy-overlay & --copy-home options
The --copy-overlay and --copy-home additions extend the utility of the script to allow the user/learner to replicate their personally-modified image.
There are many white-space changes that I couldn't avoid in order to clarify the local variable name changes made to match the broader scope of the script (for example, $ISO to $SRC and $USBDEV to $TGTDEV). In addition, there are some block order changes that make use and documentation easier to follow.
I also standardized the Bash conditional expression and list pipeline style to the more modern, [[ Expression ]] && [[ Expression ]] format. (See http://wiki.bash-hackers.org/syntax/ccmd/conditional_expression.)
This means that variables within the special double brackets need not be quoted and the old test-type operators -a -o should not be used.
I'm sorry that all the changes may make review more critical, but it was practically necessary.
Created attachment 432664 [details]
man page changes for the copy.patch
man page changes to accompany the copy.patch
Created attachment 432665 [details]
Add --builder-message & --releasefile options
The --builder-message and --releasefile options label the remixed image to prevent confusion with the pristine versions, and to credit the builder for their changes.
Created attachment 432666 [details]
man page changes for the builder & releasefile patches
Man page patches to accompany the builder-message and releasefile patch.
Created attachment 432667 [details]
add --help option to the livecd-iso-to-disk script
Because the livecd-iso-to-disk script is so often redistributed in standalone fashion, it is worth the space and effort to include usage documentation and help in the script itself. This should help the general understanding of the script and its methods, given its presently-limited documentation.
Created attachment 432669 [details]
man page for all help file changes
This is a patch to update the man page help file with all the changes.
Created attachment 432670 [details]
The proposed, new help file complete
A complete version of the help file, livecd-iso-to-disk.pod
Mailing list post for cross referencing list discussion,
Created attachment 432997 [details]
combined changes to livecd-iso-to-disk.sh
I've attached a full script with all of the proposed changes including some bug fixes, help message and code format refinements (especially on combined conditional expressions).
This should make smoke testing easier.
Created attachment 438775 [details]
changes to edit-livecd to permit cloning of live image
This is an incomplete change to show work in progress.
The goal is to support cloning of an existing image along with resparsing the operating system so that the overlay can be reset and a livecd.iso file could be generated, if desired.
The attached edit-liveos and .diff files will show the approach and current state of development.
Due to bugs in the shutil.copytree() function, I've used rsync to copy the filesystem. This seems fast and allows greater customization, if desired, by use of per directory .rsync-filter files.
Created attachment 438777 [details]
incomplete edit-liveos version of edit-livecd
See previous comment.
These changes are hard for me to follow, it would be easier to track if you posted patches of distinct changes, made against the master branch of the livecd tools git repository at http://git.fedorahosted.org/git/livecd
Created attachment 464912 [details]
Rename source- and target-related variables
Code variable name changes to remove ambiguity resulting from their new roles in supporting propagation of Live images from installed USB/SD devices.
See the following patches for the logic and documentation changes.
Created attachment 464913 [details]
Add support for Live image propagation from installed sources
Created attachment 464916 [details]
Update usage manual & add it to the script
The vastly expanded documentation is provided to support the propagation of images from an installed instance and because the script is distributed independently.
(The script options were reordered to support following the onboard documentation.)
Mailing list posts:
Created attachment 475754 [details]
alpha version of edit-livecd variant
An alpha working version of a proposed replacement for edit-livecd.
This script allows one to rebuild a custom iso image from a running image by staging the build on an attached hard drive and using only the content already on the current image.
See this mailing list posting,
for more details.
Review and testing would be appreciated.
I had to hack the system /tmp directory to bypass the hardwired use of /tmp in fs.py.resize2fs(). More robust alternatives would be appreciated.
I suggest that you add a way to specify compression type and switch the default type to xz to match livecd-creator. Several official live images are looking like they will be oversize without using xz. (If this is going to get included in older releases, gzip should remain the default in those releases.)
Another option for the default is to match the compression type used on the iso you are starting with. That probably makes even more sense than a fixed default. You can use unsquashfs -s to retrieve the compression type used for squashfs-tools 4.1 and 4.2; I am not sure about 4.0. (F13 has 4.0, F14 4.1 and F15 4.2.)
Created attachment 477571 [details]
changes to edit-livecd to permit cloning of live images
A late alpha version patch to edit-livecd to enable cloning of a running LiveOS image into a fresh iso.
Depends on pending patches to live.py and fs.py for squashfs_compression_type().
Created attachment 477572 [details]
Enable reading of SquashFS compression type.
Patch submitted to the mailing list:
Support edit-livecd & livecd-creator base_on image options by
adding the capability in fs.py to read the base_on image
compression type. Specifying a compressor type will override
the default; specifying 'None' will trigger reading and using
the base_on image's compression type.
Created attachment 477575 [details]
late alpha version of edit-liveos
This is the full edit-liveos.py script.
Note: the imports have temporary versions specified for fs, live, & creator.py due to the pending updates for squashfs_compression_type().
livecd-tools-15.4-1.fc15 has been submitted as an update for Fedora 15.
livecd-tools-15.4-1.fc15 has been pushed to the Fedora 15 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update livecd-tools'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/livecd-tools-15.4-1.fc15
Created attachment 479013 [details]
Support attached LiveOS devices, adjust iso naming, restore script option
Wasn't expecting the previous commit, so here is a catchup patch:
Support attached LiveOS devices as well as image files for LiveOS editing.
Adjust naming of iso, log the iso name, adjust usage text, restore script
livecd-tools-15.5-1.fc15 has been submitted as an update for Fedora 15.
livecd-tools-15.5-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
Created attachment 485909 [details]
Enable live-mounting of LiveOS device together with an active overlay
A standalone tool to help in working with attached LiveOS-bearing partitions.
Created attachment 492141 [details]
Support usage within a booted LiveOS instance
Provided functions to add new loop devices (and remove them before exit) to support using this script in a running LiveOS instance.
Created attachment 492146 [details]
Support refreshing of attached LiveOS devices
Added features to support refreshing an attached LiveOS source image with a renewed rootfs and freshed overlay and, optionally, skip building a new .iso file.
Still need code for refreshing a running LiveOS instance (by switching the rootfs).
Created attachment 492152 [details]
Beta version of editliveos.py
Full beta version of editliveos.py.
Still lacking code to support refreshing of running LiveOS image (by switching the
rootfs back and forth).
Propose that the filename be changed from edit-livecd to editliveos.py to reflect its broader capability and support importing in Python interactive.
Created attachment 492153 [details]
Add --copy-home and --include options to livecd-iso-to-disk
Support installation of customized builds with --copy-home and --include options.
This complements new editliveos.py capabilities.
Created attachment 492154 [details]
Document --copy-home and --include options
Document --copy-home and --include options for manual.