diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-07-28 15:35:33 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-07-28 15:35:33 -0400 |
| commit | cd19c22e96dfa9013b272efcf203da3211c199cf (patch) | |
| tree | 8911cb6e223c102774297602b62fd22d3230f580 /src/Propellor/Property/DiskImage.hs | |
| parent | 1eaf855e5f5ac35300c092034d4e7504cc232e6e (diff) | |
propellor spin
Diffstat (limited to 'src/Propellor/Property/DiskImage.hs')
| -rw-r--r-- | src/Propellor/Property/DiskImage.hs | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs index c68a99e6..f64f685a 100644 --- a/src/Propellor/Property/DiskImage.hs +++ b/src/Propellor/Property/DiskImage.hs @@ -363,35 +363,9 @@ unbootable msg = \_ _ -> property desc $ do -- This does not install the grub package. You will need to add -- the `Grub.installed` property to the chroot. grubBooted :: Finalization -grubBooted mnt loopdevs = combineProperties "disk image boots using grub" $ props - -- bind mount host /dev so grub can access the loop devices - & bindMount "/dev" (inmnt "/dev") - & mounted "proc" "proc" (inmnt "/proc") mempty - & mounted "sysfs" "sys" (inmnt "/sys") mempty - -- update the initramfs so it gets the uuid of the root partition - & inchroot "update-initramfs" ["-u"] - `assume` MadeChange - -- work around for http://bugs.debian.org/802717 - & check haveosprober (inchroot "chmod" ["-x", osprober]) - & inchroot "update-grub" [] - `assume` MadeChange - & check haveosprober (inchroot "chmod" ["+x", osprober]) - & inchroot "grub-install" [wholediskloopdev] - `assume` MadeChange - -- sync all buffered changes out to the disk image - -- may not be necessary, but seemed needed sometimes - -- when using the disk image right away. - & cmdProperty "sync" [] - `assume` NoChange +grubBooted mnt loopdevs = Grub.bootsMounted mnt wholediskloopdev + `describe` "disk image boots using grub" where - -- cannot use </> since the filepath is absolute - inmnt f = mnt ++ f - - inchroot cmd ps = cmdProperty "chroot" ([mnt, cmd] ++ ps) - - haveosprober = doesFileExist (inmnt osprober) - osprober = "/etc/grub.d/30_os-prober" - -- It doesn't matter which loopdev we use; all -- come from the same disk image, and it's the loop dev -- for the whole disk image we seek. |
