You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.4 KiB

#!/bin/bash
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
[ -z "$root" ] && root=$(getarg root=)
# support legacy syntax of passing liveimg and then just the base root
if getargbool 0 rd.live.image -d -y liveimg; then
liveroot="live:$root"
fi
if [ "${root%%:*}" = "live" ]; then
liveroot=$root
fi
[ "${liveroot%%:*}" = "live" ] || exit 0
case "$liveroot" in
live:LABEL=* | LABEL=* | live:UUID=* | UUID=* | live:PARTUUID=* | PARTUUID=* | live:PARTLABEL=* | PARTLABEL=*)
root="live:$(label_uuid_to_dev "${root#live:}")"
rootok=1
;;
live:CDLABEL=* | CDLABEL=*)
root="${root#live:}"
root="$(echo "$root" | sed 's,/,\\x2f,g;s, ,\\x20,g')"
root="live:/dev/disk/by-label/${root#CDLABEL=}"
rootok=1
;;
live:/*.[Ii][Ss][Oo] | /*.[Ii][Ss][Oo])
root="${root#live:}"
root="liveiso:${root}"
rootok=1
;;
live:/dev/*)
rootok=1
;;
live:/*.[Ii][Mm][Gg] | /*.[Ii][Mm][Gg])
[ -f "${root#live:}" ] && rootok=1
;;
esac
[ "$rootok" != "1" ] && exit 0
GENERATOR_DIR="$2"
[ -z "$GENERATOR_DIR" ] && exit 1
[ -d "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR"
getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
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.
7 years ago
getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
[ -e /xor_overlayfs ] && xor_overlayfs="yes"
[ -e /xor_readonly ] && xor_readonly="--readonly"
ROOTFLAGS="$(getarg rootflags)"
{
echo "[Unit]"
echo "Before=initrd-root-fs.target"
echo "[Mount]"
echo "Where=/sysroot"
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.
7 years ago
if [ "$overlayfs$xor_overlayfs" = "yes" ]; then
echo "What=LiveOS_rootfs"
if [ "$readonly_overlay$xor_readonly" = "--readonly" ]; then
ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase
else
ovlfs=lowerdir=/run/rootfsbase
fi
echo "Options=${ROOTFLAGS},${ovlfs},upperdir=/run/overlayfs,workdir=/run/ovlwork"
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.
7 years ago
echo "Type=overlay"
_dev=LiveOS_rootfs
else
echo "What=/dev/mapper/live-rw"
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
_dev=$'dev-mapper-live\\x2drw'
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.
7 years ago
fi
} > "$GENERATOR_DIR"/sysroot.mount
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.
7 years ago
mkdir -p "$GENERATOR_DIR/$_dev.device.d"
{
echo "[Unit]"
echo "JobTimeoutSec=3000"
echo "JobRunningTimeoutSec=3000"
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.
7 years ago
} > "$GENERATOR_DIR/$_dev.device.d/timeout.conf"