|author||Joey Hess||2017-07-28 20:38:02 -0400|
|committer||Joey Hess||2017-07-28 20:38:02 -0400|
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.
Diffstat (limited to 'src/Propellor/Property/Grub.hs')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs
index 739a63e9..dbc34f4b 100644
@@ -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