Skip to content

bsp: auto-initialise storage on deploy, clearer error otherwise#296

Merged
daniel-rossier merged 1 commit into
mainfrom
fix/deploy-auto-init-storage
Jul 16, 2026
Merged

bsp: auto-initialise storage on deploy, clearer error otherwise#296
daniel-rossier merged 1 commit into
mainfrom
fix/deploy-auto-init-storage

Conversation

@daniel-rossier

Copy link
Copy Markdown
Contributor

Problem

Deploying on a fresh tree (./scripts/deploy.sh -a bsp-so3, IB_STORAGE_MODE=soft platforms such as virt64/virt32) failed with a bare, unhelpful message:

ERROR: .../filesystem/work/sdcard.img.virt64 does not exist

Root cause: do_deploy__do_deploy_boot() goes straight to __do_fs_mount(); it never runs __do_fs_check(), so the SD-card image is never created. It only existed if the user had separately run scripts/init_storage.sh first — an undocumented prerequisite.

Changes

  • meta-bsp/classes/bsp.bbclass__do_deploy_boot() now calls __do_fs_check(d) before mounting. In soft mode this creates sdcard.img.<platform> on the fly when missing (the same work as scripts/init_storage.sh). deploy.sh has already opened a sudo session, so the losetup/mkfs via sudo -n succeeds. A single deploy.sh -a bsp-so3 now works end-to-end on a fresh checkout. The misleading WARNING: Now mounting is demoted to a plain note.
  • meta-filesystem/classes/fs_arm_common.bbclass — the ENOENT path in __do_fs_mount() now names the platform and points at ./scripts/init_storage.sh, as a safety net (and for hard mode, where there is no image to auto-create).

Test

Validated end-to-end on virt64 with no pre-existing image:

Deploy SO3 image and U-boot
The filesystem image: sdcard.img.virt64 does not exist - creating it
Mounting storage
task do_deploy: Succeeded
NOTE: Tasks Summary: Attempted 12 tasks ... all succeeded.

Resulting sdcard.img.virt64 (2.0G) has the expected FAT32 boot + ext4 rootfs partitions.

do_deploy went straight to mounting the SD-card image, so a deploy on a
fresh tree failed with a bare "sdcard.img.<platform> does not exist"
when the storage had never been initialised.

Make deploy depend on an initialised storage: __do_deploy_boot() now
calls __do_fs_check() before mounting, which in "soft" mode creates the
image on the fly (same work as scripts/init_storage.sh). deploy.sh has
already opened a sudo session, so the losetup/mkfs run fine. A single
'deploy.sh -a bsp-so3' now works end-to-end on a fresh checkout.

As a safety net (and for "hard" mode), the ENOENT path in __do_fs_mount()
now names the platform and points at ./scripts/init_storage.sh instead
of the terse "does not exist". Also demote the misleading
"WARNING: Now mounting" to a plain note.
@daniel-rossier
daniel-rossier merged commit 32953c8 into main Jul 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant