From 9ac67c9b677396e70efbae239e137509f0372e40 Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Mon, 4 Dec 2017 02:23:16 +0200 Subject: [PATCH] New directories were not copied when 'OVERLAY_LOCATION=rootfs'. For example , the 'nweb' bundle provides the folder '/srv' which was skipped before the 'switch_root' phase. Now all non-critical directories are automatically detected and the issue is fixed. --- src/minimal_rootfs/etc/02_overlay.sh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/minimal_rootfs/etc/02_overlay.sh b/src/minimal_rootfs/etc/02_overlay.sh index 78ca29ba3..230de1530 100755 --- a/src/minimal_rootfs/etc/02_overlay.sh +++ b/src/minimal_rootfs/etc/02_overlay.sh @@ -32,12 +32,32 @@ mkdir /mnt/dev mkdir /mnt/sys mkdir /mnt/proc mkdir /mnt/tmp -mkdir /mnt/var echo "Created folders for all critical file systems." # Copy root folders in the new mountpoint. echo -e "Copying the root file system to \\e[94m/mnt\\e[0m." -cp -a bin etc lib lib64 root sbin src usr var /mnt 2>/dev/null +for dir in */ ; do + case $dir in + dev/) + # skip + ;; + proc/) + # skip + ;; + sys/) + # skip + ;; + mnt/) + # skip + ;; + tmp/) + # skip + ;; + *) + cp -a $dir /mnt + ;; + esac +done DEFAULT_OVERLAY_DIR="/tmp/minimal/overlay" DEFAULT_UPPER_DIR="/tmp/minimal/rootfs" @@ -173,4 +193,3 @@ echo "(/etc/02_overlay.sh) - there is a serious bug." # Wait until any key has been pressed. read -n1 -s -