Template:Yocto Build Release IMX: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
 
(64 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:GITHUB_WARNING|{{#ifexpr: {{#var:YOCTO_VERSION}} < 2.3 |{{Note|'''Warning:''' Due to a GitHub policy change, it is necessary to add HTTPS mirrors to local.conf for Yocto Morty and older. Please refer to [[:Yocto_Common_Errors#GitHub Git protocol on port 9418|Yocto Common Errors]].}}}}}}<!--
<includeonly>{{#vardefine:GITHUB_WARNING|{{#ifexpr: {{#var:YOCTO_VERSION}} < 2.3 |{{Note|'''Warning:''' Due to a GitHub policy change, it is necessary to add HTTPS mirrors to local.conf for Yocto Morty and older. Please refer to [[:Yocto_Common_Errors#GitHub Git protocol on port 9418|Yocto Common Errors]].}}}}}}<!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Yocto {{#var:YOCTO_NAME}} {{#var:YOCTO_VERSION}} based on FSL Community BSP {{#var:FSLC_BSP_VERSION}} with {{#var:FSL_BSP_VERSION}} Linux release}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME}}}} __toc__
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Yocto {{#var:YOCTO_NAME}} {{#var:YOCTO_VERSION}} based on {{#varexists:FSLC_BSP_VERSION|FSL Community BSP {{#var:FSLC_BSP_VERSION}}|NXP BSP {{#var:FSL_BSP_VERSION}}}} with {{#var:FSL_BSP_VERSION}} Linux release}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME}}}} __toc__


<!-- Set local variables
<!-- Set local variables
Line 11: Line 11:
-->{{#vardefine:UBUNTU_COMPAT|{{#ifeq:{{#var:YOCTO_NAME}}|Zeus|18.04|{{#var:UBUNTU_COMPAT}}}}}}<!--
-->{{#vardefine:UBUNTU_COMPAT|{{#ifeq:{{#var:YOCTO_NAME}}|Zeus|18.04|{{#var:UBUNTU_COMPAT}}}}}}<!--
-->{{#vardefine:UBUNTU_COMPAT|{{#ifexpr: {{#var:YOCTO_VERSION}} >= 3.1|18.04/20.04|{{#var:UBUNTU_COMPAT}}}}}}<!--
-->{{#vardefine:UBUNTU_COMPAT|{{#ifexpr: {{#var:YOCTO_VERSION}} >= 3.1|18.04/20.04|{{#var:UBUNTU_COMPAT}}}}}}<!--
-->{{#vardefine:UBUNTU_COMPAT|{{#ifexpr: {{#var:YOCTO_VERSION}} >= 4.0|18.04/20.04/22.04|{{#var:UBUNTU_COMPAT}}}}}}
-->{{#vardefine:UBUNTU_COMPAT|{{#ifexpr: {{#var:YOCTO_VERSION}} >= 4.0|18.04/20.04/22.04|{{#var:UBUNTU_COMPAT}}}}}}<!--
-->{{#vardefine:UBUNTU_COMPAT|{{#ifexpr: {{#var:YOCTO_VERSION}} >= 4.2|20.04/22.04|{{#var:UBUNTU_COMPAT}}}}}}<!--
-->{{#vardefine:UBUNTU_COMPAT|{{#if:{{#var:BUILD_YOCTO_IN_DOCKER_CONTAINER}}|18.04/20.04/22.04/24.04|{{#var:UBUNTU_COMPAT}}}}}}
 
= Installing required packages =
= Installing required packages =
Please make sure your host PC is running Ubuntu {{#var:UBUNTU_COMPAT}} 64-bit and is up to date:
Please make sure your host PC is running Ubuntu {{#var:UBUNTU_COMPAT}} 64-bit and is up to date:
Line 17: Line 20:


Then, install the following packages:
Then, install the following packages:
  {{#if:{{#var:BUILD_YOCTO_IN_DOCKER_CONTAINER}}|
  $ sudo apt-get install python3 python3-pip python3-pexpect \
  python3-git python3-jinja2 python3-subunit python3-git liblz4-tool \
  python3-jinja2 python3-subunit curl zstd
 
For Ubuntu 20.04 and earlier, install python2:
$ sudo apt-get install python python-pysqlite2
{{#ifexpr:{{#rpos:{{#var:UBUNTU_COMPAT}}|16.04}} >= 0|{{Ubuntu16_Python}}|}}<!--
-->{{#ifexpr:{{#rpos:{{#var:UBUNTU_COMPAT}}|22.04}} >= 0|{{Ubuntu22_Python}}|}}<!--
-->{{#ifexpr:{{#rpos:{{#var:UBUNTU_COMPAT}}|24.04}} >= 0|{{Ubuntu24_Docker}}|}}
Install Docker:
$ sudo apt update && sudo apt install docker.io qemu-user-static
Give permissions to run Docker without sudo:
$ sudo usermod -aG docker ${USER}
# Logout and login again for the permissions to take effect.
|


   $ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib \
   $ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib \
   build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
   build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
   xz-utils debianutils iputils-ping libsdl1.2-dev xterm libyaml-dev libssl-dev
   xz-utils debianutils iputils-ping libsdl1.2-dev xterm libyaml-dev libssl-dev
    
    
   $ sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev \
   $ sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev \
   sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 \
   sed cvs subversion coreutils texi2html docbook-utils \
   help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev \
   help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev \
   mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \
   mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \
Line 30: Line 53:
    
    
   {{#ifexpr: {{#var:YOCTO_VERSION}} >= 3.1|
   {{#ifexpr: {{#var:YOCTO_VERSION}} >= 3.1|
   $ sudo apt-get install python3-git zstd liblz4-tool
   $ sudo apt-get install python3-git liblz4-tool python3-jinja2 python3-subunit locales libacl1
   |
   |
   $ sudo apt-get install python-git
   $ sudo apt-get install python-git
   }}
   }}
For Ubuntu 20.04 and earlier, install python2:
$ sudo apt-get install python python-pysqlite2
{{#ifexpr:{{#rpos:{{#var:UBUNTU_COMPAT}}|16.04}} >= 0|{{Ubuntu16_Python}}|}}<!--
{{#ifexpr:{{#rpos:{{#var:UBUNTU_COMPAT}}|16.04}} >= 0|{{Ubuntu16_Python}}|}}<!--
-->{{#ifexpr:{{#rpos:{{#var:UBUNTU_COMPAT}}|22.04}} >= 0|{{Ubuntu22_Python}}|}}
-->{{#ifexpr:{{#rpos:{{#var:UBUNTU_COMPAT}}|22.04}} >= 0|{{Ubuntu22_Python}}|}}
Line 39: Line 66:
{{Note|'''Note:''' Variscite provides Docker containers that can be used for a development environment as an alternative to using a virtual machine or a dedicated computer.
{{Note|'''Note:''' Variscite provides Docker containers that can be used for a development environment as an alternative to using a virtual machine or a dedicated computer.
To learn more, please see Variscite's [[Docker_Build_Environment | Docker Build Environment]] guide.}}
To learn more, please see Variscite's [[Docker_Build_Environment | Docker Build Environment]] guide.}}
}}


= Reference documentation =
= Reference documentation =
Line 45: Line 73:
-->{{#lst:Yocto_Platform_Customization|YOCTO_DOC_FSL_BSP_{{#var:FSL_BSP_VERSION}}}}
-->{{#lst:Yocto_Platform_Customization|YOCTO_DOC_FSL_BSP_{{#var:FSL_BSP_VERSION}}}}


= Download Yocto {{#var:YOCTO_NAME}} based on Freescale Community BSP =
= Download Yocto {{#var:YOCTO_NAME}} based on {{#varexists:FSLC_BSP_VERSION|Freescale Community BSP {{#var:FSLC_BSP_VERSION}}|NXP BSP {{#var:FSL_BSP_VERSION}}}} =
<pre>
 
$ git config --global user.name "Your Name"
Configure git user and email:
$ git config --global user.email "Your Email"
 
$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
 
Fetch and install the Google [https://gerrit.googlesource.com/git-repo/ git-repo] tool:


$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ mkdir -p ~/bin
$ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
# For Ubuntu 20.04 and older, install repo 2.32 according to https://gerrit.googlesource.com/git-repo/+/HEAD/docs/python-support.md:
$ export PATH=~/bin:$PATH
$ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo-2.32 > ~/bin/repo
</pre>
# For Ubuntu 22.04 and newer, install the latest repo tool:
$ curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
# Give repo execute permissions and add it to the path:
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH


Create a build directory:
  $ mkdir {{#var:BUILD_FOLDER}}
  $ mkdir {{#var:BUILD_FOLDER}}
  $ cd {{#var:BUILD_FOLDER}}
  $ cd {{#var:BUILD_FOLDER}}
Line 72: Line 111:
or<br>
or<br>
<br>
<br>
* '''Download a release tag'''<br>
* Download a release tag<br>
Each release in https://github.com/varigit/variscite-bsp-platform/releases corresponds to a tag.<br>
Each release in https://github.com/varigit/variscite-bsp-platform/releases corresponds to a tag.<br>
The tags are also listed in https://github.com/varigit/variscite-bsp-platform/tags<br>
The tags are also listed in https://github.com/varigit/variscite-bsp-platform/tags<br>
Line 85: Line 124:
  $ repo init -u https://github.com/varigit/variscite-bsp-platform.git -b refs/tags/{{#var:RELEASE_NAME}}
  $ repo init -u https://github.com/varigit/variscite-bsp-platform.git -b refs/tags/{{#var:RELEASE_NAME}}
  $ repo sync -j$(nproc)
  $ repo sync -j$(nproc)
}}
{{#if:{{#var:BUILD_YOCTO_IN_DOCKER_CONTAINER}}|
Start a Ubuntu Docker container:
$ ./var-start-container.sh {{Note|'''Note:''' After Ubuntu Docker container is started you can see the shell prompt similar to: '''vari@yocto-{{#var:DOCKER_CONTAINER_INFO}}:/workdir$'''
All references to commands without this prompt should be executed in a native terminal (outside Docker).
}}
}}
}}


Line 92: Line 139:
The following images are provided by Variscite for evaluation purpose
The following images are provided by Variscite for evaluation purpose
* '''fsl-image-gui''': Default Variscite demo image with GUI and without any Qt{{#var:QT_VER}} content. This image recipe works for Xwayland and Wayland backends.
* '''fsl-image-gui''': Default Variscite demo image with GUI and without any Qt{{#var:QT_VER}} content. This image recipe works for Xwayland and Wayland backends.
{{#if:{{#var:YOCTO_SUPPORT_CHROMIUM}}|
* '''fsl-image-gui-chromium''': Extends fsl-image-gui image with Chromium web browser.
|}}
* '''fsl-image-qt{{#var:QT_VER}}''': Extends fsl-image-gui image with Qt{{#var:QT_VER}} support and various Qt samples for Xwayland and Wayland backends.  
* '''fsl-image-qt{{#var:QT_VER}}''': Extends fsl-image-gui image with Qt{{#var:QT_VER}} support and various Qt samples for Xwayland and Wayland backends.  
|
|
Line 109: Line 159:
|}}
|}}
}}
}}
See the list of Yocto Project’s reference images in [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-images Yocto Project Reference Manual]
See the list of Yocto Project’s reference images in [https://www.yoctoproject.org/docs/{{#var:YOCTO_VERSION}}/ref-manual/ref-manual.html#ref-images Yocto Project Reference Manual]


== Supported distros ==
== Supported distros ==
Line 153: Line 203:
{{#lst:Yocto_Platform_Customization|YOCTO_ENV_SETUP_X}}
{{#lst:Yocto_Platform_Customization|YOCTO_ENV_SETUP_X}}
{{#lst:Yocto_Platform_Customization|YOCTO_ENV_SETUP_X_SHORT}}
{{#lst:Yocto_Platform_Customization|YOCTO_ENV_SETUP_X_SHORT}}
{{#vardefine:SHELL_PROMPT|{{#if:{{#var:BUILD_YOCTO_IN_DOCKER_CONTAINER}}|vari@yocto-{{#var:DOCKER_CONTAINER_INFO}}:/workdir/{{#var:BUILD_FOLDER_ENV}}$|$}}}}
{{#var:GITHUB_WARNING}}
{{#var:GITHUB_WARNING}}
<br>
<br>
Line 160: Line 211:


  Without Qt content:
  Without Qt content:
  $ bitbake fsl-image-gui
  {{#var:SHELL_PROMPT}} bitbake fsl-image-gui
{{#if:{{#var:YOCTO_SUPPORT_CHROMIUM}}|
Or with Chromium:
{{#var:SHELL_PROMPT}} bitbake fsl-image-gui-chromium
   
   
|}}
  Or with Qt content:
  Or with Qt content:
  $ bitbake fsl-image-qt{{#var:QT_VER}}
  {{#var:SHELL_PROMPT}} bitbake fsl-image-qt{{#var:QT_VER}}


{{#switch: {{#var:SOC_SERIES}} | imx8 | imx9=
{{#switch: {{#var:SOC_SERIES}} | imx8 | imx9=
Line 181: Line 236:
Without Qt content:
Without Qt content:
$ bitbake fsl-image-gui
$ bitbake fsl-image-gui
{{#if:{{#var:YOCTO_SUPPORT_CHROMIUM}}|
Or with Chromium:
$ bitbake fsl-image-gui-chromium


|}}
Or with Qt content:
Or with Qt content:
$ bitbake fsl-image-qt{{#var:QT_VER}}
$ bitbake fsl-image-qt{{#var:QT_VER}}
Line 191: Line 250:


Create a /opt/yocto_downloads directory and set its permissions:
Create a /opt/yocto_downloads directory and set its permissions:
<pre>
{{#var:SHELL_PROMPT}} sudo mkdir /opt/yocto_downloads
$ sudo mkdir /opt/yocto_downloads
{{#var:SHELL_PROMPT}} sudo chmod 777 /opt/yocto_downloads/
$ sudo chmod 777 /opt/yocto_downloads/
</pre>


Direct downloads to it, by replacing 'DL_DIR ?= "${BSPDIR}/downloads/"' with 'DL_DIR = "/opt/yocto_downloads/"' in conf/local.conf under your build directory:
Direct downloads to it, by replacing 'DL_DIR ?= "${BSPDIR}/downloads/"' with 'DL_DIR = "/opt/yocto_downloads/"' in conf/local.conf under your build directory:
<pre>
{{#var:SHELL_PROMPT}} sed -i 's/DL_DIR ?= "${BSPDIR}\/downloads/DL_DIR = "\/opt\/yocto_downloads/g' conf/local.conf
$ sed -i 's/DL_DIR ?= "${BSPDIR}\/downloads/DL_DIR = "\/opt\/yocto_downloads/g' conf/local.conf
</pre>


=== Add Qt creator and Eclipse debug support to your images ===
=== Add Qt creator and Eclipse debug support to your images ===
Line 267: Line 322:
{{#lst:Yocto_Platform_Customization|{{#var:YOCTO_BUILD_RESULTS_SECTION}}}}
{{#lst:Yocto_Platform_Customization|{{#var:YOCTO_BUILD_RESULTS_SECTION}}}}


= Create a bootable SD card =
{{#ifexpr: {{#var:YOCTO_VERSION}} < 4.1
 
    | {{Yocto_Create_Bootable_SD_Legacy}}
== SD card structure ==
    | {{Yocto_Create_Bootable_SD}}
{{#switch: {{#var:SOC_SERIES}} | imx8 | imx9=
This is the structure of our Recovery/Extended SD card:<br>
[[File:SD_card_part_mx8m.png]]<br><br>
 
 
The SD card is divided into 2 sections as shown in the picture above:<br>
* The first unallocated 8MiB section reserved for U-Boot. It can be replaced using the dd command as described in the {{Varlink2|Yocto Build U-Boot|{{#var:RELEASE_LINK}}}} section.<br>
* The first partition is an ext4 partition that contains the complete root filesystem (including kernel image and device tree files under /boot).<br><br>
|
This is the structure of our Recovery/Extended SD card:<br>
[[File:SD_card_part_v50.png|SD card partitions]]<br><br>
 
 
The SD card is divided into 3 sections as shown in the picture above:<br>
* The first unallocated 4MiB are saved space for U-Boot. It can be replaced using the dd command as described in the {{Varlink2|Yocto Build U-Boot|{{#var:RELEASE_LINK}}}} section.<br>
* The first partition is a fat16 partition used for the device tree files and the kernel image file. You can copy them as described in the {{Varlink2|Yocto Build Linux|{{#var:RELEASE_LINK}}}} section.<br>
* The second partition is an ext4 partition that contains the complete root filesystem (including the kernel modules).<br><br>
}}
 
Note:<br>
The last unallocated area is not used. It is there so that the rootfs will fit on any 4GB SD card, as not all 4GB SD cards are really the same size. If you want, you can use a program such as GParted to resize the roofs partition and make it end at the end of your specific SD card (of course, you can also use SD cards with much bigger capacity than 4GB, and then it makes more sense to resize the partition).<br>
Also, if you create the extended SD card yourself by following the [[#Create_an_extended_SD_card | Create an extended SD card]] section below, and you use the '-a' option, the rootfs partition will end at the end of your specific SD card automatically.<br>
 
==Yocto pre-built bootable SD card==
 
The Yocto build products contains many files as explained in the [[#Build_Results | Build Results section]]. For example, fsl-image-gui-{{#var:MACHINE_NAME}}.{{#var:SDCARD_IMG_EXT}}, depending on your build. This is a complete image to be flashed directly to an SD card.<br>
 
Example usage:
{{#switch: {{#var:SOC_SERIES}} | imx8 | imx9=
<br>
$ sudo umount /dev/sdX*
 
# For GUI-XWAYLAND & Qt{{#var:QT_VER}}-XWAYLAND
$ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_XWAYLAND}}
Or
# For GUI-WAYLAND & Qt{{#var:QT_VER}}-WAYLAND
$ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_WAYLAND}}
# For fsl-image-gui image (GUI-XWAYLAND & GUI-WAYLAND)
$ zcat tmp/deploy/images/{{#var:MACHINE_NAME}}/fsl-image-gui-{{#var:MACHINE_NAME}}.{{#var:SDCARD_IMG_EXT|sdcard.gz}} <nowiki>|</nowiki> sudo dd of=/dev/sdX bs=1M conv=fsync
Or
# For fsl-image-qt{{#var:QT_VER}} image (Qt{{#var:QT_VER}}-XWAYLAND & Qt{{#var:QT_VER}}-WAYLAND)
$ zcat tmp/deploy/images/{{#var:MACHINE_NAME}}/fsl-image-qt{{#var:QT_VER}}-{{#var:MACHINE_NAME}}.{{#var:SDCARD_IMG_EXT|sdcard.gz}} <nowiki>|</nowiki> sudo dd of=/dev/sdX bs=1M conv=fsync
|
<br>
$ sudo umount /dev/sdX*
 
# For GUI-X11 & Qt{{#var:QT_VER}}-X11
$ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_X11}}
Or
# For Qt{{#var:QT_VER}}-FB
$ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_FB}}
# For fsl-image-gui image (GUI-X11)
{{#ifeq: {{#var:SDCARD_IMG_EXT}} | wic.gz |
$ zcat tmp/deploy/images/{{#var:MACHINE_NAME}}/fsl-image-gui-{{#var:MACHINE_NAME}}.{{#var:SDCARD_IMG_EXT}} <nowiki>|</nowiki> sudo dd of=/dev/sdX bs=1M && sync
|
$ sudo dd if=tmp/deploy/images/{{#var:MACHINE_NAME}}/fsl-image-gui-{{#var:MACHINE_NAME}}.{{#var:SDCARD_IMG_EXT}} of=/dev/sdX bs=1M && sync
}}
Or
# For fsl-image-qt{{#var:QT_VER}} image (Qt{{#var:QT_VER}}-X11 & Qt{{#var:QT_VER}}-FB)
{{#ifeq: {{#var:SDCARD_IMG_EXT}} | wic.gz |
$ zcat tmp/deploy/images/{{#var:MACHINE_NAME}}/fsl-image-qt{{#var:QT_VER}}-{{#var:MACHINE_NAME}}.{{#var:SDCARD_IMG_EXT}} <nowiki>|</nowiki> sudo dd of=/dev/sdX bs=1M && sync
|
$ sudo dd if=tmp/deploy/images/{{#var:MACHINE_NAME}}/fsl-image-qt{{#var:QT_VER}}-{{#var:MACHINE_NAME}}.{{#var:SDCARD_IMG_EXT}} of=/dev/sdX bs=1M && sync
}}
}}
}}
Replace sdX with the right device name. This can be obtained by "dmesg" command on your host Linux PC, after the SD card reader is inserted.
* <span style="color:red">Note:</span> Booting your system from an SD card requires pressing the boot-select button, or switching the relevant DIP switch to "Boot from SD card", according to the relevant start-up guide of your system<br><br>
Drawbacks of the native .{{#var:SDCARD_IMG_EXT}} yocto-built image, (relative to the Recovery/Extended SD card):
* The rootfs partition doesn't use the entire SD card.
* The rootfs partition is not labeled as rootfs.
* The NAND flash and eMMC installation scripts and images are not included.
== Create an extended SD card ==
Variscite provides the var-create-yocto-sdcard.sh script which creates our recovery SD card - an SD card based on the fsl-image-gui filesystem, which also contain the scripts and relevant binaries for installation to the internal storage of the SOM.<br>
Later, you will be able to follow either the more automatic {{Varlink2|Yocto Recovery SD card|{{#var:RELEASE_LINK}}}} guide or the more manual {{Varlink|Yocto NAND Flash Burning|{{#var:RELEASE_LINK}}|Installing Yocto to the SOM's internal storage}} guide.<br><br>
Note:<br>
This is essentially the same as our pre-built Recovery SD image, with the following main differences:<br>
{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX6 |
* The Android recovery (Android-eMMC) is only present on the pre-built SD image, and not on the SD card built from the Yocto script.<br>
}}
* The pre-built image's rootfs partition size is 3700MiB, which is also the default size when using the script, but the script also has an option to set the rootfs partition size to fill the whole free space of the used SD card. Anyway, you can always resize the partition later with an external tool such as gparted.<br>
Naturally, the pre-built image is more straight forward and easier to use, while the script method is easier to customize.<br><br>
Usage:<br>
* Follow the [[#Setup and build Yocto|Setup and build Yocto]] guide, and bitbake fsl-image-gui.
* Plug-in the SD card to your Linux Host PC, run dmesg and see which device is added (i.e. /dev/sdX or /dev/mmcblkX)
$ cd {{#var:BUILD_FOLDER}}
$ sudo MACHINE={{#var:MACHINE_NAME}} sources/{{#var:META_VARISCITE_SDK}}/scripts/var_mk_yocto_sdcard/var-create-yocto-sdcard.sh <options> /dev/sdX
(Replace /dev/sdX with your actual device)
options:
  -h            Display help message
  -s            Only show partition sizes to be written, without actually write them
  -a            Automatically set the rootfs partition size to fill the SD card
  -r            Select alternative rootfs for recovery images (default: {{#var:BUILD_FOLDER_X11}}/tmp/deploy/images/{{#var:MACHINE_NAME}}/fsl-image-gui-{{#var:MACHINE_NAME}}.*)
If you don't use the '-a' option, a default rootfs size of 3700MiB will be used
The '-r' option allows you to create a bootable SD card with an alternative image for the installation to NAND flash or eMMC.
Example: "-r tmp/deploy/images/{{#var:MACHINE_NAME}}/fsl-image-qt{{#var:QT_VER}}-{{#var:MACHINE_NAME}}" -- selected the "Qt{{#var:QT_VER}} image with X11" recovery image
=== Create an extended SD card image using a loop device ===
It is also possible to use the var-create-yocto-sdcard.sh script to create an extended SD card image, while using a loop device instead of attaching a real SD card.<br>
<br>
Create an empty file using the following command:
$ dd if=/dev/zero of={{#var:MACHINE_NAME}}-extended-sd.img bs=1M count=7420
The above command creates a 7420MiB file representing the SD card.<br>
<br>
Attach the first available loop device to this file:
$ sudo losetup -Pf {{#var:MACHINE_NAME}}-extended-sd.img
To find the actual loop device being used, run:
$ losetup -a | grep {{#var:MACHINE_NAME}}-extended-sd.img
Write the content to the loop device to generate the SD card image:
$ sudo MACHINE={{#var:MACHINE_NAME}} sources/{{#var:META_VARISCITE_SDK}}/scripts/var_mk_yocto_sdcard/var-create-yocto-sdcard.sh <options> /dev/loopX
(Replace /dev/loopX with your actual loop device, e.g. /dev/loop0)<br><br>
Detach the loop device from the file:
$ sudo losetup -d /dev/loopX
To compress the SD card image file use the following command:
$ gzip -9 {{#var:MACHINE_NAME}}-extended-sd.img
To write the SD card image to a real SD card device use the following command:
$ zcat {{#var:MACHINE_NAME}}-extended-sd.img.gz | sudo dd of=/dev/sdX bs=1M && sync
(Replace /dev/sdX with your actual SD device, e.g. /dev/sdb)


= Boot the board with a bootable SD card =
= Boot the board with a bootable SD card =
Line 470: Line 391:


  In order to update the kernel, U-Boot and rootfs:
  In order to update the kernel, U-Boot and rootfs:
  $ bitbake -c cleanall u-boot-variscite linux-variscite kernel-module-imx-gpu-viv ti-compat-wireless-wl18xx wl18xx-firmware cryptodev-module
  {{#var:SHELL_PROMPT}} bitbake -c cleanall u-boot-variscite linux-variscite kernel-module-imx-gpu-viv ti-compat-wireless-wl18xx wl18xx-firmware cryptodev-module
   
   
  for GUI image
  for GUI image
  $ bitbake -c clean fsl-image-gui
  {{#var:SHELL_PROMPT}} bitbake -c clean fsl-image-gui
  for Qt{{#var:QT_VER}} image
  for Qt{{#var:QT_VER}} image
  $ bitbake -c clean fsl-image-qt{{#var:QT_VER}}
  {{#var:SHELL_PROMPT}} bitbake -c clean fsl-image-qt{{#var:QT_VER}}


{{#switch: {{#var:SOC_SERIES}} | imx8 | imx9=
{{#switch: {{#var:SOC_SERIES}} | imx8 | imx9=

Latest revision as of 22:08, 18 November 2024