Difference between revisions of "Getting started with Linux on CM-X300"
m (1 revision(s)) |
|||
Line 1: | Line 1: | ||
== Preparation steps == | == Preparation steps == | ||
− | + | {{Note|It is possible to install Linux on CM-X300 using either an NFS share or a USB flash drive. The first method is preferred because NFS setup will ease further Linux evaluation and development.}} | |
* Obtain a PC workstation with serial communication port. | * Obtain a PC workstation with serial communication port. | ||
− | * | + | * For installation using NFS install TFTP server on host PC. For Windows machines we recommend [http://tftpd32.jounin.net/ TFTPD32] included in this distribution package. |
* Download the [http://www.compulab.co.il/x300/download/x300-linux.zip Linux distribution package for CM-X300] from CompuLab's website . Unzip the package to a directory on your host workstation. | * Download the [http://www.compulab.co.il/x300/download/x300-linux.zip Linux distribution package for CM-X300] from CompuLab's website . Unzip the package to a directory on your host workstation. | ||
* All image files mentioned below can be found in {{filename|images}} subdirectory | * All image files mentioned below can be found in {{filename|images}} subdirectory | ||
− | + | * Copy {{filename|debian-image.jffs2}} and {{filename|cm-x300-kernel.jffs2}} from [http://www.compulab.co.il/x300/download/x300-linux.zip Linux distribution package for CM-X300] either to a directory exported through NFS or to a USB flash drive. | |
− | |||
− | |||
− | * Copy {{filename|debian-image.jffs2}} and {{filename|cm-x300-kernel.jffs2}} from [http://www.compulab.co.il/x300/download/x300-linux.zip Linux distribution package for CM-X300] to a directory exported through NFS. | ||
== Image installation == | == Image installation == | ||
− | |||
− | |||
* Connect the host PC to the CM-X300 via a null modem cable supplied with the Eval Kit. | * Connect the host PC to the CM-X300 via a null modem cable supplied with the Eval Kit. | ||
* Start terminal emulation software on your PC using the COM port to which the null modem is connected. Set baud rate to 38400 bps, 8 bit per frame, 1 stop bit, no parity, no flow control. | * Start terminal emulation software on your PC using the COM port to which the null modem is connected. Set baud rate to 38400 bps, 8 bit per frame, 1 stop bit, no parity, no flow control. | ||
* Turn on the CM-X300. The U-Boot will start and you will get a command prompt. | * Turn on the CM-X300. The U-Boot will start and you will get a command prompt. | ||
*: {{Note|If the boot settings of your CM-X300 are different than default, you may need to press and hold ^C while turning the CM-X300 on, in order to get command prompt.}} | *: {{Note|If the boot settings of your CM-X300 are different than default, you may need to press and hold ^C while turning the CM-X300 on, in order to get command prompt.}} | ||
+ | |||
+ | === Installation using NFS === | ||
+ | * Connect CM-X300's ETH0 port to your local Ethernet | ||
+ | * Make sure that Linux kernel binary image {{filename|kernel.img}}, ramdisk image {{filename|ramdisk.img}} and bootloader script image {{filename|first_boot.img}} are accessible by the TFTP server. | ||
+ | *: - On Windows machine: copy {{filename|kernel.img}}, {{filename|ramdisk.img}} and {{filename|first_boot.img}} to the same folder and point the TFTP server to that folder | ||
+ | *: - On Linux machine: copy {{filename|kernel.img}}, {{filename|ramdisk.img}} and {{filename|first_boot.img}} to TFTP sevrver root directory, usually {{filename|/tftpboot}} or {{filename|/tftproot}}. | ||
* You can use U-boot {{cmd|dhcp}} command to obtain IP address or manually set {{parameter|ipaddr}} and {{parameter|serverip}} environment variables: | * You can use U-boot {{cmd|dhcp}} command to obtain IP address or manually set {{parameter|ipaddr}} and {{parameter|serverip}} environment variables: | ||
<pre> | <pre> | ||
Line 28: | Line 29: | ||
> tftp 80400000 first_boot.img && autoscr 80400000 | > tftp 80400000 first_boot.img && autoscr 80400000 | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
* During boot the CM-X300 tries to obtain an IP address using DHCP. If you do not have DHCP server you can set the CM-X300 IP address statically using {{cmd|ifconfig}}: | * During boot the CM-X300 tries to obtain an IP address using DHCP. If you do not have DHCP server you can set the CM-X300 IP address statically using {{cmd|ifconfig}}: | ||
<pre> | <pre> | ||
$ ifconfig eth0 <ip address> | $ ifconfig eth0 <ip address> | ||
</pre> | </pre> | ||
+ | * After the ramdisk image is loaded you will get Linux login prompt. Login as {{parameter|root}} into the system. | ||
* Mount the NFS share containing {{filename|debian-image.jffs2}} image: | * Mount the NFS share containing {{filename|debian-image.jffs2}} image: | ||
<pre> | <pre> | ||
Line 47: | Line 44: | ||
$ nandwrite /dev/mtd4 /mnt/net/cm-x300-kernel.jffs2 | $ nandwrite /dev/mtd4 /mnt/net/cm-x300-kernel.jffs2 | ||
$ nandwrite /dev/mtd5 /mnt/net/debian-image.jffs2 | $ nandwrite /dev/mtd5 /mnt/net/debian-image.jffs2 | ||
+ | </pre> | ||
+ | |||
+ | === Installation using USB flash drive === | ||
+ | * Make sure that CM-X300's ETH0 port is '''disconnected''' | ||
+ | * Make sure that Linux kernel binary image {{filename|kernel.img}}, ramdisk image {{filename|ramdisk.img}} and bootloader script image {{filename|first_boot.img}} are present at the root directory of the USB flash drive. | ||
+ | * Connect USB flash drive to CM-X300. Use USB2 (host/slave) port. | ||
+ | * Use the following U-boot command to boot Linux on CM-X300: | ||
+ | <pre> | ||
+ | > usb start | ||
+ | > fatload usb 0:1 80400000 first_boot.img | ||
+ | > autoscr 80400000 | ||
+ | </pre> | ||
+ | * After the ramdisk image is loaded you will get Linux login prompt. Login as {{parameter|root}} into the system. | ||
+ | * The USB flash drive will be automatically mounted under {{filename|/media/sda1}} | ||
+ | * Format the NAND flash and write the kernel image and Debian filesystem image onto it: | ||
+ | <pre> | ||
+ | $ flash_eraseall /dev/mtd4 | ||
+ | $ flash_eraseall /dev/mtd5 | ||
+ | $ nandwrite /dev/mtd4 /media/sda1/cm-x300-kernel.jffs2 | ||
+ | $ nandwrite /dev/mtd5 /media/sda1/debian-image.jffs2 | ||
</pre> | </pre> | ||
Line 53: | Line 70: | ||
<ol> | <ol> | ||
<li> Reset the CM-X300.</li> | <li> Reset the CM-X300.</li> | ||
+ | {{Note|If the boot settings of your CM-X300 are different than default, you may need to press and hold ^C while turning the CM-X300 on, in order to get command prompt.}} | ||
<li> To start Linux type: | <li> To start Linux type: | ||
<pre>> fsload; bootm</pre> | <pre>> fsload; bootm</pre> |
Revision as of 13:05, 21 June 2009
Contents
Preparation steps
It is possible to install Linux on CM-X300 using either an NFS share or a USB flash drive. The first method is preferred because NFS setup will ease further Linux evaluation and development. |
- Obtain a PC workstation with serial communication port.
- For installation using NFS install TFTP server on host PC. For Windows machines we recommend TFTPD32 included in this distribution package.
- Download the Linux distribution package for CM-X300 from CompuLab's website . Unzip the package to a directory on your host workstation.
- All image files mentioned below can be found in images subdirectory
- Copy debian-image.jffs2 and cm-x300-kernel.jffs2 from Linux distribution package for CM-X300 either to a directory exported through NFS or to a USB flash drive.
Image installation
- Connect the host PC to the CM-X300 via a null modem cable supplied with the Eval Kit.
- Start terminal emulation software on your PC using the COM port to which the null modem is connected. Set baud rate to 38400 bps, 8 bit per frame, 1 stop bit, no parity, no flow control.
- Turn on the CM-X300. The U-Boot will start and you will get a command prompt.
If the boot settings of your CM-X300 are different than default, you may need to press and hold ^C while turning the CM-X300 on, in order to get command prompt. |
Installation using NFS
- Connect CM-X300's ETH0 port to your local Ethernet
- Make sure that Linux kernel binary image kernel.img, ramdisk image ramdisk.img and bootloader script image first_boot.img are accessible by the TFTP server.
- - On Windows machine: copy kernel.img, ramdisk.img and first_boot.img to the same folder and point the TFTP server to that folder
- - On Linux machine: copy kernel.img, ramdisk.img and first_boot.img to TFTP sevrver root directory, usually /tftpboot or /tftproot.
- You can use U-boot dhcp command to obtain IP address or manually set ipaddr and serverip environment variables:
> setenv serverip <host ip address> > setenv ipaddr <CM-X300 ip address> > saveenv
- Use the following U-boot command to boot Linux on CM-X300:
> tftp 80400000 first_boot.img && autoscr 80400000
- During boot the CM-X300 tries to obtain an IP address using DHCP. If you do not have DHCP server you can set the CM-X300 IP address statically using ifconfig:
$ ifconfig eth0 <ip address>
- After the ramdisk image is loaded you will get Linux login prompt. Login as root into the system.
- Mount the NFS share containing debian-image.jffs2 image:
$ mount <host ip>:/path/to/nfs/share /mnt/net
- Format the NAND flash and write the kernel image and Debian filesystem image onto it:
$ flash_eraseall /dev/mtd4 $ flash_eraseall /dev/mtd5 $ nandwrite /dev/mtd4 /mnt/net/cm-x300-kernel.jffs2 $ nandwrite /dev/mtd5 /mnt/net/debian-image.jffs2
Installation using USB flash drive
- Make sure that CM-X300's ETH0 port is disconnected
- Make sure that Linux kernel binary image kernel.img, ramdisk image ramdisk.img and bootloader script image first_boot.img are present at the root directory of the USB flash drive.
- Connect USB flash drive to CM-X300. Use USB2 (host/slave) port.
- Use the following U-boot command to boot Linux on CM-X300:
> usb start > fatload usb 0:1 80400000 first_boot.img > autoscr 80400000
- After the ramdisk image is loaded you will get Linux login prompt. Login as root into the system.
- The USB flash drive will be automatically mounted under /media/sda1
- Format the NAND flash and write the kernel image and Debian filesystem image onto it:
$ flash_eraseall /dev/mtd4 $ flash_eraseall /dev/mtd5 $ nandwrite /dev/mtd4 /media/sda1/cm-x300-kernel.jffs2 $ nandwrite /dev/mtd5 /media/sda1/debian-image.jffs2
After Installation
- Reset the CM-X300.
- To start Linux type:
> fsload; bootm
- If you want Linux to start automatically, type:
> setenv bootdelay <delay in seconds> > setenv bootcmd "fsload; bootm" > saveenv > boot
If the boot settings of your CM-X300 are different than default, you may need to press and hold ^C while turning the CM-X300 on, in order to get command prompt. |
If you want to get back to U-Boot prompt, hold Ctrl-C during reset.
Connection and Logging In
Use the following usernames and passwords to login:
Account with administrative privileges:
User: root Password: 111111
Regular user account:
User: user Password: 111111
In addition to these accounts CM-X300 allows anonymous FTP access.