Installation of new kernels on Foxboard (Axis SDK)

jean Huens, jean@huens.be, july 21 2006

To complie the kernel:
jean@flater: /home/jean/axis/devboard-R2_01^Gjean@flater:~/axis/devboard-R2_01$ export PATH=/usr/local/cris/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games
jean@flater: /home/jean/axis/devboard-R2_01^Gjean@flater:~/axis/devboard-R2_01$ make
make init_env
make[1]: Entering directory `/home/jean/axis/devboard-R2_01'
make[1]: `init_env' is up to date.
make[1]: Leaving directory `/home/jean/axis/devboard-R2_01'
make tools
make[1]: Entering directory `/home/jean/axis/devboard-R2_01'
make -C tools/build install
make[2]: Entering directory `/home/jean/axis/devboard-R2_01/tools/build-R2_12_4'
make -C ccdv install BINDIR="/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin" LIBDIR="/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/lib"
make[3]: Entering directory `/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/ccdv'
install_elinux -p -d /home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin
install_elinux -p -m 0755 ccdv @ccdv /home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin
make[3]: Leaving directory `/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/ccdv'
make -C scripts install BINDIR="/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin" LIBDIR="/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/lib"
make[3]: Entering directory `/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/scripts'
install_elinux -p -d /home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin
install_elinux -p -m 0755 arpping axls.pl axrequires boot_argus boot_elinux boot_linux boot_etraxfs buildsrc compiler-version convertcomments.pl cris-sym-tab cvs_diff cvs_log cvs2cl.pl diff_prodspec find-needed-shlibs.pl fix_cvsroot gcc_cris gen_log genindex init_env_elinux.pl install_elinux ksymoops-cris meta_name2nbr mke2fs_elinux mkfdscript mknod_elinux mkprod mkptable mkswinfo multiflash optlibs padflashimage prodspec.pm prodspec2configure remotecmd sort-cl-args strrpl.pl /home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin
ln -sfn gcc_cris /home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin/arm_linux_gcc
make[3]: Leaving directory `/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/scripts'
make -C aconfig install BINDIR="/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin" LIBDIR="/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/lib"
make[3]: Entering directory `/home/jean/axis/devboard-R2_01/tools/build-R2_12_4/aconfig'
install_elinux -p -d /home/jean/axis/devboard-R2_01/tools/build-R2_12_4/bin
...
install_elinux -p -d /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/usr/html/incl
echo "FOX board by Acme Systems srl (brown_1_0) release 2.01" > /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/usr/html/incl/version.shtml
echo "JFFSID=\"2.01\"" > /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/etc/release
install_elinux -p -d /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/usr/etc/defaultfiles
echo "JIMAGEID=\"2.01\"" \
> /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/usr/etc/defaultfiles/jimageid
install_elinux -p -m 0644 \
"fstab" "/home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/etc/"
install_elinux -p -d /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/usr/share/axis-release
ln -sfn dash /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/bin/sh
Making tar file of /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/var/
var/
var/lib/
var/log/
var/run/
var/run/utmp
var/state/
var/tmp/
var/empty/
make[1]: Leaving directory `/home/jean/axis/devboard-R2_01'
make images
make[1]: Entering directory `/home/jean/axis/devboard-R2_01'
Creating new ptablespec... done
Making jffs2 of /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/mnt/flash
install_elinux -p -p -m 0644 flash2.img /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/usr/etc/defaultfiles/jimage
Including needed shared library files
Converting names to numbers in meta files
Making cramfs of /home/jean/axis/devboard-R2_01/target/cris-axis-linux-gnu/
Using a blocksize of 8192 bytes.
Using meta file(s) named "romfs_meta.txt".
Directory data: 8944 bytes
Everything: 2232 kilobytes
Edition timestamp: 1145734174 = Sat Apr 22 21:29:34 2006

Super block: 76 bytes
CRC: be60a39f
warning: gids truncated to 8 bits (this may be a security concern)
cat vmlinux.bin rootfs.img > kimage
cat /home/jean/axis/devboard-R2_01/os/linux/arch/cris/boot/rescue/rescue.bin \
> rescue.img
padflashimage 0x010000 rescue.img
**** Adding 64828 $ff-bytes as alignment to get 65536 (0x010000)
echo -n > flash1.img
mkptable -a crisv10 -d -f ptable_dummy.img ptablespec
cat ptable_dummy.img vmlinuz rootfs.img > flash1.img
padflashimage 0x350000 flash1.img
**** Adding 490192 $ff-bytes as alignment to get 3473408 (0x350000)
mkptable -a crisv10 -v -f ptable.img ptablespec

Creating partition table ...

Ignoring rescue

Check flash1 0x350000 ro kernel flash1.img
partition starts at 0
partition size is 3473408
partition checksum is 515389320

Check flash2 0x0a0000 rw jffs2 flash2.img
partition starts at 3473408
partition size is 655360
partition checksum is 161176048

partition table csum size is 68, sum is 2037
Updated branch-skip offset to 88
rm ptable_dummy.img
cat ptable.img vmlinuz rootfs.img > flash1.img
padflashimage 0x350000 flash1.img
**** Adding 490192 $ff-bytes as alignment to get 3473408 (0x350000)
Creating fimage
cat rescue.img flash1.img flash2.img > fimage
Adding hardware ID "1.00" to fimage
Adding checksum "693147112" to fimage
make[1]: Leaving directory `/home/jean/axis/devboard-R2_01'
jean@flater: ~/axis/devboard-R2_01$

Kernel Installation (= a new fimage)


Start reading the documentation on How to write a newz fimage  .

As a first test we did install a precompiled image from the archive.
In fact this means a upgrade to kernel 2.6.12 :
jean@flater:~/src/axis$ ls -l
^[[00mtotal 166816
-rw-r--r-- 1 jean jean 49056938 Apr 2 10:06 cris-dist_1.63-1_i386.deb
-rw-r--r-- 1 jean jean 111707916 Apr 2 10:11 devboard-R2_01-distfiles.tar.gz
-rw-r--r-- 1 jean jean 53070 Apr 2 10:06 devboard-R2_01.tar.gz
-rw-r--r-- 1 jean jean 4194328 Oct 26 2005 fimage^[[00m
-rw-r--r-- 1 jean jean 2998881 Jul 21 19:58 fimage_701_v100.tgz
-rw-r--r-- 1 jean jean 2358363 Jul 21 19:54 fimage_712_v100.tgz
-rw-r--r-- 1 jean jean 2344 Apr 2 11:47 hello.out
-rw-r--r-- 1 jean jean 243056 Apr 2 10:04 pmake_1.98-3_i386.deb
-rw-r--r-- 1 jean jean 0 Jul 21 20:01 script.ftp
^[[m^[]0;jean@flater: /home/jean/src/axis^Gjean@flater:~/src/axis$ tar zxf fimage_712_v100.tgz
^[]0;jean@flater: /home/jean/src/axis^Gjean@flater:~/src/axis$ ls -l
^[[00mtotal 166816
-rw-r--r-- 1 jean jean 49056938 Apr 2 10:06 cris-dist_1.63-1_i386.deb
-rw-r--r-- 1 jean jean 111707916 Apr 2 10:11 devboard-R2_01-distfiles.tar.gz
-rw-r--r-- 1 jean jean 53070 Apr 2 10:06 devboard-R2_01.tar.gz
-rw-r--r-- 1 jean jean 4194328 Oct 26 2005 fimage
-rw-r--r-- 1 jean jean 2998881 Jul 21 19:58 fimage_701_v100.tgz
-rw-r--r-- 1 jean jean 2358363 Jul 21 19:54 fimage_712_v100.tgz
-rw-r--r-- 1 jean jean 2344 Apr 2 11:47 hello.out
-rw-r--r-- 1 jean jean 243056 Apr 2 10:04 pmake_1.98-3_i386.deb
-rw-r--r-- 1 jean jean 0 Jul 21 20:01 script.ftp
^[[m^[]0;jean@flater: /home/jean/src/axis^Gjean@flater:~/src/axis$ ftp 192.168.113.90
Connected to 192.168.113.90.
220 FOX board by Acme Systems srl (brown_1_0) release 2.01 (Mar 06 2006) rea
Name (192.168.113.90:jean): root
331 User name okay, need password.
Password:
230 User logged in, proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put fimage flash_all
local: fimage remote: flash_all
200 Command okay.
150-Shutting down processes.
Preparing system for upgrade ...
Starting run level 4 (stop most daemons) ...
Waiting for run level 4 to start ...
Run level 4 started.
Waiting for run level 4 to finish ...
... waiting ...
Run level 4 finished.
Stopping some remaining processes.
sending TERM signal ...
Most processes stopped.
The file system will be factory default before reboot.
Unmounting file system /var ...
Unmounting file system /mnt/flash ...
File systems successfully shut down.
150 Opening data connection.
214-Virtual target execution.
Receiving new firmware ...
No HWID in bootblock, continuing anyway.
Erasing old file system ...
1%
3%
5%
7%
9%
...
...
94%
96%
98%
100%

Loading new file system ...
1%
2%
3%
4%
5%
...
...
93%
94%
95%
96%
97%
99% 100%

Erasing old file system ...
10%
...
80%
90%
100%

Loading new file system ...
6%
12%
18%
25%
...
68%
75%
81%
87%
93%
100%

The system upgrade completed successfully.
The unit will now reboot.
To continue, please connect to the unit again.
There may be a short delay before the new connection is accepted.
This connection will now close.
214 Virtual target exit.
4194328 bytes sent in 2.12 secs (1928.9 kB/s)
ftp> quit
221 Goodbye.
jean@flater:~/src/axis$ exit

Since we did replace the complete flash preious changes e.g. are probably changed to the default.
Therefore you may need to gie your computer an IP on the 192.168.0.0 subnet.
/sbin/ifconfig eth0:1 inet 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0

You can now (hopefully?) login to the board (beware the root password is acme ...) and check the kernel version:
flater:/home/jean/src/axis# telnet 192.168.0.90
Trying 192.168.0.90...
Connected to 192.168.0.90.
Escape character is '^]'.
axis-00408c011853 login: root
Password:
[root@axis-00408c011853 /root]102#
[root@axis-00408c011853 /root]102# uname -a
Linux axis-00408c011853 2.6.12 #4 Wed Oct 26 18:19:56 CEST 2005 cris unknown
[root@axis-00408c011853 /root]102# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/flash3 5304 5304 0 100% /
/dev/flash2 1664 232 1432 14% /mnt/flash
tmpfs 6992 88 6904 1% /var
[root@axis-00408c011853 /root]102#


Now a real self made kernel. What happens if the flash is not usable ?

Probably use jumper J8 ?