armbian-install: add "spi" mode for self-contained boot on NVMe/SATA/USB - #1024
Merged
Merged
Conversation
Boards that keep u-boot in on-board SPI/NOR flash but cannot flash it from
the OS (e.g. SpacemiT K3 / k3picoitx, where u-boot is written once via
fastboot/DFU) had no good install target for an NVMe/SATA/USB disk. The
only mode offered was "sd", which leaves /boot on the removable install
media and binds it into the target - so the freshly installed NVMe was not
bootable on its own and needed a manual /boot copy + fstab fix.
Add a new "spi" mode, offered first for nvme/sata/usb when SPI/MTD flash is
present (partitioner_mtd_list non-empty) but the board has no
write_uboot_platform_mtd hook. It installs a fully self-contained target:
* layout identical to "emmc" (local /boot the board's u-boot reads), but
with the ordinary 1MiB start offset - u-boot lives in SPI, not on this
disk, so no 16MiB raw-sector reserve;
* /boot populated on the target and its boot env pointed at the target's
own new root (like emmc/mtd/ufs);
* NO bootloader write - u-boot is already in SPI and its boot script
scans the disk for /boot/boot.scr, so install_write_bootloader is
skipped and install_bootloader_available returns 0 unconditionally
(like "sd");
* source partition-table type inherited, same as emmc/sd/mtd.
Wired through the TUI (dedicated warning), the CLI (--boot spi, accepted
and routed to install_run_scenario) and the mode descriptions. Boards that
DO have write_uboot_platform_mtd still get "mtd" as before; boards with no
SPI still get "sd" only. Offer-only: a false positive just adds an unpicked
menu entry.
Tests: spi layout (ext4 boot-flagged root, btrfs dedicated boot, 1MiB start,
source-table inheritance) and spi bootloader-availability (no capability
required). Full suite 97/97.
Signed-off-by: Igor Pecovnik <igor@armbian.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On boards that keep u-boot in on-board SPI/NOR flash but cannot flash it from the OS (e.g. SpacemiT K3 / k3picoitx, where u-boot is written once via fastboot/DFU), an NVMe/SATA/USB install target had no good option. The only mode offered was
sd, which leaves/booton the removable install media and binds it into the target — so the freshly installed NVMe was not bootable on its own and needed a manual/bootcopy + fstab fix.New
spimodeOffered first for
nvme/sata/usbwhen SPI/MTD flash is present (partitioner_mtd_listnon-empty) but the board has nowrite_uboot_platform_mtdhook. It installs a fully self-contained target:emmc(local/bootthe board’s u-boot reads), but with the ordinary 1MiB start offset — u-boot lives in SPI, not on this disk, so no 16MiB raw-sector reserve;/bootpopulated on the target and its boot env pointed at the target’s own new root (likeemmc/mtd/ufs);/boot/boot.scr, soinstall_write_bootloaderis skipped andinstall_bootloader_availablereturns 0 unconditionally (likesd);emmc/sd/mtd.Wired through the TUI (dedicated warning), the CLI (
--boot spi, routed toinstall_run_scenario) and the mode descriptions. Boards that do havewrite_uboot_platform_mtdstill getmtd; boards with no SPI still getsdonly. Offer-only — a false positive just adds an unpicked menu entry.Tests
New unit tests for the
spilayout (ext4 boot-flagged root, btrfs dedicated boot, 1MiB start, source-table inheritance) andspibootloader-availability (no capability required). Full bats suite 97/97.Hardware validation (k3picoitx, RISC-V)
Ran the installer standalone from a USB-booted system:
[spi sd]for the NVMe (spi first);UUID=… /only — no/media/boot-mediabind, zero dependency on the USB;armbianEnv.txtrootdevpoints at the NVMe’s own root;/dev/nvme0n1p1via the SPI u-boot.Related
Companion to the SpacemiT K3 u-boot / NVMe enablement in the build framework: armbian/build#10506 (u-boot
k3-br-v1.0.7bump +pci enumbeforenvme scanin the autoboot env, which makes NVMe boot possible in the first place). That PR makes the board able to boot from NVMe; this one makes the installer produce a bootable NVMe automatically.Signed-off-by: Igor Pecovnik igor@armbian.com