|author||Joey Hess||2019-04-08 13:32:32 -0400|
|committer||Joey Hess||2019-04-08 13:32:32 -0400|
change from inChroot to granular container capabilities info
* Removed inChroot, instead use hasContainerCapability FilesystemContained. (API change) * Hostname: Properties that used to not do anything in a systemd or docker container will now change the container's hostname, since it's namespaced. More container capabilities can easily be added later, to fine grain control what properties will run in different kinds of containers. This changed CmdLine's Read instance, which should be ok, because propellor inside the container is always updated at the same time as propellor outside, so when it chains into the chroot, it will know to expect the capability list. Docker was not setting InChroot before, but now sets both container capabilities, so chroot setting will also work in it. Note that, things that used to check inChroot before would not work in docker, but things that check FilesystemContained now will. It may be that some of those properties don't really work properly in docker. And, Grub.installed used to run grub-mkconfig in a docker container before, I doubt that made sense (was it even safe?); it doesn't do it now. This commit was sponsored by Trenton Cronholm on Patreon.
Diffstat (limited to 'src/Propellor/Property/Grub.hs')
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs
index 852b8dcd..9b001476 100644
@@ -18,9 +18,9 @@ import qualified Propellor.Property.File as File
import qualified Propellor.Property.ConfFile as ConfFile
import qualified Propellor.Property.Apt as Apt
-import Propellor.Property.Chroot (inChroot)
@@ -34,10 +34,11 @@ type OSDevice = String
-- | Installs the grub package. This does not make grub be used as the
--- This includes running update-grub, unless it's run in a chroot.
+-- This includes running update-grub, unless it's run in a chroot
+-- or container.
installed :: GrubTarget -> Property (HasInfo + DebianLike)
installed grubtarget = installed' grubtarget
- `onChange` (check (not <$> inChroot) mkConfig)
+ `onChange` (check (not <$> hasContainerCapability FilesystemContained) mkConfig)
-- | Run update-grub, to generate the grub boot menu. It will be
-- automatically updated when kernel packages are installed.