README.org 3.74 KB
Newer Older
Benjamin Slade's avatar
Benjamin Slade committed
1 2
[[misc/void-on-zfs.png]]

Benjamin Slade's avatar
Benjamin Slade committed
3
This is a rough but working set of scripts to set up [[https://voidlinux.org/][Void Linux]] running on pure [[https://en.wikipedia.org/wiki/ZFS][ZFS]], =/=, =/home=, =/boot= and all on a fully [[https://gitlab.com/cryptsetup/cryptsetup][LUKS-encrypted]] partition.
Benjamin Slade's avatar
Benjamin Slade committed
4

5
* PSAs
Benjamin Slade's avatar
Benjamin Slade committed
6
** Dracut Breaking Change [2019:08:11T20:56:17:06:00]
7
*You will need to fix the post-install =dracut= script; otherwise future installed kernels will not properly locate your LUKS ZFS partition.*
8 9 10 11 12

Do so by running as root:

=sed -i 's/--force/--force --hostonly --include \/boot\/rootkey.bin \/rootkey.bin/' /etc/kernel.d/post-install/20-dracut=

Benjamin Slade's avatar
Benjamin Slade committed
13 14 15 16
* WARNING, WARNING
NOTICE: basically the first thing that these scripts do (in =01-cryptsetup.sh=) is to wipe the drive you're installing to. 

[[misc/danger.gif]]
17

Benjamin Slade's avatar
Benjamin Slade committed
18
So DON'T use this unless you're prepared to lose all data on the drive you're installing to. *The entire drive* (e.g. =/dev/sda=) will be wiped by =01-cryptsetup.sh=. 
19

Benjamin Slade's avatar
Benjamin Slade committed
20 21 22
The scripts are released under GPLv3, and come with absolutely no warranty, no refunds.

*  Basic Instructions
23
Run each script in order with =. <scriptname>= (in order to make variables available to next stage).
24

Benjamin Slade's avatar
Benjamin Slade committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
You need to somehow get the scripts over to the machine you're installing on. This may involve installing =git= and/or =rsync= on that machine.

For your installation medium, you might use either the [[https://github.com/leahneukirchen/hrmpf/][hrmpf rescue system]], itself built on Void Linux, or else an [[https://ubuntu.com/download/desktop][Ubuntu Live CD]] (the latter having the advantage of not having to recompile ZFS DKMS modules twice (one for the chroot-host, once in the chroot), and having an easier-to-get-working WiFi, so that is what I'd actually recommend).

* Caveats, Limitations
** ZFS pool dimensions
The scripts assume that you have a single drive that you're creating a single LUKS partition on for your ZFS pool which will be your Void Linux =/=, =/home=, =/boot= &c. 

If you have something more complex in mind, it shouldn't be too hard to modify the scripts accordingly, though LUKS encryption means you'll have to worry about multiple LUKS-encrypted device UUIDs and this information is made use of at several points in the scripts. Hopefully a future, more sophisticated version will have built in support for using mirrored, raidz, &c. groups of drives.

** BIOS/UEFI 
The scripts assume a 'BIOS', i.e. non-(U)EFI, set-up. This should be even easier to modify than the ZFS pool configuration, but I don't use UEFI on any of my current Void machines, so this is set up for a 'BIOS', Coreboot/Libreboot-compatible installation.

** libc, architecture
The scripts assume that the glibc flavour of Void will be installed. Installing musl libc instead should be relatively easy: just specify the relevant musl rootfs in =03-fetch-void-rootfs.sh= and comment out the locale setup in =06-config-inside-chroot.sh=. In theory it should work on ARM as well, though I don't think the ZFS DKMS modules currently build against the =rpi-kernel=.
40

Benjamin Slade's avatar
Benjamin Slade committed
41 42
** Post-installation configuration
The installation scripts have you set timezone, language(s), keyboard, system-name/hostname, root password, and a single non-root user account (& password). And there's some 'courtesy' stuff to make first-boot WiFi a bit easier (i.e. setting up NetworkManager), including a final first-boot script which (if the NetworkManager option is selected earlier in the installation) will enable the relevant services. But =sudo= access for the =wheel= group is not set up for you, nor is any graphical user interface set up. But, if you have internet access, the remainder of the post-installation configuration can be conducted as desired, perhaps following [[https://wiki.voidlinux.org/Post_Installation][the relevant bits of the Void Wiki]].