bsp: auto-initialise storage on deploy, clearer error otherwise#296
Merged
Conversation
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.
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.
Problem
Deploying on a fresh tree (
./scripts/deploy.sh -a bsp-so3,IB_STORAGE_MODE=softplatforms such as virt64/virt32) failed with a bare, unhelpful message: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 runscripts/init_storage.shfirst — an undocumented prerequisite.Changes
meta-bsp/classes/bsp.bbclass—__do_deploy_boot()now calls__do_fs_check(d)before mounting. Insoftmode this createssdcard.img.<platform>on the fly when missing (the same work asscripts/init_storage.sh).deploy.shhas already opened a sudo session, so thelosetup/mkfsviasudo -nsucceeds. A singledeploy.sh -a bsp-so3now works end-to-end on a fresh checkout. The misleadingWARNING: Now mountingis demoted to a plain note.meta-filesystem/classes/fs_arm_common.bbclass— theENOENTpath in__do_fs_mount()now names the platform and points at./scripts/init_storage.sh, as a safety net (and forhardmode, where there is no image to auto-create).Test
Validated end-to-end on virt64 with no pre-existing image:
Resulting
sdcard.img.virt64(2.0G) has the expected FAT32 boot + ext4 rootfs partitions.