©2011 High Energy Accelerator Research Organization (KEK), All Rights Reserved.
This page summarizes how to make a CF for typical use of F3RP61 at KEK. The emphasis is
on the pitfalls and would-be-overlooked points in reading and understanding the manuals
of the BSP. For more detailed and comprehensive information, consult relevant manuals of
the BSP carefully.
- Check if the prerequisites listed below are satisfied.
- You have already gotten the latest version of the BSP of F3RP61
(SFRD11JCW_R210.tar.gz) and un-tared it somewhere on a host
machine.
- It doesn't matter whether you have installed the BSP by running the installer (script)
included in the BSP.
- You have a CF card reader and writer compatible with the host machine.
- You have a CF card compatible with the F3RP61 CPU.
- Manufacturer of the CF might matter.
- KEKB Control Group has adopted SanDisk Ultra series as a battle-proven.
- 2GB is enough for all of the possible options of installation.
- Format the CF on the host machine.
- Find the device name of the CF to be formatted.
- fdisk /dev/sdb (if the device name is sdb)
- "m" for help.
- "d" for deleting a partition.
- "n" for creating a new partition.
- Choose primary partition. (Answer the prompt with "p")
- Choose the partition number. (Answer the prompt with "1")
- "w" for writing.
- "If you forget this, you'll lose your precious time.
- Make a new file system in the partition.
- Need to unmount /dev/sdb1 in advance if it has been automatically mounted.
- ext3 is recommeded, though it is not mentioned in the manual of the BSP.
- # mke2fs -j -I 128 /dev/sdb1 (if the device name is sdb)
- "-j" option stands for "journaling", the author guesses.
- Mount the filesystem.
- # mount -t ext3 /dev/sdb1 /mnt/cf
- If you type "ls /mnt/cf", you'll see "lost+found".
- Move to /mnt/cf.
- # cd /mnt/cf (Hereafter, we assume that /mnt/cf is the current dirctory unless otherwise explicitly expressed.)
- Choose appropreate kernel for CF boot and copy it to /mnt/cf.
- # cp (BSP)/kernel/prebuit/uImage_CF uImage
- Here, "(BSP)" stands for the directory under where you have un-tared the BSP (SFRD11JCW_R210.tar.gz).
- You might want to choose uImageRT_CF as uImage if you need better real-time responsiveness.
- Copy Device Tree Binary
- # cp (BSP)/yokogawa/misc/f3rp6x.dtb .
- Choose appropreate rootfs for CF boot and un-tar it under /mnt/cf.
- We choose "std" (standard) , as an example, from among other options.
- # tar zxvf (BSP)/userland/std/cf-rootfs-std-1.tar.gz
- Move to /mnt/cf/usr/lib and copy a library from
/mnt/cf/opt to the directory.
- # cd /mnt/cf/usr/lib
- # cp /mnt/cf/opt/libm3.so.1.0.0 .
- "If you forget this, you'll lose your precious time.
- Copy NTP-related binaries if necessary.
- Un-tar (BSP)/userland/dev/cf-rootfs-dev-1.tar.gz somewhere.
- Move to (somewhere)/usr/sbin.
- Type "ls ntp*" to check relevant files.
- Copy them to /mnt/cf/usr/sbin.
- Edit /mnt/cf/etc/sysconfig/network-scripts/ifcfg-eth0 to set IP and Netmask
- Edit /mnt/cf/etc/fstab if you load iocCore and relevant libraries on NFS.
- Edit /mnt/cf/etc/hosts and /mnt/cf/etc/sysconfig/network to set hostname.
- Edit /mnt/cf/etc/ntp.conf to specify the NTP server.
- You might also want to edit /mnt/cf/etc/rc.local to add the following lines:
- /sbin/insmod /opt/m3iodrv.ko (or m3iodrvRT.ko if you chose uImageRT_CF.)
- /etc/init.d/ntpd start
and other stuff, such as lines to exectute startup script (st.cmd), to extend
PATH to reach libraries and executable binaries for executing ioc,
and so forth. It might be convenient to create .bash_profile under /root to
export TERM=vt100 so that the text editor, vi, works fine.
- Unmount the CF.
- Boot up your F3RP61-based IOC with the newly created CF and login to it. And then,
visit /usr/lib to execute ldconfig there.
- -bash-3.2# cd /usr/lib
- -bash-3.2# ldconfig
- "If you forget this, you'll lose your precious time.