[28384] in Source-Commits
scripts commit: Force-unmount anything that's mounted
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Aug 12 10:33:37 2014
Date: Tue, 12 Aug 2014 10:33:31 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201408121433.s7CEXVdx010168@drugstore.mit.edu>
To: source-commits@MIT.EDU
https://github.com/mit-athena/scripts/commit/d25450881260880f0175cb01c35d9ce85216e068
commit d25450881260880f0175cb01c35d9ce85216e068
Author: Jonathan Reed <jdreed@mit.edu>
Date: Tue Aug 12 10:27:46 2014 -0400
Force-unmount anything that's mounted
mountmedia became very aggressive and insists on mounting
any ext2/3/4 partitions on local disk (say, the old /boot).
partman does not let you preseed an answer to the "do you want
to unmount any mounted disks?" question.
So we resort to the early_command to iterate over all extant
partitions and unmount them if they're mounted
installer/pxe/trusty/debathena/check-disks.sh | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/installer/pxe/trusty/debathena/check-disks.sh b/installer/pxe/trusty/debathena/check-disks.sh
index 4f4a774..0e9c11d 100644
--- a/installer/pxe/trusty/debathena/check-disks.sh
+++ b/installer/pxe/trusty/debathena/check-disks.sh
@@ -17,6 +17,14 @@ youlose() {
reboot
}
+# Unmount partitions because partman and d-i are incompetent.
+# http://ubuntuforums.org/showthread.php?t=2215103&p=12977473
+# LP: 1355845
+for p in $(list-devices partition); do
+ umount "$p" || true
+done
+
+
first_disk=`list-devices disk | head -n1`
if ! echo "$first_disk" | grep -q ^/dev; then
youlose "No disks found."