arkup update manager architecture

/notes/arkup/
Created: 2026-10-26 00:00
Edited: 2026-10-26 11:45
Commit: i love making custom stuff

what is arkup?

arkup is the signed system and feature update manager for arkanaOS.

wrote it in rust. like the other arkanaOS tools, the goal is keeping things secure, predictable, and not bloated with complicated package manager logic when doing base OS updates.

instead of treating system upgrades like thousands of loose packages with unpredictable pre/post-install shell scripts, arkup applies atomic, cryptographically signed update packs (.aup files).


arkup vs arkpkg: why two tools?

one big problem in minimal distros is package database desync: what happens if you update core OS files with one tool, and an application package manager touches the same system libraries? everything breaks.

so arkanaOS splits them cleanly:

  • arkup: handles core system updates, base libraries, kernel updates, and feature packs (.aup files).
  • arkpkg: handles standalone, user-facing optional applications (.ark files).

this separation guarantees that only arkup touches core root filesystems, avoiding dual package database conflicts completely.


.aup package structure

just like .ark packages are lz4 tars, an .aup update pack is literally a gzip-compressed tar archive (.tar.gz) containing:

arkanaOS-1.0-a1-891.aup
│
└── gzip container
    │
    └── tar Archive
        │
        ├── arkup.json      ← update manifest & metadata
        ├── arkup.sig       ← Ed25519 signature of arkup.json (base64)
        └── payload/        ← directory tree of files to install
             ├── usr/
             │    ├── bin/
             │    └── lib/
             └── etc/

inside arkup.json, the manifest looks like:

{
  "format_version": 1,
  "name": "arkanaos-system",
  "version": "arkanaOS 1.0 (alpha 1) build 891",
  "sequence": 891,
  "architecture": "x86_64",
  "description": "arkanaOS system update",
  "key_id": "8a3f...",
  "entries": [
    {
      "path": "usr/bin/tool",
      "kind": "file",
      "mode": 493,
      "size": 14208,
      "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "config": false
    },
    {
      "path": "usr/lib/libtool.so",
      "kind": "symlink",
      "mode": 511,
      "target": "libtool.so.1",
      "config": false
    },
    {
      "path": "usr/bin/retired-tool",
      "kind": "delete",
      "mode": 0,
      "config": false
    }
  ]
}

security & safety rules

running system updates can easily brick an OS if something goes wrong, so arkup has strict verification built in:

  • Ed25519 signatures: every update pack manifest must be signed with a trusted release key. public keys live in /etc/arkup/trustedkeys.d/<key_id>.pub.
  • zero install scripts: no arbitrary pre-install or post-install shell scripts. no rm -rf / hidden in hook scripts. everything is purely declarative files, symlinks, and deletions.
  • checksum verification: every single payload file is verified against its SHA-256 hash before installation.
  • traversal & symlink checks: rejects paths with .., leading /, double slashes, or symlinks that point outside the system root.
  • protected paths: update packs are strictly forbidden from writing to mutable or OS-managed paths like /etc/ld.so.cache or /var/lib/arkup.
  • monotonic sequences: each update has a numeric sequence counter (e.g. 891). arkup refuses to apply an update with a sequence lower than or equal to the installed version unless --allow-downgrade is explicitly passed.

update lifecycle & rollback

when you run sudo arkup apply update.aup:

                 verify signature & manifest
                              ↓
              check sequence & target architecture
                              ↓
                  acquire exclusive lock
                              ↓
             create backup in /var/lib/arkup/backups/
                              ↓
           apply files, symlinks & process deletions
                              ↓
                    error? ──yes──► rollback from backup
                              │
                             no
                              ▼
            record installed info in /var/lib/arkup/
                              ↓
                     complete & release lock

if disk runs out of space, power drops, or any file fails to extract mid-update, arkup catches the error, triggers an automatic rollback from the backup directory, and restores the system to its previous state.


config handling (.arkup-new)

one annoying thing with linux updates is when an update wipes your custom configuration in /etc/.

arkup handles this cleanly:

  • if an /etc/ file is marked as config: true:
    • if the user hasn’t touched the file, it updates normally.
    • if the user modified the file, arkup keeps the user’s customized file intact and writes the new update’s default config to <file>.arkup-new (similar to .pacnew in Arch).
  • if a deletion removes a file that was locally modified by the user, arkup preserves the file rather than blindly deleting user data.

cli commands

everything is driven through a clean clap CLI:

# generate a release keypair (keep private key offline!)
arkup keygen --output-dir release-keys

# add the public key to trusted keys
sudo arkup trust release-keys/<key_id>.pub

# pack a staged root directory into a signed .aup pack
arkup pack \
  --source staging/root \
  --name arkanaos-system \
  --version 'arkanaOS 1.0 (alpha 1) build 891' \
  --sequence 891 \
  --arch x86_64 \
  --delete usr/bin/retired-tool \
  --description 'arkanaOS system update' \
  --signing-key release-keys/<key_id>.key \
  --output arkanaOS-1.0-a1-891.aup

# inspect and verify without applying
arkup verify arkanaOS-1.0-a1-891.aup
arkup list arkanaOS-1.0-a1-891.aup

# apply update to system root
sudo arkup apply arkanaOS-1.0-a1-891.aup

testing against an alternate root directory is as easy as passing --root /path/to/chroot.


repositories:

specifications & crates: