summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/DirectBoot.hs7
-rw-r--r--src/Propellor/Property/DiskImage.hs15
-rw-r--r--src/Propellor/Types/Bootloader.hs4
3 files changed, 13 insertions, 13 deletions
diff --git a/src/Propellor/Property/DirectBoot.hs b/src/Propellor/Property/DirectBoot.hs
deleted file mode 100644
index 4807471e..00000000
--- a/src/Propellor/Property/DirectBoot.hs
+++ /dev/null
@@ -1,7 +0,0 @@
-module Propellor.Property.DirectBoot(installed) where
-
-import Propellor.Base
-import Propellor.Types.Bootloader
-
-installed :: Property (HasInfo + UnixLike)
-installed = pureInfoProperty "direct boot" [DirectBoot]
diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs
index a41af18c..fa41808e 100644
--- a/src/Propellor/Property/DiskImage.hs
+++ b/src/Propellor/Property/DiskImage.hs
@@ -18,6 +18,7 @@ module Propellor.Property.DiskImage (
imageBuiltFrom,
imageExists,
GrubTarget(..),
+ noBootloader,
) where
import Propellor.Base
@@ -228,7 +229,7 @@ imageBuilt' rebuild img mkchroot tabletype partspec =
ubootFlashKernelFinalized p
[FlashKernelInstalled, UbootInstalled p] ->
ubootFlashKernelFinalized p
- [DirectBoot] -> directBootFinalized
+ [NoBootloader] -> noBootloaderFinalized
_ -> unbootable "multiple bootloaders are installed; don't know which to use"
-- | This property is automatically added to the chroot when building a
@@ -470,9 +471,6 @@ grubFinalized grubtarget _img mnt loopdevs =
ubootFinalized :: (FilePath -> FilePath -> Property Linux) -> Finalization
ubootFinalized p (RawDiskImage img) mnt _loopdevs = p img mnt
-directBootFinalized :: Finalization
-directBootFinalized _img _mnt _loopDevs = doNothing
-
flashKernelFinalized :: Finalization
flashKernelFinalized _img mnt _loopdevs = FlashKernel.flashKernelMounted mnt
@@ -481,6 +479,15 @@ ubootFlashKernelFinalized p img mnt loopdevs =
ubootFinalized p img mnt loopdevs
`before` flashKernelFinalized img mnt loopdevs
+-- | Normally a boot loader is installed on a disk image. However,
+-- when the disk image will be booted by eg qemu booting the kernel and
+-- initrd, no boot loader is needed, and this property can be used.
+noBootloader :: Property (HasInfo + UnixLike)
+noBootloader = pureInfoProperty "no bootloader" [NoBootloader]
+
+noBootloaderFinalized :: Finalization
+noBootloaderFinalized _img _mnt _loopDevs = doNothing
+
isChild :: FilePath -> Maybe MountPoint -> Bool
isChild mntpt (Just d)
| d `equalFilePath` mntpt = False
diff --git a/src/Propellor/Types/Bootloader.hs b/src/Propellor/Types/Bootloader.hs
index cdb37a31..52a6da02 100644
--- a/src/Propellor/Types/Bootloader.hs
+++ b/src/Propellor/Types/Bootloader.hs
@@ -10,7 +10,7 @@ data BootloaderInstalled
= GrubInstalled GrubTarget
| FlashKernelInstalled
| UbootInstalled (FilePath -> FilePath -> Property Linux)
- | DirectBoot
+ | NoBootloader
deriving (Typeable)
-- | Platforms that grub can boot.
@@ -20,7 +20,7 @@ instance Show BootloaderInstalled where
show (GrubInstalled _) = "GrubInstalled"
show FlashKernelInstalled = "FlashKernelInstalled"
show (UbootInstalled _) = "UbootInstalled"
- show DirectBoot = "DirectBoot"
+ show NoBootloader = "NoBootloader"
instance IsInfo [BootloaderInstalled] where
propagateInfo _ = PropagateInfo False