Difference between revisions of "IOT-GATE-iMX7 and SBC-IOT-iMX7: Linux: Manual Installation: Micro SD"
(→Preparation steps) |
|||
Line 4: | Line 4: | ||
== Preparation steps == | == Preparation steps == | ||
* Obtain a Linux PC workstation with a USB port. | * Obtain a Linux PC workstation with a USB port. | ||
− | * Download the Linux package for IOT-GATE-iMX7 and SBC-IOT-iMX7 from CompuLab website. Use either [http://www.compulab. | + | * Download the Linux package for IOT-GATE-iMX7 and SBC-IOT-iMX7 from CompuLab website. Use either [http://www.compulab.com/products/iot-gateways/iot-gate-imx7-nxp-i-mx-7-internet-of-things-gateway/#devres IOT-GATE-iMX7] or [http://www.compulab.com/products/sbcs/sbc-iot-imx7-nxp-i-mx-7-internet-of-things-single-board-computer/#devres SBC-IOT-iMX7] product web page for downloading. Unzip the package to a directory on your host workstation. The following discussion uses {{filename|/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 {{filename|images}} subdirectory. | * All image files mentioned below can be found in the {{filename|images}} subdirectory. | ||
* Obtain a micro SD card. Any commercially available micro SD card of 1GB (or larger) may be used. | * Obtain a micro SD card. Any commercially available micro SD card of 1GB (or larger) may be used. | ||
Line 12: | Line 12: | ||
* Plug the USB SD Card reader to a host Linux PC. Insert the micro SD Card into the USB Card reader. The following discussion assumes the device name of the micro SD card on your Linux PC is {{filename|/dev/sdc}} Please use the actual device name instead. | * Plug the USB SD Card reader to a host Linux PC. Insert the micro SD Card into the USB Card reader. The following discussion assumes the device name of the micro SD card on your Linux PC is {{filename|/dev/sdc}} Please use the actual device name instead. | ||
* Depending on the desktop system setup, following steps might require super user privileges. | * Depending on the desktop system setup, following steps might require super user privileges. | ||
− | + | {{:Transclusion: CL-SOM-iMX7: Linux: Manual Installation: Install Images on SD}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== After Installation == | == After Installation == |
Revision as of 14:30, 8 May 2017
Instoduction
This article provides an introduction on how to install the Linux kernel and the example root filesystem image for the IOT-GATE-iMX7 Internet of Things Gateway or CompuLab SBC-IOT-iMX7 Internet of Things Single Board Computer 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 IOT-GATE-iMX7 and SBC-IOT-iMX7 from CompuLab website. Use either IOT-GATE-iMX7 or SBC-IOT-iMX7 product web page for downloading. 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 images subdirectory.
- Obtain a micro SD card. Any commercially available micro SD card of 1GB (or larger) may be used.
- Obtain a USB Card reader with micro SD card slot or use microSD-to-SD adapter.
Install Linux Images
- Plug the USB SD Card reader to a host Linux PC. Insert the micro SD Card into the USB Card reader. The following discussion assumes the device name of the micro 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 installation media (micro MMC/SD card) to the microSD socket marked uSD on IOT-GATE-iMX7 front panel (slot P18 on the SBC-iMX7).
- Use the following U-Boot commands to configure removable micro 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-iot-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