mirror of
https://github.com/blazblue547-afk/ForgeOS.git
synced 2026-12-02 14:34:17 -05:00
feat(rollback): add slot selector and manager
This commit is contained in:
1 parent
23681b9f48
commit
f445a4ce10
12 files changed
+1421
-71
No files matched your search
@@ -22,7 +22,7 @@ As of `2026-06-17`, the project defaults to:
|
||||
- a minimal root filesystem with systemd as `/sbin/init`
|
||||
- a bootable GPT disk image with:
|
||||
- an EFI system partition
|
||||
- a read-only ext4 base root partition
|
||||
- read-only ext4 base root partitions for current and rollback boots
|
||||
- a writable ext4 app/state partition
|
||||
- a faster QEMU smoke-test path using `kernel + initramfs`
|
||||
|
||||
@@ -74,6 +74,21 @@ mount -a
|
||||
systemctl restart forgeos-nix-bootstrap.service nix-daemon.socket nix-daemon.service
|
||||
```
|
||||
|
||||
Base OS rollback slots are managed in the installed OS with `forgeos-rollback`. As root, create a rollback snapshot before changing the base OS:
|
||||
|
||||
```bash
|
||||
forgeos-rollback status
|
||||
forgeos-rollback create
|
||||
```
|
||||
|
||||
If the current base fails later, reboot and choose `ForgeOS rollback selector` from GRUB. After booting the rollback slot and confirming it works, make it the current base again:
|
||||
|
||||
```bash
|
||||
forgeos-rollback promote
|
||||
```
|
||||
|
||||
If `forgeos-rollback create` says the source and destination are the same slot, check `forgeos-rollback status`. You are probably already booted from `root-rollback`; use `forgeos-rollback promote` from that boot to copy it back to `root`.
|
||||
|
||||
To build a UEFI disk image:
|
||||
|
||||
```bash
|
||||
@@ -121,9 +136,11 @@ sudo make install DISK=/dev/nvme0n1
|
||||
|
||||
- The root filesystem is not copied from a distro. It is assembled from upstream systemd, upstream D-Bus, upstream Linux-PAM, upstream BusyBox rescue tools, copied runtime library dependencies for systemd, D-Bus, PAM, and BusyBox, and the files in `overlay/rootfs/`.
|
||||
- The default removable-media boot path uses GRUB at `EFI/BOOT/BOOTX64.EFI` and keeps the kernel EFI stub at `EFI/BOOT/FORGEOS.EFI`.
|
||||
- The built-in kernel command line targets `PARTLABEL=root` and keeps Intel graphics modesetting enabled, with a couple of laptop display workarounds for newer firmware.
|
||||
- The default GRUB menu boots `PARTLABEL=root` and includes a rollback selector for any additional base slots, starting with `PARTLABEL=root-rollback`. The primary selector entries use an initramfs-assisted fixed-framebuffer handoff so recovery boots stay visible.
|
||||
- For default direct QEMU testing, `scripts/run-qemu.sh direct` uses the generated `rootfs.cpio.gz`.
|
||||
- The host-side installer expands the writable app/state partition to fill larger target disks. The base root partition stays fixed-size and read-only at runtime.
|
||||
- The host-side installer expands the writable app/state partition to fill larger target disks. Base root partitions stay fixed-size and read-only at runtime.
|
||||
- Normal atomic images build with `ROLLBACK_SLOTS=2` by default: one current base slot plus one rollback base slot. Set `ROLLBACK_SLOTS=1` to use the old single-base-slot layout.
|
||||
- `forgeos-rollback` can copy the currently booted read-only base into an inactive rollback slot and promote a booted rollback slot back to `root`.
|
||||
- systemd is installed as `/sbin/init`. BusyBox remains available for `/bin/sh`, PAM-backed `/bin/login`, early switch-root support, and emergency command-line tools.
|
||||
- Nix `2.34.0` is staged from the official `x86_64-linux` binary tarball and configured in multi-user daemon mode with `/nix`, `nixbld` build users, `cache.nixos.org`, and `nix-command`/`flakes` enabled. The `/nix` tree lives in the mutable app layer on disk images. Override `NIX_VERSION` or `NIX_SYSTEM` if you intentionally want a different upstream tarball.
|
||||
- A ForgeOS-native `neofetch` command is included in the overlay with a custom ForgeOS ASCII logo at `/usr/share/neofetch/ascii/distro/forgeos`.
|
||||
@@ -134,7 +151,8 @@ sudo make install DISK=/dev/nvme0n1
|
||||
- `ENABLE_DESKTOP=1` adds an Openbox/tint2/PCManFM desktop layer to the normal ForgeOS rootfs by extracting a minimal Debian package payload while preserving the source-built systemd and D-Bus daemons.
|
||||
- `DESKTOP=gnome` switches rootfs assembly to a Debian package bootstrap because GNOME depends on a large desktop stack that ForgeOS does not source-build yet.
|
||||
|
||||
Set `BOOTLOADER=stub` when building an image to use the direct kernel EFI-stub fallback path instead of GRUB.
|
||||
Set `BOOTLOADER=stub` only when building a direct kernel EFI-stub image with its own firmware-provided load options or a kernel built with an embedded command line.
|
||||
The rollback selector is generated by the default GRUB bootloader path.
|
||||
|
||||
## Secure Boot Signing
|
||||
|
||||
@@ -168,7 +186,7 @@ Linux-PAM, systemd, and D-Bus are built with Meson/Ninja and staged dynamically.
|
||||
- UEFI only for now; BIOS boot is not implemented.
|
||||
- The kernel config includes common desktop, laptop, and QEMU storage/input paths, but not every vendor driver.
|
||||
- Wireless firmware, GPU acceleration, stock Microsoft-trusted Secure Boot/shim integration, audio, and power-management polish are not bundled yet.
|
||||
- Nix is the package manager for the mutable app layer, but ForgeOS does not yet have a declarative NixOS-style base OS rebuild/update flow or rollback selector.
|
||||
- Nix is the package manager for the mutable app layer, but ForgeOS does not yet have a declarative NixOS-style base OS rebuild/update flow.
|
||||
- Account management is limited to the built-in `forge` and `root` accounts.
|
||||
- The Openbox desktop layer is a staged runtime payload, not an in-OS package manager.
|
||||
- GNOME support is currently a package-bootstrapped desktop flavor, not a source-built ForgeOS desktop stack.
|
||||
|
||||
Reference in new issue
Block a user