Bug 11283 - wic: allow wic to update a kernel or bootloader in a disk image
Summary: wic: allow wic to update a kernel or bootloader in a disk image
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 2.4 M1
Assignee: Ed Bartosh
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-03-31 18:47 UTC by Stephano Cetola
Modified: 2017-06-14 09:51 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephano Cetola 2017-03-31 18:47:42 UTC
Often, especially when doing board bring-up, modifications to the kernel must happen at a fast pace. This often requires burning the disk image to some medium (uSD card) and booting the board numerous times.

Wic should be able to update an existing image with a new bootloader and/or kernel without having to rebuild the entire rootfs.

We can assume that the user has sudo, however if you can find a way to do this without sudo, Brian will buy you a round confectionery present.

e.g.
wic --update-kernel <kernel_path>  image.wic
wic --update-bootloader <bootloader_path> image.wic
Comment 1 Ed Bartosh 2017-05-10 11:26:40 UTC
As boot partition is usually msdos/vfat type it should be possible to use mtools https://www.gnu.org/software/mtools/manual/mtools.html for this task.
This would allow users to update files on boot vfat partition without mounting the image.
Comment 2 Ed Bartosh 2017-05-11 15:43:17 UTC
here is a list of new wic commands I ended up with:

1. copy files or directories to/from vfat partition of the image:

wic copy <src> <dst>

   - copy file or directory to the image:
     wic cp [-r] <local path> <image path>:<partition number>/<path>

   - copy file or directory from the image:
     wic cp [-r] <image path>:<partition number>/<path> <local path>

2. list partitions:
wic ls <image path>

3. list files on vfat partition:
wic ls <image path>:<partition number>/<path>

4. remove files/directories from vfat partition:

wic rm [-r] <image path>:<partition number>/<path>

Thoughts?
Comment 3 Ed Bartosh 2017-05-15 14:22:02 UTC
Implemented 'wic ls': http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136678.html
Comment 4 Ed Bartosh 2017-05-26 09:22:59 UTC
implemented 'wic cp': http://lists.openembedded.org/pipermail/openembedded-core/2017-May/137118.html
Comment 5 Ed Bartosh 2017-06-02 17:22:40 UTC
implemented 'wic rm': http://lists.openembedded.org/pipermail/openembedded-core/2017-June/137500.html
Comment 6 Ed Bartosh 2017-06-14 09:51:02 UTC
merged to poky master. commit id: 1de1a34a64d2e34d438f6d24adbd70a62366dab7