From 715b2e23b0cb347dbf6b6516e5811e45406324ac Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 20 Jan 2013 19:24:19 +0100 Subject: minikrebs: init_overlay now does the right thing --- minikrebs/profiles/init_overlay | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) mode change 100644 => 100755 minikrebs/profiles/init_overlay (limited to 'minikrebs/profiles/init_overlay') diff --git a/minikrebs/profiles/init_overlay b/minikrebs/profiles/init_overlay old mode 100644 new mode 100755 index 3b714c39..e71cd151 --- a/minikrebs/profiles/init_overlay +++ b/minikrebs/profiles/init_overlay @@ -1,10 +1,22 @@ -#!/bin/sh +#!/bin/bash +cd $(dirname $(readlink -f $0)) [ ! -e overlay/ ] && echo "profile data for external overlay does not exist, bailing out" -[ ! -e doc/overlay ] && echo "Profile demands the following partitioning of the overlay usb stick:" && cat doc/overlay +[ -e doc/overlay ] && echo "Profile demands the following partitioning of the overlay usb stick:" && cat doc/OVERLAY if grep -q $PWD/mnt/overlay /etc/mtab;then - + echo "overlay mounted" + echo "copying overlay data:" + find overlay/ -mindepth 1 -maxdepth 1 | while read data; do + echo " $data -> mnt/overlay/$(basename $data)" + rm -rf mnt/overlay/$(basename $data) + cp -r $data mnt/overlay + done + echo + echo "unmounting overlay" + umount mnt/overlay/ else - echo "please mount your overlay to $PWD/overlay" + mkdir -p $PWD/mnt/overlay + echo "please mount your overlay to $PWD/mnt/overlay" fi + -- cgit v1.2.3