2023-09-21 21:51:57 +02:00
# arkdep
2023-08-09 12:59:28 +02:00
A toolkit for building, deploying and maintaining a btrfs-based multi-root system.
2023-08-14 07:27:35 +02:00
## Packaging
### Custom configurations
#### Arch Linux-based
```text
2023-09-21 21:51:57 +02:00
arkdep-build.d
2023-08-14 07:29:46 +02:00
├── customlinux # Directory carrying a custom name
2023-08-14 08:38:13 +02:00
| ├── overlay # (Optional) Root filesystem overlay directory, contents are copied to root
2023-08-14 07:29:46 +02:00
| ├── base.list # Plain text file containing list of packages installed by pacstrap
| ├── package.list # (Optional) Plain text file containing list of packages installed by pacman
| ├── systemd.services # (Optional) Plain text file containing list of systemd services to enable
| ├── type # Plain text file, for configs of the Arch type should contain `archlinux`
2023-08-14 07:27:35 +02:00
```
### Building an image
2023-09-21 21:51:57 +02:00
Use the arkdep-build script to build your customlinux images.
2023-08-14 07:27:35 +02:00
```shell
2023-09-21 21:51:57 +02:00
sudo arkdep-build customlinux
2023-08-14 08:24:10 +02:00
2023-08-14 08:24:46 +02:00
# Or alternatively using a custom image name
2023-10-08 01:23:01 +02:00
sudo ARKDEP_CUSTOM_NAME='customlinux_v1.0' arkdep-build customlinux
2023-08-14 07:27:35 +02:00
```
Once done you can find compressed and uncompressed copies of your new image in the `target` directory.
2023-10-08 01:23:01 +02:00
arkdep will by default generate a psuedo-random hex string and use this as the name of your image. This behaviour can be overwritten by assigning a custom name to the `ARKDEP_CUSTOM_NAME` environment variable.
2023-08-15 10:31:34 +02:00
## Repository
2023-08-15 10:34:15 +02:00
### Example repository layout
2023-09-21 21:51:57 +02:00
This would be a suitable layout if `repo_url` in `/arkdep/config` is set to `https://repo.example.com/arkdep` .
2023-08-15 10:31:34 +02:00
```text
repo.example.com
2023-09-21 21:51:57 +02:00
├── arkdep
2023-08-15 10:32:55 +02:00
| ├── list # Plain text file containing names of all available image types
2023-08-15 10:31:34 +02:00
| ├── customlinux
2023-08-15 10:32:55 +02:00
| | ├── database # Plain text file containing : delimited lists of all available images `image_name:compression_method:sha1sum`
2023-08-15 10:32:23 +02:00
| | ├── customlinux_v1.0.tar.zst # Compressed disk images
2023-08-15 10:36:30 +02:00
| | ├── customlinux_v2.0.tar.zst # Compressed disk images
2023-08-15 10:31:34 +02:00
```
### Example repository configuration
2023-09-21 17:05:47 +02:00
The `list` file is in part optional, it not utilized during the deployment process but the user may use it in combination with the `arkdep list` command to request a list of all available images in the repository.
2023-08-15 10:31:34 +02:00
```text
customlinux
customlinux-gnome
customlinux-kde
```
2023-08-15 10:45:13 +02:00
The `database` file contains a `:` delimited list of all available images. Each line contains the following information `image_name:compression_method:sha1sum` .
2023-08-15 10:31:34 +02:00
```text
customlinux_v2.0:zst:d5f45b2dac77399b37231c6ec4e864d184d35cf1
2023-08-15 10:45:13 +02:00
customlinux_v1.0:zst:80ba4c7f3ff7a0ebce8e67d5b73f87c56af1b9f3
2023-08-15 10:32:23 +02:00
```
2023-09-21 17:05:47 +02:00
The image name is used to find the actual image, users can also manually refer to a version with `arkdep deploy customlinux customlinux_v1.0`
2023-08-15 10:45:13 +02:00
The compression method is flexible, any compression method tar can ifner is supported. Some examples being `xz` , `gz` and `zst` .
The sha1sum is used to ensure the file was downloaded properly.
2023-09-21 21:51:57 +02:00
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.
2023-09-19 21:49:17 +02:00
## Usage
2023-09-21 21:51:57 +02:00
### Rolling out arkdep on a new system
2023-09-19 21:49:17 +02:00
2023-09-21 21:51:57 +02:00
> **Note** arkdep has as of now only been tested on Arch Linux-based systems
2023-09-19 21:49:17 +02:00
2023-09-21 21:51:57 +02:00
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.
2023-09-19 21:49:17 +02:00
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
2023-09-21 21:51:57 +02:00
The following command will initialize arkdep, it will deploy a subvolume containing all arkdep related files excluding kernels and initramfs to `/arkdep` .
2023-09-19 21:50:39 +02:00
```shell
2023-09-21 17:05:47 +02:00
sudo arkdep init
2023-09-19 21:49:17 +02:00
```
### Deploying an image
To deploy the latest available image from the default repository run the following command;
2023-09-19 21:50:39 +02:00
```shell
2023-09-21 17:05:47 +02:00
sudo arkdep deploy
2023-09-19 21:49:17 +02:00
```
2023-09-21 21:51:57 +02:00
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.
2023-09-19 21:49:17 +02:00
### Deploying a specified image version
A specific image version to pull and deploy can be parsed like so;
2023-09-19 21:50:39 +02:00
```shell
2023-09-21 17:05:47 +02:00
sudo arkdep deploy 00ce35074659538f946be77d9efaefc37725335689
2023-09-19 21:49:17 +02:00
```
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.
2023-09-19 21:50:39 +02:00
```shell
2023-09-21 17:05:47 +02:00
sudo arkdep deploy 00ce
2023-09-19 21:49:17 +02:00
```