Commit Graph

148 Commits (049)

Author SHA1 Message Date
Frederick Grose 8dd7bb48fc dmsquash-live/apply-live-updates: Test proper file link.
Update flag link to /dev/root as required by commit
789668deb3.
2018-09-06 11:46:24 +02:00
Frederick Grose 44d1688164 dmsquash-live-root: Manage absent overlayfs module better.
die when required; systemctl reload otherwise.
2018-09-06 11:46:24 +02:00
Frederick Grose a7d8fc280c dmsquash-live: Avoid grep and sed in this module.
strstr and variable string manipulations suffice.
2018-09-06 11:46:24 +02:00
Frederick Grose eb18a1fe29 dmsquash-live, livenet: Simplify OverlayFS read-only overlay setup.
Use multiple lower layer directories in a single OverlayFS mount with
  a transient overlay directory.
Tolerate a command line with rd.live.overlay.readonly and NO persistent
  overlay by reconfiguring the OverlayFS mount options.
Use more compatible shell syntax for testing symlinks, and use printf
  instead of echo -e.
2018-08-21 10:52:34 +02:00
Frederick Grose 789668deb3 dmsquash-live: Support a flattened squashfs.img
A simplified root filesystem structure may be provided for OverlayFS
overlays by squashing the root filesystem directly instead of squashing
an embedded image file at /LiveOS/rootfs.img.  Detect and configure
such a squashed root filesystem for live booting.

For OverlayFS boots, avoid the read-only Device-mapper linear device
  at /dev/mapper/live-base.
Create a consistent device link at /dev/live-base for the read-only
  base loop device for all overlayed live root filesystems.
Consistently provide a link at /dev/root for wait_for_dev.

Update documentation.
2018-08-21 10:52:34 +02:00
Frederick Grose e791d753be livenet: Enable OverlayFS overlay in sysroot.mount generator.
Adjust sysroot.mount configuration for rd.live.overlay.overlayfs option.
Use link at /dev/root as a consistent flag for wait_for_dev.
Adjust documentation.
2018-08-20 10:08:43 +02:00
Lukas Nykryn c42c387cca 90dmsquash-live: we don't have find_binary inside initramdisk 2018-01-11 13:31:43 +01:00
Frederick Grose b1e1b6cba3 dmsquash-live-root: Replace incompatible shell syntax.
Fix issue #279  supercede PR #299
Fix bug https://issues.openmandriva.org/show_bug.cgi?id=2219
Replace Bashisms in the boot message for a missing overlay.
Verify presence of plymouth before calling it.
(Rework of commit f1b65e92af5e3f9df79f99e55d5aa936c9bca940.)
2017-11-05 02:19:10 -05:00
Zbigniew Jędrzejewski-Szmek 38ff9dfbe5 dmsquash-generator.sh: properly escape backslash in path
We need an actual bashslash in the filename on disk.

https://bugzilla.redhat.com/show_bug.cgi?id=1508794
2017-11-02 17:07:09 +01:00
Michal Sekletar 28401778c4 systemd: fix setting of timeouts for device units
JobRunningTimeoutSec now affects how long can start jobs for device
units stay in the "running" state. Disabling default job timeout via
JobTimeoutSec=0 doesn't disable running state timeout. We need to set
running state timeout as well.

Note that doing this the other way around has effect on generic timeout,
i.e. disabling running state timeout disables generic timeout. But doing
it this way we would create implicit dependency on fairly new
systemd-234. However, by setting both options we don't create dependency
on specific systemd version.
2017-10-06 10:05:25 +02:00
Robert Scheck 37437cac8a Add NTFS support to 90dmsquash-live module (#191)
Support booting from USB media with NTFS filesystem (optionally),
which removes the FAT32 related 4 GB file size limit for LiveOS/
squashfs.img (and any other file on the same USB media).
2017-06-30 00:15:57 +02:00
Frederick Grose ea765c0ee1 dmsquash-live-root: Avoid mount source conflict on $BASE_LOOPDEV.
The newer mount utilities are more strict about directly shared
devices. For OverlayFS boots, which mount $BASE_LOOPDEV directly,
avoid a mount error by indirectly sharing the read-only base
filesystem through a second, over-attached $BASE_LOOPDEV for
the DM live-base target.
2017-04-09 11:23:12 -04:00
Frederick Grose 3c6337f68e dmsquash-live-root: Extend rd.live.overlay.readonly support
Support the rd.live.overlay.readonly option for writable images,
such as rd.live.overlay=none and rd.writable.fsimg.
2017-03-11 19:14:26 -05:00
Frederick Grose f1b65e92af dmsquash-live-root: Provide enhanced feedback on missing overlay.
Provide a more prominent alert to the user if an overlay is
missing or the overlay module is not available and a temporary
overlay will be provided.  This, to avoid losing data intended to
persist.
2017-03-11 00:43:05 -05:00
Frederick Grose ea28824027 Enable the use of the OverlayFS for the LiveOS root filesystem.
Integrate the option to use an OverlayFS as the root filesystem
into the 90dmsquash-live module for testing purposes.

The rd.live.overlay.overlayfs option allows one to request an
OverlayFS overlay.  If a persistent overlay is detected at the
standard LiveOS path, the overlay & type detected will be used.

Tested primarily with transient, in-RAM overlay boots on vfat-
formatted Live USB devices, with persistent overlay directories
on ext4-formatted Live USB devices, and with embedded, persistent
overlay directories on vfat-formatted devices. (Persistent overlay
directories on a vfat-formatted device must be in an embedded
filesystem that supports the creation of trusted.* extended
attributes, and must provide valid d_type in readdir responses.)

The rd.live.overlay.readonly option, which allows a persistent
overlayfs to be mounted read only through a higher level transient
overlay directory, has been implemented through the multiple lower
layers feature of OverlayFS.

The default transient DM overlay size has been adjusted up to 32 GiB.
This change supports comparison of transient Device-mapper vs.
transient OverlayFS overlay performance.  A transient DM overlay
is a sparse file in memory, so this setting does not consume more
RAM for legacy applications.  It does permit a user to use all of
the available root filesystem storage, and fails gently when it is
consumed, as the available free root filesystem storage on a typical
LiveOS build is only a few GiB.  Thus, when booted on other-
than-small RAM systems, the transient DM overlay should not overflow.

OverlayFS offers the potential to use all of the available free RAM
or all of the available free disc storage (on non-vfat-devices)
in its overlay, even beyond the root filesystem available space,
because the OverlayFS root filesystem is a union of directories on
two different partitions.

This patch also cleans up some message spew at shutdown, shortens
the execution path in a couple of places, and uses persistent
DM targets where required.

Documentation is updated for these changes.
2017-03-11 00:42:19 -05:00
Harald Hoyer de7ab164dd dmsquash-live/dmsquash-live-root: det_img_fs() redirect udevadm output to stderr
Otherwise the output is taken as input for modprobe.
2016-10-13 09:20:33 +02:00
Harald Hoyer ce9a398771 dmsquash-live/dmsquash-live-root.sh: SQUASHED can be set earlier
8b5ee88ff6 removed the check for SQUASHED,
assuming, that the if clause above was the only place, where SQUASHED is
set.

This patch reverts to the old logic, because SQUASHED can be set
earlier.
2015-12-01 08:52:00 +01:00
Harald Hoyer 6ed1d9fd07 dmsquash-live/dmsquash-live-root.sh: fixed typo 2015-11-26 15:50:39 +01:00
Harald Hoyer 03de49609c Merge pull request #97 from FGrose/dmsquash-live-root
dmsquash-live-root:  Persistence without overlay for uncompressed live installations
2015-11-23 11:07:43 +01:00
Frederick Grose 8b5ee88ff6 dmsquash-live-root: Avoid an overlay for persistent, uncompressed, read-write live installations.
Persistent, uncompressed live installations can avoid overlays with a new rd.live.overlay=none flag.
Non-persistent rd.live.ram boots can also take advantage of persistent home.img filesystems.
2015-11-20 23:38:12 -05:00
Harald Hoyer fc146519f9 Merge pull request #103 from FGrose/metadata
dmsquash-live-root: Use non-persistent metadata snapshots.
2015-11-11 11:36:47 +01:00
Frederick Grose 49c9d8174f dmsquash-live-root: Use non-persistent metadata snapshots.
Transient snapshots can take advantage of smaller,
   non-persistent metadata structures.
Make the --readonly option explicit rather than inferred
   for the readonly_overlay target.
Assure that the live-base target is on the BASE_LOOPDEV.
2015-11-09 10:46:27 -08:00
Frederick Grose 97be933592 dmsquash-live-root: Request overflow support for persistent snapshot. 2015-11-09 09:45:07 -08:00
Frederick Grose 0ea86cb727 dmsquash-live-root: Use non-persistent metadata snapshots for transient overlays.
Temporary snapshots can take advantage of smaller, non-persistent metadata structures.
Make the --readonly option explicit rather than inferred for the readonly_overlay target.
Assure that the live-base target is on the BASE_LOOPDEV.
2015-10-09 16:23:58 -04:00
Harald Hoyer f4d64d55ea dmsquash-generator.sh: increase timeout for checkisomd5
if the checkisomd5 takes longer than 3 minutes, the device timeout for
/dev/mapper/live-rw cancels the boot process.
2015-07-18 13:02:25 +02:00
Harald Hoyer 3d579309cd dmsquash-live/dmsquash-live-root.sh: fixup checkisomd5 for systemd
systemd does not like a leading "-" for unit template filenames anymore.
2015-07-07 13:44:13 +02:00
Harald Hoyer 2c66c3bccf dmsquash-live: add dmsquash-generator 2015-06-15 11:31:10 +02:00
Harald Hoyer 8ff624df9f dmsquash-live: install a sysroot.mount generator for systemd
otherwise systemd uses its own sysroot.mount line
2015-06-11 17:39:31 +02:00
Harald Hoyer 4851deca54 dmsquash-live/apply-live-updates.sh: needs 'find'
also add /run/initramfs/live/updates as a directory, where to pull
the updates from

https://bugzilla.redhat.com/show_bug.cgi?id=1213736
2015-04-24 12:18:53 +02:00
Fabian Deutsch b0472eac11 dmsquash: Add squashfs support to rd.live.fsimg
Previously rd.live.fsimg only supported filesystems residing in
(compressed) archives.
Now rd.live.fsimg can also be used when a squashfs image is used.
This is achieved by extracting the rootfs image from the squashfs and
then continue with the default routines for rd.live.fsimg.
In addition some code duplication got removed and some documentation
got added.

Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-02-19 10:59:54 +01:00
Fabian Deutsch d6e34d362a dmsquash: Add rd.live.overlay.thin
This option changes the underlying mechanism for the overlay in the
dmsquash module.
Instead of a plain dm snapshot a dm thin snapshot is used. The advantage
of the thin snapshot is, that the TRIM command is recognized, which
means that at runtime, only the occupied blocks will be claimed from
memory, and freed blocks will really be freed in ram.

Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-02-19 10:59:54 +01:00
Radek Vykydal 18423f7951 Add rd.live.overlay.size option 2015-01-21 14:10:27 +01:00
Harald Hoyer 1f8abe81a9 dmsquash-live: setup the images in /run/initramfs
We want to cleanup / after switch_root. Placing the loop files in /
works, but it is more sane to put them in /run/initramfs
2014-12-16 12:53:18 +01:00
Harald Hoyer 370035d561 dmsquash-live: do not abort, if user pressed ESC on checkisomd5
If the user pressed ESC while checkisomd5 runs the media check, it will
exit with "2". Previously that would mean, that the media check was not
successful.
2014-11-25 13:44:54 +01:00
Harald Hoyer d829e7fce2 dmsquash-live: addresss the device via it's symlink
Otherwise multipath parts might be passed, before it's assembled.

https://bugzilla.redhat.com/show_bug.cgi?id=1152948
2014-10-24 11:16:26 +02:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Major Hayden 504c0a8fec Adding support for read/write filesystem images
A user can provide a filesystem image (rootfs.img) inside a compressed
tarball and that filesystem image will be mounted read/write.  This provides
some benefits over a device mapper snapshot overlay, especially when the
live system becomes full.  The boot command line simple needs
"rd.writable.fsimg" added to utilize this feature.

Additional documentation for this option as well as other live boot
options is included.

Signed-off-by: Major Hayden <major@mhtx.net>
2014-08-15 16:05:19 +02:00
Harald Hoyer 352d557d4d Do not reload systemd with wait_for_dev 2014-02-05 13:12:29 +01:00
Harald Hoyer ba9368fa4f dmsquash-live/dmsquash-liveiso-genrules.sh: s/loop0/loop-control/
If loop is a kernel module, /dev/loop0 will never show up as a udev
event, if the loop module is not manually loaded somewhere.
2014-01-28 18:33:36 +01:00
Brian C. Lane 3622d6d7b0 dmsquash-live: add /dev/mapper/live-base
This is similar to the reason for adding the
/run/initramfs/live-baseloop symlink -- access to the original live
image without overlays.

livemedia-creator does not create a osmin.img, so there is no mountable
device for it to use when rsyncing the live image to the target. It
needs a device that points to the original live image without overlays.

Note that lmc won't be creating osmin.img, since really isn't needed any
longer. Its purpose was to provide a minimal image that could be dd'd to
the target. Now that we use rsync this is no longer necessary.

The included patch adds a /dev/mapper/live-base device that Anaconda can
use whether or not there is an osmin present.
2013-10-08 15:13:44 +02:00
Harald Hoyer 8bcfd683bd */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
Harald Hoyer e6aafacb23 dmsquash-live/iso-scan: do the iso scan regardless of /dev/loop0
The loop driver could be a module and would never be loaded, so the
iso-scan never takes place.

To let the iso-scan happen, it is now placed into the initqueue/settled
unconditionally.
2013-09-09 16:49:45 +02:00
Harald Hoyer 8d3d72a68c no more global $CMDLINE
Do not use the global variable CMDLINE anymore. Use
CMDLINE=$(getcmdline)
2013-09-05 09:57:48 +02:00
Harald Hoyer af11946054 dracut-functions.sh: inst_multiple == dracut_install 2013-08-07 10:33:15 +02:00
Harald Hoyer 1e057b352a add PARTLABEL and PARTUUID 2013-07-05 15:32:38 +02:00
Harald Hoyer 32bd2fbb4c use "rm --" to guard against filenames beginning with "-" 2013-06-28 10:31:18 +02:00
Harald Hoyer aef0f55791 dmsquash-live/iso-scan: wait until the iso-scan/filename is found
Do not only run once, but wait until all devices are found.
2013-06-12 12:49:03 +02:00
Harald Hoyer d18fd0235b dmsquash-live/dmsquash-live-root.sh: fixup 32214acb3a 2013-05-31 09:04:55 +02:00
Harald Hoyer 32214acb3a dmsquash-live/dmsquash-live-root.sh: add parameter rd.live.squashimg
rd.live.squashimg names the squash image in the rd.live.dir
and defaults to squashfs.img

https://bugzilla.redhat.com/show_bug.cgi?id=789036
https://bugzilla.redhat.com/show_bug.cgi?id=782108
2013-05-30 09:27:54 +02:00
Harald Hoyer 14499534ba dmsquash-live: add support for "iso-scan/filename" kernel parameter
now you can write grub entries like

  set isofile="/Fedora-live.iso"
  loopback loop $isofile
  linux loop)/isolinux/vmlinuz iso-scan/filename=$isofile root=live:CDLABEL=Fedora-...
  initrd (loop)/isolinux/initrd0.img
2013-04-15 11:39:32 +02:00