Security hardening: bind kubeconfig server to localhost, mount hardening (noexec/nosuid/nodev on tmpfs), sysctl network hardening, kernel module loading lock after boot, SHA256 checksum verification for downloads, kernel AppArmor + Audit support, complain-mode AppArmor profiles for containerd and kubelet, and security integration test. ARM64 Raspberry Pi support: piCore64 base extraction, RPi kernel build from raspberrypi/linux fork, RPi firmware fetch, SD card image with 4- partition GPT and tryboot A/B mechanism, BootEnv Go interface abstracting GRUB vs RPi boot environments, architecture-aware build scripts, QEMU aarch64 dev VM and boot test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
768 B
Go
35 lines
768 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"log/slog"
|
|
)
|
|
|
|
// Rollback forces an immediate switch to the other partition.
|
|
// Use this to manually revert to the previous version.
|
|
func Rollback(args []string) error {
|
|
opts := parseOpts(args)
|
|
env := opts.NewBootEnv()
|
|
|
|
activeSlot, err := env.ActiveSlot()
|
|
if err != nil {
|
|
return fmt.Errorf("reading active slot: %w", err)
|
|
}
|
|
|
|
passiveSlot, err := env.PassiveSlot()
|
|
if err != nil {
|
|
return fmt.Errorf("reading passive slot: %w", err)
|
|
}
|
|
|
|
slog.Info("forcing rollback", "from", activeSlot, "to", passiveSlot)
|
|
|
|
if err := env.ForceRollback(); err != nil {
|
|
return fmt.Errorf("rollback failed: %w", err)
|
|
}
|
|
|
|
fmt.Printf("Rolled back: %s → %s\n", activeSlot, passiveSlot)
|
|
fmt.Println("Reboot to complete rollback.")
|
|
|
|
return nil
|
|
}
|