summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/DiskImage.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property/DiskImage.hs')
-rw-r--r--src/Propellor/Property/DiskImage.hs15
1 files changed, 11 insertions, 4 deletions
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