From 5dd6368e69336781fe35691c7666874328e00e5c Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Sat, 2 Dec 2017 03:28:23 +0200 Subject: [PATCH] The overlay structure is copied in proper way (this was serious bug). --- src/15_generate_image.sh | 10 ++++++---- src/generate_mll_image.sh | 30 +++++++++++++++++++----------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/15_generate_image.sh b/src/15_generate_image.sh index 3f7fb41da..c66986a3d 100755 --- a/src/15_generate_image.sh +++ b/src/15_generate_image.sh @@ -23,10 +23,12 @@ fi if [ -d $SRC_DIR/work/overlay_rootfs ] ; then echo "Merging overlay software in image." - # Copy the overlay area. - cp -r $SRC_DIR/work/overlay_rootfs/* \ + # Copy the overlay content. + # With '--remove-destination' all possibly existing soft links in + # '$SRC_DIR/work/mll_image' will be overwritten correctly. + cp -r --remove-destination $SRC_DIR/work/overlay_rootfs/* \ $SRC_DIR/work/mll_image - cp -r $SRC_DIR/minimal_overlay/rootfs/* \ + cp -r --remove-destination $SRC_DIR/minimal_overlay/rootfs/* \ $SRC_DIR/work/mll_image else echo "MLL image will have no overlay software." @@ -47,7 +49,7 @@ cat << CEOF # # # docker import mll_image.tgz minimal-linux-live:latest # # # - # Then you can run MLL container in Docker like this: # + # Then you can run MLL shell in Docker container like this: # # # # docker run -it minimal-linux-live /bin/sh # # # diff --git a/src/generate_mll_image.sh b/src/generate_mll_image.sh index f6ec17f96..49a6f4067 100755 --- a/src/generate_mll_image.sh +++ b/src/generate_mll_image.sh @@ -8,17 +8,21 @@ TEMP_DIR=xxx MLL_ISO=xxx finalWords() { - cat << CEOF +cat << CEOF - Minimal Linux Live image 'mll_image.tgz' has been generated. - - You can import the MLL image in Docker like this: - - docker import mll_image.tgz minimal-linux-live:latest - - Then you can run MLL container in Docker like this: - - docker run -it minimal-linux-live /bin/sh + ################################################################## + # # + # Minimal Linux Live image 'mll_image.tgz' has been generated. # + # # + # You can import the MLL image in Docker like this: # + # # + # docker import mll_image.tgz minimal-linux-live:latest # + # # + # Then you can run MLL shell in Docker container like this: # + # # + # docker run -it minimal-linux-live /bin/sh # + # # + ################################################################## CEOF } @@ -40,7 +44,11 @@ prepareImage() { cp -r $TEMP_DIR/rootfs_extracted/* $TEMP_DIR/image_root if [ -d $TEMP_DIR/iso_extracted/minimal/rootfs ] ; then - cp -r $TEMP_DIR/iso_extracted/minimal/rootfs/* $TEMP_DIR/image_root + # Copy the overlay content. + # With '--remove-destination' all possibly existing soft links in + # '$TEMP_DIR/image_root' will be overwritten correctly. + cp -r --remove-destination $TEMP_DIR/iso_extracted/minimal/rootfs/* \ + $TEMP_DIR/image_root fi }