From 07ec3f2f86169a016be4fe6b44cbd5d910c29a2b Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Fri, 13 Oct 2017 09:00:54 -0700 Subject: dev-manual: Added wic ls, rm, and cp example Fixes [YOCTO #12191] Put in a new example in the Wic section to highlight the use of the 'wic ls', 'wic rm', and 'wic cp' commands. (From yocto-docs rev: 2bf316961d22d5dc2df2d849c50ec347d5f9db51) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 132 +++++++++++++++++++++ 1 file changed, 132 insertions(+) (limited to 'documentation') diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 9063b70b3f..c9dc5550c8 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -5438,6 +5438,138 @@ artifact is manually specified. + +
+ Using Wic to Manipulate an Image + + + Wic image manipulation allows you to shorten turnaround + time during image development. + For example, you can use Wic to delete the kernel partition + of a Wic image and then insert a newly built kernel. + This saves you time from having to rebuild the entire image + each time you modify the kernel. + + In order to use Wic to manipulate a Wic image as in + this example, your development machine must have the + mtools package installed. + + + + + The following example examines the contents of the Wic + image, deletes the existing kernel, and then inserts a + new kernel: + + + List the Partitions: + Use the wic ls command to list + all the partitions in the Wic image: + + $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic + Num Start End Size Fstype + 1 1048576 25041919 23993344 fat16 + 2 25165824 72157183 46991360 ext4 + + The previous output shows two partitions in the + core-image-minimal-qemux86.wic + image. + + + Examine a Particular Partition: + Use the wic ls command again + but in a different form to examine a particular + partition. + + You can get command usage on any Wic command + using the following form: + + $ wic help command + + For example, the following command shows you + the various ways to use the + wic ls command: + + $ wic help ls + + + The following command shows what is in Partition + one: + + $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1 + Volume in drive : is boot + Volume Serial Number is E894-1809 + Directory for ::/ + + libcom32 c32 186500 2017-10-09 16:06 + libutil c32 24148 2017-10-09 16:06 + syslinux cfg 220 2017-10-09 16:06 + vesamenu c32 27104 2017-10-09 16:06 + vmlinuz 6904608 2017-10-09 16:06 + 5 files 7 142 580 bytes + 16 582 656 bytes free + + The previous output shows five files, with the + vmlinuz being the kernel. + + If you see the following error, you need to + update or create a + ~/.mtoolsrc with the + suggested statement and then run the Wic + command again: + + ERROR: _exec_cmd: /usr/bin/mdir -i /tmp/wic-parttfokuwra ::/ returned '1' instead of 0 + output: Total number of sectors (47824) not a multiple of sectors per track (32)! + Add mtools_skip_check=1 to your .mtoolsrc file to skip this test + + + + + Remove the Old Kernel: + Use the wic rm command to + remove the vmlinuz file + (kernel): + + $ wic rm tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz + + + + Add In the New Kernel: + Use the wic cp command to + add the updated kernel to the Wic image. + Depending on how you built your kernel, it could + be in different places. + If you used devtool and + an SDK to build your kernel, it resides in the + tmp/work directory of the + extensible SDK. + If you used make to build the + kernel, the kernel will be in the + workspace/sources area. + + + The following example assumes + devtool was used to build + the kernel: + + cp ~/poky_sdk/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+git999-r0/linux-yocto-4.12.12+git999/arch/x86/boot/bzImage \ + ~/poky/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz + + Once the new kernel is added back into the image, + you can use the dd + command or + bmaptool + to flash your wic image onto an SD card + or USB stick and test your target. + + Using bmaptool is + generally 10 to 20 times faster than using + dd. + + + + +
-- cgit v1.2.3-54-g00ecf