From b1d78cb40c5c26032dd7949825cea653896ea5ff Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Thu, 27 Sep 2018 15:41:20 +0200 Subject: [PATCH] TT#11444 Mount 'data' partition inside chroot We perform all packages installation on 'root' partition. Some packages, like faxserver for now, want to create something on 'data' partition. They do it successfully in Debian maintainer files (like postinst), so the 'data' partition has to be mounted properly, otherwise the data will be gone on reboot. Also we need to unmount it properly at the end of installation. P.S. we need to call mount under grml-chroot as chroot fails: > (netscript.grml:1353): main(): chroot /mnt mount /ngcp-data > mount: /ngcp-data: mount failed: Unknown error -1 Change-Id: Ief90d380d71ea6e0a64eba45f403465989865952 --- templates/scripts/includes/deployment.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index 3899aae..62eeb0c 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -1347,6 +1347,10 @@ if [ -n "${DATA_PARTITION}" ] ; then cat >> "${TARGET}/etc/fstab" << EOF ${DATA_PARTITION} /ngcp-data auto noatime 0 0 EOF + + # Make sure /ngcp-data is mounted inside chroot + # (some package might need to create folders structure on .postinst) + grml-chroot "${TARGET}" mount /ngcp-data fi # provide useable /ngcp-fallback read-only partition @@ -2079,6 +2083,11 @@ if [[ "${SWRAID}" = "true" ]] ; then grml-chroot "$TARGET" update-grub fi +# unmount /ngcp-data partition inside chroot (if available) +if [ -n "${DATA_PARTITION}" ] ; then + grml-chroot "${TARGET}" umount /ngcp-data +fi + # don't leave any mountpoints sync