UCM-iMX7: Linux: Manual Installation: SD

From Compulab Mediawiki
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 UCM-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 Linux package for UCM-iMX7 from CompuLab website. Unzip the package to a directory on your host workstation. The following article uses /path/to/ucm-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 images 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/ucm-imx7-linux/images/zImage /path/to/ucm-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/ucm-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 micro SD socket (P8) on the SBC-UCM-iMX7.
  • The default U-Boot environment configuration can boot from am external micro SD card if proper images are found on it.
  • Alternatively, you can use the following U-Boot commands to configure removable micro SD card as the main storage for both Linux kernel and root filesystem images manually:
UCM-iMX7 # env default -a
UCM-iMX7 # setenv bootdelay 3
UCM-iMX7 # setenv kernel zImage
UCM-iMX7 # setenv loadaddr 0x80800000
UCM-iMX7 # setenv fdtfile imx7d-sbc-ucm-imx7.dtb
UCM-iMX7 # setenv fdtaddr 0x83000000
UCM-iMX7 # setenv mmcroot "/dev/mmcblk0p2 rootwait rw"
UCM-iMX7 # setenv loadimage 'load mmc 0:1 ${loadaddr} ${kernel}'
UCM-iMX7 # setenv loadfdt 'load mmc 0:1 ${fdtaddr} ${fdtfile}'
UCM-iMX7 # setenv bootargs "console=ttymxc0,115200 root=${mmcroot}"
UCM-iMX7 # setenv bootcmd 'run loadimage; run loadfdt; bootz ${loadaddr} - ${fdtaddr}'
  • To save this configuration:
UCM-iMX7 # saveenv
  • To boot Linux type:
UCM-iMX7 # boot

See also