BasedOS

BasedOS user guide (GKD 350H Ultra)

BasedOS is a small operating system that lives on the 350H Ultra's internal storage (eMMC) and starts spruce from your SD card. Your spruce card stays a normal spruce card: you can move it between the 350H Ultra and your other spruce devices.

What you need

Setup on the device (basedos-setup)

basedos-setup.sh runs on the 350H Ultra itself, under stock. There are two ways to run it: from a PC over SSH (here), or from a setup card with no PC (below); both offer the same choices.

Over SSH it downloads its release from GitHub. From a PC, in one go (press Enter at the password prompt: stock's root has none; the release page has the exact line for each release):

ssh -t root@<device> "curl -fsSL -o /tmp/basedos-setup.sh <release URL>/basedos-setup.sh && sh /tmp/basedos-setup.sh"

It checks stock's build and files first, states its requirements, asks everything, shows a numbered summary, asks you to type the confirmations (capitals don't matter), and only then downloads and writes. What it offers depends on what it finds on the device:

On the deviceChoices
No BasedOSInstall BasedOS on the built-in storage (eMMC), next to stock
BasedOS installed (on or disabled; also when its folder was deleted, as long as stock's own boot script, kept beside BasedOS's as boot.scr.stock, is still there)Repair BasedOS: puts this release's BasedOS back (its system, initrd and boot script), keeps its settings and clears its boot counter. For a BasedOS that no longer starts (the device then starts stock), or to go back to this release. A disabled one stays disabled. Uninstall BasedOS: stock's boot script back, BasedOS's files, settings and its Ports entry removed; stock is as it was (to install again: setup, from a PC or a setup card)
An install that didn't finishInstall (replaces it), or Remove it
Settings or Ports entries left from an uninstall that didn't finishInstall, or Remove what's left
AlwaysMake a recovery SD card: see "Recovery" below. Over SSH you type ERASE to confirm the card

Before Install, Repair or Uninstall it recommends making a recovery card and offers to in the same run (the change happens only once the card is made and checked). Over SSH you type INSTALL, REPAIR or UNINSTALL to confirm you understand the built-in storage is modified, know the risks and have a backup. Setup installs the release it comes with: to go back to an older release, run that release's setup.

If setup stops part-way (Ctrl-C, the SSH connection drops), run it again. A card is simply made again. An install is finished: BasedOS's boot script goes in last, so until then stock still starts, and setup recognises the unfinished install and replaces it.

Without a PC: the setup card

Each release also has basedos-setup-card-<release>.zip. Unpack it onto the root of a spare SD card (FAT32 or exFAT; not your spruce card, whose Roms folder stock doesn't read). It holds BasedOS's menu, roms/ports/BasedOS.sh, and the release in basedos-setup/. Power off, put the card in, power on into stock, and run Ports > BasedOS. Stock reads a card only at power-on: swapped while stock runs, it still shows the card that was in. With the setup card in, stock's Ports shows the card's own roms/ports (stock uses the card's roms folder, and makes its own system folders there), so BasedOS's menu from the card is the one there.

The entry copies the release into memory and checks it (on the screen, a file at a time), then runs the same setup with BasedOS's screens: Up/Down and A choose, B goes back to stock before anything is written, and the summary is confirmed by tapping A, B, X, Y in that order, as in BasedOS's maintenance menu. Stock's frontend is stopped while it runs. The checks and the recovery card's backup show how far they've got. While BasedOS is installed, the menu also has Disable BasedOS or Enable BasedOS, as below.

For a recovery card, setup releases the setup card first (it's unmounted, so it comes out clean): take it out and put in the card to erase, or use the setup card itself (setup has what it needs in memory). The screen shows the card in the slot, and A takes it. At the end it restarts or goes back to stock (after a recovery card: it powers off).

BasedOS in stock's Ports

From stock, while BasedOS is installed, stock's Ports has BasedOS: BasedOS's menu, with its version, stock's build, the battery and whether BasedOS is on or disabled. It shows BasedOS's screens, as its maintenance menu does (stock's frontend stops while it's up, and starts again after), and Disable and Uninstall want A, B, X, Y tapped in that order:

(Stock's Ports shows only what's in it; this entry is what makes BasedOS appear there.)

To go back to stock: the maintenance menu (below, Everyday use), or from SSH basedos-boot stock-once, disable or uninstall (add --reboot); basedos-boot status says what boots next. install-dev.sh revert (from stock or BasedOS) still puts stock's boot script back and leaves BasedOS's files.

These are careful with the boot script, the one file that decides whether the device boots: each script is checked before it's written (a well-formed boot script, BasedOS's or stock's as expected; stock's against the known stock build) and read back after; everything a switch needs is in place first, so a failure leaves the device as it was; nothing is removed until stock's script is back.

Everyday use

You doBasedOS does
Power onboots in about 4 s to spruce's menu
Power on holding Selectmaintenance mode: no spruce; Wi-Fi and SSH, BasedOS's version and build, and a menu (Up/Down, A): Boot Stock OS (this boot only); Install update (a .bosupd from the card: see Updates); Disable BasedOS (stock boots from then on; Ports > BasedOS > Enable BasedOS in stock turns BasedOS back on); Uninstall BasedOS (removes its files and settings from the device while it restarts, then starts stock; stock is as before the install); Restart; Power off. Updating, disabling and uninstalling want A, B, X, Y tapped in that order (as the recovery card); any other button goes back. The screen shows the address to SSH to once Wi-Fi is up
Power on holding Startstock, for this boot: BasedOS restarts into stock once; the next power-on is BasedOS again
Power on holding another buttonwhatever /data/boot-keys.conf maps it to (none by default): maintenance mode, stock once, or a frontend on the card other than the first one found. The format and the button names are in /usr/share/basedos/boot-keys.conf; copy it to /data/ to change it. The boot screen labels the mapped buttons: Select's and Start's beside the buttons themselves ("Maintenance", "Boot Stock OS" by default), any other in a list
Hold Volume Up + Volume Down together 3 sclean shutdown with any frontend, also a hung one: programs get 3 s to save and quit, then the card is synced and unmounted (basedos-shutdown-keys). Holding power is the frontend's (spruce: Button Settings > Power button hold time)
Tap power (in spruce)sleep; tap again to wake. spruce's "Shutdown after sleeping" works
Pull and reinsert the cardthe card is found again; a card that wasn't unmounted cleanly is checked first (the screen counts the seconds)

Without a card, or with a card that has no frontend on it (a setup card, say), BasedOS waits for one and says so on screen; a card with a frontend put in then starts it. While it waits, the buttons the boot-key map uses work there too, held for a second: Select for maintenance mode, Start for stock once (or whatever /data/boot-keys.conf maps them to), without restarting first. The screen stays on while it waits, so a device left there runs its battery down.

Wi-Fi and SSH

Updates

Safeguards

Recovery

If anything goes wrong, see recovery.md. In short, from gentlest to strongest:

  1. Recovery card (basedos-setup's "Make a recovery SD card"): power on with it in; it checks its backup, and when you tap A, B, X, Y in that order it puts the built-in storage back as it was when the card was made, then checks it. Tapping power powers off without writing. No PC needed. A restore from a recovery card was verified byte for byte on a unit (2026-11-20, with the earlier hold-A screen), and one brought a unit back after a boot script hung (2026-11-21).
  2. USB disk mode: hold Menu + Home and power on; the whole eMMC appears on your PC.
  3. Maskrom: hold Volume Down and power on; RKDevTool on a PC can rewrite the whole eMMC (tested, including a full restore).

Every SD card, the recovery card included, needs the device's own bootloader (at the start of the built-in storage) to start: the chip never starts one from a card (tested). If the bootloader itself is gone, only maskrom and a PC bring the device back; the recovery card carries what that needs (its maskrom/ folder: Rockchip's USB loader and the steps, and the backup's own copy of the bootloader).

Logs

For developers: installing a build

Setup (above) is the way to install. To install a build of your own instead:

  1. Prepare your stock files from a backup of your eMMC (recovery.md): python tools/prepare_stock.py <backup>/mmcblk0.img prepared. The build makes BasedOS's links into stock's files against them; nothing of stock's goes into BasedOS.
  2. Build: in WSL (Ubuntu 24.04) with tools/wsl/build.sh, or on any Linux host with podman or docker with tools/container/run.sh tools/wsl/build.sh (an Ubuntu 24.04 container; its work folders go to ~/basedos-host, about 30 GB). It unpacks your stock image the first time. It writes out/: the system layer (rootfs.squashfs), the initrd, BasedOS's boot script, the recovery card's files and an update payload (.bosupd).
  3. With the 350H Ultra running stock and reachable over SSH, copy out/ to /tmp on the device and run tools/install-dev.sh /tmp/<dir> there. It adds BasedOS's files to the boot partition (the system layer, the initrd), puts BasedOS's boot script in place of stock's (kept), copies your Wi-Fi network and SSH keys, and leaves stock's own files untouched.
  4. Reboot. BasedOS starts, then spruce from the card.

This page is docs/user-guide.md in the repository.