Debian Build Release: Difference between revisions

From Variscite Wiki
(Created page with "<!-- Set release according to "release" parameter in URL and use RELEASE_STRETCH_V1.0_DART-6UL as default --> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- --> {{#lst:...")
 
No edit summary
Line 84: Line 84:
<!-- Make NOTE for DART-6UL only -->
<!-- Make NOTE for DART-6UL only -->
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-6UL |
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-6UL |
<span style="color:red">Note: Booting from SD card eliminates WiFi</span> as the WiFi and SD card are using the same SDIO interface.<br>
<span style="color:red">Note: Booting from SD card eliminates WiFi</span> as the WiFi and SD card are using the same SDIO interface.
 
A typical use-case, is to boot from an SD card, flash the eMMC/NAND flash, and re-boot from the eMMC/NAND flash to have WiFi operational.
A typical use-case, is to boot from an SD card, flash the eMMC/NAND flash, and re-boot from the eMMC/NAND flash to have WiFi operational.
|}}
|}}
Line 94: Line 95:
{{#lst:Yocto_Platform_Customization|DART-6UL_U-BOOT_DT_SELECTION}}  
{{#lst:Yocto_Platform_Customization|DART-6UL_U-BOOT_DT_SELECTION}}  
|
|
As shown in the [[#Build_Results| Build Results]] table above, we have different kernel device trees, corresponding to our different H/W configurations (sometimes they are renamed without the "{{#var:KERNEL_IMAGE}}-" prefix).<br>
As shown in the [[#Build_Results| Build Results]] table above, we have different kernel device trees, corresponding to our different H/W configurations (sometimes they are renamed without the "{{#var:KERNEL_IMAGE}}-" prefix).
 
We implemented a script in U-Boot's environment, which sets the fdt_file environment variable based on the detected hardware.
We implemented a script in U-Boot's environment, which sets the fdt_file environment variable based on the detected hardware.
}}
}}
Line 110: Line 112:
<!-- Make NOTE for DART-6UL only -->
<!-- Make NOTE for DART-6UL only -->
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-6UL |
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-6UL |
{{note|Comment:<br/>Make sure you don't set am illegal value like "imx6ul-var-dart-sd_nand.dtb" in a SOM that has eMMC flash.|info}}
{{note|Make sure you don't set am illegal value like "imx6ul-var-dart-sd_nand.dtb" in a SOM that has eMMC flash.|info}}
|}}
|}}


Line 119: Line 121:
{| class="wikitable"
{| class="wikitable"
|-
|-
! scope="col" | User name<br/>
! scope="col" | User name
! scope="col" | User password<br/>
! scope="col" | User password
! scope="col" | User descriptor
! scope="col" | User descriptor
|-
|-

Revision as of 23:17, 7 January 2018

DART-6UL - Debian Stretch 9.3 with imx_4.9.11_1.0.0_ga-var01 Linux release

Overview

This page describes how to build and install Debian distribution (Stretch) on Variscite boards with DART-6UL.

These instructions were tested with Ubuntu 16.04 x64! When using other distributions, there may be problems.

Create build environment

Installing required packages

On Ubuntu building machine:

$ sudo apt-get install -y binfmt-support qemu qemu-user-static debootstrap kpartx
$ sudo apt-get install -y lvm2 dosfstools gpart binutils git lib32ncurses5-dev python-m2crypto
$ sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
$ sudo apt-get install -y autoconf libtool libglib2.0-dev libarchive-dev
$ sudo apt-get install -y python-git xterm sed cvs subversion coreutils texi2html bc
$ sudo apt-get install -y docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev
$ sudo apt-get install -y libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools mtd-utils device-tree-compiler

Deploy source

Download archive containing the build script and support files for building Debian Stretch for this board:

$ cd ~
$ git clone https://github.com/varigit/debian-var.git -b debian_stretch_mx6ul_var01 var_mx6ul_dart_debian

Create environment (Internet connection should be available):

$ cd ~/var_mx6ul_dart_debian
$ ./make_var_mx6ul_dart_debian.sh -c deploy

This environment prepared to build.

Make Debian

Build all

Internet connection should be available

$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c all | tee 2.log

Build by parts

Build bootloader

$ cd ~/var_mx6ul_dart_debian
$ ./make_var_mx6ul_dart_debian.sh -c bootloader

Build kernel, dtb files and kernel modules

$ cd ~/var_mx6ul_dart_debian
$ ./make_var_mx6ul_dart_debian.sh -c kernel
$ ./make_var_mx6ul_dart_debian.sh -c modules

Build rootfs

Internet connection should be available

$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c rootfs

Pack rootfs

For the create archive root file system (rootfs.tar.bz2) and image ubi (rootfs.ubi.img) run the following commands:

$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c rtar
$ sudo ./make_var_mx6ul_dart_debian.sh -c rubi

Create boot SD card

  1. Follow the above steps for make rootfs, kernel, bootloader;
  2. Insert the SD card to card reader connected to a host system;
  3. Run the following commands (Caution! All data on the card will be destroyed):
$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c sdcard -d /dev/sdX

where '/dev/sdX' path to the block SD device in your system.

Boot the board with a bootable SD card

Note: Booting from SD card eliminates WiFi as the WiFi and SD card are using the same SDIO interface.

A typical use-case, is to boot from an SD card, flash the eMMC/NAND flash, and re-boot from the eMMC/NAND flash to have WiFi operational.

Setting the Boot Mode

Booting your system from an SD card requires switching the Boot DIP switches. See picture below.
On the VAR-6ULCustomBoard (with a DART-6UL):

Boot switch 6ul1.jpg
  • "00" The current position in the picture will set the system to boot from SD card
  • "01" Moving the right switch will set the system to boot from eMMC
  • "10" Moving the left switch will set the system to boot from NAND flash
  • "11" is illegal.
Be aware that your system has eMMC or NAND but never both.



On the Concerto-Board (with a VAR-SOM-6UL):

Boot switch concerto.jpg
  • ON-EXT: Boot from the external storage (SD card) - the current position in the picture
  • OFF-INT: Boot from the SOM's internal storage (eMMC/NAND flash)


Automatic device Tree selection in U-Boot

Enable/Disable Automatic Device Tree selection

To enable the automatic device tree selection in U-Boot (already enabled by default):

$ setenv fdt_file=undefined
$ saveenv

To disable the automatic device tree selection in U-Boot, set the device tree file manually:

$ setenv fdt_file=YOUR_DTB_FILE
$ saveenv
Make sure you don't set am illegal value like "imx6ul-var-dart-sd_nand.dtb" in a SOM that has eMMC flash.

Build Results

The resulted images are located in ~/var_mx6ul_dart_debian/output/.

Image name
How to use
rootfs.tar.gz Root filesystem tarball used for installation on SD card and eMMC
rootfs.ubi.img Use for flash to NAND
zImage Linux kernel image
SPL.nand SPL built for NAND. The SPL is pre-U-Boot SW component, required for DDR initialization
SPL.emmc SPL built for SD card and eMMC boot. The SPL is pre-U-Boot SW component, required for DDR initialization
u-boot.img.nand U-Boot built for NAND flash
u-boot.img.emmc U-Boot built for SD card or eMMC
Device Tree name
Details
imx6ul-var-dart-emmc_wifi.dtb DART-6UL with eMMC and WiFi enabled. (SD card & NAND disabled)
imx6ul-var-dart-nand_wifi.dtb DART-6UL with l NAND and WiFi enabled. (SD card & eMMC disabled)
imx6ul-var-dart-sd_emmc.dtb DART-6UL with SD card and eMMC enabled (WiFi & NAND disabled). You can boot from eMMC or SD card
imx6ul-var-dart-sd_nand.dtb DART-6UL with SD card and NAND enabled (WiFi & eMMC disabled). You can boot from NAND or SD card
imx6ul-var-dart-5g-emmc_wifi.dtb DART-6UL-5G with eMMC and WiFi enabled. (SD card & NAND disabled)
imx6ul-var-dart-5g-nand_wifi.dtb DART-6UL-5G with l NAND and WiFi enabled. (SD card & eMMC disabled)
imx6ull-var-dart-emmc_wifi.dtb DART-6ULL with eMMC and WiFi enabled. (SD card & NAND disabled)
imx6ull-var-dart-nand_wifi.dtb DART-6ULL with l NAND and WiFi enabled. (SD card & eMMC disabled)
imx6ull-var-dart-sd_emmc.dtb DART-6ULL with SD card and eMMC enabled (WiFi & NAND disabled). You can boot from eMMC or SD card
imx6ull-var-dart-sd_nand.dtb DART-6ULL with SD card and NAND enabled (WiFi & eMMC disabled). You can boot from NAND or SD card
imx6ull-var-dart-5g-emmc_wifi.dtb DART-6ULL-5G with eMMC and WiFi enabled. (SD card & NAND disabled)
imx6ull-var-dart-5g-nand_wifi.dtb DART-6ULL-5G with l NAND and WiFi enabled. (SD card & eMMC disabled)


Linux console access

User name User password User descriptor
root root system administrator
user user local user
xuser used for X session access

Flash images to NAND flash and eMMC

To flash images on NAND flash, on the device, as root, run the following command:

# debian-nand.sh

If you wanr to flash images on eMMC, on the device, as root, run the following command:

# debian-emmc.sh

Both the above commands are located in /usr/bin folder of uSD card used to boot debian.

How-to: Test and use an Interface

Please see this section in the Yocto developer guide page. It is the same for Debian.

How-to: Modify kernel configuration

To modify kernel configuration (add/remove features and drivers) please follow the steps below:

1. cd ~/var_mx6ul_dart_debian/src/kernel
2. Run "sudo make ARCH=arm mrproper"
3. Run "sudo make ARCH=arm imx_v7_var_defconfig
5. Navigate the menu and select the desired kernel functionality
6. Exit the menu and answer "Yes" when asked "Do you wish to save your new configuration?"
7. Run "sudo make ARCH=arm savedefconfig"
8. Run "sudo cp arch/arm/configs/imx_v7_var_defconfig arch/arm/configs/imx_v7_var_defconfig.orig
9. Run "sudo cp defconfig arch/arm/configs/imx_v7_var_defconfig
10. Follow the instructions above to rebuild kernel and modules, repack rootfs images and recreate SD card