Difference between revisions of "User:SamuelM"

From ArmadeusWiki
Jump to: navigation, search
(tips: fix prompt, add my u-boot config)
m (NFS server configuration)
 
(6 intermediate revisions by the same user not shown)
Line 58: Line 58:
  
 
== Contributions ==
 
== Contributions ==
[[OpenCV|Cross-compile OpenCV for your APF]]
 
  
[[CMake]]
+
; [[CMake]]
 +
: CMake infrastructure has been integrated in Buildroot since the BR release 2011.02 (available in Armadeus SDK since the armadeus-4.1 release).
 +
 
 +
Armadeus-4.0 uses the Buildroot 2010.11 release
 +
 
 +
Armadeus-4.1 uses the Buildroot 2011.05 release
 +
 
 +
; [[OpenCV|Cross-compile OpenCV for your APF]]
 +
: Already in Buildroot since the BR release 2011.11 (requires CMake infrastructure).
 +
 
 +
; [[External_Toolchains]]
 +
: How to build an Armadeus rootfs with a Buildroot more recent than the one used by the official Armadeus SDK. '''!!! Experimental !!!'''
  
 
== Tips ==
 
== Tips ==
Line 73: Line 83:
 
## Enhanced promt
 
## Enhanced promt
 
if [ -t 0 ]; then
 
if [ -t 0 ]; then
  bldblk='\033[1;30m' # Black - Bold
+
    bldblk='\033[1;30m' # Black - Bold
  bldred='\033[1;31m' # Red
+
    bldred='\033[1;31m' # Red
  bldgrn='\033[1;32m' # Green
+
    bldgrn='\033[1;32m' # Green
  bldylw='\033[1;33m' # Yellow
+
    bldylw='\033[1;33m' # Yellow
  bldblu='\033[1;34m' # Blue
+
    bldblu='\033[1;34m' # Blue
  bldpur='\033[1;35m' # Purple
+
    bldpur='\033[1;35m' # Purple
  bldcyn='\033[1;36m' # Cyan
+
    bldcyn='\033[1;36m' # Cyan
  bldwht='\033[1;37m' # White
+
    bldwht='\033[1;37m' # White
  txtrst='\033[0m'    # Text Reset
+
    txtrst='\033[0m'    # Text Reset
  undred='\033[4;31m' # Red - Underlined
+
    undred='\033[4;31m' # Red - Underlined
  bgdred='\033[1;41m' # Red - Background
+
    bgdred='\033[1;41m' # Red - Background
  bgdblu='\033[1;44m' # Blue - Background
+
    bgdblu='\033[1;44m' # Blue - Background
 
fi;
 
fi;
if [ $(id -u) -eq 0 ]; then
 
  userbgd="${bgdred}"
 
else
 
  userbgd="${bgdblu}"
 
fi
 
  
export PS1="${userbgd}\u${bldylw}@${bldgrn}\h${txtrst} ${bldpur}[\$(eval \"res=\$?\"; [ \${res}$
+
rootbgd="${bgdred}"
 +
userbgd="${bgdblu}"
 +
 
 +
export PS1="\$([ \$(id -u) -eq 0 ] && echo -en \"${rootbgd}\" || echo -en \"${userbgd}\")\u${bldylw}@${bldgrn}\h${txtrst} \
 +
${bldpur}[\$(eval \"res=\$?\"; [ \${res} -eq 0 ] && echo -en \"${bldwht}\${res}\" || echo -en \"${bldred}err \${res}\")${bldpur}] \
 +
[${bldblu}\$([ \$(id -u) -eq 0 ] && echo -en \"\\W\" || echo -en \"\\\w\")${bldpur}] ${txtrst}\n\${SHELL:5}${bldgrn}\$${txtrst} "
 
</source>
 
</source>
  
Line 137: Line 147:
  
 
If the '''NFS server is alive''', but neither the '''linux kernel image nor the rootfs'''  
 
If the '''NFS server is alive''', but neither the '''linux kernel image nor the rootfs'''  
are '''NOT at the expected location''' (<tt>/path/to/where/you/untar/your/rootfs</tt>),
+
are '''NOT at the expected location''': ''/path/to/where/you/untar/your/rootfs'',
  
the boot will hang up, '''booting will fail''' !}}
+
the boot will hang up, so '''booting will fail''' !}}
  
 
==== NFS server configuration ====
 
==== NFS server configuration ====
  
 
Refer to the [[Network File System configuration|NFS wiki page]] to setting the NFS server up.
 
Refer to the [[Network File System configuration|NFS wiki page]] to setting the NFS server up.
 +
 +
{{Note|Check that the NFS server configuration allows NFS v2 request.
 +
 +
On Archlinux: ''/etc/conf.d/nfs-server'' (see https://wiki.archlinux.org/index.php/NFS#Configure_NFS_fixed_ports)
 +
<source lang="bash">
 +
#MOUNTD_OPTS="--no-nfs-version 2"
 +
MOUNTD_OPTS=""
 +
</source>
 +
}}
  
 
Then:
 
Then:
  
* untar the rootfs tarball in <tt>/path/to/where/you/untar/your/rootfs</tt>
+
* untar the rootfs tarball in ''/path/to/where/you/untar/your/rootfs''
* copy the linux kernel image to <tt>/path/to/where/you/untar/your/rootfs</tt>
+
* copy the linux kernel image to ''/path/to/where/you/untar/your/rootfs''
  
 
<pre class="host">
 
<pre class="host">

Latest revision as of 23:54, 7 March 2012

<< Member list

<< User list

whoami

  • Name:
Samuel MARTIN
  • Background:
Student at ESEO (French engineering school), specialised in Embedded systeme and Automation /
Master student at l'University of Plymouth (UK), in Robotics.
Embedded and System Engineer (Paris, France)

Interests

  • Robotics
  • Computer Vision
  • Image & signal processing
  • Linux

Objectives

or, what I wanna do with the APF board (APF27 + Devfull)

  • Have fun!
  • Improve my skills in:
    • Hardware development (FPGA)
    • System and embedded OS
    • Electronic development
    • Software development for embedded (tiny) target
  • Share my experiments

Contributions

CMake
CMake infrastructure has been integrated in Buildroot since the BR release 2011.02 (available in Armadeus SDK since the armadeus-4.1 release).

Armadeus-4.0 uses the Buildroot 2010.11 release

Armadeus-4.1 uses the Buildroot 2011.05 release

Cross-compile OpenCV for your APF
Already in Buildroot since the BR release 2011.11 (requires CMake infrastructure).
External_Toolchains
How to build an Armadeus rootfs with a Buildroot more recent than the one used by the official Armadeus SDK. !!! Experimental !!!

Tips

A colored (and useful) prompt

zsh and ctafconf users won't be lost ;-)

##
## ~/.profile
##
source /etc/profile

## Enhanced promt
if [ -t 0 ]; then
    bldblk='\033[1;30m' # Black - Bold
    bldred='\033[1;31m' # Red
    bldgrn='\033[1;32m' # Green
    bldylw='\033[1;33m' # Yellow
    bldblu='\033[1;34m' # Blue
    bldpur='\033[1;35m' # Purple
    bldcyn='\033[1;36m' # Cyan
    bldwht='\033[1;37m' # White
    txtrst='\033[0m'    # Text Reset
    undred='\033[4;31m' # Red - Underlined
    bgdred='\033[1;41m' # Red - Background
    bgdblu='\033[1;44m' # Blue - Background
fi;

rootbgd="${bgdred}"
userbgd="${bgdblu}"

export PS1="\$([ \$(id -u) -eq 0 ] && echo -en \"${rootbgd}\" || echo -en \"${userbgd}\")\u${bldylw}@${bldgrn}\h${txtrst} \
${bldpur}[\$(eval \"res=\$?\"; [ \${res} -eq 0 ] && echo -en \"${bldwht}\${res}\" || echo -en \"${bldred}err \${res}\")${bldpur}] \
[${bldblu}\$([ \$(id -u) -eq 0 ] && echo -en \"\\W\" || echo -en \"\\\w\")${bldpur}] ${txtrst}\n\${SHELL:5}${bldgrn}\$${txtrst} "

u-boot configuration

  1. nfs-boot (kernel and rootfs), if the nfs server is alive
  2. boot from the NAND flash, otherwise

u-boot environment

BIOS> setenv nfsboot 'setenv bootargs ${console} ${mtdparts}; \
 run addnfsargs addipargs; \
 setenv autostart yes; \
 nfs ${loadaddr} {serverip}:${rootpath}/${board_name}-linux.bin; \
 bootm'
BIOS> setenv addnfsargs 'setenv bootargs ${bootargs} root=/dev/nfs rw nfsroot=${serverip}:${rootpath}'
BIOS> setenv addipargs 'setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off'
BIOS> setenv bootcmd 'if ping ${serverip}; then \
  echo; \
  echo Boot over NFS; \
  echo; \
  run nfsboot; \
 else \
  echo; \
  echo Boot from the board;  \
  run jffsboot; \
 fi'
BIOS> setenv board_name apf27
BIOS> setenv netmask 255.255.255.0
BIOS> setenv serverip 192.168.10.2
BIOS> setenv gatewayip 192.168.10.1
BIOS> setenv ipaddr 192.168.10.10
BIOS> setenv rootpath /path/to/where/you/untar/your/rootfs
BIOS> saveenv
BIOS> boot

Adjust the bootdelay if needed.

Next boot will automatically try to boot over NFS, then fallback on the NAND flash

Warning Warning:

If the NFS server is alive, but neither the linux kernel image nor the rootfs are NOT at the expected location: /path/to/where/you/untar/your/rootfs,

the boot will hang up, so booting will fail !


NFS server configuration

Refer to the NFS wiki page to setting the NFS server up.

Note Note: Check that the NFS server configuration allows NFS v2 request.

On Archlinux: /etc/conf.d/nfs-server (see https://wiki.archlinux.org/index.php/NFS#Configure_NFS_fixed_ports)

#MOUNTD_OPTS="--no-nfs-version 2"
MOUNTD_OPTS=""


Then:

  • untar the rootfs tarball in /path/to/where/you/untar/your/rootfs
  • copy the linux kernel image to /path/to/where/you/untar/your/rootfs
sudo tar xvf apf27-rootfs.tar -C /path/to/where/you/untar/your/rootfs
sudo -fv cp apf27-linux.bin /path/to/where/you/untar/your/rootfs