CL-SOM-AM57x: Linux: Manual Installation: destination: SATA
Contents
Introduction
This article provides an introduction on how to install the Linux kernel and the example root filesystem image on the CompuLab CL-SOM-AM57x System-on-Module / Computer-on-Module SATA storage using one of the following sources:
- SD card
- USB storage device
- Network interface
Preparation steps
- Obtain a PC workstation with a serial communication port.
- Download the Linux package for CL-SOM-AM57x from CompuLab website. Unzip the package to a directory on your host workstation.
- All image files mentioned below can be found in the install subdirectory.
- Connect the host PC to the SBC-AM57x base-board (connector P8) via the serial cable supplied with the evaluation kit.
For networked installation you need to install a TFTP and NFS servers on the host PC |
Preparing installation media
- Obtain an SD card or USB storage with minimum capacity of 1GB.
- Create a first partition on the installation media. The partition can be formatted either ext2/3/4 or FAT16/32 file system.
- Copy the content of the install directory from the unzipped Linux package to the root directory on the first partition of the installation media.
Installation storage media must contain a partition table. Use fdisk (or alike) utility to create a partition table. |
Boot into the installation environment (ramdisk)
- Start terminal emulation software on your PC with the following serial port settings:
Baud Rate Data Bits Stop Bits Parity Flow Control 115200 8 1 none none
- Insert the installation media into the MMC/SD socket (P9) or USB connector (P6) on the SBC-AM57x.
- Make sure no other removable media is plugged.
- Turn on the device. Press a key to prevent a possible autoboot and get into the U-Boot command prompt.
If the boot settings of your device are different than the default, you may need to press and hold Ctrl-C while turning the device on, in order to get command prompt. |
- Use the following U-Boot commands to boot the installation environment from the installation SD card:
U-Boot# mmc dev 0 && mmc rescan U-Boot# load mmc 0 0x88000000 ramdisk.dtb && load mmc 0 0x82000000 kernel.img && load mmc 0 0x88080000 ramdisk.img U-Boot# setenv bootargs "root=/dev/ram0 rw ramdisk_size=16384 console=ttyO2,115200n8 vram=16M" U-Boot# bootz 0x82000000 0x88080000 0x88000000
- Use the following U-Boot commands to boot the installation environment from the installation USB storage:
U-Boot # usb start U-Boot # load usb 0 0x88000000 ramdisk.dtb && load usb 0 0x82000000 kernel.img && load usb 0 0x88080000 ramdisk.img U-Boot # setenv bootargs "root=/dev/ram0 rw ramdisk_size=16384 console=ttyO2,115200n8 vram=16M" U-Boot # bootz 0x82000000 0x88080000 0x88000000
Mount installation source
- Use the following mount command to mount the installation SD card.
- The character X should be replaced with the SD card device block number:
root@cl-ramdisk:~# mkdir -p /media/install && mount /dev/mmcblkXp1 /media/install
- Use the following mount command to mount the installation USB storage.
- The character X should be replaced with the USB drive letter
root@cl-ramdisk:~# mkdir -p /media/install && mount /dev/sdX1 /media/install
The below procedure will work only on empty SATA drive. If you have already used the drive, please delete all the partitions before proceeding. |
- Identify SATA drive special device file
export SATA_DRIVE=/dev/`basename /sys/devices/platform/44000000.ocp/4a140000.sata/ata1/host0/target0\:0\:0/0\:0\:0\:0/block/sd?`
- Create two partitions for the Linux kernel (FAT32 100M) and root file system (EXT4 the rest of the disk) on SATA drive:
root@compulab:~# echo -e "o\nn\np\n1\n\n+100M\nn\np\n2\n\n\nw\neof\n" | fdisk -u ${SATA_DRIVE} root@compulab:~# mdev -s 1>&- 2>&-; umount ${SATA_DRIVE}1; umount ${SATA_DRIVE}2
In the below procedure the first (boot) partition can be either FAT32 or EXT2/3/4, only FAT32 file system is demonstrated. |
- Format the first partition with FAT32 file system:
root@compulab:~# mkfs.ext2 -L boot ${SATA_DRIVE}1
- Format the second partition with EXT4 file system:
root@compulab:~# mkfs.ext4 ${SATA_DRIVE}2
- Mount both partitions:
root@compulab:~# mkdir -p /media/boot && mount ${SATA_DRIVE}1 /media/boot root@compulab:~# mkdir -p /media/rootfs && mount ${SATA_DRIVE}2 /media/rootfs
- Copy the kernel images to the first (FAT) partition:
root@compulab:~# cp /media/install/zImage-cl-som-am57x /media/install/am57?x-sbc-am57x.dtb /media/boot && sync
- Extract the content of rootfs.tar.bz2 onto the second partition:
root@compulab:~# tar --numeric-owner -xvpjf /media/install/rootfs.tar.bz2 -C /media/rootfs && sync
- Unmount both partitions:
root@compulab:~# umount ${SATA_DRIVE}?
After Installation
- Remove the installation media and reboot the device
- Press a key to prevent a possible autoboot and get into the U-Boot command prompt.
- Set default U-Boot environment:
U-Boot# env default -a
- Select the SATA as the boot storage
U-Boot# setenv bootcmd 'run sataboot'
Select video output
CL-SOM-AM57x evaluation platform (SBC-AM57x) has four video output interfaces: LCD, DVI, LVDS and HDMI. Current version of Xorg driver of CL-SOM-AM57x example root file system supports mirror video output mode only. It causes last registered video output device (LCD) resolution to be propagated to other devices.
In order to force a specific video output device to be selected as a primary device the U-Boot environment variables should be adjusted.
- To enable HDMI video output:
U-Boot# setenv displaytype hdmi
- To enable LCD video output:
U-Boot# setenv displaytype lcd
- To enable LVDS video output:
U-Boot# setenv displaytype lvds
- To enable DVI video output:
U-Boot# setenv displaytype dvi
Boot the module
- Save U-Boot environment:
U-Boot # saveenv
- Boot command:
U-Boot # reset