Skip to content

Commit 32953c8

Browse files
Merge pull request #296 from smartobjectoriented/fix/deploy-auto-init-storage
bsp: auto-initialise storage on deploy, clearer error otherwise
2 parents f733a4e + d0a4ffc commit 32953c8

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

build/meta-bsp/classes/bsp.bbclass

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,13 @@ addtask do_deploy_boot_chain before do_deploy
176176
def __do_deploy_boot(d):
177177

178178
if d.getVar('IB_STORAGE_MODE') not in ("remote", "http"):
179-
bb.warn("Now mounting")
179+
# Make deploy depend on an initialised storage. In "soft" mode this
180+
# creates sdcard.img.<platform> on the fly when it is missing (the
181+
# same work as scripts/init_storage.sh), so a fresh tree can deploy
182+
# without a separate manual init step. deploy.sh already opened a
183+
# sudo session, so the losetup/mkfs done here via `sudo -n` succeeds.
184+
__do_fs_check(d)
185+
bb.plain("Mounting storage")
180186
__do_fs_mount(d)
181187

182188
__do_platform_deploy(d)

build/meta-filesystem/classes/fs_arm_common.bbclass

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,13 @@ def __do_fs_mount(d):
169169
os.stat(img_path)
170170
except OSError as e:
171171
if e.errno == errno.ENOENT:
172-
bb.fatal(f"{img_path} does not exist")
172+
bb.fatal(
173+
f"Storage image '{img_path}' does not exist: the filesystem "
174+
f"for platform '{IB_PLATFORM}' has not been initialised yet.\n"
175+
f"Deploy normally creates it automatically; if you reach this, "
176+
f"initialise the storage explicitly by running:\n"
177+
f" ./scripts/init_storage.sh\n"
178+
f"then run the deploy again.")
173179

174180
p1 = os.path.join(WORKDIR, "p1")
175181
p2 = os.path.join(WORKDIR, "p2")

0 commit comments

Comments
 (0)