summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Parted.hs
AgeCommit message (Collapse)Author
2018-04-30fix broken SemigroupMonoid transition <<loop>>Joey Hess
Turns out that with ghc 8.2.2, the instructions given on the page don't work. And the cppless variant that I had compiles, but into effectively mappend = mappend so it loops. The only way I can see to make it work without cpp is to use mappend = (Sem.<>) which is ugly and a land mine waiting to explode if someone changes it to a nicer mappend = (<>) with a newer version of ghc which will compile it and work ok, while breaking it with 8.2.2. Sigh. I posted to haskell-cafe about this.
2018-04-23semigroup monoid change fallout; drop ghc 7 supportJoey Hess
Fix build with ghc 8.4, which broke due to the Semigroup Monoid change. See https://prime.haskell.org/wiki/Libraries/Proposals/SemigroupMonoid Dropped support for building propellor with ghc 7 (as in debian oldstable), to avoid needing to depend on the semigroups transitional package, but also because it's just too old to be worth supporting. If we indeed drop ghc 7 support entirely, some code to support "jessie" can be removed; concurrent-output can be de-embedded, and the Singletons code can be simplified. This commit was sponsored by Jack Hill on Patreon.
2018-01-06changes to allow GPT BIOS boot partitionsJoey Hess
* Parted: Allow partitions to have no filesystem, for eg, GPT BIOS boot partitions. (API change) * Added rawPartition to PartSpec, for specifying partitions with no filesystem. * Added BiosGrubFlag to PartFlag. Note that man parted does not list the "bios_boot" flag, but I found it in its html documentation. Other flags may also be missing. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
2017-12-22specify typeJoey Hess
2017-12-21fuzzy partition end location for partedJoey Hess
This should fix the reversion in GPT partition creation. See my long comment for the gory details. This commit was sponsored by Peter on Patreon.
2017-12-20add missingJoey Hess
2017-12-20disk partition alignmentJoey Hess
Cheap flash drives need partitions aligned to 4 MiB in order to not be slow (and to avoid extra writes). <https://lwn.net/Articles/428584/> And at least 1 MiB alignment is generally a good idea, and most people seem to think 4 MiB is for all drives. I noticed that Parted.partitioned does not do that; the first partition started at an offset of 1 MB, and subsequent partitions from where it ends. (The 1 MB offset came from the PartedVal PartSize instance, and note that it was not 1 MiB.) * Parted: Add an Alignment parameter. (API change) A good default to use is safeAlignment, which is 4MiB, well suited for inexpensive flash drives, and fine for other disks too. Previously, a very non-optimial 1MB (not 1MiB) alignment had been used. * DiskImage: Use safeAlignment. It didn't seem worth making the alignment configurable here. Alignment is implemented by offsetting the first partition's start position so it's aligned (making sure to leave room for the partition table). Each partition is then extended as needed so the next partition will start properly aligned. Note that parted rejects partition tables that don't fit in cylinder bounderies. Before, propellor let parted deal with the fine details of layout, so that was not a problem. Now it's possible to set some wacky Alignment not divisible by 512, or use Byte sizes for partitions and create a partition table that parted rejects. But, using safeAlignment and MegaBytes should always be safe. Also, this fixes a rounding bug in Parted.calcPartTable. It was rounding up to the nearest MegaByte when allocating remaining disk space, so returned partition table that was actually larger than the disk size. This commit was sponsored by an anonymous bitcoiner.
2017-11-18reorganizedJoey Hess
2017-07-25new propertiesJoey Hess
* Added Rsync.installed property. * Added DiskImage.vmdkBuilt property which is useful for booting a disk image in VirtualBox.
2017-07-21calcPartTable using PartSpec DSLJoey Hess
* Generalized the PartSpec DSL, so it can be used for both disk image partitioning, and disk device partitioning, with different partition sizing methods as appropriate for the different uses. (minor API change) * Propellor.Property.Parted: Added calcPartTable function which uses PartSpec DiskPart, and a useDiskSpace combinator. This commit was sponsored by Thomas Hochstein on Patreon.
2017-02-26fix minor bug in pval (MegaBytes 0)Joey Hess
2017-02-26Added ConfigurableValue type classJoey Hess
* Added ConfigurableValue type class, for values that can be used in a config file, or to otherwise configure a program. * The val function converts such values to String. This was motivated by the bug caused by type Port = Int changing to newtype Port = Port Int deriving Show After that change, some things that used show port to generate config files were broken. By using the ConfigurableValue type class instead, such breakage can be prevented.
2017-02-04add some support for Arch Linux to PartedZihao Wang
Signed-off-by: Zihao Wang <dev@wzhd.org>
2016-03-26more portingJoey Hess
2015-12-05UncheckedProperty for cmdProperty et alJoey Hess
* Properties that run an arbitrary command, such as cmdProperty and scriptProperty are converted to use UncheckedProperty, since they cannot tell on their own if the command truely made a change or not. (API Change) Transition guide: - When GHC complains about an UncheckedProperty, add: `assume` MadeChange - Since these properties used to always return MadeChange, that change is always safe to make. - Or, if you know that the command should modifiy a file, use: `changesFile` filename * A few properties have had their Result improved, for example Apt.buldDep and Apt.autoRemove now check if a change was made or not.
2015-10-22propellor spinJoey Hess
2015-10-10propellor spinJoey Hess
2015-09-03partition setup dslJoey Hess
2015-09-02propellor spinJoey Hess
2015-09-02propellor spinJoey Hess
2015-09-02run parted before kpartexJoey Hess
2015-09-01keystone for disk image creationJoey Hess
Untested, and grub booting not done.
2015-08-31propellor spinJoey Hess
(cherry picked from commit 7087a94b21a086a98784d17b45dd2b7779e320e9)
2015-08-25idempotency fix for kpartxJoey Hess
noticed kpartx could get confused if a disk image it had mapped was deleted and a fresh one mapped
2015-08-25propellor spinJoey Hess
2015-08-25propellor spinJoey Hess
2015-08-25struggling with alignmentJoey Hess
2015-08-25propellor spinJoey Hess
2015-08-25propellor spinJoey Hess
2015-08-25formatting for partitions set up by partedJoey Hess
Including support for formatting partitions of a disk image file.
2015-08-25working on partedJoey Hess