From d10983c0ac2e7b14ae5c51041a71b5f430603f80 Mon Sep 17 00:00:00 2001 From: Tomas M Date: Sat, 20 Oct 2012 22:39:31 -0500 Subject: [PATCH] rootcopy support --- initramfs/init | 3 +++ livekitlib | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/initramfs/init b/initramfs/init index 58c021f..4c8dd21 100644 --- a/initramfs/init +++ b/initramfs/init @@ -40,6 +40,9 @@ init_union "$CHANGES" "$UNION" # add data to union union_append_bundles "$DATA" "$BUNDLES" "$UNION" debug_shell +# rootcopy +copy_rootcopy_content "$DATA" "$UNION" + # create empty fstab fstab_create "$UNION" debug_shell diff --git a/livekitlib b/livekitlib index fea34ec..3e50b13 100644 --- a/livekitlib +++ b/livekitlib @@ -367,6 +367,18 @@ persistent_changes() fi } +# Copy content of rootcopy directory to union +# $1 = data directory +# $2 = union directory +copy_rootcopy_content() +{ + if [ "$(find "$1/rootcopy/" -maxdepth 1 2>/dev/null)" != "" ]; then + echo_green_star + echo "Copying content of rootcopy directory..." + cp -a "$1/rootcopy/*" "$2" + fi +} + # Copy data to RAM if requested # $1 = live data directory # $2 = changes directory