CL-SOM-iMX7: Linux: Manual Installation: SD

From Compulab Mediawiki
Revision as of 11:03, 29 November 2018 by imported>Uri.mashiach
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Instoduction

This article provides an introduction on how to install the Linux kernel and the example root filesystem image for the CompuLab CL-SOM-iMX7 System-on-Module / Computer-on-Module onto removable micro SD card using Linux host machine.

Preparation steps

  • Obtain a Linux PC workstation with a USB port.
  • Download the BSP binary package for CL-SOM-iMX7 from CompuLab website. Unzip the package to a directory on your host workstation. The following discussion uses /path/to/cl-som-imx7-linux/ template for this location. Please use the real path to the Linux package instead.
  • All image files mentioned below can be found in the install subdirectory.
  • Obtain an SD card. Any commercially available SD card of 1GB (or larger) may be used.
  • Obtain a USB Card reader with SD card slot.

Install Linux Images

  • Plug the USB SD Card reader to a host Linux PC. Insert the SD Card into the USB Card reader. The following discussion assumes the device name of the SD card on your Linux PC is /dev/sdc Please use the actual device name instead.
  • Depending on the desktop system setup, following steps might require super user privileges.
  • Unmount all SD card partitions:
umount -l /dev/sdc*
  • Clean up the on the SD card:
dd if=/dev/zero of=/dev/sdc bs=1M count=1
hdparm -z /dev/sdc
  • Create two partitions for the Linux kernel (EXT2 100M) and root file system (EXT4 the rest of the disk) on the SD card:
echo -e "n\np\n1\n\n+100M\nn\np\n2\n\n\nw\neof\n" | fdisk /dev/sdc
  • Format the first partition with EXT2 file system:
mkfs.ext2 -L boot /dev/sdc1
  • Format the second partition with EXT4 file system:
mkfs.ext4 -L rootfs /dev/sdc2
  • Mount both partitions:
mkdir -p /media/boot && mount /dev/sdc1 /media/boot
mkdir -p /media/rootfs && mount /dev/sdc2 /media/rootfs
  • Copy zImage and imx7d-*imx7.dtb to the first (EXT2) partition:
cp /path/to/cl-som-imx7-linux/images/zImage /path/to/cl-som-imx7-linux/images/imx7d-*.dtb /media/boot && sync
  • Extract the content of rootfs.tar.bz2 onto the second partition:
tar --numeric-owner -xpf /path/to/cl-som-imx7-linux/images/rootfs.tar.bz2 -C /media/rootfs && sync
  • Unmount both partitions:
umount /media/boot
umount /media/rootfs
  • Eject the SD card
eject /dev/sdc
  • Remove the SD card from the SD card reader

After Installation

  • Plug the SD card to the SD socket (P9) on the SBC-iMX7.
  • Use the following U-Boot commands to configure removable SD card as the main storage for both Linux kernel and root filesystem images:
env default -a
setenv bootdelay 3
setenv kernel zImage
setenv loadaddr 0x80800000
setenv fdtfile imx7d-sbc-imx7.dtb
setenv fdtaddr 0x83000000
setenv mmcroot "/dev/mmcblk0p2 rootwait rw"
setenv loadimage 'load mmc 0:1 ${loadaddr} ${kernel}'
setenv loadfdt 'load mmc 0:1 ${fdtaddr} ${fdtfile}'
setenv bootargs "console=ttymxc0,115200 root=${mmcroot}"
setenv bootcmd 'run loadimage; run loadfdt; bootz ${loadaddr} - ${fdtaddr}'
  • To save this configuration:
saveenv
  • To boot Linux type:
run bootcmd

See also