VAR-SOM-MX6 Ubuntu Flash From Net: Difference between revisions

From Variscite Wiki
(Created page with "{{PageHeader|VAR-SOM-MX6 - Ubuntu Linaro Alip-20151215 Flash your target from NET}} {{DocImage|category1=VAR-SOM-MX6|category2=Alip}} __toc__ {{note|Note:<br/>Under construct...")
 
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{PageHeader|VAR-SOM-MX6 - Ubuntu Linaro Alip-20151215 Flash your target from NET}} {{DocImage|category1=VAR-SOM-MX6|category2=Alip}} __toc__
{{PageHeader|VAR-SOM-MX6 - Ubuntu Linaro Alip-20151215 Flash your target from NET}} {{DocImage|category1=VAR-SOM-MX6|category2=Alip}} __toc__
{{note|Note:<br/>Under construction!!! Under construction!!! Under construction!!!|info}}


= Overview =
= Overview =
Line 9: Line 6:


[[VAR-SOM-MX6_Ubuntu_Build_Ubuntu_Alip_NFS | Build Ubuntu Alip NFS]] is prerequisite step. Please make sure you run it and have a complete NFS build directory as described in the linked WIKI.
[[VAR-SOM-MX6_Ubuntu_Build_Ubuntu_Alip_NFS | Build Ubuntu Alip NFS]] is prerequisite step. Please make sure you run it and have a complete NFS build directory as described in the linked WIKI.
Also make sure you target is booted from NFS.


The steps require to build an Bootable  SDCARD:
The steps require to build an Bootable  SDCARD:
# Build Ubuntu Alip NFS.
# Build Ubuntu Alip NFS. [[VAR-SOM-MX6_Ubuntu_Build_Ubuntu_Alip_NFS | Build Ubuntu Alip NFS]]
# Format and partition the SCDARD
# Boot your Ubuntu Alip with TFTP and mount your file system over NFS. [[VAR-SOM-MX6_Ubuntu_Build_Ubuntu_Alip_NFS | Build Ubuntu Alip NFS]]
# Install U-Boot images
# Copy required file to your NFS directory
# Copy the kernel image and device tree files.
# Format and partition the target eMMC
# Install U-Boot and Linux Kernel images
# Install the root file system
# Install the root file system
# Deploy the kernel modules
# Deploy the kernel modules
# Deploy the Wi-Fi modules and firmware
# Deploy the Wi-Fi modules and firmware
= Format and partition the SCDARD =
 
Use to find oout your SDCARD device.
= Copy required file to your NFS directory =
<pre>$ dmesg
{{note|Note:<br/>Make sure you built U-Boot for NAND.|info}}
<pre>
$ cd  ~/var-som-mx6-alip/
$ sudo cp uboot-imx/SPL rootfs/root
$ sudo cp uboot-imx/u-boot.img rootfs/root
$ sudo cp linux-2.6-imx/arch/arm/boot/uImage rootfs/root
$ sudo cp linux-2.6-imx/arch/arm/boot/dts/*var*.dtb rootfs/root
$ sudo cp ~/baba/Downloads/
$ sudo cp ~/baba/Downloads/linaro-alip-20151215-v3.tar.bz2  rootfs/root/
</pre>
</pre>
change /dev/sdxxx with your real device in the following commands.
 
<br>
= Format and partition the target eMMC =
Delete the MBR on your SDCARD
Boot your target and:
<pre>$ cd ~/var-som-mx6-alip
$ sudo umount /dev/sdxxx*
$ sudo dd if=/dev/zero of=/dev/sdxxx bs=1K count=10
$ sync
</pre>
Use fdisk to partition the SDCARD
<pre>
<pre>
$ sudo fdisk /dev/sdxxx
$ fdisk /dev/mmcblk1                                                                               
n
n
p
p
1
1
8192
<enter for default>
24575
<enter for default>
t
t
b
n
p
2
24576
<enter to select default last sector>
t
2
83
83
w
w
$ sync
$ mkfs.ext4 /dev/mmcblk1p1 -Lrootfs
</pre>
</pre>
Check:
 
<pre>
= Install U-Boot and Linux Kernel images =
$ sudo fdisk /dev/sdxxx
{{note|Note:<br/>Make sure you built U-Boot for NAND.|info}}
p
<pre>$ flash_erase /dev/mtd0 0 0
q
$ kobs-ng init -x SPL --search_exponent=1 -v > /dev/null
  Device Boot      Start        End      Blocks  Id  System
$ flash_erase /dev/mtd1 0 0
/dev/sde1            8192      24575        8192    b  W95 FAT32
$ nandwrite -p /dev/mtd1 u-boot.img
/dev/sde2          24576    7862271    3918848  83  Linux
$
</pre>
$ flash_erase  /dev/mtd2 0 0
if you do "ls /dev/sdxxx*" you will get 2 /dev/sdxxx1 and /dev/sdxxx2. Use them in the following commands.
$ nandwrite -p /dev/mtd2 uImage
Format:
$ nandwrite -p /dev/mtd1 -s 0x1e0000 imx6q-var-som.dtb
<pre>
$ mkfs.vfat /dev/sdxxx1 -nBOT-VARSOM
$ mkfs.ext4 /dev/sdxxx2 -Lrootfs
$ sync
$ sync
</pre>
</pre>
Remove/Insert the SCDARD or just push the media icons to mount the new empty partitions.


= Install U-Boot images =
= Install the root file system =
{{note|Note:<br/>Make sure you built U-Boot for SD.|info}}
<pre>$ mkdir tmp
<pre>$ ~/var-som-mx6-alip/uboot-imx
$ mount /dev/mmcblk1p1 tmp/
$ sudo dd if=SPL of=/dev/sdxxx bs=1K seek=1; sync
$ tar xf linaro-alip-20151215-v3.tar.bz2  -C tmp/
$ sudo dd if=u-boot.img of=/dev/sdxxx bs=1K seek=69; sync
$ umount tmp
$ rm -rf tmp
</pre>
</pre>


= Copy the kernel image and device tree files =
= Deploy the kernel modules =
<pre>
<pre>
$ cd ~/var-som-mx6-alip/linux-2.6-imx
$ sudo cp arch/arm/boot/uImage /media/BOT-VARSOM/
$ sudo cp arch/arm/boot/dts/*var*.dtb /media/BOT-VARSOM/
</pre>


= Install the root file system =
<pre>$ sudo tar xvf ~/Downloads/linaro-alip-20151215-v1.tar.bz2 -C /media/rootfs
</pre>
</pre>


= Deploy the kernel modules =
<pre>
$ cd ~/var-som-mx6-alip/linux-2.6-imx
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=/media/rootfs/
</pre>
= Deploy the Wi-Fi modules and firmware =
= Deploy the Wi-Fi modules and firmware =


<pre>
<pre>
$ cd ~/var-som-mx6-alip/build-utilites
$ gedit setup-env
set:
export ROOTFS=/media/rootfs
</pre>
<pre>
$ ./sudo_build_wl18xx.sh modules
$ ./sudo_build_wl18xx.sh firmware
$ ./sudo_build_wl18xx.sh bt-firmware
$ sudo umount /dev/sdxxx*
</pre>
</pre>
= u-boot paramters =
echo "Please stop at u-boot and set enviroment"
echo "setenv bootargs console=ttymxc0,115200 video=mxcfb1:off root=/dev/mmcblk1p1 rootwait rw"
echo "saveenv"

Latest revision as of 06:46, 19 January 2016

VAR-SOM-MX6 - Ubuntu Linaro Alip-20151215 Flash your target from NET

Overview

Ubuntu Linaro Alip is pre built file system. For more information Ubuntu based Rootfs provided by Linaro. Variscite used linaro-vivid-alip-20151215-714 image added Vivante Graphic acceleration and compile the GStreamer with i.MX6 support.

Build Ubuntu Alip NFS is prerequisite step. Please make sure you run it and have a complete NFS build directory as described in the linked WIKI. Also make sure you target is booted from NFS.

The steps require to build an Bootable SDCARD:

  1. Build Ubuntu Alip NFS. Build Ubuntu Alip NFS
  2. Boot your Ubuntu Alip with TFTP and mount your file system over NFS. Build Ubuntu Alip NFS
  3. Copy required file to your NFS directory
  4. Format and partition the target eMMC
  5. Install U-Boot and Linux Kernel images
  6. Install the root file system
  7. Deploy the kernel modules
  8. Deploy the Wi-Fi modules and firmware

Copy required file to your NFS directory

Note:
Make sure you built U-Boot for NAND.
$ cd  ~/var-som-mx6-alip/
$ sudo cp uboot-imx/SPL rootfs/root
$ sudo cp uboot-imx/u-boot.img rootfs/root
$ sudo cp linux-2.6-imx/arch/arm/boot/uImage rootfs/root
$ sudo cp linux-2.6-imx/arch/arm/boot/dts/*var*.dtb rootfs/root
$ sudo cp ~/baba/Downloads/
$ sudo cp ~/baba/Downloads/linaro-alip-20151215-v3.tar.bz2  rootfs/root/

Format and partition the target eMMC

Boot your target and:

$ fdisk /dev/mmcblk1                                                                                 
n
p
1
<enter for default>
<enter for default>
t
83
w
$ mkfs.ext4 /dev/mmcblk1p1 -Lrootfs

Install U-Boot and Linux Kernel images

Note:
Make sure you built U-Boot for NAND.
$ flash_erase /dev/mtd0 0 0
$ kobs-ng init -x SPL --search_exponent=1 -v > /dev/null
$ flash_erase /dev/mtd1 0 0
$ nandwrite -p /dev/mtd1 u-boot.img
$
$ flash_erase  /dev/mtd2 0 0
$ nandwrite -p /dev/mtd2 uImage
$ nandwrite -p /dev/mtd1 -s 0x1e0000 imx6q-var-som.dtb
$ sync

Install the root file system

$ mkdir tmp
$ mount /dev/mmcblk1p1 tmp/
$ tar xf linaro-alip-20151215-v3.tar.bz2  -C tmp/
$ umount tmp
$ rm -rf tmp

Deploy the kernel modules


Deploy the Wi-Fi modules and firmware


u-boot paramters

echo "Please stop at u-boot and set enviroment" echo "setenv bootargs console=ttymxc0,115200 video=mxcfb1:off root=/dev/mmcblk1p1 rootwait rw" echo "saveenv"