Difference between revisions of "CM-FX6: Linux: Getting started"
(→After Installation) |
(→Debian Images) |
||
Line 64: | Line 64: | ||
The latest [http://compulab.co.il/products/computer-on-modules/cm-fx6/#devres Linux package for CM-FX6] contains two rootfs images: | The latest [http://compulab.co.il/products/computer-on-modules/cm-fx6/#devres Linux package for CM-FX6] contains two rootfs images: | ||
# {{filename|debian-image.tar.bz2}} | # {{filename|debian-image.tar.bz2}} | ||
− | # {{filename|debian-image- | + | # {{filename|debian-image-bt-support.tar.bz2}} |
It is up to user to decide what image to install. Unpack and Install procedures are the same. | It is up to user to decide what image to install. Unpack and Install procedures are the same. | ||
− | In the procedure bellow the {{filename|debian-image.tar.bz2}} name can be changed to {{filename|debian-image- | + | In the procedure bellow the {{filename|debian-image.tar.bz2}} name can be changed to {{filename|debian-image-bt-support.tar.bz2}} |
=== Mount an MMC/SD Card === | === Mount an MMC/SD Card === |
Revision as of 12:32, 6 November 2014
Contents
Preparation steps
- Obtain a PC workstation with a serial communication port.
- For networked installation you need to install a TFTP server on the host PC. For Windows machines we recommend TFTPD32 included in the Linux package for CM-FX6 (link below).
- Download the Linux package for CM-FX6 from CompuLab website. Unzip the package to a directory on your host workstation.
- All image files mentioned below can be found in the images subdirectory.
- Connect the host PC to the SB-FX6 base-board (connector P60) via the serial cable supplied with the evaluation kit.
- Start the terminal emulation software on your PC. Set baud rate to 115200 bps, 8 bit per frame, 1 stop bit, no parity, no flow control.
- Turn on the CM-FX6 evaluation system. The U-Boot boot-loader will start and you will get a command prompt.
If the boot settings of your CM-FX6 are different than the default, you may need to press and hold Ctrl-C while turning the CM-FX6 on, in order to get command prompt. |
Boot into the installation environment (ramdisk)
The first step in CM-FX6 Linux installation is starting the installation environment (Linux kernel and Ramdisk image). This can be done using the following media:
Using installation environment on MMC/SD card
- Copy kernel.img, ramdisk.img and bootscr.img from Linux package for CM-FX6 to the root directory on the first partition of the MMC/SD card. Note, the partition must be FAT (16 or 32) formated.
- Insert the MMC/SD card into the SD socket (P6) on the SB-FX6.
- Use the following U-boot commands to boot the installation environment on the CM-FX6:
CM-FX6 # mmc dev 2 CM-FX6 # mmc rescan CM-FX6 # fatload mmc 2:1 10700000 bootscr.img CM-FX6 # source 10700000
- Continue to the Install Kernel and Debian Linux Images section.
Using installation environment from TFTP server
- Connect the CM-FX6 Ethernet port (connector P9 marked as "CM ETHERNET" on the SB-FX6) to your local network.
- Put kernel.img and ramdisk.img from Linux package for CM-FX6 to a location accessible by the TFTP server:
- - On Windows machine: copy kernel.img and ramdisk.img to the same folder and point the TFTP server to that folder
- - On Linux machine: copy kernel.img and ramdisk.img to the TFTP server root directory, usually /tftpboot or /tftproot.
- You can use U-boot dhcp command to obtain IP address or manually set ipaddr environment variable:
CM-FX6 # setenv ipaddr <CM-FX6 ip address>
- Set the serverip environment variable and save the new environment:
CM-FX6 # setenv serverip <tftp server host ip address> CM-FX6 # saveenv
- Use the following U-Boot commands to boot Linux on CM-FX6:
CM-FX6 # setenv bootargs "root=/dev/ram0 ramdisk_size=16384 console=ttymxc3,115200" CM-FX6 # tftpboot 10800000 kernel.img && tftpboot 12000000 ramdisk.img CM-FX6 # bootm 10800000 12000000
- Continue to the Install Kernel and Debian Linux Images section.
Install Kernel and Debian Linux Images
After the ramdisk image is loaded the Linux login prompt will appear. Login as root into the system. Use 111111 password for login:
compulab login: root Password: 111111
The next step is installing the kernel and Debian Linux images. The following media can be used as a source for installation:
Debian Images
The latest Linux package for CM-FX6 contains two rootfs images:
- debian-image.tar.bz2
- debian-image-bt-support.tar.bz2
It is up to user to decide what image to install. Unpack and Install procedures are the same. In the procedure bellow the debian-image.tar.bz2 name can be changed to debian-image-bt-support.tar.bz2
Mount an MMC/SD Card
- Copy the debian-image.tar.bz2, and the uImage-cm-fx6 from the Linux package for CM-FX6 to the root directory of any partition on the MMC/SD card. The partition can be formatted as either ext2/3/4 or FAT file system.
- Insert the MMC/SD card into the SD socket (P6) on the SB-FX6.
- The MMC/SD card is mounted automatically under /media/mmcblk0pX. Where X is the partition number.
- If for some reason the MMC/SD card hasn't been mounted automatically, use the following mount command:
root@compulab:~# mkdir -p /media/mmcblk0pX && mount /dev/mmcblk0pX /media/mmcblk0pX
- Continue to the Install Images section.
Mount a USB Storage Device
- Copy the debian-image.tar.bz2, and the uImage-cm-fx6 from the Linux package for CM-FX6 to the root directory of any partition on the USB storage device.
- Plug the USB storage device to the lower port on the dual USB host connector P13 of the SB-FX6.
- The USB device is mounted automatically under /media/sdXY. Where X is the device letter and Y is the partition number.
- If for some reason the USB storage device hasn't been mounted automatically, use the following mount command:
root@compulab:~# mkdir -p /media/sdXY && mount /dev/sdXY /media/sdXY
- Continue to the Install Images section.
Mount an NFS drive
- Connect the CM-FX6 Ethernet port (connector P9 marked as "CM ETHERNET" on the SB-FX6) to your local network.
- Copy the debian-image.tar.bz2, and the uImage-cm-fx6 from the Linux package for CM-FX6 to a directory exported through NFS.
- Obtain an IP address for the CM-FX6:
- Using DHCP:
root@compulab:~# ifup `basename /sys/devices/platform/enet.0/net/eth?`
- If you do not have a DHCP server, you can set a static IP address using ifconfig:
root@compulab:~# ifconfig `basename /sys/devices/platform/enet.0/net/eth?` <ip address>
- Using DHCP:
- Mount the NFS share containing the uImage-cm-fx6 and the debian-image.tar.bz2 files:
root@compulab:~# mount -o nolock <host ip>:/path/to/nfs/share /mnt/net
- Continue to Install Images section.
Install Images
Once the ramdisk image is loaded and the media containing the CM-FX6 Kernel and Debian Linux images is mounted, the installation can be done on either of the following:
Install on the NAND flash
- In this subsection the term /mount/point can be:
- /mnt/net if NFS is used
- /media/mmcblk0pX if an MMC/SD card is used, where X is the partition number.
- /media/sdXY if a USB storage is used, where X is the USB drive letter and Y is the partition number.
- Format the NAND flash kernel partition and write the kernel image onto it:
root@compulab:~# flash_erase /dev/mtd3 0 0 root@compulab:~# nandwrite -p /dev/mtd3 /mount/point/uImage-cm-fx6
- Format the NAND flash root filesystem partition:
root@compulab:~# ubiformat /dev/mtd4
- Attach the NAND flash root filesystem partition:
root@compulab:~# ubiattach -m 4 -d 0
- Create a ubi volume and name it "rootfs":
root@compulab:~# ubimkvol /dev/ubi0 -m -N rootfs
- Mount the ubi volume:
root@compulab:~# mkdir -p /media/rootfs && mount -t ubifs ubi0:rootfs /media/rootfs
- Extract the content of debian-image.tar.bz2 onto the /media/rootfs:
root@compulab:~# tar -xvpjf /mount/point/debian-image.tar.bz2 -C /media/rootfs && sync
- Unmount the ubi volume:
root@compulab:~# umount /media/rootfs
- Continue to the After Installation section.
Install on the SSD Disk-on-Chip
The below procedure will work only on empty SSD Disk-on-Chip. If you have already used the SSD, please delete all the partitions before proceeding. |
- In this subsection the term /mount/point can be:
- /mnt/net if NFS is used
- /media/mmcblk0pX if an MMC/SD card is used, where X is the partition number.
- /media/sdXY if USB storage is used, where X is the USB drive letter and Y is the partition number.
- Create two partitions for the Linux kernel (FAT32 100M) and root file system (EXT4 the rest of the disk) on the SSD:
root@compulab:~# echo -e "n\np\n1\n\n+100M\na\n1\nt\nc\nn\np\n2\n\n\nw\neof\n" | fdisk /dev/sda
- Format the first partition with FAT32 file system:
root@compulab:~# mkfs.vfat -n boot /dev/sda1
- Format the second partition with EXT4 file system:
root@compulab:~# mkfs.ext4 /dev/sda2
- Mount both partitions:
root@compulab:~# mkdir -p /media/boot && mount /dev/sda1 /media/boot root@compulab:~# mkdir -p /media/rootfs && mount /dev/sda2 /media/rootfs
- Copy the uImage-cm-fx6 to the first (FAT) partition:
root@compulab:~# cp /mount/point/uImage-cm-fx6 /media/boot && sync
- Extract the content of debian-image.tar.bz2 onto the second partition:
root@compulab:~# tar -xvpjf /mount/point/debian-image.tar.bz2 -C /media/rootfs && sync
- Unmount both SSD partitions:
root@compulab:~# umount /dev/sda1 root@compulab:~# umount /dev/sda2
- Continue to the After Installation section.
After Installation
If the boot settings of the CM-FX6 are different than default, you may need to press and hold Ctrl-C while turning the CM-FX6 on, in order to get command prompt. |
- CM-FX6 will boot Debian Linux from the internal NAND flash or the SSD Disk-on-Chip.
For DataImage SCF04 LCD, please append cm_fx6_lcd=dataimage to the bootargs U-Boot variable. |
Boot from the NAND flash
- Set the bootargs environment variable:
CM-FX6 # setenv bootargs 'console=ttymxc3,115200 root=ubi0:rootfs rw rootfstype=ubifs ubi.mtd=rootfs'
- To boot Linux, type:
CM-FX6 # setenv bootdelay 3 CM-FX6 # setenv bootcmd "nand read 10800000 0 400000; bootm" CM-FX6 # saveenv CM-FX6 # boot
Boot from SSD Disk-on-Chip
- Set the bootargs environment variable:
CM-FX6 # setenv bootargs 'console=ttymxc3,115200 root=/dev/sda2 rootfstype=ext4 rw rootwait'
- To boot Linux, type:
CM-FX6 # setenv bootdelay 3 CM-FX6 # setenv bootcmd 'sata init; fatload sata 0 10800000 uImage-cm-fx6; bootm' CM-FX6 # saveenv CM-FX6 # boot