diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-22 14:10:52 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-22 14:10:52 -0400 |
| commit | cc8fbeda82774f6c9a223a87187408496fcd0d2b (patch) | |
| tree | cac18ab6afcae783cfb765caea9a063d426b2bdd | |
| parent | e73f67c381d41c65f33fb94dccdcbb7b120ad9a8 (diff) | |
avoid grub install failure in chroot
| -rw-r--r-- | config-joey.hs | 2 | ||||
| -rw-r--r-- | src/Propellor/Property/DiskImage.hs | 7 | ||||
| -rw-r--r-- | src/Propellor/Property/Grub.hs | 19 |
3 files changed, 19 insertions, 9 deletions
diff --git a/config-joey.hs b/config-joey.hs index 3fcf2289..815fe798 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -85,7 +85,7 @@ darkstar = host "darkstar.kitenet.net" [ partition EXT2 `mountedAt` "/boot" `setFlag` BootFlag , partition EXT4 `mountedAt` "/" `addFreeSpace` MegaBytes 100 -- , swapPartition (MegaBytes 256) - ] (grubBooted PC) -- (grubBooted PC) + ] (grubBooted PC) where c d = Chroot.debootstrapped (System (Debian Unstable) "amd64") mempty d & Apt.installed ["linux-image-amd64"] diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs index 8d503e28..3c2b2200 100644 --- a/src/Propellor/Property/DiskImage.hs +++ b/src/Propellor/Property/DiskImage.hs @@ -292,7 +292,12 @@ type Finalization = (Property NoInfo, Property NoInfo) -- | Makes grub be the boot loader of the disk image. -- TODO not implemented grubBooted :: Grub.BIOS -> Finalization -grubBooted bios = (Grub.installed bios, undefined) +grubBooted bios = (inchroot, inimg) + where + -- Need to set up device.map manually before running update-grub. + inchroot = Grub.installed' bios + + inimg = undefined noFinalization :: Finalization noFinalization = (doNothing, doNothing) diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs index 6b763d08..ea54295b 100644 --- a/src/Propellor/Property/Grub.hs +++ b/src/Propellor/Property/Grub.hs @@ -18,14 +18,19 @@ data BIOS = PC | EFI64 | EFI32 | Coreboot | Xen -- | Installs the grub package. This does not make grub be used as the -- bootloader. -- --- This includes running update-grub, so that the grub boot menu is --- created. It will be automatically updated when kernel packages are --- installed. +-- This includes running update-grub. installed :: BIOS -> Property NoInfo -installed bios = - Apt.installed [pkg] `describe` "grub package installed" - `before` - cmdProperty "update-grub" [] +installed bios = installed' bios `before` mkConfig + +-- Run update-grub, to generate the grub boot menu. It will be +-- automatically updated when kernel packages are +-- -- installed. +mkConfig :: Property NoInfo +mkConfig = cmdProperty "update-grub" [] + +-- | Installs grub; does not run update-grub. +installed' :: BIOS -> Property NoInfo +installed' bios = Apt.installed [pkg] `describe` "grub package installed" where pkg = case bios of PC -> "grub-pc" |
