Changes

Jump to navigation Jump to search
no edit summary
Line 6: Line 6:     
{{Message|'''Latest news''':
 
{{Message|'''Latest news''':
'''10 February 2011''': A new bundle, named '''[[#SoaS-remix|SoaS-remix]]''', has been prepared, which includes edit-liveos.py with a launcher named 'liveos-disk-to-iso', and temporary versions of fs.py, live.py, creator.py (pending livecd-tools acceptance).  
+
'''23 September 2012''': I've updated editliveos.py with bug fixes and simplificationsRun it in from a folder with these files:
  The SoaS-remix bundle will inject itself into the image, unbundle itself into /tmp,
+
https://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/trees/master/editliveos
launch edit-liveos.py (with editable options), then cleanup /tmp.
  −
Sugar Clone is now in a Sugar on a Stick repository clone at http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions.
     −
'''28 January 2011''': An alpha version of a python script that allows one to rebuild a custom iso image from a running image by 1.) staging the build on an attached hard drive and then 2.) copy only the content already on the current image. See http://www.mail-archive.com/soas@lists.sugarlabs.org/msg02044.html See '''[[#edit-liveos.py]]''' below.}}
+
There is also a new Bash script, LiveOS-merge, for merging a LiveOS snapshot and refreshing an installation with the new image. (A new
 +
osmin.img is not created, but it is only used during installation of a traditional image from a LiveOS image.)
 +
 
 +
'''17 June 2012''': I've posted my working files for a new version of edit-livecd, which I named editliveos.py in this commit,
 +
http://git.sugarlabs.org/soas/sugar-clone-extensions/commit/8c4e03323fc9a7e630e6c62213bb842909fbaa00
 +
 
 +
See my comments in this mailing list post,
 +
http://www.mail-archive.com/livecd@lists.fedoraproject.org/msg01506.html
 +
 
 +
It includes several new options for adjusting the image filesystem size as well as home.img and overlay file sizes. Expand the [[#editliveos.help]] listing below.
 +
 
 +
It includes editliveos.py, liveimage-mount, and temporary versions of fs.py, live.py, creator.py, util.py (pending incremental patches for livecd-tools acceptance).  The livecd-iso-to-disk version is not up-to-date with all the recent changes and improvements.}}
      Line 105: Line 114:  
===Notes===
 
===Notes===
   −
These scripts have been tested with SoaS-Mirabelle (available at http://alt.fedoraproject.org/pub/alt/nightly-composes/soas/) but should work with other versions of SoaS.
+
These scripts have been tested with SoaS-Mirabelle (available at http://download.sugarlabs.org/soas/releases/soas-3-mirabelle.iso) but should work with other versions of SoaS.
    
The current version of the script has the /bin/bash shell specified without the -x (xtrace) option.  Set this option, #!/bin/bash -x in the first line of the script to aid testing.  When set, the script will show a lot of output on the screen as it runs.
 
The current version of the script has the /bin/bash shell specified without the -x (xtrace) option.  Set this option, #!/bin/bash -x in the first line of the script to aid testing.  When set, the script will show a lot of output on the screen as it runs.
Line 144: Line 153:  
The script is available at http://people.sugarlabs.org/fgrose/SugarClone and is displayed from there below.<br>
 
The script is available at http://people.sugarlabs.org/fgrose/SugarClone and is displayed from there below.<br>
 
Embedded help, which describes the script and its usage in greater detail, is available in the script below (There is a 'shortusage()' section followed by a more complete 'usage()' section).
 
Embedded help, which describes the script and its usage in greater detail, is available in the script below (There is a 'shortusage()' section followed by a more complete 'usage()' section).
{{Iframe|collapsed=|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/newSugarStick#line52|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/newSugarStick#line52|800|342|1}}
+
{{Iframe|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/newSugarStick#line52|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/newSugarStick#line52|800|600|1}}
    
===Sugar Cellar===
 
===Sugar Cellar===
 
A small, utility script, available in the bundle, or separately.  It is used to report on the storage space available on the persistent overlay, home directory, and other file spaces attached to the running image.  
 
A small, utility script, available in the bundle, or separately.  It is used to report on the storage space available on the persistent overlay, home directory, and other file spaces attached to the running image.  
   −
{{Iframe|collapsed=|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/SugarCellar|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/SugarCellar#line4|800|200|1}}
+
{{Iframe|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/SugarCellar|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/SugarCellar#line4|800|600|1}}
 
===Bundle===
 
===Bundle===
{{Iframe|collapsed=|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/bundle|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/bundle#line4|800|200|1}}
+
{{Iframe|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/bundle|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/bundle#line4|800|600|1}}
 
===Launcher===
 
===Launcher===
{{Iframe|collapsed=|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/launcher|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/launcher#line4|800|200|1}}
+
{{Iframe|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/launcher|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/launcher#line4|800|600|1}}
 
===edit-liveos.py===
 
===edit-liveos.py===
 
* The edit-liveos script can be thought of as a "liveos-disk-to-iso" script.  It takes the currently installed system and converts it back into an iso9660 image file&mdash;but with all the current customizations to the system and Learner files.
 
* The edit-liveos script can be thought of as a "liveos-disk-to-iso" script.  It takes the currently installed system and converts it back into an iso9660 image file&mdash;but with all the current customizations to the system and Learner files.
Line 160: Line 169:  
** ''livecd-iso-to-disk'' uses the --home-size-mb NNN options to specify the home.img installation.  
 
** ''livecd-iso-to-disk'' uses the --home-size-mb NNN options to specify the home.img installation.  
 
* With edit-liveos (disk-to-iso), a nearly-consumed overlay can be refreshed by rebuilding the system into a new, SquashFS image that re[[wikipedia:Sparse_file|sparse]]s the system files and repackages them into an iso installation file for reuse or distribution.
 
* With edit-liveos (disk-to-iso), a nearly-consumed overlay can be refreshed by rebuilding the system into a new, SquashFS image that re[[wikipedia:Sparse_file|sparse]]s the system files and repackages them into an iso installation file for reuse or distribution.
 +
====editliveos.help====
 +
Below is the output of editliveos --help in a working version from 25 January 2013.
 +
{{Show|'''editliveos.py --help'''|<pre>Usage:
 +
              editliveos.py: [options] <LiveOS_source>
 +
 +
              Edit a LiveOS image to insert files or to clone a customized
 +
              instance, rebuild the image into a new, .iso image installation
 +
              file, and refresh the source's persistent filesystem overlay.
 +
 +
              options:  [-n, --name <name>]
 +
                        [-o, --output <output directory>]
 +
                        [-k, --kickstart <kickstart-file>]
 +
                        [-S, --force-SELinux]
 +
                        [-s, --script <script.sh>]
 +
                        [-N, --noshell]
 +
                        [-t, --tmpdir <tmpdir>]
 +
                        [-T, --leave-tmpfiles]
 +
                        [-y, --yumcache <cachedir>]
 +
                        [-e, --exclude <exclude, s>]
 +
                        [-i, --include <include, s>]
 +
                        [-u, --seclude <seclude, s>]
 +
                        [-r, --releasefile <releasefile, s>]
 +
                        [-b, --builder <builder>]
 +
                        [--clone]
 +
                        [--refresh-only]
 +
                        [--skip-refresh]
 +
                        [-c, --compress-type <compression type>]
 +
                        [--compress]
 +
                        [--skip-compression]
 +
                        [--refresh-uncompressed]
 +
                        [--skip-minimize]
 +
                        [--skip-reboot]
 +
                        [--expand-image-gb [+[<size>]]
 +
                        [--shift-home-mb [+|-]<size>]
 +
                        [--adjust-overlay-mb [+|-]<size>]
 +
                        [-a, --extra-kernel-args <arg s>]
 +
                        [--extra-space-mb <size>]
 +
                       
 +
USAGE HELP  editliveos.py --help
 +
 +
              LiveOS_source must be entered as "live" to edit or clone the
 +
              currently running LiveOS image.  An attached LiveOS installed
 +
              device may be edited or cloned through its node id, such as
 +
              /dev/sdd1, or, if it is mounted, through its mount point path.
 +
              An .iso image file is addressed through its pathname, such as
 +
              /path/to/build.iso, or, if mounted, through the mount point
 +
              directory path.  A mounted Live CD-ROM image is addressed through
 +
              its device node, such as /dev/sr0.  Even a directory containing a
 +
              LiveOS and iso/syslinux folders with the appropriate files can be
 +
              edited or cloned through that parent directory path.
 +
 +
              The --clone option copies the home.img or persistent home folder
 +
              to the new build .iso file, allowing user customizations to be
 +
              replicated.  A new version of livecd-iso-to-disk with the
 +
              --copy-home installation option may be used to propagate clones.
 +
 +
              By default, other files and folders in the source device's outer
 +
              file system are included in the new build.  Options are provided
 +
              to --include, --exclude, and --seclude files or folders for the
 +
              new build.  The new builds are branded to distinguish them with
 +
              the --name, --builder, and --releasefile options.
 +
 +
              Space requirements for stageing the build files are estimated by
 +
              the script and compared to the space available in a -t <TMPDIR>
 +
              option.
 +
 +
              Invoke the --help option to learn about other optional features.
 +
             
 +
 +
Options:
 +
  -h, --help            show this help message and exit
 +
  -n NAME, --name=NAME  Name for the new LiveOS image (don't include .iso, it
 +
                        will be added.) Unless the name is prefixed with a
 +
                        colon, :, the build will be branded with a date-
 +
                        builder-Remix-releasename string, and the .iso will be
 +
                        named as NAME-arch-Ymd.HM
 +
  -o OUTPUT, --output=OUTPUT
 +
                        Specify directory location for the new .iso file.
 +
  -k KSCFG, --kickstart=KSCFG
 +
                        Path or URL to kickstart config file.
 +
  -S, --force-SELinux  Force setting SELinux attributes on install root.
 +
  -s SCRIPT, --script=SCRIPT
 +
                        Specify a script to run chrooted in the LiveOS
 +
                        filesystem hierarchy.
 +
  -N, --noshell        Specify no breaking to shell after edit.
 +
  -t TMPDIR, --tmpdir=TMPDIR
 +
                        Temporary directory to use for staging the build.
 +
                        (default: /var/tmp)
 +
  -T, --leave-tmpfiles  Skip deletion of temporary files and directories and
 +
                        unmounting of the edited image.
 +
  -y CACHEDIR, --yumcache=CACHEDIR
 +
                        Directory to use for for the yum cache. default: None
 +
                        (A temporary filesystem cache will be used.)
 +
  -e EXCLUDES, --exclude=EXCLUDES
 +
                        A string of filename patterns to exclude from the copy
 +
                        of the outer device filesystem.  See _copy_src_root().
 +
                        Denote multiple patterns as "pattern1, pattern2, ...".
 +
                        To exclude all device content except for the
 +
                        iso/syslinux and LiveOS directories, enter  "all".
 +
  -i INCLUDES, --include=INCLUDES
 +
                        A string of file or directory paths to copy to the
 +
                        .iso file in _copy_src_root().  Denote multiple files
 +
                        as "path1, path2, ..."  (The paths are referenced
 +
                        relative to the source mount directory, either
 +
                        /mnt/live/ or /run/initramfs/live for the running
 +
                        LiveOS, or /TMPDIR/editliveos-<random>/<srcmnt>/ for
 +
                        an attached or .iso file.  So ../../../<mount
 +
                        point>/INCLUDE or ../../../../<mount point>/INCLUDE
 +
                        may be used, respectively, to include files from other
 +
                        branches of the active hierarchy.)
 +
  -u SECLUDES, --seclude=SECLUDES
 +
                        A string of file or directory paths in the LiveOS
 +
                        filesystem to seclude from the final build
 +
                        configuration.  The user directory may be denoted with
 +
                        ~/.  Denote multiple files as "path1, path2, ..."
 +
  -r RELEASEFILE, --releasefile=RELEASEFILE
 +
                        Specify release file/s for branding.  Denote multiple
 +
                        files as "path1, path2, ..."
 +
  -b BUILDER, --builder=BUILDER
 +
                        Specify the builder of a Remix.
 +
  --clone              Specify copying of the home.img filesystem or the
 +
                        /home folder contents to the new .iso file.
 +
  --expand-image-gb=EXPAND_IMAGE_SIZE
 +
                        Specifies a new size of NN GiB for the image (or
 +
                        changing the size by a difference of +NN GiB, if a +
 +
                        sign is prefixed).  This is useful when a larger image
 +
                        is needed for a script, or during package updates in
 +
                        the chroot shell.
 +
  --shift-home-mb=SHIFT_HOME_MB
 +
                        Specify copying of the /home folder contents into a
 +
                        home.img filesystem of size NN MiB, or changing the
 +
                        size of an existing home.img filesystem to NN MiB (or
 +
                        by a difference of +NN or -NN MiB, if a sign is
 +
                        prefixed).  If NN = 0 (or nets to <= 0), the home.img
 +
                        filesystem contents will be shifted to the the /home
 +
                        folder, which is normally compressed; however, it
 +
                        subsequently will not have access to the --encrypted-
 +
                        home installation option of livecd-iso-to-disk.  If
 +
                        the selected or calculated size is insufficient for
 +
                        the current home contents, the edit will be to a size
 +
                        10% larger than the current home size.
 +
  --adjust-overlay-mb=ADJUST_OVERLAY_MB
 +
                        Specifies a new size of NN MiB for the overlay (or
 +
                        changing the size by a difference of +NN or -NN MiB,
 +
                        if a size is prefixed).  If NN = 0 (or nets to <= 0),
 +
                        no change will be made.
 +
  --refresh-only        Specify replacing the squashfs.img or rootfs_img of
 +
                        the source LiveOS installation instance with such
 +
                        files from the new build, and resetting any overlay.
 +
                        No new .iso installation file will be produced.
 +
  --skip-refresh        Specify no refreshening of source filesystems.
 +
  -c COMPRESS_TYPE, --compress-type=COMPRESS_TYPE
 +
                        Specify the compression type for SquashFS. Will
 +
                        override the current compression or lack thereof.
 +
  --compress            Specify compression for the filesystem imageUsed when
 +
                        overriding an uncompressed source.
 +
  --skip-compression    Specify building the .iso with an uncompressed root
 +
                        file system.
 +
  --refresh-uncompressed
 +
                        Specify refreshing the source with an uncompressed
 +
                        root file system.
 +
  --skip-minimize      Specify no osmin.img minimal snapshot.
 +
  -a KERNELARGS, --extra-kernel-args=KERNELARGS
 +
                        Specify extra kernel arguments to include in the new
 +
                        .iso file boot configuration.  Multiple arguments
 +
                        should be specified in one string, i.e., --extra-
 +
                        kernel-args "arg1 arg2 ..."
 +
  --extra-space-mb=EXTRA_SPACE_MB
 +
                        Specify extra space in MiB to reserve for unexpected
 +
                        staging area needs.
 +
 +
  Debugging options:
 +
    These options control the output of logging information during image
 +
    creation
 +
 +
    -d, --debug        Output debugging information
 +
    -v, --verbose      Output verbose progress information
 +
    -q, --quiet        Supress stdout
 +
    --logfile=FILE      Save debug information to FILE</pre>}}
 +
 
===SoaS-remix===
 
===SoaS-remix===
 
'''SoaS-remix''' is a bundle of edit-liveos.py and supporting scripts to make testing and use easier.
 
'''SoaS-remix''' is a bundle of edit-liveos.py and supporting scripts to make testing and use easier.
Line 171: Line 360:  
:{{Code|wget http://people.sugarlabs.org/fgrose/SoaS-remix}}
 
:{{Code|wget http://people.sugarlabs.org/fgrose/SoaS-remix}}
   −
====Usage====
+
====Recipe====
This is my recipe:
   
# Having used the ''livecd-iso-to-disk'' with --home-size-mb NNN to install my SoaS iso onto a Live USB device, I proceed to customize my working Stick with new Activites, content, or system settings as described [[#Introduction|above]] in step 2.
 
# Having used the ''livecd-iso-to-disk'' with --home-size-mb NNN to install my SoaS iso onto a Live USB device, I proceed to customize my working Stick with new Activites, content, or system settings as described [[#Introduction|above]] in step 2.
# Before copying ''SoaS-remix'' to the Live USB, it may be easiest to open it in an editor and adjust the {{Code|set}} command statement at line 80 to something appropriate for your system.<br>
+
# Before copying ''SoaS-remix'' to the Live USB, it may be easiest to open it in an editor and adjust the {{Code|set}} command statement at line 86 to something appropriate for your system.<br>
 
#:{{Code|# Example command line. Edit and uncomment the set statement below to suit.}}
 
#:{{Code|# Example command line. Edit and uncomment the set statement below to suit.}}
#:{{Code|#set -- -v -n SoaSremix -o /media/WD-ext4 -t /media/WD-ext4 -i /GPL \}}
+
#:{{Code|# set -- -v -n SoaSremix -o /media/WD-ext4 -t /media/WD-ext4 -i /GPL \}}
#:{{Code|# &nbsp; &nbsp; &nbsp; -r /boot/olpc_build --builder fgrose --clone /dev/live}}
+
#:{{Code|# &nbsp;&nbsp; &nbsp; &nbsp; -r /boot/olpc_build --builder fgrose --clone /dev/live}}
 
# I then copy ''SoaS-remix'' onto the USB device bearing a SoaS installation (to the /LiveOS/ folder on the device's filesystem).
 
# I then copy ''SoaS-remix'' onto the USB device bearing a SoaS installation (to the /LiveOS/ folder on the device's filesystem).
 
# Before running the ''SoaS-remix'' script bundle, I run these 2 system updates:
 
# Before running the ''SoaS-remix'' script bundle, I run these 2 system updates:
Line 228: Line 416:     
The script code is below:
 
The script code is below:
{{Iframe|collapsed=
+
{{Iframe
|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/edit-liveos.py
+
|https://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/editliveos/editliveos.py
|http://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/sugar-clone/edit-liveos.py#line4|800|200|1}}
+
|https://git.sugarlabs.org/~FGrose/soas/sugar-clone-extensions/blobs/master/editliveos/editliveos.py#line4|800|600|1}}

Navigation menu