Difference between revisions of "CM-iAM: Linux: Getting started"

From Compulab Mediawiki
Jump to: navigation, search
 
(Overview)
Line 1: Line 1:
 
== Overview  ==
 
== Overview  ==
  
Linux for the CM-iAM/SB-iAM is based on Ubuntu 9.04. [http://www.compulab.co.il/iam/download/release/iam-linux-release.zip The Linux package for CM-iAM] includes a ready-to-run NAND flash image, Linux kernel configuration and source code, dedicated repository with graphic drivers, media player and kernel related packages.
+
Linux for the CM-iAM/SB-iAM is based on Ubuntu 9.10. [http://www.compulab.co.il/iam/download/freeze/iam-linux-freeze.zip The Linux package for CM-iAM] includes a ready-to-run NAND flash image and kernel sources.
  
==  Package contents ==
+
In its initial state, the local NAND disk is empty. Use the EtherLink utility to download the NAND flash image from the TFTP server to the CM-iAM.
The CompuLab Linux package for CM-iAM contains the following components:
 
  
=== run-time disk images ===
+
The EtherLink utility is an integrated part of the BIOS on the CM-iAM.
* {{filename|sb-iam.ubuntu-9.04.NAND.img.bz2}} - archived image of local NAND disk. Contains fully configured Ubuntu 9.04
+
The TFTP server should be installed and configured on a host-side computer.
  
=== kernel ===
+
== TFTP server ==
* '''2.6.28''' kernel sources and configuration file customized by Compulab.
+
Recommended TFTP servers:
* The kernel is also present as a package in ''debian repository''.
+
* “tftpd32 by Ph.Jounin” TFTP server for a Windows-based host (http://tftpd32.jounin.net/).
 +
* A tftpd package for your distribution on a Linux-based host. For example, tftp-hpa on Ububntu.
  
=== debian repository ===
 
* To be consistent with Ubuntu/Debian packaging standards, we created a simple local repository that resides in {{filename|/opt/compulab/}} in the run-time image.
 
* This repository contains binaries and sources for all the custom packages provided by CompuLab, such as kernel, graphic drivers, libraries, etc. Please read more about working with a repository in [http://www.debian.org/doc/manuals/repository-howto/repository-howto Debian Repository HOWTO]
 
  
=== scripts ===
+
The following describes an example configuration on a Ubuntu/Debian host machine:
Miscellaneous useful scripts
 
* {{filename|image_mount.sh}} - utility to mount run-time image partitions on a host workstation
 
* {{filename|image_creator.sh}} - utility to create installation and recovery image for bootable USB flash drive. Run this script from {{filename|scripts}} directory in the package, {{filename|sb-iam.ubuntu-9.04.USB.img}} will be created in the {{filename|images}} directory.
 
  
== Boot from external device  ==
+
* Install required packages:
It`s possible to boot not only from the local NAND disk, but also from an external storage device such as a USB flash disk, SATA disk or MMC/SD/SDIO card. At it`s initial state, the local NAND disk is empty and booting from an external device is the only option. Below booting from disk-on-key is described.
 
* Obtain any Linux workstation and download [http://www.compulab.co.il/iam/download/release/iam-linux-release.zip Linux kernel package for CM-iAM] to it.
 
* Unzip ''iam-linux-release.zip'' to some place on your Linux workstation.
 
* Open '''Applications->Accessories->Terminal'''
 
* Get root permitions using the {{cmd|su}} command.
 
* Run {{cmd|image_creator.sh}} script from {{filename|scripts}} directory in the package, {{filename|sb-iam.ubuntu-9.04.USB.img}} will be created in the {{filename|images}} directory.
 
 
<pre>
 
<pre>
# cd /path/to/downloaded/iam-linux-release/scripts/
+
sudo apt-get install tftpd-hpa
# ls
 
image_creator.sh image_mount.sh
 
# ./image_creator.sh
 
(some output here)
 
../images/sb-iam.ubuntu-9.04.USB.img is ready.
 
# ls ../images/
 
sb-iam.ubuntu-9.04.USB.img sb-iam.ubuntu-9.04.NAND.img.bz2
 
 
</pre>
 
</pre>
{{Note|Currently created {{filename|sb-iam.ubuntu-9.04.USB.img}} is nearly identical to {{filename|sb-iam.ubuntu-9.04.NAND.img}}. The images differ only in device numbering in {{filename|/boot/grub/menu.lst}} and {{filename|/etc/fstab}}. Also {{filename|sb-iam.ubuntu-9.04.USB.img}} contains archived {{filename|sb-iam.ubuntu-9.04.NAND.img}} in {{filename|/home/user/Desktop/}} }}
+
* The default directory location in which to store your TFTP files is {{filename|/var/lib/tftpboot}}. You can chose an alternative location if you prefer. For now, set up the directory permissions of the TFTP server root directory:
 +
<pre>
 +
sudo mkdir /var/lib/tftpboot
 +
sudo chown nobody.nogroup /var/lib/tftpboot
 +
sudo chmod 777 /var/lib/tftpboot
 +
</pre>
 +
* Open the TFTP server configuration file with your selected editor, for example nano:
 +
<pre>
 +
sudo nano /etc/default/tftpd-hpa
 +
</pre>
 +
Configure the tftpd-hpa service to run in daemon mode. Also, if you are using a custom TFTP directory, change {{filename|/var/lib/tftpboot}} to the correct directory location.
 +
<pre>
 +
#Defaults for tftpd-hpa
 +
RUN_DAEMON="yes"
 +
OPTIONS="-l -s /var/lib/tftpboot"
 +
</pre>
 +
* Start the TFTP init script.
 +
<pre>
 +
sudo /etc/init.d/tftpd-hpa start
 +
</pre>
 +
* Place the NAND image files in the TFTP server`s storage directory.
 +
<pre>
 +
cp /path/to/iam-linux-release/image/ubuntu.img* /var/lib/tftpboot
 +
</pre>
 +
 
 +
==  EtherLink ==
 +
 
 +
EtherLink enables fast binary transfers between a host computer and a target Computer-on-Module, through an Ethernet link. Network communication is based on the TFTP protocol.  
 +
EtherLink can write or read back contents of the NAND flash to enable an o/s package’s installation/duplication, as well as write/read BIOS and Configuration Block.
 +
 
 +
Interactive activation through {{cmd|BIOS [F2] >>Advanced>> Start EtherLink menu}}.
  
* Prepare an external storage device, 4GB or more capacity will be enough.
+
The EtherLink menus are self-explanatory. The full menu tree of EtherLink is presented below. The value in parenthesis specifies the default of that parameter.
* Connect the USB flash drive to the Linux workstation.  We assume here it's recognized as {{filename|/dev/sdb}}.
 
* Extract the USB image directly to the connected USB flash drive using the following command:
 
 
<pre>
 
<pre>
# dd if=../images/sb-iam.ubuntu-9.04.USB.img of=/dev/sdb bs=2M
+
* 1. Configure
 +
* 1.1. Use DHCP to obtain ip address for the device (Yes)
 +
* 1.2. Set static ip address for the device (0.0.0.0)
 +
* 1.3. Set subnet mask for the device (0.0.0.0)
 +
* 1.4. Set ip address of the tftp server (server-ip-address)
 +
* 1.5. Set NAND image file name (NAND-image-filename)
 +
* 1.6. Set bios image file name (bios-image-filename)
 +
* 1.7. Set configblock file name (configblock-image-filename)
 +
* 1.8. Set NAND image start sector (00000000h)
 +
* 1.9. Set NAND image end sector (ffffffffh)
 +
* 1.A  Enable split (for nand size >2Gb)
 +
* 3. Download NAND image (from tftp://server-ip-address/NAND-image-filename - full image)
 +
* 4. Upload NAND image (to tftp://server-ip-address/NAND-image-filename - full image)
 +
* 5. Download bios image (from tftp://server-ip-address/bios-image-filename)
 +
* 6. Download configblock (from tftp://server-ip-address/bios-image-filename)
 +
* 7. Upload configblock (to tftp://server-ip-address/configblock-image-filename)
 +
* 8. Upload bios image (to tftp://server-ip-address/configblock-image-filename)
 +
* 9. Save configurations
 +
* 10. Quit EtherLink and reboot
 
</pre>
 
</pre>
* Insert formatted USB flash drive into an empty USB slot on the SB-iAM baseboard, ensuring that no other external storage device is connected.
+
 
* Power on the SB-iAM. In BIOS, choose your USB flash drive as the first boot device and reboot.
+
== NAND image download ==
* Welcome to Ubuntu 9.04 for SB-iAM, username: '''user''', password: '''111111'''
+
Set up initial EtherLink configuration:
{{Note|Bootable USB image {{filename|sb-iam.ubuntu-9.04.USB.img}} contains a filesystem with 1.2GB empty space. If your storage device is bigger than 4GB - you can easily reformat it with the {{cmd|fdisk}} and {{cmd|resize2fs}} utilities to get more empty space.}}
+
* Power-On the CM-iAM.
 +
* Activate EtherLink through {{cmd|BIOS [F2] >>Advanced>> Start EtherLink menu}}.
 +
* Press {{cmd|[1]}} for configuration menu.
 +
* Press {{cmd|[4]}}, set ip address of the TFTP server.
 +
* Press {{cmd|[5]}}, set NAND image file name to “ubuntu.img“.
 +
* Check that the “Enable split“ option is enabled. If not - press {{cmd|[A]}} to enable it.
 +
* Press {{cmd|[0]}} to return to main menu.
 +
Once the TFTP server and EtherLink are configured you can download the NAND image to the CM-iAM:
 +
* Press {{cmd|[3]}} to download the NAND image. Do not interrupt the host PC and CM-iAM until the process is complete.
 +
** "Processing cylinder X of Y" indicates the downloading progress.
 +
* Press {{cmd|[10]}} Quit EtherLink and reboot.
  
 
== Boot from local NAND disk  ==
 
== Boot from local NAND disk  ==
* Boot from external device as described above.
+
Welcome to Ubuntu 9.10 Desktop, username: fit, password: 111111.
* {{filename|sb-iam.ubuntu-9.04.NAND.img.bz2}} image file will appear on the desktop.
 
* Open '''Applications->Accessories->Terminal'''
 
* Get root permitions using the {{cmd|su}} command, root password is "111111".
 
* Extract the image file directly to the local NAND disk using the following command:
 
<pre>
 
root@sb-iam:/home/user# bzip2 -dc /home/user/Desktop/sb-iam.ubuntu-9.04.NAND.img.bz2 | dd of=/dev/sda bs=2M
 
</pre>
 
* Reboot, choose in BIOS, local NAND disk as first boot device, save changes.
 
* Welcome to Ubuntu 9.04 for SB-iAM, username: '''user''', password: '''111111'''
 
  
 
== See also ==
 
== See also ==
Line 69: Line 97:
 
* [[Ubuntu Linux for CM-iAM]]
 
* [[Ubuntu Linux for CM-iAM]]
  
[[Category:Linux|Getting started]]
+
[[Category:Linux]]
[[Category:CM-IAM|Linux: Getting started]]
+
[[Category:CM-IAM]]

Revision as of 13:36, 5 May 2010

Overview

Linux for the CM-iAM/SB-iAM is based on Ubuntu 9.10. The Linux package for CM-iAM includes a ready-to-run NAND flash image and kernel sources.

In its initial state, the local NAND disk is empty. Use the EtherLink utility to download the NAND flash image from the TFTP server to the CM-iAM.

The EtherLink utility is an integrated part of the BIOS on the CM-iAM. The TFTP server should be installed and configured on a host-side computer.

TFTP server

Recommended TFTP servers:

  • “tftpd32 by Ph.Jounin” TFTP server for a Windows-based host (http://tftpd32.jounin.net/).
  • A tftpd package for your distribution on a Linux-based host. For example, tftp-hpa on Ububntu.


The following describes an example configuration on a Ubuntu/Debian host machine:

  • Install required packages:
sudo apt-get install tftpd-hpa
  • The default directory location in which to store your TFTP files is /var/lib/tftpboot. You can chose an alternative location if you prefer. For now, set up the directory permissions of the TFTP server root directory:
sudo mkdir /var/lib/tftpboot
sudo chown nobody.nogroup /var/lib/tftpboot
sudo chmod 777 /var/lib/tftpboot
  • Open the TFTP server configuration file with your selected editor, for example nano:
sudo nano /etc/default/tftpd-hpa

Configure the tftpd-hpa service to run in daemon mode. Also, if you are using a custom TFTP directory, change /var/lib/tftpboot to the correct directory location.

#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"
  • Start the TFTP init script.
sudo /etc/init.d/tftpd-hpa start
  • Place the NAND image files in the TFTP server`s storage directory.
cp /path/to/iam-linux-release/image/ubuntu.img* /var/lib/tftpboot

EtherLink

EtherLink enables fast binary transfers between a host computer and a target Computer-on-Module, through an Ethernet link. Network communication is based on the TFTP protocol. EtherLink can write or read back contents of the NAND flash to enable an o/s package’s installation/duplication, as well as write/read BIOS and Configuration Block.

Interactive activation through BIOS [F2] >>Advanced>> Start EtherLink menu.

The EtherLink menus are self-explanatory. The full menu tree of EtherLink is presented below. The value in parenthesis specifies the default of that parameter.

* 1.	Configure
* 1.1.	Use DHCP to obtain ip address for the device (Yes)
* 1.2.	Set static ip address for the device (0.0.0.0)
* 1.3.	Set subnet mask for the device (0.0.0.0)
* 1.4.	Set ip address of the tftp server (server-ip-address)
* 1.5.	Set NAND image file name (NAND-image-filename)
* 1.6.	Set bios image file name (bios-image-filename)
* 1.7.	Set configblock file name (configblock-image-filename)
* 1.8.	Set NAND image start sector (00000000h)
* 1.9.	Set NAND image end sector (ffffffffh)
* 1.A   Enable split (for nand size >2Gb)
* 3.	Download NAND image (from tftp://server-ip-address/NAND-image-filename - full image)
* 4.	Upload NAND image (to tftp://server-ip-address/NAND-image-filename - full image)
* 5.	Download bios image (from tftp://server-ip-address/bios-image-filename)
* 6.	Download configblock (from tftp://server-ip-address/bios-image-filename)
* 7.	Upload configblock (to tftp://server-ip-address/configblock-image-filename)
* 8.	Upload bios image (to tftp://server-ip-address/configblock-image-filename)
* 9.	Save configurations
* 10.	Quit EtherLink and reboot

NAND image download

Set up initial EtherLink configuration:

  • Power-On the CM-iAM.
  • Activate EtherLink through BIOS [F2] >>Advanced>> Start EtherLink menu.
  • Press [1] for configuration menu.
  • Press [4], set ip address of the TFTP server.
  • Press [5], set NAND image file name to “ubuntu.img“.
  • Check that the “Enable split“ option is enabled. If not - press [A] to enable it.
  • Press [0] to return to main menu.

Once the TFTP server and EtherLink are configured you can download the NAND image to the CM-iAM:

  • Press [3] to download the NAND image. Do not interrupt the host PC and CM-iAM until the process is complete.
    • "Processing cylinder X of Y" indicates the downloading progress.
  • Press [10] Quit EtherLink and reboot.

Boot from local NAND disk

Welcome to Ubuntu 9.10 Desktop, username: fit, password: 111111.

See also