X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F08persistence_excludes;fp=scripts%2Flive-bottom%2F08persistence_excludes;h=0000000000000000000000000000000000000000;hb=a2049b4f8507bf9c7950d553ec1172ec388304e0;hp=633f6ac7346e1993db1c93adac6721859c568009;hpb=80e7f344bc729318a4788c7062a85dc66bf3a305;p=live-boot-grml.git diff --git a/scripts/live-bottom/08persistence_excludes b/scripts/live-bottom/08persistence_excludes deleted file mode 100755 index 633f6ac..0000000 --- a/scripts/live-bottom/08persistence_excludes +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh - -# Persistence enhancer script -# This script saves precious time on slow persistence devices/image files -# and writes on flash based device. -# a tmpfs on $PERSTMP is mounted and directories listed in -# /etc/live-persistence.binds will be copied there and then bind mounted back. - -#set -e - -# initramfs-tools header - -PREREQ="" - -prereqs() -{ - echo "${PREREQ}" -} - -case "${1}" in - prereqs) - prereqs - exit 0 - ;; -esac - -# live-boot header - -if [ -z "${PERSISTENCE}" ] || [ -n "${NOPERSISTENCE}" ] || [ -z "${PERSISTENCE_IS_ON}" ] || [ ! -f /root/etc/live-persistence.binds ] -then - exit 0 -fi - -. /scripts/live-functions - -# live-boot script - -dirs="$(sed -e '/^ *$/d' -e '/^#.*$/d' /root/etc/live-persistence.binds | tr '\n' '\0')" -if [ -z "${dirs}" ] -then - exit 0 -fi - -log_begin_msg "Moving persistence bind mounts" - -PERSTMP="/root/live/persistence-binds" -CPIO="/bin/cpio" - -if [ ! -d "${PERSTMP}" ] -then - mkdir -p "${PERSTMP}" -fi - -mount -t tmpfs tmpfs "${PERSTMP}" - -for dir in $(echo "${dirs}" | tr '\0' '\n') -do - if [ ! -e "/root/${dir}" ] && [ ! -L "/root/${dir}" ] - then - # directory do not exists, create it - mkdir -p "/root/${dir}" - elif [ ! -d "/root/${dir}" ] - then - # it is not a directory, skip it - break - fi - - # Copy previous content if any - cd "/root/${dir}" - find . -print0 | ${CPIO} -pumd0 "${PERSTMP}/${dir}" - cd "${OLDPWD}" - - # Bind mount it to origin - mount -o bind "${PERSTMP}/${dir}" "/root/${dir}" -done - -log_end_msg