summaryrefslogtreecommitdiff
path: root/doc/forum/support_for_non-bootable_disk_images
diff options
context:
space:
mode:
authordavid2018-10-08 12:43:42 +0000
committeradmin2018-10-08 12:43:42 +0000
commitb374cf151c6181ffe7341df73f5a5eb3833ab7d8 (patch)
tree2fbb2b8a54d2dfd1bc0a768b926bef59f08c4066 /doc/forum/support_for_non-bootable_disk_images
parent772bd8e3902f8c4a052d13bc786e341837a47e24 (diff)
Added a comment: Initial attempt
Diffstat (limited to 'doc/forum/support_for_non-bootable_disk_images')
-rw-r--r--doc/forum/support_for_non-bootable_disk_images/comment_1_4c4a376db9071336011abbf2993022f2._comment68
1 files changed, 68 insertions, 0 deletions
diff --git a/doc/forum/support_for_non-bootable_disk_images/comment_1_4c4a376db9071336011abbf2993022f2._comment b/doc/forum/support_for_non-bootable_disk_images/comment_1_4c4a376db9071336011abbf2993022f2._comment
new file mode 100644
index 00000000..60cbc9f0
--- /dev/null
+++ b/doc/forum/support_for_non-bootable_disk_images/comment_1_4c4a376db9071336011abbf2993022f2._comment
@@ -0,0 +1,68 @@
+[[!comment format=mdwn
+ username="david"
+ avatar="http://cdn.libravatar.org/avatar/22c2d800db6a7699139df604a67cb221"
+ subject="Initial attempt"
+ date="2018-10-08T12:43:42Z"
+ content="""
+I tried to solve this in the stupidest possible way. I'll paste diff here, as it's small and I'm not really confident it's ready for merging.
+
+
+[[!format \"\"\"
+diff --git a/src/Propellor/Property/DirectBoot.hs b/src/Propellor/Property/DirectBoot.hs
+new file mode 100644
+index 00000000..4807471e
+--- /dev/null
++++ b/src/Propellor/Property/DirectBoot.hs
+@@ -0,0 +1,7 @@
++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 289de151..a41af18c 100644
+--- a/src/Propellor/Property/DiskImage.hs
++++ b/src/Propellor/Property/DiskImage.hs
+@@ -228,6 +228,7 @@ imageBuilt' rebuild img mkchroot tabletype partspec =
+ ubootFlashKernelFinalized p
+ [FlashKernelInstalled, UbootInstalled p] ->
+ ubootFlashKernelFinalized p
++ [DirectBoot] -> directBootFinalized
+ _ -> unbootable \"multiple bootloaders are installed; don't know which to use\"
+
+ -- | This property is automatically added to the chroot when building a
+@@ -469,6 +470,9 @@ 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
+
+diff --git a/src/Propellor/Types/Bootloader.hs b/src/Propellor/Types/Bootloader.hs
+index 65117bd2..cdb37a31 100644
+--- a/src/Propellor/Types/Bootloader.hs
++++ b/src/Propellor/Types/Bootloader.hs
+@@ -10,6 +10,7 @@ data BootloaderInstalled
+ = GrubInstalled GrubTarget
+ | FlashKernelInstalled
+ | UbootInstalled (FilePath -> FilePath -> Property Linux)
++ | DirectBoot
+ deriving (Typeable)
+
+ -- | Platforms that grub can boot.
+@@ -19,6 +20,7 @@ instance Show BootloaderInstalled where
+ show (GrubInstalled _) = \"GrubInstalled\"
+ show FlashKernelInstalled = \"FlashKernelInstalled\"
+ show (UbootInstalled _) = \"UbootInstalled\"
++ show DirectBoot = \"DirectBoot\"
+
+ instance IsInfo [BootloaderInstalled] where
+ propagateInfo _ = PropagateInfo False
+
+\"\"\"]]
+"""]]