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
changes/71/23871/5
Alexander Lutay 8 years ago
parent 9de6138cba
commit b1d78cb40c

@ -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

Loading…
Cancel
Save