Update README

This commit is contained in:
Dennis ten Hoove 2023-10-23 17:46:23 +00:00
parent 61215ebde8
commit 7b019b2783

View file

@ -1,6 +1,61 @@
# arkdep
A toolkit for building, deploying and maintaining a btrfs-based multi-root system.
## Usage
### Rolling out arkdep on a new system
> **Note** arkdep has as of now only been tested on Arch Linux-based systems
arkdep can be easily rolled out and torn down again, it is non-invasive by design. So it _should_ be safe to just toy around with it on your system.
System requirements;
- `/` is partitioned with btrfs
- `/boot` mounted boot partition
- Systemd-boot bootloader is installed and configured as the primary bootloader
- dracut, wget and curl are installed
The following command will initialize arkdep, it will deploy a subvolume containing all arkdep related files excluding kernels and initramfs to `/arkdep`. Kernel and initramfs will instead be stored in `/boot/arkdep` upon generation.
```shell
sudo arkdep init
```
Once ardep is installed you should prepare the overlay located at `/arkdep/overlay`. The overlay is copied directory on to the root filesystem of a new deployment, create directories inside of it as-if it were a root filesystem. For example, `/arkdep/overlay/etc` will be your `/etc` folder.
You will most likely wish to add the following to the overlay;
- passwd, shadow, group, subgid and subuid files
- Optionally an fstab, locale.conf/locale.gen and custom dracut configuration
Here is a reference fstab file, take note of the `subvol` mount option;
```shell
UUID=f8b62c6c-fba0-41e5-b12c-42aa1cdaa452 / btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/,compress=zstd 0 0
UUID=f8b62c6c-fba0-41e5-b12c-42aa1cdaa452 /root btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvol=arkdep/shared/root,compress=zstd 0 0
UUID=f8b62c6c-fba0-41e5-b12c-42aa1cdaa452 /home btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvol=arkdep/shared/home,compress=zstd 0 0
UUID=f8b62c6c-fba0-41e5-b12c-42aa1cdaa452 /var btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvol=arkdep/shared/var,compress=zstd 0 0
UUID=f8b62c6c-fba0-41e5-b12c-42aa1cdaa452 /arkdep btrfs rw,relatime,ssd,discard=async,space_cache=v2,subvol=arkdep,compress=zstd 0 0
UUID=1223-2137 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
```
If you wish to use custom kernel parameters you can edit `/arkdep/templates/systemd-boot`
### Deploying an image
To deploy the latest available image from the default repository run the following command;
```shell
sudo arkdep deploy
```
It will check in with the server defined in `/arkdep/config` as `repo_url` and pull the latest image defined in `$repo_url/database`, see [Repository](#Repository) for additional information.
### Deploying a specified image version
A specific image version to pull and deploy can be parsed like so;
```shell
sudo arkdep deploy 00ce35074659538f946be77d9efaefc37725335689
```
Simply provide the basename of the image and it will attempt to find it in `/database`.
You do not have to provide the full basename, you can provide it with an impartial basename, the first hit will be pulled and deployed.
```shell
sudo arkdep deploy 00ce
```
## Packaging
### Custom configurations
#### Arch Linux-based
@ -63,39 +118,3 @@ The sha1sum is used to ensure the file was downloaded properly.
arkdep will assume the top most entry in the database is the latest one, when no image version is defined or `latest` is requested it will grab the top most entry.
## Usage
### Rolling out arkdep on a new system
> **Note** arkdep has as of now only been tested on Arch Linux-based systems
arkdep can be easily rolled out and torn down again, it is non-invasive by design. So it _should_ be safe to just toy around with it on your system.
System requirements;
- `/` is partitioned with btrfs
- `/boot` mounted boot partition
- Systemd-boot bootloader is installed and configured as the primary bootloader
- dracut, wget and curl are installed
The following command will initialize arkdep, it will deploy a subvolume containing all arkdep related files excluding kernels and initramfs to `/arkdep`.
```shell
sudo arkdep init
```
### Deploying an image
To deploy the latest available image from the default repository run the following command;
```shell
sudo arkdep deploy
```
It will check in with the server defined in `/arkdep/config` as `repo_url` and pull the latest image defined in `$repo_url/database`, see [Repository](#Repository) for additional information.
### Deploying a specified image version
A specific image version to pull and deploy can be parsed like so;
```shell
sudo arkdep deploy 00ce35074659538f946be77d9efaefc37725335689
```
Simply provide the basename of the image and it will attempt to find it in `/database`.
You do not have to provide the full basename, you can provide it with an impartial basename, the first hit will be pulled and deployed.
```shell
sudo arkdep deploy 00ce
```