From 0df33175b356cd3e4970b16861089503bc534ed4696a883f67291555c8bf8f6f Mon Sep 17 00:00:00 2001 From: kira Date: Sun, 13 Sep 2026 22:10:11 +0200 Subject: [PATCH] Adding disk-layout doc and reconsidering life choices --- src/disk-layout.md | 17 +++++++++++++++++ src/index.md | 2 ++ src/updates.md | 18 ++++++++++-------- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 src/disk-layout.md diff --git a/src/disk-layout.md b/src/disk-layout.md new file mode 100644 index 0000000..cdb3ebb --- /dev/null +++ b/src/disk-layout.md @@ -0,0 +1,17 @@ +[Back to index](index.md) + +# Disk Layout + +EFI partition - FAT32 +Root partition - bcachefs +SWAP - optional + +Bcachefs subvolumes: +`/home` +`/usr` +`/var` +`/var/tmp` + +`/usr` and `/var` supposed to be captured by snapshots + +`/var/tmp` - need to be excluded from snapshots so making it separate subvolume diff --git a/src/index.md b/src/index.md index 80acd6b..9184f45 100644 --- a/src/index.md +++ b/src/index.md @@ -1,3 +1,5 @@ # Documentation for Kira Linux + +[Disk Layout](disk-layout.md) [Update Process](updates.md) diff --git a/src/updates.md b/src/updates.md index accfab1..c7609ab 100644 --- a/src/updates.md +++ b/src/updates.md @@ -2,17 +2,19 @@ # Update process -Main feature of Kira Linux is atomic (to some degree) update process that allows roll back of unsuccessful or broken updates. +Kira Linux provides atomic (to some degree) update process that allows roll back of unsuccessful or broken updates. We achieve this by relying on bcachefs snapshots and subvolumes. The main internal routine is as follows: -1. Before update process snapshot /usr and /var directories. -Put snapshots to `/bzz-snaps` directory named as `bzz-usr-yyyy-mm-ddTHH-MM-SS` and `bzz-var-yyyy-mm-ddTHH-MM-SS` -2. Set update status in `/var/lib/hive-up/hyve-db.json` as failed (`update_status = false`) -3. Perform update (`pacman -Su`) -4. If update was successful, set update status in `/var/lib/hive-up/hyve-db.json` to true. -5. Process with reboot. -6. On boot **nyanit** reads update status from `/var/lib/hive-up/hyve-db.json` and if it is false **nyanit** roll back latest snapshots from `/bzz-snaps` dir. +1. When perform update (`pacman -Su`) - pacman hook that triggers before a system upgrade by using the "When = PreTransaction" + - will snapshot /usr and /var subvolumes and put snapshots to `/bzz-snaps` directory named as `bzz-usr-yyyy-mm-ddTHH-MM-SS` and `bzz-var-yyyy-mm-ddTHH-MM-SS` + - will create file `/var/lib/hive-up/lock` + +2. If update was successful, remove file `/var/lib/hive-up/lock` by another pacman hook + + +6. On boot **nyanit** check file existence `/var/lib/hive-up/lock` and if it is false **nyanit** roll back latest snapshots from `/bzz-snaps` dir. + 7. Otherwise boot as usual.