Difference between revisions of "User:SamuelM"
From ArmadeusWiki
m |
m (→NFS server configuration) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 37: | Line 37: | ||
* Background: | * Background: | ||
− | :: Student at [http://www.eseo.fr/ ESEO] (French engineering school), specialised in Embedded systeme and Automation / | + | :: <s>Student at [http://www.eseo.fr/ ESEO] (French engineering school), specialised in Embedded systeme and Automation /</s> |
:: <s>Master student at l'[http://www.plymouth.ac.uk/ University of Plymouth] (UK), in [http://www.plymouth.ac.uk/courses/postgraduate/taught/2558/MSc+Robotics Robotics].</s> | :: <s>Master student at l'[http://www.plymouth.ac.uk/ University of Plymouth] (UK), in [http://www.plymouth.ac.uk/courses/postgraduate/taught/2558/MSc+Robotics Robotics].</s> | ||
− | :: | + | :: Embedded and System Engineer (Paris, France) |
== Interests == | == Interests == | ||
Line 58: | Line 58: | ||
== Contributions == | == Contributions == | ||
− | |||
− | [[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 == | ||
=== A colored (and useful) prompt === | === A colored (and useful) prompt === | ||
+ | ''zsh and [http://www.ctaf.free.fr/dokuwiki/doku.php?id=ctafconf ctafconf] users won't be lost'' ;-) | ||
<source lang="bash"> | <source lang="bash"> | ||
## | ## | ||
− | ## .profile | + | ## ~/.profile |
## | ## | ||
source /etc/profile | source /etc/profile | ||
− | bldblk='\033[1;30m' # Black - Bold | + | ## Enhanced promt |
− | bldred='\033[1;31m' # Red | + | if [ -t 0 ]; then |
− | bldgrn='\033[1;32m' # Green | + | bldblk='\033[1;30m' # Black - Bold |
− | bldylw='\033[1;33m' # Yellow | + | bldred='\033[1;31m' # Red |
− | bldblu='\033[1;34m' # Blue | + | bldgrn='\033[1;32m' # Green |
− | bldpur='\033[1;35m' # Purple | + | bldylw='\033[1;33m' # Yellow |
− | bldcyn='\033[1;36m' # Cyan | + | bldblu='\033[1;34m' # Blue |
− | bldwht='\033[1;37m' # White | + | bldpur='\033[1;35m' # Purple |
− | txtrst='\033[0m' # Text Reset | + | 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; | ||
− | export PS1="${ | + | 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> | ||
+ | |||
+ | === u-boot configuration === | ||
+ | |||
+ | # ''nfs-boot'' (kernel and rootfs), if the nfs server is alive | ||
+ | # ''boot from the NAND flash'', otherwise | ||
+ | |||
+ | ==== u-boot environment ==== | ||
+ | |||
+ | <pre class="apf"> | ||
+ | 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 | ||
+ | </pre> | ||
+ | |||
+ | Adjust the <tt>bootdelay</tt> if needed. | ||
+ | |||
+ | Next boot will automatically try to boot over NFS, then fallback on the NAND flash | ||
+ | |||
+ | {{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 [[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: | ||
+ | |||
+ | * 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'' | ||
+ | |||
+ | <pre class="host"> | ||
+ | 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 | ||
+ | </pre> |
Latest revision as of 22:54, 7 March 2012
Contents
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
- nfs-boot (kernel and rootfs), if the nfs server is alive
- 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
NFS server configuration
Refer to the 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) #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