diff options
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 453 |
1 files changed, 237 insertions, 216 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 3202f348dc..c788a8d30a 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -4844,7 +4844,7 @@ | |||
4844 | contained in an Openembedded kickstart file | 4844 | contained in an Openembedded kickstart file |
4845 | (<filename>.wks</filename>) specified either directly on | 4845 | (<filename>.wks</filename>) specified either directly on |
4846 | the command line or as one of a selection of canned | 4846 | the command line or as one of a selection of canned |
4847 | <filename>.wks</filename> files as shown with the | 4847 | kickstart files as shown with the |
4848 | <filename>wic list images</filename> command in the | 4848 | <filename>wic list images</filename> command in the |
4849 | "<link linkend='using-a-provided-kickstart-file'>Using an Existing Kickstart File</link>" | 4849 | "<link linkend='using-a-provided-kickstart-file'>Using an Existing Kickstart File</link>" |
4850 | section. | 4850 | section. |
@@ -4869,16 +4869,14 @@ | |||
4869 | This section provides some background information on Wic, | 4869 | This section provides some background information on Wic, |
4870 | describes what you need to have in | 4870 | describes what you need to have in |
4871 | place to run the tool, provides instruction on how to use | 4871 | place to run the tool, provides instruction on how to use |
4872 | the <filename>wic</filename> utility, | 4872 | the Wic utility, and provides several examples. |
4873 | and provides several examples. | ||
4874 | </para> | 4873 | </para> |
4875 | 4874 | ||
4876 | <section id='wic-background'> | 4875 | <section id='wic-background'> |
4877 | <title>Background</title> | 4876 | <title>Background</title> |
4878 | 4877 | ||
4879 | <para> | 4878 | <para> |
4880 | This section provides some background on the | 4879 | This section provides some background on the Wic utility. |
4881 | <filename>wic</filename> utility. | ||
4882 | While none of this information is required to use | 4880 | While none of this information is required to use |
4883 | Wic, you might find it interesting. | 4881 | Wic, you might find it interesting. |
4884 | <itemizedlist> | 4882 | <itemizedlist> |
@@ -4920,9 +4918,9 @@ | |||
4920 | <title>Requirements</title> | 4918 | <title>Requirements</title> |
4921 | 4919 | ||
4922 | <para> | 4920 | <para> |
4923 | In order to use the <filename>wic</filename> utility | 4921 | In order to use the Wic utility with the OpenEmbedded Build |
4924 | with the OpenEmbedded Build system, your system needs | 4922 | system, your system needs to meet the following |
4925 | to meet the following requirements: | 4923 | requirements: |
4926 | <itemizedlist> | 4924 | <itemizedlist> |
4927 | <listitem><para>The Linux distribution on your | 4925 | <listitem><para>The Linux distribution on your |
4928 | development host must support the Yocto Project. | 4926 | development host must support the Yocto Project. |
@@ -4938,6 +4936,13 @@ | |||
4938 | development host system. | 4936 | development host system. |
4939 | </para></listitem> | 4937 | </para></listitem> |
4940 | <listitem><para> | 4938 | <listitem><para> |
4939 | You must have sourced the build environment | ||
4940 | setup script (i.e. | ||
4941 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>) | ||
4942 | found in the | ||
4943 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>. | ||
4944 | </para></listitem> | ||
4945 | <listitem><para> | ||
4941 | You need to have the build artifacts already | 4946 | You need to have the build artifacts already |
4942 | available, which typically means that you must | 4947 | available, which typically means that you must |
4943 | have already created an image using the | 4948 | have already created an image using the |
@@ -4947,22 +4952,16 @@ | |||
4947 | in order to create an image using | 4952 | in order to create an image using |
4948 | Wic, the current version of | 4953 | Wic, the current version of |
4949 | Wic requires the artifacts | 4954 | Wic requires the artifacts |
4950 | in the form generated by the build system. | 4955 | in the form generated by the OpenEmbedded build |
4956 | system. | ||
4951 | </para></listitem> | 4957 | </para></listitem> |
4952 | <listitem><para> | 4958 | <listitem><para> |
4953 | You must build several native tools, which are tools | 4959 | You must build several native tools, which are |
4954 | built to run on the build system: | 4960 | built to run on the build system: |
4955 | <literallayout class='monospaced'> | 4961 | <literallayout class='monospaced'> |
4956 | $ bitbake parted-native dosfstools-native mtools-native | 4962 | $ bitbake parted-native dosfstools-native mtools-native |
4957 | </literallayout> | 4963 | </literallayout> |
4958 | </para></listitem> | 4964 | </para></listitem> |
4959 | <listitem><para> | ||
4960 | You must have sourced the build environment | ||
4961 | setup script (i.e. | ||
4962 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>) | ||
4963 | found in the | ||
4964 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>. | ||
4965 | </para></listitem> | ||
4966 | </itemizedlist> | 4965 | </itemizedlist> |
4967 | </para> | 4966 | </para> |
4968 | </section> | 4967 | </section> |
@@ -4982,13 +4981,16 @@ | |||
4982 | </para> | 4981 | </para> |
4983 | 4982 | ||
4984 | <para> | 4983 | <para> |
4985 | Currently, Wic supports two commands: | 4984 | Currently, Wic supports seven commands: |
4986 | <filename>create</filename> and <filename>list</filename>. | 4985 | <filename>cp</filename>, <filename>create</filename>, |
4987 | You can get help for these commands as follows: | 4986 | <filename>help</filename>, <filename>list</filename>, |
4987 | <filename>ls</filename>, <filename>rm</filename>, and | ||
4988 | <filename>write</filename>. | ||
4989 | You can get help for these commands as follows with | ||
4990 | <replaceable>command</replaceable> being one of the | ||
4991 | supported commands: | ||
4988 | <literallayout class='monospaced'> | 4992 | <literallayout class='monospaced'> |
4989 | $ wic help <replaceable>command</replaceable> | 4993 | $ wic help <replaceable>command</replaceable> |
4990 | with <replaceable>command</replaceable> being either | ||
4991 | <filename>create</filename> or <filename>list</filename>. | ||
4992 | </literallayout> | 4994 | </literallayout> |
4993 | </para> | 4995 | </para> |
4994 | 4996 | ||
@@ -5007,15 +5009,29 @@ | |||
5007 | </para> | 5009 | </para> |
5008 | 5010 | ||
5009 | <para> | 5011 | <para> |
5010 | You can find out more about the images | 5012 | You can find out more about the images Wic creates using |
5011 | Wic creates using the existing | 5013 | the existing kickstart files with the following form of |
5012 | kickstart files with the following form of the command: | 5014 | the command: |
5013 | <literallayout class='monospaced'> | 5015 | <literallayout class='monospaced'> |
5014 | $ wic list <replaceable>image</replaceable> help | 5016 | $ wic list <replaceable>image</replaceable> help |
5015 | </literallayout> | 5017 | </literallayout> |
5016 | with <filename><replaceable>image</replaceable></filename> | 5018 | For <replaceable>image</replaceable>, you can provide |
5017 | being either <filename>directdisk</filename> or | 5019 | any of the following: |
5018 | <filename>mkefidisk</filename>. | 5020 | <literallayout class='monospaced'> |
5021 | beaglebone | ||
5022 | mpc8315e-rdb | ||
5023 | genericx86 | ||
5024 | edgerouter | ||
5025 | qemux86-directdisk | ||
5026 | directdisk-gpt | ||
5027 | mkefidisk | ||
5028 | directdisk | ||
5029 | systemd-bootdisk | ||
5030 | mkhybridiso | ||
5031 | sdimage-bootpart | ||
5032 | directdisk-multi-rootfs | ||
5033 | directdisk-bootloader-config | ||
5034 | </literallayout> | ||
5019 | </para> | 5035 | </para> |
5020 | </section> | 5036 | </section> |
5021 | 5037 | ||
@@ -5031,7 +5047,7 @@ | |||
5031 | <listitem><para> | 5047 | <listitem><para> |
5032 | <emphasis>Raw Mode:</emphasis> | 5048 | <emphasis>Raw Mode:</emphasis> |
5033 | You explicitly specify build artifacts through | 5049 | You explicitly specify build artifacts through |
5034 | command-line arguments. | 5050 | <filename>wic</filename> command-line arguments. |
5035 | </para></listitem> | 5051 | </para></listitem> |
5036 | <listitem><para> | 5052 | <listitem><para> |
5037 | <emphasis>Cooked Mode:</emphasis> | 5053 | <emphasis>Cooked Mode:</emphasis> |
@@ -5039,6 +5055,8 @@ | |||
5039 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | 5055 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |
5040 | setting and image name are used to automatically | 5056 | setting and image name are used to automatically |
5041 | locate and provide the build artifacts. | 5057 | locate and provide the build artifacts. |
5058 | You just supply a kickstart file and the name | ||
5059 | of the image from which to use artifacts. | ||
5042 | </para></listitem> | 5060 | </para></listitem> |
5043 | </itemizedlist> | 5061 | </itemizedlist> |
5044 | </para> | 5062 | </para> |
@@ -5046,61 +5064,69 @@ | |||
5046 | <para> | 5064 | <para> |
5047 | Regardless of the mode you use, you need to have the build | 5065 | Regardless of the mode you use, you need to have the build |
5048 | artifacts ready and available. | 5066 | artifacts ready and available. |
5049 | Additionally, the environment must be set up using the | ||
5050 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
5051 | script found in the | ||
5052 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>. | ||
5053 | </para> | 5067 | </para> |
5054 | 5068 | ||
5055 | <section id='raw-mode'> | 5069 | <section id='raw-mode'> |
5056 | <title>Raw Mode</title> | 5070 | <title>Raw Mode</title> |
5057 | 5071 | ||
5058 | <para> | 5072 | <para> |
5073 | Running Wic in raw mode allows you to specify all the | ||
5074 | partitions through the <filename>wic</filename> | ||
5075 | command line. | ||
5076 | The primary use for raw mode is if you have built | ||
5077 | your kernel outside of the Yocto Project | ||
5078 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>. | ||
5079 | In other words, you can point to arbitrary kernel, | ||
5080 | root filesystem locations, and so forth. | ||
5081 | Contrast this behavior with cooked mode where Wic | ||
5082 | looks in the Build Directory (e.g. | ||
5083 | <filename>tmp/deploy/images/</filename><replaceable>machine</replaceable>). | ||
5084 | </para> | ||
5085 | |||
5086 | <para> | ||
5059 | The general form of the | 5087 | The general form of the |
5060 | <filename>wic</filename> command in raw mode is: | 5088 | <filename>wic</filename> command in raw mode is: |
5061 | <literallayout class='monospaced'> | 5089 | <literallayout class='monospaced'> |
5062 | $ wic create <replaceable>image_name</replaceable>.wks [<replaceable>options</replaceable>] [...] | 5090 | $ wic create <replaceable>wks_file</replaceable> <replaceable>options</replaceable> ... |
5063 | 5091 | ||
5064 | Where: | 5092 | Where: |
5065 | 5093 | ||
5066 | <replaceable>image_name</replaceable>.wks | 5094 | <replaceable>wks_file</replaceable>: |
5067 | An OpenEmbedded kickstart file. You can provide | 5095 | An OpenEmbedded kickstart file. You can provide |
5068 | your own custom file or use a file from a set of | 5096 | your own custom file or use a file from a set of |
5069 | existing files as described by further options. | 5097 | existing files as described by further options. |
5070 | 5098 | ||
5071 | -o <replaceable>OUTDIR</replaceable>, --outdir=<replaceable>OUTDIR</replaceable> | 5099 | optional arguments: |
5072 | The name of a directory in which to create image. | 5100 | -h, --help show this help message and exit |
5073 | 5101 | -o <replaceable>OUTDIR</replaceable>, --outdir <replaceable>OUTDIR</replaceable> | |
5074 | -i <replaceable>PROPERTIES_FILE</replaceable>, --infile=<replaceable>PROPERTIES_FILE</replaceable> | 5102 | name of directory to create image in |
5075 | The name of a file containing the values for image | 5103 | -e <replaceable>IMAGE_NAME</replaceable>, --image-name <replaceable>IMAGE_NAME</replaceable> |
5076 | properties as a JSON file. | 5104 | name of the image to use the artifacts from e.g. core- |
5077 | 5105 | image-sato | |
5078 | -e <replaceable>IMAGE_NAME</replaceable>, --image-name=<replaceable>IMAGE_NAME</replaceable> | 5106 | -r <replaceable>ROOTFS_DIR</replaceable>, --rootfs-dir <replaceable>ROOTFS_DIR</replaceable> |
5079 | The name of the image from which to use the artifacts | 5107 | path to the /rootfs dir to use as the .wks rootfs |
5080 | (e.g. <filename>core-image-sato</filename>). | 5108 | source |
5081 | 5109 | -b <replaceable>BOOTIMG_DIR</replaceable>, --bootimg-dir <replaceable>BOOTIMG_DIR</replaceable> | |
5082 | -r <replaceable>ROOTFS_DIR</replaceable>, --rootfs-dir=<replaceable>ROOTFS_DIR</replaceable> | 5110 | path to the dir containing the boot artifacts (e.g. |
5083 | The path to the <filename>/rootfs</filename> directory to use as the | 5111 | /EFI or /syslinux dirs) to use as the .wks bootimg |
5084 | <filename>.wks</filename> rootfs source. | 5112 | source |
5085 | 5113 | -k <replaceable>KERNEL_DIR</replaceable>, --kernel-dir <replaceable>KERNEL_DIR</replaceable> | |
5086 | -b <replaceable>BOOTIMG_DIR</replaceable>, --bootimg-dir=<replaceable>BOOTIMG_DIR</replaceable> | 5114 | path to the dir containing the kernel to use in the |
5087 | The path to the directory containing the boot artifacts | 5115 | .wks bootimg |
5088 | (e.g. <filename>/EFI</filename> or <filename>/syslinux</filename>) to use as the <filename>.wks</filename> bootimg | 5116 | -n <replaceable>NATIVE_SYSROOT</replaceable>, --native-sysroot <replaceable>NATIVE_SYSROOT</replaceable> |
5089 | source. | 5117 | path to the native sysroot containing the tools to use |
5090 | 5118 | to build the image | |
5091 | -k <replaceable>KERNEL_DIR</replaceable>, --kernel-dir=<replaceable>KERNEL_DIR</replaceable> | 5119 | -s, --skip-build-check |
5092 | The path to the directory containing the kernel to use | 5120 | skip the build check |
5093 | in the <filename>.wks</filename> boot image. | 5121 | -f, --build-rootfs build rootfs |
5094 | 5122 | -c {gzip,bzip2,xz}, --compress-with {gzip,bzip2,xz} | |
5095 | -n <replaceable>NATIVE_SYSROOT</replaceable>, --native-sysroot=<replaceable>NATIVE_SYSROOT</replaceable> | 5123 | compress image with specified compressor |
5096 | The path to the native sysroot containing the tools to use | 5124 | -m, --bmap generate .bmap |
5097 | to build the image. | 5125 | --no-fstab-update Do not change fstab file. |
5098 | 5126 | -v <replaceable>VARS_DIR</replaceable>, --vars <replaceable>VARS_DIR</replaceable> | |
5099 | -s, --skip-build-check | 5127 | directory with <image>.env files that store bitbake |
5100 | Skips the build check. | 5128 | variables |
5101 | 5129 | -D, --debug output debug information | |
5102 | -D, --debug | ||
5103 | Output debug information. | ||
5104 | </literallayout> | 5130 | </literallayout> |
5105 | <note> | 5131 | <note> |
5106 | You do not need root privileges to run | 5132 | You do not need root privileges to run |
@@ -5115,26 +5141,37 @@ | |||
5115 | <title>Cooked Mode</title> | 5141 | <title>Cooked Mode</title> |
5116 | 5142 | ||
5117 | <para> | 5143 | <para> |
5118 | The general form of the <filename>wic</filename> command | 5144 | Running Wic in cooked mode leverages off artifacts in |
5119 | using Cooked Mode is: | 5145 | Build Directory. |
5146 | In other words, you do not have to specify kernel or | ||
5147 | root filesystem locations as part of the command. | ||
5148 | All you need to provide is a kickstart file and the | ||
5149 | name of the image from which to use artifacts by using | ||
5150 | the "-e" option. | ||
5151 | Wic looks in the Build Directory (e.g. | ||
5152 | <filename>tmp/deploy/images/</filename><replaceable>machine</replaceable>) | ||
5153 | for artifacts. | ||
5154 | </para> | ||
5155 | |||
5156 | <para> | ||
5157 | The general form of the <filename>wic</filename> | ||
5158 | command using Cooked Mode is as follows: | ||
5120 | <literallayout class='monospaced'> | 5159 | <literallayout class='monospaced'> |
5121 | $ wic create <replaceable>kickstart_file</replaceable> -e <replaceable>image_name</replaceable> | 5160 | $ wic create <replaceable>wks_file</replaceable> -e <replaceable>IMAGE_NAME</replaceable> |
5122 | 5161 | ||
5123 | Where: | 5162 | Where: |
5124 | 5163 | ||
5125 | <replaceable>kickstart_file</replaceable> | 5164 | <replaceable>wks_file</replaceable>: |
5126 | An OpenEmbedded kickstart file. You can provide your own | 5165 | An OpenEmbedded kickstart file. You can provide |
5127 | custom file or a supplied file. | 5166 | your own custom file or use a file from a set of |
5167 | existing files provided with the Yocto Project | ||
5168 | release. | ||
5128 | 5169 | ||
5129 | <replaceable>image_name</replaceable> | 5170 | required argument: |
5130 | Specifies the image built using the OpenEmbedded build | 5171 | -e <replaceable>IMAGE_NAME</replaceable>, --image-name <replaceable>IMAGE_NAME</replaceable> |
5131 | system. | 5172 | name of the image to use the artifacts from e.g. core- |
5173 | image-sato | ||
5132 | </literallayout> | 5174 | </literallayout> |
5133 | This form is the simplest and most user-friendly, as it | ||
5134 | does not require specifying all individual parameters. | ||
5135 | All you need to provide is your own | ||
5136 | <filename>.wks</filename> file or one provided with the | ||
5137 | release. | ||
5138 | </para> | 5175 | </para> |
5139 | </section> | 5176 | </section> |
5140 | </section> | 5177 | </section> |
@@ -5143,14 +5180,33 @@ | |||
5143 | <title>Using an Existing Kickstart File</title> | 5180 | <title>Using an Existing Kickstart File</title> |
5144 | 5181 | ||
5145 | <para> | 5182 | <para> |
5146 | If you do not want to create your own | 5183 | If you do not want to create your own kickstart file, you |
5147 | <filename>.wks</filename> file, you can use an existing | 5184 | can use an existing file provided by the Wic installation. |
5148 | file provided by the Wic installation. | 5185 | As shipped, kickstart files can be found in the |
5149 | Use the following command to list the available files: | 5186 | Yocto Project |
5187 | <ulink url='&YOCTO_DOCS_REF_URL;#source-repositories'>Source Repositories</ulink> | ||
5188 | in the following two locations: | ||
5189 | <literallayout class='monospaced'> | ||
5190 | poky/meta-yocto-bsp/wic | ||
5191 | poky/scripts/lib/wic/canned-wks | ||
5192 | </literallayout> | ||
5193 | Use the following command to list the available kickstart | ||
5194 | files: | ||
5150 | <literallayout class='monospaced'> | 5195 | <literallayout class='monospaced'> |
5151 | $ wic list images | 5196 | $ wic list images |
5152 | directdisk Create a 'pcbios' direct disk image | 5197 | beaglebone Create SD card image for Beaglebone |
5153 | mkefidisk Create an EFI disk image | 5198 | mpc8315e-rdb Create SD card image for MPC8315E-RDB |
5199 | genericx86 Create an EFI disk image for genericx86* | ||
5200 | edgerouter Create SD card image for Edgerouter | ||
5201 | qemux86-directdisk Create a qemu machine 'pcbios' direct disk image | ||
5202 | directdisk-gpt Create a 'pcbios' direct disk image | ||
5203 | mkefidisk Create an EFI disk image | ||
5204 | directdisk Create a 'pcbios' direct disk image | ||
5205 | systemd-bootdisk Create an EFI disk image with systemd-boot | ||
5206 | mkhybridiso Create a hybrid ISO image | ||
5207 | sdimage-bootpart Create SD card image with a boot partition | ||
5208 | directdisk-multi-rootfs Create multi rootfs image using rootfs plugin | ||
5209 | directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config | ||
5154 | </literallayout> | 5210 | </literallayout> |
5155 | When you use an existing file, you do not have to use the | 5211 | When you use an existing file, you do not have to use the |
5156 | <filename>.wks</filename> extension. | 5212 | <filename>.wks</filename> extension. |
@@ -5164,20 +5220,16 @@ | |||
5164 | 5220 | ||
5165 | <para> | 5221 | <para> |
5166 | Here are the actual partition language commands | 5222 | Here are the actual partition language commands |
5167 | used in the <filename>mkefidisk.wks</filename> file to | 5223 | used in the <filename>genericx86.wks</filename> file to |
5168 | generate an image: | 5224 | generate an image: |
5169 | <literallayout class='monospaced'> | 5225 | <literallayout class='monospaced'> |
5170 | # short-description: Create an EFI disk image | 5226 | # short-description: Create an EFI disk image for genericx86* |
5171 | # long-description: Creates a partitioned EFI disk image that the user | 5227 | # long-description: Creates a partitioned EFI disk image for genericx86* machines |
5172 | # can directly dd to boot media. | 5228 | part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024 |
5173 | 5229 | part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid | |
5174 | part /boot --source bootimg-efi --ondisk sda --label msdos --active --align 1024 | ||
5175 | |||
5176 | part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024 | ||
5177 | |||
5178 | part swap --ondisk sda --size 44 --label swap1 --fstype=swap | 5230 | part swap --ondisk sda --size 44 --label swap1 --fstype=swap |
5179 | 5231 | ||
5180 | bootloader --timeout=10 --append="rootwait rootfstype=ext3 console=ttyPCH0,115200 console=tty0 vmalloc=256MB snd-hda-intel.enable_msi=0" | 5232 | bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0" |
5181 | </literallayout> | 5233 | </literallayout> |
5182 | </para> | 5234 | </para> |
5183 | </section> | 5235 | </section> |
@@ -5187,7 +5239,7 @@ | |||
5187 | 5239 | ||
5188 | <para> | 5240 | <para> |
5189 | This section provides several examples that show how to use | 5241 | This section provides several examples that show how to use |
5190 | the <filename>wic</filename> utility. | 5242 | the Wic utility. |
5191 | All the examples assume the list of requirements in the | 5243 | All the examples assume the list of requirements in the |
5192 | "<link linkend='wic-requirements'>Requirements</link>" | 5244 | "<link linkend='wic-requirements'>Requirements</link>" |
5193 | section have been met. | 5245 | section have been met. |
@@ -5203,42 +5255,36 @@ | |||
5203 | <filename>mkefidisk</filename> kickstart file: | 5255 | <filename>mkefidisk</filename> kickstart file: |
5204 | <literallayout class='monospaced'> | 5256 | <literallayout class='monospaced'> |
5205 | $ wic create mkefidisk -e core-image-minimal | 5257 | $ wic create mkefidisk -e core-image-minimal |
5206 | Checking basic build environment... | 5258 | INFO: Building wic-tools... |
5207 | Done. | 5259 | . |
5208 | 5260 | . | |
5209 | Creating image(s)... | 5261 | . |
5210 | 5262 | INFO: The new image(s) can be found here: | |
5211 | Info: The new image(s) can be found here: | 5263 | ./mkefidisk-201710061409-sda.direct |
5212 | <replaceable>current_directory</replaceable>/build/mkefidisk-201310230946-sda.direct | ||
5213 | 5264 | ||
5214 | The following build artifacts were used to create the image(s): | 5265 | The following build artifacts were used to create the image(s): |
5215 | ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/minnow-poky-linux/core-image-minimal/1.0-r0/rootfs | 5266 | ROOTFS_DIR: /home/scottrif/poky/build/tmp.wic.r4hkds0b/rootfs_copy |
5216 | BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/work/minnow-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0/hddimg | 5267 | BOOTIMG_DIR: /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share |
5217 | KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/minnow/usr/src/kernel | 5268 | KERNEL_DIR: /home/scottrif/poky/build/tmp/deploy/images/qemux86 |
5218 | NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux | 5269 | NATIVE_SYSROOT: /home/scottrif/poky/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native |
5219 | 5270 | ||
5220 | The image(s) were created using OE kickstart file: | 5271 | INFO: The image(s) were created using OE kickstart file: |
5221 | /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/mkefidisk.wks | 5272 | /home/scottrif/poky/scripts/lib/wic/canned-wks/mkefidisk.wks |
5222 | </literallayout> | 5273 | </literallayout> |
5223 | The previous example shows the easiest way to create | 5274 | The previous example shows the easiest way to create |
5224 | an image by running in Cooked Mode and using the | 5275 | an image by running in cooked mode and supplying |
5225 | <filename>-e</filename> option with an existing | 5276 | a kickstart file and the "-e" option to point to the |
5226 | kickstart file. | 5277 | existing build artifacts. |
5227 | All that is necessary is to specify the image used to | 5278 | Your <filename>local.conf</filename> file needs to have |
5228 | generate the artifacts. | 5279 | the |
5229 | Your <filename>local.conf</filename> needs to have the | ||
5230 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | 5280 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |
5231 | variable set to the machine you are using, which is | 5281 | variable set to the machine you are using, which is |
5232 | "minnow" in this example. | 5282 | "qemux86" in this example. |
5233 | </para> | 5283 | </para> |
5234 | 5284 | ||
5235 | <para> | 5285 | <para> |
5236 | The output specifies the exact image created as well as | 5286 | Once the image builds, the output provides image |
5237 | where it was created, which is in the current | 5287 | location, artifact use, and kickstart file information. |
5238 | directory by default. | ||
5239 | The output also names the artifacts used and the exact | ||
5240 | <filename>.wks</filename> script that was used to | ||
5241 | generate the image. | ||
5242 | <note> | 5288 | <note> |
5243 | You should always verify the details provided in the | 5289 | You should always verify the details provided in the |
5244 | output to make sure that the image was indeed | 5290 | output to make sure that the image was indeed |
@@ -5249,16 +5295,16 @@ | |||
5249 | <para> | 5295 | <para> |
5250 | Continuing with the example, you can now write the | 5296 | Continuing with the example, you can now write the |
5251 | image to a USB stick, or whatever media for which you | 5297 | image to a USB stick, or whatever media for which you |
5252 | built your image, and boot the resulting media. | 5298 | built your image, and boot from the media. |
5253 | You can write the image by using | 5299 | You can write the image by using |
5254 | <filename>bmaptool</filename> or | 5300 | <filename>bmaptool</filename> or |
5255 | <filename>dd</filename>: | 5301 | <filename>dd</filename>: |
5256 | <literallayout class='monospaced'> | 5302 | <literallayout class='monospaced'> |
5257 | $ oe-run-native bmaptool copy build/mkefidisk-201310230946-sda.direct /dev/sd<replaceable>X</replaceable> | 5303 | $ oe-run-native bmaptool copy build/mkefidisk-201710061409-sda.direct /dev/sd<replaceable>X</replaceable> |
5258 | </literallayout> | 5304 | </literallayout> |
5259 | or | 5305 | or |
5260 | <literallayout class='monospaced'> | 5306 | <literallayout class='monospaced'> |
5261 | $ sudo dd if=build/mkefidisk-201310230946-sda.direct of=/dev/sd<replaceable>X</replaceable> | 5307 | $ sudo dd if=build/mkefidisk-201710061409-sda.direct of=/dev/sd<replaceable>X</replaceable> |
5262 | </literallayout> | 5308 | </literallayout> |
5263 | <note> | 5309 | <note> |
5264 | For more information on how to use the | 5310 | For more information on how to use the |
@@ -5274,22 +5320,25 @@ | |||
5274 | <title>Using a Modified Kickstart File</title> | 5320 | <title>Using a Modified Kickstart File</title> |
5275 | 5321 | ||
5276 | <para> | 5322 | <para> |
5277 | Because partitioned image creation is | 5323 | Because partitioned image creation is driven by the |
5278 | driven by the kickstart file, it is easy to affect | 5324 | kickstart file, it is easy to affect image creation by |
5279 | image creation by changing the parameters in the file. | 5325 | changing the parameters in the file. |
5280 | This next example demonstrates that through modification | 5326 | This next example demonstrates that through modification |
5281 | of the <filename>directdisk</filename> kickstart file. | 5327 | of the <filename>directdisk-gpt</filename> kickstart |
5328 | file. | ||
5282 | </para> | 5329 | </para> |
5283 | 5330 | ||
5284 | <para> | 5331 | <para> |
5285 | As mentioned earlier, you can use the command | 5332 | As mentioned earlier, you can use the command |
5286 | <filename>wic list images</filename> to show the list | 5333 | <filename>wic list images</filename> to show the list |
5287 | of existing kickstart files. | 5334 | of existing kickstart files. |
5288 | The directory in which these files reside is | 5335 | The directory in which the |
5289 | <filename>scripts/lib/image/canned-wks/</filename> | 5336 | <filename>directdisk-gpt.wks</filename> file resides is |
5290 | located in the | 5337 | <filename>scripts/lib/image/canned-wks/</filename>, |
5291 | <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>. | 5338 | which is located in the |
5292 | Because the available files reside in this directory, | 5339 | <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink> |
5340 | (e.g. <filename>poky</filename>). | ||
5341 | Because available files reside in this directory, | ||
5293 | you can create and add your own custom files to the | 5342 | you can create and add your own custom files to the |
5294 | directory. | 5343 | directory. |
5295 | Subsequent use of the | 5344 | Subsequent use of the |
@@ -5299,104 +5348,77 @@ | |||
5299 | 5348 | ||
5300 | <para> | 5349 | <para> |
5301 | In this example, the existing | 5350 | In this example, the existing |
5302 | <filename>directdisk</filename> file already does most | 5351 | <filename>directdisk-gpt</filename> file already does |
5303 | of what is needed. | 5352 | most of what is needed. |
5304 | However, for the hardware in this example, the image | 5353 | However, for the hardware in this example, the image |
5305 | will need to boot from <filename>sdb</filename> instead | 5354 | will need to boot from <filename>sdb</filename> instead |
5306 | of <filename>sda</filename>, which is what the | 5355 | of <filename>sda</filename>, which is what the |
5307 | <filename>directdisk</filename> kickstart file uses. | 5356 | <filename>directdisk-gpt</filename> kickstart file |
5357 | uses. | ||
5308 | </para> | 5358 | </para> |
5309 | 5359 | ||
5310 | <para> | 5360 | <para> |
5311 | The example begins by making a copy of the | 5361 | The example begins by making a copy of the |
5312 | <filename>directdisk.wks</filename> file in the | 5362 | <filename>directdisk-gpt.wks</filename> file in the |
5313 | <filename>scripts/lib/image/canned-wks</filename> | 5363 | <filename>scripts/lib/image/canned-wks</filename> |
5314 | directory and then by changing the lines that specify | 5364 | directory and then by changing the lines that specify |
5315 | the target disk from which to boot. | 5365 | the target disk from which to boot. |
5316 | <literallayout class='monospaced'> | 5366 | <literallayout class='monospaced'> |
5317 | $ cp /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisk.wks \ | 5367 | $ cp /home/scottrif/poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks \ |
5318 | /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisksdb.wks | 5368 | /home/scottrif/poky/scripts/lib/wic/canned-wks/directdisksdb-gpt.wks |
5319 | </literallayout> | 5369 | </literallayout> |
5320 | Next, the example modifies the | 5370 | Next, the example modifies the |
5321 | <filename>directdisksdb.wks</filename> file and changes | 5371 | <filename>directdisksdb-gpt.wks</filename> file and |
5322 | all instances of "<filename>--ondisk sda</filename>" | 5372 | changes all instances of |
5323 | to "<filename>--ondisk sdb</filename>". | 5373 | "<filename>--ondisk sda</filename>" to |
5374 | "<filename>--ondisk sdb</filename>". | ||
5324 | The example changes the following two lines and leaves | 5375 | The example changes the following two lines and leaves |
5325 | the remaining lines untouched: | 5376 | the remaining lines untouched: |
5326 | <literallayout class='monospaced'> | 5377 | <literallayout class='monospaced'> |
5327 | part /boot --source bootimg-pcbios --ondisk sdb --label boot --active --align 1024 | 5378 | part /boot --source bootimg-pcbios --ondisk sdb --label boot --active --align 1024 |
5328 | part / --source rootfs --ondisk sdb --fstype=ext3 --label platform --align 1024 | 5379 | part / --source rootfs --ondisk sdb --fstype=ext4 --label platform --align 1024 --use-uuid |
5329 | </literallayout> | 5380 | </literallayout> |
5330 | Once the lines are changed, the example generates the | 5381 | Once the lines are changed, the example generates the |
5331 | <filename>directdisksdb</filename> image. | 5382 | <filename>directdisksdb-gpt</filename> image. |
5332 | The command points the process at the | 5383 | The command points the process at the |
5333 | <filename>core-image-minimal</filename> artifacts for | 5384 | <filename>core-image-minimal</filename> artifacts for |
5334 | the Next Unit of Computing (nuc) | 5385 | the Next Unit of Computing (nuc) |
5335 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | 5386 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |
5336 | the <filename>local.conf</filename>. | 5387 | the <filename>local.conf</filename>. |
5337 | <literallayout class='monospaced'> | 5388 | <literallayout class='monospaced'> |
5338 | $ wic create directdisksdb -e core-image-minimal | 5389 | $ wic create directdisksdb-gpt -e core-image-minimal |
5339 | Checking basic build environment... | 5390 | INFO: Building wic-tools... |
5340 | Done. | 5391 | . |
5341 | 5392 | . | |
5342 | Creating image(s)... | 5393 | . |
5343 | 5394 | Initialising tasks: 100% |#######################################| Time: 0:00:01 | |
5344 | Info: The new image(s) can be found here: | 5395 | NOTE: Executing SetScene Tasks |
5345 | <replaceable>current_directory</replaceable>/build/directdisksdb-201310231131-sdb.direct | 5396 | NOTE: Executing RunQueue Tasks |
5397 | NOTE: Tasks Summary: Attempted 1161 tasks of which 1157 didn't need to be rerun and all succeeded. | ||
5398 | INFO: Creating image(s)... | ||
5399 | |||
5400 | INFO: The new image(s) can be found here: | ||
5401 | ./directdisksdb-gpt-201710090938-sdb.direct | ||
5346 | 5402 | ||
5347 | The following build artifacts were used to create the image(s): | 5403 | The following build artifacts were used to create the image(s): |
5404 | ROOTFS_DIR: /home/scottrif/poky/build/tmp.wic.hk3wl6zn/rootfs_copy | ||
5405 | BOOTIMG_DIR: /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share | ||
5406 | KERNEL_DIR: /home/scottrif/poky/build/tmp/deploy/images/qemux86 | ||
5407 | NATIVE_SYSROOT: /home/scottrif/poky/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native | ||
5348 | 5408 | ||
5349 | ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/nuc-poky-linux/core-image-minimal/1.0-r0/rootfs | 5409 | INFO: The image(s) were created using OE kickstart file: |
5350 | BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/nuc/usr/share | 5410 | /home/scottrif/poky/scripts/lib/wic/canned-wks/directdisksdb-gpt.wks |
5351 | KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/nuc/usr/src/kernel | ||
5352 | NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux | ||
5353 | |||
5354 | The image(s) were created using OE kickstart file: | ||
5355 | /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisksdb.wks | ||
5356 | </literallayout> | 5411 | </literallayout> |
5357 | Continuing with the example, you can now directly | 5412 | Continuing with the example, you can now directly |
5358 | <filename>dd</filename> the image to a USB stick, or | 5413 | <filename>dd</filename> the image to a USB stick, or |
5359 | whatever media for which you built your image, | 5414 | whatever media for which you built your image, |
5360 | and boot the resulting media: | 5415 | and boot the resulting media: |
5361 | <literallayout class='monospaced'> | 5416 | <literallayout class='monospaced'> |
5362 | $ sudo dd if=build/directdisksdb-201310231131-sdb.direct of=/dev/sdb | 5417 | $ sudo dd if=directdisksdb-gpt-201710090938-sdb.direct of=/dev/sdb |
5363 | 86018+0 records in | 5418 | 140966+0 records in |
5364 | 86018+0 records out | 5419 | 140966+0 records out |
5365 | 44041216 bytes (44 MB) copied, 13.0734 s, 3.4 MB/s | 5420 | 72174592 bytes (72 MB, 69 MiB) copied, 78.0282 s, 925 kB/s |
5366 | [trz at empanada tmp]$ sudo eject /dev/sdb | 5421 | $ sudo eject /dev/sdb |
5367 | </literallayout> | ||
5368 | </para> | ||
5369 | </section> | ||
5370 | |||
5371 | <section id='creating-an-image-based-on-core-image-minimal-and-crownbay-noemgd'> | ||
5372 | <title>Creating an Image Based on <filename>core-image-minimal</filename> and <filename>crownbay-noemgd</filename></title> | ||
5373 | |||
5374 | <para> | ||
5375 | This example creates an image based on | ||
5376 | <filename>core-image-minimal</filename> and a | ||
5377 | <filename>crownbay-noemgd</filename> | ||
5378 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | ||
5379 | that works right out of the box. | ||
5380 | <literallayout class='monospaced'> | ||
5381 | $ wic create directdisk -e core-image-minimal | ||
5382 | |||
5383 | Checking basic build environment... | ||
5384 | Done. | ||
5385 | |||
5386 | Creating image(s)... | ||
5387 | |||
5388 | Info: The new image(s) can be found here: | ||
5389 | <replaceable>current_directory</replaceable>/build/directdisk-201309252350-sda.direct | ||
5390 | |||
5391 | The following build artifacts were used to create the image(s): | ||
5392 | |||
5393 | ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs | ||
5394 | BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share | ||
5395 | KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel | ||
5396 | NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel | ||
5397 | |||
5398 | The image(s) were created using OE kickstart file: | ||
5399 | /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisk.wks | ||
5400 | </literallayout> | 5422 | </literallayout> |
5401 | </para> | 5423 | </para> |
5402 | </section> | 5424 | </section> |
@@ -5412,26 +5434,25 @@ | |||
5412 | somewhere other than the default output directory, | 5434 | somewhere other than the default output directory, |
5413 | which is the current directory: | 5435 | which is the current directory: |
5414 | <literallayout class='monospaced'> | 5436 | <literallayout class='monospaced'> |
5415 | $ wic create ~/test.wks -o /home/trz/testwic --rootfs-dir \ | 5437 | $ wic create /home/scottrif/my_yocto/test.wks -o /home/scottrif/testwic \ |
5416 | /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs \ | 5438 | --rootfs-dir /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/rootfs \ |
5417 | --bootimg-dir /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share \ | 5439 | --bootimg-dir /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share \ |
5418 | --kernel-dir /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel \ | 5440 | --kernel-dir /home/scottrif/poky/build/tmp/deploy/images/qemux86 \ |
5419 | --native-sysroot /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux | 5441 | --native-sysroot /home/scottrif/poky/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native |
5420 | 5442 | ||
5421 | Creating image(s)... | 5443 | INFO: Creating image(s)... |
5422 | 5444 | ||
5423 | Info: The new image(s) can be found here: | 5445 | INFO: The new image(s) can be found here: |
5424 | /home/trz/testwic/build/test-201309260032-sda.direct | 5446 | /home/scottrif/testwic/test-201710091445-sdb.direct |
5425 | 5447 | ||
5426 | The following build artifacts were used to create the image(s): | 5448 | The following build artifacts were used to create the image(s): |
5449 | ROOTFS_DIR: /home/scottrif/testwic/tmp.wic.x4wipbmb/rootfs_copy | ||
5450 | BOOTIMG_DIR: /home/scottrif/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share | ||
5451 | KERNEL_DIR: /home/scottrif/poky/build/tmp/deploy/images/qemux86 | ||
5452 | NATIVE_SYSROOT: /home/scottrif/poky/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native | ||
5427 | 5453 | ||
5428 | ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs | 5454 | INFO: The image(s) were created using OE kickstart file: |
5429 | BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share | 5455 | /home/scottrif/my_yocto/test.wks |
5430 | KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel | ||
5431 | NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel | ||
5432 | |||
5433 | The image(s) were created using OE kickstart file: | ||
5434 | /home/trz/test.wks | ||
5435 | </literallayout> | 5456 | </literallayout> |
5436 | For this example, | 5457 | For this example, |
5437 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | 5458 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |