The secret-project can probably partition disks now. I have not tried it yet.
I generalized propellor's PartSpec DSL, which had been used for only auto-fitting disk images to chroot sizes, to also support things like partitions that use some percentage of the disk.
A sample partition table using that, that gives /
and /srv
each 20% of
the disk, has a couple of fixed size partitions, and uses the rest for /home
:
[ partition EXT2 `mountedAt` "/boot"
`setFlag` BootFlag
`setSize` MegaBytes 512
, partition EXT4 `mountedAt` "/"
`useDiskSpace` (Percent 20)
, partition EXT4 `mountedAt` "/srv"
`useDiskSpace` (Percent 20)
, partition EXT4 `mountedAt` "/home"
`useDiskSpace` RemainingSpace
, swapPartition (MegaBytes 1024)
]
It would probably be good to extend that with a combinator that sets
a minimum allows size, so eg /
can be made no smaller than 4 GB.
The implementation should make it simple enough to add such combinators.
I thought about reusing the disk image auto-fitting code, so the
target's /
would start at the size of the installer's /
.
May yet do that; it would make some sense when the target and
installer are fairly similar systems.