summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2017-07-28 20:38:02 -0400
committerJoey Hess2017-07-28 20:38:02 -0400
commit1aac2336977a6c589b00f99eb18b26edee86a7a0 (patch)
tree5a2cca0a80131e4feb1613874c62dfd8b783cd30
parente485839d394ce364b3c756ddb908a4c423f99d3e (diff)
Grub.bootsMounted: Avoid failing when proc sys etc are already mounted within the chroot.
Perhaps it should keep track of what was mounted before and restore it, but it would complicate it a lot, and I doubt it would be needed by any use of this property. Usually, this property will come after a chroot provisioning property, which may leave proc and sys mounted, but that's done only so that the chroot can later be used; and when bootsMounted is applied to a chroot, the goal is presumably to boot the underlying disk soon.
-rw-r--r--debian/changelog2
-rw-r--r--src/Propellor/Property/Grub.hs3
2 files changed, 5 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index c66038d6..f91ee8cb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,8 @@ propellor (4.7.0) UNRELEASED; urgency=medium
* Sbuild: Updated sample config in haddock for Propellor.Property.Sbuild.
If you use this module, please compare both your config.hs and
your ~/.sbuildrc with the haddock documentation.
+ * Grub.bootsMounted: Avoid failing when proc sys etc are already mounted
+ within the chroot.
-- Joey Hess <id@joeyh.name> Fri, 28 Jul 2017 20:13:58 -0400
diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs
index 739a63e9..dbc34f4b 100644
--- a/src/Propellor/Property/Grub.hs
+++ b/src/Propellor/Property/Grub.hs
@@ -97,6 +97,9 @@ chainPVGrub rootdev bootdev timeout = combineProperties desc $ props
-- not a partition).
bootsMounted :: FilePath -> OSDevice -> Property Linux
bootsMounted mnt wholediskdev = combineProperties desc $ props
+ -- remove mounts that are done below to make sure the right thing
+ -- gets mounted
+ & cleanupmounts
-- bind mount host /dev so grub can access the loop devices
& bindMount "/dev" (inmnt "/dev")
& mounted "proc" "proc" (inmnt "/proc") mempty