http://www.armadeus.org/wiki/api.php?action=feedcontributions&user=DenisB&feedformat=atom ArmadeusWiki - User contributions [en] 2024-03-28T08:20:15Z User contributions MediaWiki 1.26.3 http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=11236 User:DenisB 2012-09-02T14:19:09Z <p>DenisB: /* Misc 1 : Qemu launching */ script works undder FC17 and armadeus5.0, too</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them might lead to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors and typos..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> (it is also used with Armadeus-5.0, under Fedora 17)<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers in-line help and syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source for one's PC, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on one's PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# these 3 lines depend on your installation and should obviously be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests (mainly of strip)<br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> # puts joe into armadeus files and prepares installation<br /> #<br /> cp joe ../tftboot/. # it is ready to be shipped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting (it was meant for!) . The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achieved by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocaletc/joe /usr/local/etc/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say: - a simple tar exists with Busy Box or a full version can be installed- but this way can give opportunities of easily removing some syntax files, if they are felt unuseful), syntax highlight works...<br /> <br /> One can seen a screenshot here (joe is launched from a qemu-lated armadeus, the host system being a Fedora Core 16, with KDE as desktop manager):<br /> [[image:snapshot_qemu_joe1.png|center|frame|thumb|'''figure 1''' - ''a session with Joe's editor'']]</div> DenisB http://www.armadeus.org/wiki/index.php?title=Template:Derni%C3%A8resNouvelles&diff=10592 Template:DernièresNouvelles 2012-02-01T13:57:55Z <p>DenisB: /* 27 Janvier 2012: La release Armadeus 4.1 est sortie */ fixed the link</p> <hr /> <div>__NOTOC__<br /> <br /> =====27 Janvier 2012: La release Armadeus 4.1 est sortie=====<br /> &lt;noinclude&gt;<br /> Cette nouvelle release ajoute le pré-support (vraiment expérimental) de l'[[APF28]], BR 2011.05, une meilleure intégration de BR, Linux 3.0 pour APF51 et de nouveaux packages orientés automatisation industrielle. Plus les corrections de bugs et les améliorations d'utilisation habituelles bien sûr.<br /> L'annonce sur LinuxFr:http://linuxfr.org/news/sortie-de-la-version-4-1-du-projet-armadeus&lt;/noinclude&gt;<br /> <br /> =====Certains membres d'Armadeus Project tiendront un stand (71) aux RMLL 2011 à Strasbourg (du 11 au 14 Juillet)=====<br /> <br /> =====9 Juillet 2011: La release Armadeus 4.0 est sortie=====<br /> &lt;noinclude&gt;<br /> Cette nouvelle release ajoute le support pour l'[[APF51]] , BR 2010.11 et continue le travail d'intégration (expérimental) de Linux 2.6.38 pour APF27/PPS et APF9328.<br /> L'annonce sur LinuxFr: http://linuxfr.org/news/sortie-de-la-version-40-du-projet-armadeus&lt;/noinclude&gt;<br /> <br /> =====1er Mai 2011: Le module [[APF51]] et sa carte d'accueil [[APF51Dev]] sont disponibles=====<br /> &lt;noinclude&gt;<br /> Ces nouvelles cartes surpuissantes ( ;-) ) sont disponible dans la boutique en ligne d'Armadeus Systems.&lt;/noinclude&gt;<br /> <br /> =====3 Mars 2011: [[Release_3.4|La release Armadeus 3.4]] est sortie=====<br /> &lt;noinclude&gt;<br /> Cette nouvelle release ajoute le support pour la carte d'accueil [[APF27_PPS]] et continue le travail d'intégration (expérimental) de Linux 2.6.38 et Buildroot 2010.xx.<br /> L'annonce sur LinuxFr: http://linuxfr.org/news/sortie-de-la-version 34-du- projet-armadeus &lt;/noinclude&gt;<br /> <br /> =====30 Juillet 2010: [[Release_3.3|La release Armadeus 3.3]] est sortie=====<br /> &lt;noinclude&gt;<br /> Cette nouvelle release améliore le support pour l'[[Wireless_extension_board|APW]], WiFi, Bluetooth, GPS, ajoute Qt 4.5.3, BR 2010.05 &amp; U-Boot 2010.03 (expérimental), etc... <br /> L'annonce sur LinuxFr: [http://linuxfr.org/2010/08/24/27281.html]&lt;/noinclude&gt;<br /> <br /> =====15 Janvier 2010: La carte APW est disponible=====<br /> &lt;noinclude&gt;<br /> La nouvelle carte [[Wireless_extension_board|APW]] (extension &quot;Wireless&quot; pour l'APF27) est disponible dans la boutique en ligne d'Armadeus Systems.&lt;/noinclude&gt;<br /> <br /> &lt;noinclude&gt;<br /> =====1er Décembre 2009: [[Release_3.2|La release Armadeus 3.2]] est sortie=====<br /> La nouvelle release Armadeus 3.2 améliore le support [[APF27]], ajoute un écran 7 pouces, de nouveaux packages (pygame, xenomai, etc...), migration svn vers git, etc... <br /> L'annonce sur LinuxFr: [http://linuxfr.org/2009/12/02/26228.html]&lt;/noinclude&gt;<br /> <br /> &lt;noinclude&gt;<br /> =====29 Juin 2009: La release Armadeus 3.1 est sortie, suivant la disponibilité des [[APF27Dev|APF27DevFull]]=====<br /> La nouvelle release Armadeus 3.1 supporte désormais Linux 2.6.29, GDB 6.7.1, la sortie HDMI de l'APF27DevFull, le FPGA de l'APF27 et une foultitude de nouveautés.&lt;br&gt;<br /> Elle peut être téléchargée sous forme d'archive à [http://sourceforge.net/project/showfiles.php?group_id=122057 l'endroit habituel.]&lt;/noinclude&gt;<br /> <br /> &lt;noinclude&gt;<br /> =====26 Février 2009: La release [[Armadeus 3]] est sortie, juste après les [[APF27]]=====<br /> La nouvelle release Armadeus 3.0 supporte la nouvelle carte d'Armadeus Systems ([[APF27]]), Linux 2.6.27, GCC 4.2.1, U-Boot 1.3.4 et une foultitude de nouveautés.&lt;br&gt;<br /> Elle peut être téléchargée sous forme d'archive à l'endroit habituel: http://sourceforge.net/projects/armadeus&lt;/noinclude&gt;<br /> <br /> &lt;noinclude&gt;<br /> =====20 Mai 2008: Les cartes DevFull sont arrivées=====<br /> Les cartes de développement [[APF9328DevFull|DevFull]] sont désormais produites et seront bientôt en vente à tarif préférentiel (pour les membres d'Armadeus Project) dans le [http://www.store.armadeus.com/index.php?language=fr magasin en ligne d'armadeus systems]&lt;/noinclude&gt;<br /> <br /> &lt;noinclude&gt;<br /> =====15 Sept. 2007: Des cartes APF9328 ont été reçues &amp; les premiers prototypes de DevFull sont en test=====<br /> Toutes les cartes sont désormais disponibles. Le DevFull fonctionne bien et sera vraisemblablement disponible vers la fin de l'année.&lt;/noinclude&gt;<br /> <br /> &lt;noinclude&gt;<br /> =====10 Juin 2007: Des DevLight et des LCD_Adapt ont été reçues, mais nous attendons toujours les APF9328 :-( !=====<br /> Des DevLight et des LCD_Adapt ont été reçues, mais nous attendons toujours les APF9328. Date de livraison: fin Juin ??&lt;/noinclude&gt;<br /> <br /> &lt;noinclude&gt;<br /> =====26 Mar. 2007: des DevLight et des LCD_Adapt ont été commandées !=====<br /> De nouvelles DevLight ont été commandées ! Date de livraison: semaine 17/18 (mi-Avril)<br /> <br /> Les LCD_Adapter ont été commandées aussi. Date de livraison: semaine 18/19<br /> <br /> =====22 Mars 2007: Rupture de stock sur les DevLight=====<br /> Devant l'arrivée massive de nouveaux membres, nous sommes en rupture de stock de DevLight. De nouvelles cartes ont été commandées mais elles ne seront disponibles que mi-Avril.<br /> &lt;noinclude&gt;<br /> =====01 Mars 2007: Article dans GLMF=====<br /> Le magazine français GNU/Linux Magazine France (Linux Mag) a publié ce mois-ci notre article de présentation de l'association&lt;/noinclude&gt;<br /> &lt;noinclude&gt;<br /> =====09 Fev. 2007: ça y est la V2.0 est sortie !=====<br /> La version 2.0 est (enfin ;-) ) disponible. Pour la charger, RDV sur Sourceforge... Maintenant les choses sérieuses vont pouvoir commencer !&lt;/noinclude&gt;<br /> &lt;noinclude&gt;<br /> =====05 Nov. 2006: Les APF DevLight sont prêtes !=====<br /> <br /> Nous pouvons désormais accueillir 50 nouveaux membres ! &lt;/noinclude&gt;<br /> &lt;noinclude&gt;<br /> =====15 Oct. 2006: Les cartes APF DevLight seront bientôt là=====<br /> Les cartes DevLight (de développement) sont en cours de production et seront disponibles fin Octobre. &lt;/noinclude&gt;<br /> &lt;noinclude&gt;<br /> =====12 Sept. 2006: Les cartes APF DevLight sont commandées=====<br /> Nico a commandé 50 cartes APF DevLight aujourd'hui. Elles devraient arriver mi-Octobre. Elles permettront à un plus grand nombre de personnes de rejoindre le projet bientôt ! :-). &lt;/noinclude&gt;<br /> &lt;noinclude&gt;<br /> =====10 Sept. 2006: Le Wiki et le site Web sont presques prêts=====<br /> 250 ans (et quelques mois) après la naissance de notre idole Wolfgang, un nouveau génie est apparu sur Terre: le projet Armadeus... ;-) &lt;/noinclude&gt;<br /> <br /> <br /> [[Template:DernièresNouvelles|Voir toutes les nouvelles]]</div> DenisB http://www.armadeus.org/wiki/index.php?title=Talk:Configure_or_flash_FPGA%C2%A0%3F&diff=10480 Talk:Configure or flash FPGA ? 2012-01-19T10:28:24Z <p>DenisB: likely typo... this page should be deleted, once the main is corrected</p> <hr /> <div>there is a small issue, onfiguring and flashin seem to to the same thing, and they are different:<br /> <br /> Configure FPGA : At power on, the FPGA is not configured. FPGA configuration <br /> ***is the action of transfering the bitstream from the processor RAM to the FPGA***.<br /> Flash FPGA : It is possible to save the FPGA configuration under the Flash memory of the APF. Flashing FPGA <br /> ***is the action of transfering the bitstream from the processor RAM to the FPGA. ***<br /> <br /> somewhere &quot;to&quot; should be substituted into &quot;from&quot; and &quot;from&quot; into &quot;to&quot;?</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10479 User:DenisB 2012-01-19T10:18:53Z <p>DenisB: /* Misc 2 */ typos</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them might lead to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors and typos..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers in-line help and syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source for one's PC, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on one's PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# these 3 lines depend on your installation and should obviously be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests (mainly of strip)<br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> # puts joe into armadeus files and prepares installation<br /> #<br /> cp joe ../tftboot/. # it is ready to be shipped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting (it was meant for!) . The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achieved by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocaletc/joe /usr/local/etc/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say: - a simple tar exists with Busy Box or a full version can be installed- but this way can give opportunities of easily removing some syntax files, if they are felt unuseful), syntax highlight works...<br /> <br /> One can seen a screenshot here (joe is launched from a qemu-lated armadeus, the host system being a Fedora Core 16, with KDE as desktop manager):<br /> [[image:snapshot_qemu_joe1.png|center|frame|thumb|'''figure 1''' - ''a session with Joe's editor'']]</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10371 User:DenisB 2012-01-10T16:10:53Z <p>DenisB: /* Misc 2 */</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them might lead to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors and typos..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers in-line help and syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source for one's PC, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on one's PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# these 3 lines depend on your installation and should obviously be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests (mainly of strip)<br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> # puts joe into armadeus files ans prepears installation<br /> #<br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting (it was meant for!) . The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achieved by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocaletc/joe /usr/local/etc/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say: - a simple tar exists with Busy Box or a full version can be installed- but this way can give opportunities of easily removing some syntax files, if they are felt unuseful), syntax highlight works...<br /> <br /> One can seen a screenshot here (joe is launched from a qemu-lated armadeus, the host system being a Fedora Core 16, with KDE as desktop manager):<br /> [[image:snapshot_qemu_joe1.png|center|frame|thumb|'''figure 1''' - ''a session with Joe's editor'']]</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10370 User:DenisB 2012-01-10T16:05:02Z <p>DenisB: /* Misc 1 : Qemu launching */</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them might lead to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors and typos..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on ones PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting. The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achievd by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocaletc/joe /usr/local/etc/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say: - a simple tar exists with Busy Box or a full version can be installed- but this way can give opportunities of easily removing some syntax files, if they are felt unuseful), syntax highlight works...<br /> <br /> One can seen a screenshot here (joe is launched from a qemu-lated armadeus, the host system being a Fedora Core 16, with KDE as desktop manager):<br /> [[image:snapshot_qemu_joe1.png|center|frame|thumb|'''figure 1''' - ''a session with Joe's editor'']]</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10369 User:DenisB 2012-01-09T15:57:00Z <p>DenisB: /* Misc 2 */ Added a picture of joe'editor at work</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on ones PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting. The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achievd by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocaletc/joe /usr/local/etc/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say: - a simple tar exists with Busy Box or a full version can be installed- but this way can give opportunities of easily removing some syntax files, if they are felt unuseful), syntax highlight works...<br /> <br /> One can seen a screenshot here (joe is launched from a qemu-lated armadeus, the host system being a Fedora Core 16, with KDE as desktop manager):<br /> [[image:snapshot_qemu_joe1.png|center|frame|thumb|'''figure 1''' - ''a session with Joe's editor'']]</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10368 User:DenisB 2012-01-09T15:55:00Z <p>DenisB: /* Misc 2 */</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on ones PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting. The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achievd by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocaletc/joe /usr/local/etc/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say: - tar exists with Busy Box_ but this way can give opportunities of easily removing some syntax files, if they are felt unuseful), syntax highlight works...<br /> One can seen a screenshot here (joe is launched from a qemu-lated armadeus, the host system being a Fedora Core 16, with KDE as desktop manager):<br /> [[image:snapshot_qemu_joe1.png|center|frame|thumb|'''figure 1''' - ''a session with Joe's editor'']]</div> DenisB http://www.armadeus.org/wiki/index.php?title=File:Snapshot_qemu_joe1.png&diff=10367 File:Snapshot qemu joe1.png 2012-01-09T15:50:58Z <p>DenisB: A session example with qemu and joe's syntax highlight.</p> <hr /> <div>A session example with qemu and joe's syntax highlight.</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10296 User:DenisB 2011-12-02T14:47:17Z <p>DenisB: /* Misc 2 */</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on ones PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting. The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achievd by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocaletc/joe /usr/local/etc/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say: as tar exists with Busy Box, but this way can give opportunities of easily removing some syntax files, if they are felt unuseful), syntax highlight works...</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10295 User:DenisB 2011-12-02T10:30:34Z <p>DenisB: /* Misc 2 */</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on ones PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting. The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achievd by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say: as tar exists wth the busy box, but this way can give opportunities of removing language syntax files, if they are unuseful), syntax highlight works...</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10294 User:DenisB 2011-12-02T10:29:52Z <p>DenisB: /* Misc 2 */</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on ones PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting. The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place. This can be achievd by executing, under an emulated board, a script like that:<br /> <br /> &lt;source lang=bash&gt;<br /> [ -d /usr/local/share ] || mkdir /usr/local/share<br /> [ -d /usr/local/etc ] || mkdir /usr/local/etc<br /> mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> \mv /usr/local/bin/usrlocalshare/joe /usr/local/share/. <br /> &lt;/source&gt;<br /> <br /> After this installation (there are better ones, based on tar files, say as tar exists wth the busy box, but this way can give opportunities of removing language syntax files, if they are unuseful), syntx highlight works...</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10292 User:DenisB 2011-12-01T16:05:54Z <p>DenisB: /* Misc 2 */</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script one should execute on ones PC:<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card tomake things simple....<br /> <br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> <br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory<br /> &lt;/source&gt;<br /> <br /> In this configuration, joe can be activated from an emulated card, its help appears but there is no syntax highligting. The ressource files/folders necessary to syntax highlight , however, have been shipped (they are ASCII files, valid on a x86 and an arm) but need to be on the right place.</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10291 User:DenisB 2011-12-01T15:59:26Z <p>DenisB: /* Misc 1 : Qemu launching */</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;bash&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script:<br /> <br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card....<br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10290 User:DenisB 2011-12-01T15:29:48Z <p>DenisB: /* Misc 2 */ Adding joe as a comfortable text editor</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==<br /> Adding a text editor:<br /> <br /> Natively, armadeus is shipped with nano, a very simple version of vi (not like vim) and uemacs. If one needs some features like syntax highlighting (for shell/lua scripting) , noone of them is satisfying (and a full version of vim can be installed, but is space-consuming).<br /> A light solution can be found with joe [http://joe-editor.sourceforge.net/], which offers syntax-highlighting (I noticed that 10% of my errors could be avoided with such a feature).<br /> The easiest solution is to compile it from source, test it and train oneself with it, and to modify the make invocation to use Armadeus's cross compiler instead of gcc, which leads to the following script:<br /> <br /> JOEROOT=/usr/local/ # in both the PC and the (emulated) Armadeus card....<br /> cd /usr/local/armadeus-4.0/# both these lines depend on your installation and should be adapted<br /> cd ~/armadeus-4.0/<br /> cd joe-3.7/ # joe's source tree is located here<br /> ici=`pwd`<br /> make clean # first, removes everything (might be arm's binaries)<br /> ./configure --disable-termcap --prefix=${JOEROOT}<br /> make &amp;&amp; sudo make install<br /> cd ..<br /> # now, to arms<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> cd ${ici}<br /> # one removes x86 binaries, then one builds for arm<br /> make clean &amp;&amp; make CC=arm-linux-gcc<br /> # some tests <br /> <br /> echo &quot;unstripped joe &quot; &gt; joestrip.txt<br /> cp joe ../tftboot/unstrippedjoe <br /> ls -l joe &gt;&gt; joestrip.txt<br /> echo &quot;stripped joe &quot; &gt;&gt; joestrip.txt<br /> arm-linux-strip joe<br /> ls -l joe &gt;&gt; joestrip.txt<br /> <br /> cp joe ../tftboot/. # it is ready to be shiped to an emulated card..<br /> mkdir .././tftboot/usrlocalshare<br /> cp -rpvf ${JOERROT}/share/joe .././tftboot/usrlocalshare/.<br /> mkdir .././tftboot/usrlocaletc<br /> cp -rpvf ${JOERROT}/etc/joe .././tftboot/usrlocaletc/.<br /> # history &gt;joestory</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10279 User:DenisB 2011-11-19T15:28:01Z <p>DenisB: /* Misc 1 : Qemu launching */ Fedora 16 has its toolchain working, too</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for more than one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD),Fedora 16 and a Mageia-1: emulated cards were apf9328 and apf27.<br /> The only flaw I could notice with SL-5.x was the absence of qemu on their live DVD (it is difficult to have a package manager add stuff on a RO media...) , which could be recompiled from source in a RW part of a disk with little trouble.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10225 User:DenisB 2011-10-24T09:49:24Z <p>DenisB: /* Misc 1 : Qemu launching */ some lines of a bash scripts looked ugly</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}&quot;/&quot;* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD) and a Mageia-1: emulated cards were apf9328 and apf27.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVDD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> <br /> ==Misc 2 ==</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10191 User:DenisB 2011-10-15T13:46:40Z <p>DenisB: Suppress an unuseful line</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> <br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}/* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD) and a Mageia-1: emulated cards were apf9328 and apf27.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVDD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> ==Misc 2 ==</div> DenisB http://www.armadeus.org/wiki/index.php?title=QEMU&diff=10190 QEMU 2011-10-15T13:45:25Z <p>DenisB: /* Launch it */</p> <hr /> <div>{{Under_Construction}}<br /> <br /> Well, you don't have enough money to buy an Armadeus board and just want to be part of the &quot;Software&quot; side of the project ? Then QEMU can be a good choice for you !! &lt;br&gt;&lt;br&gt;<br /> {{Warning|<br /> Just be aware that currently Armadeus hardware is not emulated under QEMU, we are just using an other board hardware emulation (ARM Versatile) and Linux kernel to launch our rootfs and test our software which is not hardware related (ie User interface, Network, etc...)<br /> }}<br /> <br /> In order to build a hardware matching machine for Armadeus boards under Qemu, follow this link and add devices you are interested to see emulated in Qemu: <br /> [[QemuMachineDevelopment | Qemu machine development]]<br /> <br /> ==Installation==<br /> * on Debian, *Ubuntu just do a:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils vde<br /> * on Kubuntu 9.10 do:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils qemu-kvm-extras vde<br /> <br /> ==Configuration==<br /> <br /> QEMU has several ways of emulating the network:<br /> * user mode (by default): you can access Internet from your emulated target or an internal Samba/TFTP server but your are not directly accessible<br /> * bridge mode: you can communicate directly with the Host<br /> <br /> &lt;br&gt;<br /> {{Note|For a first try you can skip following part and go directly [[QEMU#Get.2Fgenerate_simulation_images_.28Linux_.26_rootfs.29|here.]]}}<br /> As we want to mimic the devt environment with a real target (that has its own IP adress and is eccesible from the host) we will use &quot;bridged mode&quot;.<br /> This mode require some configuration on your Host:<br /> * Install ''bridge_utils'' package<br /> * Activate IPv4 forwarding, for example on Ubuntu, uncomment the following line in ''/etc/sysctl.conf'':<br /> &lt;pre class=host&gt;<br /> $ sudo vim /etc/sysctl.conf<br /> <br /> # Uncomment the next line to enable packet forwarding for IPv4<br /> #net/ipv4/ip_forward=1<br /> &lt;/pre&gt;<br /> * In ''/etc/network/interface'' comment the line referring to your current Ethernet card and replace them with:<br /> <br /> auto br0<br /> iface br0 inet dhcp<br /> bridge_ports eth0<br /> bridge_fd 9<br /> bridge_hello 2<br /> bridge_maxage 12<br /> bridge_stp off <br /> <br /> #auto eth0<br /> #iface eth0 inet dhcp<br /> {{Note|If you are using a modern linux distribution like Ubuntu, also be sure NetworkManager is disabled/not configured. Otherwise conflict occur and network does not work at all.}}<br /> <br /> * Create a script ''/etc/qemu-ifup'' that will be executed upon the start of QEMU:<br /> #!/bin/sh<br /> echo &quot;Executing /etc/qemu-ifup&quot;<br /> echo &quot;Bringing up $1 for bridged mode...&quot;<br /> sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br /> echo &quot;Adding $1 to br0...&quot;<br /> sudo /usr/sbin/brctl addif br0 $1<br /> sleep 2<br /> <br /> * Now you can append the following options to the qemu command line:<br /> -net nic,vlan=0,macaddr=00:16:3e:00:00:01 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup<br /> You don't need to give a MAC address if you are emulating only one machine, as QEMU will use a default one. However if you have more than one emulated machine (don't forget QEMU can also emulate other architectures than ARM), you will have to specify a unique MAC address for each machine.<br /> <br /> * Once booted, on your guest you can configure the network simply as follows:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # udhcpc -i eth0<br /> &lt;/pre&gt;<br /> <br /> ==Get/generate simulation images (Linux &amp; rootfs)==<br /> * As QEMU doesn't support (yet) the APF, we will use the Versatile PB emulated hardware. To get a compatible Linux kernel for this board do:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ cd your_armadeus_view/<br /> $ wget ftp://ftp2.armadeus.com/armadeusw/download/qemu/vmlinuz-2.6.29.6-versatile-armadeus<br /> &lt;/pre&gt;<br /> one wanting to rebuild this image itself will find the correspondig config file in the same dir. (after compiling, take ''arch/arm/boot/zImage'')<br /> * get some useful environment variables:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make shell_env<br /> $ source armadeus_env.sh<br /> &lt;/pre&gt;<br /> * deactivate login on serial port:<br /> ** in Buildroot menuconfig:<br /> &lt;pre class=&quot;config&quot;&gt;<br /> System configuration ---&gt;<br /> () Port to run a getty (login prompt) on<br /> &lt;/pre&gt;<br /> : * and in ''$ARMADEUS_ROOTFS_DIR/etc/inittab'', comment following lines:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> # Put a getty on the serial port<br /> ttymxcX::respawn:/sbin/getty -L ttymxcX 115200 vt100 # GENERIC_SERIAL<br /> <br /> This can be achieved with sed :<br /> sed --in-place -e &quot;s/^ttymcX/#ttymcX/&quot; $ARMADEUS_ROOTFS_DIR/etc/inittab <br /> &lt;/pre&gt;<br /> * Re-generate your Armadeus rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make<br /> &lt;/pre&gt;<br /> * check the size of your rootfs image<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ ls -al $ARMADEUS_ROOTFS_TAR<br /> &lt;/pre&gt;<br /> * generate a dummy image larger than your rootfs; here 60 MBytes for a 45 MBytes tared rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ dd if=/dev/zero of=armadeus-qemu.img bs=1MB count=60<br /> $ sudo mke2fs -F -m 0 -b 1024 armadeus-qemu.img<br /> &lt;/pre&gt;<br /> * mount it and copy it your rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ mkdir qemu_mnt<br /> $ sudo mount -t ext2 -o loop armadeus-qemu.img qemu_mnt/<br /> $ sudo tar xf $ARMADEUS_ROOTFS_TAR -C qemu_mnt/<br /> $ sudo umount qemu_mnt/<br /> &lt;/pre&gt;<br /> * now you have all you need to launch Qemu<br /> <br /> ==Launch it==<br /> * Example with 64 MBytes of RAM:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ qemu-system-arm -M versatilepb -kernel ./vmlinuz-2.6.29.6-versatile-armadeus -hda armadeus-qemu.img -m 64 \<br /> -append &quot;root=/dev/sda mem=64M ro&quot; (rw for read/write works, too instead of tw two last characters ro)<br /> &lt;/pre&gt;<br /> option ''-cpu arm926'' can be added on APF27 &lt;br&gt;<br /> [[Image:qemu_apf_ramdisk.png]]<br /> <br /> * When system has booted, if you are French, load a usable keymap:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # loadkmap &lt; /etc/i18n/fr.kmap<br /> &lt;/pre&gt;<br /> &lt;pre class=&quot;host&quot;&gt;<br /> =&gt; loqdk,qp &lt; !etc!i&amp;_n!fr:k,qp on your PC keyboard<br /> &lt;/pre&gt;<br /> Another solution is to generate the command one wants to lanch on your PC, with a normal keyboard layout<br /> <br /> &lt;pre class=&quot;host&quot;&gt;<br /> $echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; kfr<br /> &lt;/pre&gt;<br /> <br /> or<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; kde<br /> <br /> chmod +x k*<br /> &lt;/pre&gt;<br /> <br /> and to copy it on the virtual image, before it is unmounted and qemu is launched<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $cp -uv k* $IMAGE/usr/local/bin/. # it will be in the guest PATH<br /> &lt;/pre&gt;<br /> <br /> Once qemu has been launched, and one is connected, just type kfr (or kde) to get a keyboard layout one is accustomed to (these letters are layout agnostic, and they can be directly executed).<br /> <br /> A bash script to avoid typing all these lines can be found here, and might make things simpler, if adapted.<br /> [[http://www.armadeus.com/wiki/index.php?title=User:DenisB]]<br /> <br /> ==To Be Continued... ;-) ==<br /> <br /> ==Links==<br /> * [http://fabrice.bellard.free.fr/qemu/ QEMU WebPage]<br /> * [http://www.aurel32.net/info/debian_arm_qemu.php Debian on an emulated ARM machine tutorial by Aurel32] + [http://qemu-forum.ipi.fi/viewtopic.php?t=3919 comments about it]<br /> * [http://909ers.apl.washington.edu/~dushaw/ARM/ Debian ARM Linux on Qemu]<br /> * http://www.gnome.org/~markmc/qemu-networking.html<br /> * [http://compsoc.dur.ac.uk/~djw/qemu.html QEMU - Debian - Linux - TUN/TAP - network bridge]<br /> * [http://gumstix.net/wiki/index.php?title=Running_qemu Gumstix's way of using QEmu]<br /> * [http://gumstix.net/wiki/index.php?title=Making_qemu_images Gumstix's way of generating QEmu's images]<br /> * [https://wiki.ubuntu.com/ARM/RootfsFromScratch Generating Ubuntu for ARM with QEMU]<br /> * [http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/ compiling-linux-kernel-for-qemu-arm-emulator]<br /> <br /> <br /> [[Category:Emulation]]</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10189 User:DenisB 2011-10-15T13:42:22Z <p>DenisB: Suppress an unuseful line</p> <hr /> <div>==Misc 1 : Qemu launching ==<br /> <br /> '''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> NOM_IMAGE=armadeus-qemu.img<br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}/* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD) and a Mageia-1: emulated cards were apf9328 and apf27.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVDD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....<br /> ==Misc 2 ==</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10187 User:DenisB 2011-10-14T14:19:16Z <p>DenisB: DVDs are not CDs + typos</p> <hr /> <div>'''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one has to type as host can be very long and tedious; and forgetting to type one of them leads to unpleasant results (ex : a mounted image should be unmounted before being used by qemu)<br /> <br /> a bash script like this one, once adapted, might give ideas to avoid errors..<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> NOM_IMAGE=armadeus-qemu.img<br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}/* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for one month on Scientific Linux - 5.7 (a Red Hat clone, able to mount NTFS partitions and having a live DVD) and a Mageia-1: emulated cards were apf9328 and apf27.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts on a Scientific Linux live DVDD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....</div> DenisB http://www.armadeus.org/wiki/index.php?title=User:DenisB&diff=10126 User:DenisB 2011-10-09T15:26:37Z <p>DenisB: New page: '''1) A script to make qemu launching automatic''' Sometimes, the list of commands one ahs to type as host can be very long and tedious; a bash script like this one might give ideas to a...</p> <hr /> <div>'''1) A script to make qemu launching automatic'''<br /> <br /> Sometimes, the list of commands one ahs to type as host can be very long and tedious;<br /> <br /> a bash script like this one might give ideas to avoid a lot of errors..<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> NOM_IMAGE=armadeus-qemu.img<br /> echo &quot; image pour qemu : ${NOM_IMAGE:=armadeus-qemu.img}<br /> montee dans ${NOM_DIR_MNT:=qemu-mnt} &quot;<br /> echo -e &quot; repertoire de transit : ${TFTBOOT:=tftboot} <br /> rafraichissement ${rafraichir:=no} <br /> options -rw ou ro- : ${OPTION:=rw} <br /> RAM :${RAMSIZE:=96M} DISQUE: ${DISKSIZE:=160} <br /> image de boot :${VMBOOT:=./vmlinuz-2.6.29.6-versatile-armadeus}<br /> &quot;<br /> <br /> # sets sudo options (if one is not sudoer, one might launch this script as root)<br /> #<br /> <br /> SUDO=<br /> udo=`sudo echo alut`<br /> [ s${udo} == &quot;salut&quot; ] &amp;&amp; SUDO=sudo<br /> #<br /> <br /> [ -f ${NOM_IMAGE} ] || rafraichir=oui_evidemment<br /> [ -d $TFTBOOT ] || mkdir $TFTBOOT<br /> [ -d ${NOM_DIR_MNT} ] || mkdir ${NOM_DIR_MNT}<br /> <br /> make shell_env &amp;&amp; source armadeus_env.sh<br /> export PATH=${ARMADEUS_TOOLCHAIN_PATH}/../bin/:${PATH}<br /> <br /> # fixes armadeus-4.0 $ARMADEUS_ROOTFS_TAR gets the right name<br /> <br /> tempo=<br /> ls $ARMADEUS_ROOTFS_DIR<br /> [ -f $ARMADEUS_ROOTFS_TAR ] || tempo=`echo $ARMADEUS_ROOTFS_TAR | sed -e &quot;s/\.arm\././&quot;`<br /> [ z$tempo != &quot;z&quot; ] &amp;&amp; ARMADEUS_ROOTFS_TAR=$tempo<br /> # ls -al $ARMADEUS_ROOTFS_TAR<br /> <br /> if [ $rafraichir = no ]<br /> then<br /> echo pas de rafraichissement<br /> else<br /> # destroys and creates an new image<br /> \rm $NOM_IMAGE<br /> dd if=/dev/zero of=${NOM_IMAGE} bs=1MB count=${DISKSIZE}<br /> $SUDO /sbin/mke2fs -F -m 0 -b 1024 ${NOM_IMAGE}<br /> fi<br /> <br /> # for old versions of life CDs, where, sometimes, there are not enough mount points<br /> # mknod /dev/loop/333 b 7 333<br /> # losetup /dev/loop/333 ${NOM_IMAGE}<br /> # mount /dev/loop/333 ${NOM_DIR_MNT}<br /> <br /> $SUDO mount -t ext2 -o loop $NOM_IMAGE ${NOM_DIR_MNT}<br /> $SUDO tar xf $ARMADEUS_ROOTFS_TAR -C ${NOM_DIR_MNT}/<br /> [ -f ${NOM_DIR_MNT}/usr/local/bin ] &amp;&amp; $SUDO \rm ${NOM_DIR_MNT}/usr/local/bin<br /> <br /> # comments lines with tty (else, initialisation endlessly loops under qemu)<br /> # sudo vi ${NOM_DIR_MNT}/etc/inittab<br /> # editing can be tedious if one does it every time: has been automated wwith sed<br /> $SUDO sed --in-place -e &quot;s/^ttySMX/#ttySMX/&quot; ${NOM_DIR_MNT}/etc/inittab<br /> <br /> # creates a french (and german) keyboard layout launcher and puts it in a temporary dir<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; ${TFTBOOT}/kfr<br /> $SUDO echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; ${TFTBOOT}/kde<br /> $SUDO chmod +x ${TFTBOOT}/k*<br /> <br /> # prepares other softs<br /> <br /> for monmac in qemu/Makefile makefilua # myoscillo/Makefile<br /> do<br /> [ -f $monmac ] &amp;&amp; make -f $monmac &amp;&amp; make -f $monmac install<br /> done<br /> TSTDIR=/usr/local/armadeus-4.0/myoscillo # places where one has some code to test<br /> opwd=`pwd`<br /> [ -d ${TSTDIR} ] &amp;&amp; cd ${TSTDIR} &amp;&amp; make &amp;&amp; make install<br /> [ -d ${opwd}/fontes ] &amp;&amp; cd ${opwd}/fontes &amp;&amp; make &amp;&amp; make install<br /> cd $opwd<br /> # sleep 8 # you have some time to admire make at work<br /> #<br /> # puts everything one wants to download (from the temporary folder) in to <br /> # what will become, in the emulated board, /usr/local/bin (is in the PATH) ....<br /> set -vx<br /> [ -d ${NOM_DIR_MNT}/usr/local/bin ] || $SUDO mkdir -p ${NOM_DIR_MNT}/usr/local/bin<br /> $SUDO cp -rpuv ${TFTBOOT}/* ${NOM_DIR_MNT}/usr/local/bin/.<br /> #<br /> # one **must** unmount the qemu image before qemu can use it<br /> $SUDO umount ${NOM_DIR_MNT}<br /> #<br /> qemu-system-arm -M versatilepb -kernel ${VMBOOT} -hda ${NOM_IMAGE} -append &quot;root=/dev/sda mem=${RAMSIZE} ${OPTION}&quot;<br /> &lt;/source&gt;<br /> <br /> Nota : this script has been tested and run with some satisfaction for one month on a scientific Linux - 5 (a Red Hat clone, able to mount NTFS partitions and having a live CD) and a Mageia-1: emulated cards were apf9328 and apf27.<br /> <br /> Nota : Some things are very unstandard : using /usr/local as a working directory on ones host is a consequence of lazy mounts an a Scientific Linux live CD.... The size of the disks and the RAM do not need to be realistic, as it is meant for some tests (and lacking 500 K of disk , without tools to test it, might be frustrating)<br /> <br /> Nota : copies which are made on an emulated image wo not appear on real hardware....</div> DenisB http://www.armadeus.org/wiki/index.php?title=LinuxInstall&diff=10036 LinuxInstall 2011-09-16T15:03:32Z <p>DenisB: /* Prerequisites for Linux installation */ make-3.82 troubles are not Fedora-specific (were reproducted in Mandriva 2010.1, with a new make, and in mageia).</p> <hr /> <div>&lt;noinclude&gt;<br /> &lt;big&gt;How-To install Armadeus Software Development Kit (SDK) on Linux systems. This SDK is currently based on the (excellent) [http://buildroot.net/ Buildroot].&lt;/big&gt;<br /> &lt;/noinclude&gt;<br /> <br /> The installation was successfully tested on the following distributions:<br /> * Debian Sarge (3.1), Etch (4.0) &amp; Lenny (5.0)<br /> * X/KUbuntu Edgy Eft (6.10), Gutsy Gibbon (7.10), Hardy Heron (8.04) &amp; Jaunty Jackalope (9.04)<br /> * Ubuntu Dapper Drake (6.04), Hardy Heron (8.04), Intrepid Ibex (8.10) &amp; Lucid Lynx (10.04) (64bits)<br /> * Mandriva 2006<br /> * Fedora Core 3 &amp; 4, Fedora 10, Laughlin (14)<br /> * Red Hat Enterprise 5.2<br /> * Gentoo 10.0 (32 &amp; 64 bits)<br /> * SuSE 10.1, OpenSUSE 11.3<br /> <br /> '''The installation may fail on:'''<br /> * Ubuntu Karmic Koala (9.10): tslib fails to build<br /> <br /> <br /> ==Prerequisites for Linux installation==<br /> {{Note|From here we assume that your Linux system has a ''make'' version '''greater or equal to''' 3.81. To check it: <br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make -v<br /> GNU Make 3.81<br /> ...<br /> &lt;/pre&gt;<br /> }}<br /> For armadeus up to 3.4, make should be '''strictly''' make-3.81 (make-3.82 is too strict). A Fedora (14 and 15) -specific solution can be found later; other recent distributions such as mageia1 also have make-3.82, and a generic solution, based on configure&amp;&amp; make&amp;&amp; sudo make install can be used to install make-3.81 (which can be retrieved from http://ftp.gnu.org/gnu/make/make-6.81.tar.gz) in /usr/local/bin (and , according to one's PATH, make 3-81 can be invoked directly or as /usr/local/bin/make). <br /> <br /> Depending on your distribution, some additional packages are required:<br /> <br /> ===Debian/Ubuntu based systems===<br /> [[Ubuntu/Debian installation prerequisites]]<br /> <br /> ===Mandriva based systems=== <br /> [[Mandriva installation prerequisites]]<br /> <br /> ===RPM-based systems (RedHat, Fedora, CentOS)===<br /> [[RedHat/Fedora installation prerequisites]]<br /> <br /> ===OpenSuse based systems===<br /> [[OpenSuse installation prerequisites]]<br /> <br /> ==Get Armadeus software==<br /> * '''If you are a &quot;careful&quot; user''', then download [https://sourceforge.net/projects/armadeus/files/ the latest stable installation tarball from SourceForge] and detar it wherever you want:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ tar xjvf armadeus-4.0.tar.bz2<br /> &lt;/pre&gt;<br /> * '''If you want the latest snapshot''', the whole development tree can checked out from the [[GIT]] repository. (SVN repository is no more maintained !!!)<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ git clone git://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus armadeus<br /> &lt;/pre&gt; <br /> <br /> * depending on your previous choice, a directory named ''armadeus/'' or ''armadeus-4.0/'' will be created on your hard-disk and will contain all the files you need.<br /> <br /> '''Remarks''':<br /> * '''Do not use spaces''' in the directory name !<br /> * GIT write/push accesses are limited to the integrators ([[User:JulienB|JulienB]], [[User:Salocin68|Salocin68]], [[User:Jorasse|Jorasse]], [[User:FabienM|FabienM]])<br /> <br /> ==Configure SDK options==<br /> {{Note|If you are new to Armadeus and have troubles compiling armadeus-4.0 using the following instructions, you may find some hints here: [[Armadeus 4.0 Troubleshots]]}}<br /> *Go to the directory where you put the Armadeus sources:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ cd armadeus/ (or armadeus-4.0/)<br /> &lt;/pre&gt;<br /> *The first time you compile an Armadeus distribution you have to specify the target (here the apf9328) to work with. <br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make apf9328_defconfig<br /> &lt;/pre&gt;<br /> This command reloads the default configuration to support your target and automatically start a Buildroot's configuration menu.<br /> <br /> * Current valid default configurations are:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> apf9328_defconfig apf27_defconfig pps_defconfig<br /> &lt;/pre&gt;<br /> <br /> For PPS, please see [[APF27_PPS]] for details on specific build<br /> <br /> *After some downloads, you will get the Buildroot configuration interface:<br /> <br /> {{Note|If you ever made changes in the following steps, at any time you can reload the default configuration with the same command}}<br /> <br /> [[Image:Menuconfig3.png]]&lt;br&gt;<br /> *If you are not familiar with Buildroot here are some tips:<br /> *# you can move the highlighted item with the &quot;up&quot;/&quot;down&quot; arrow keys<br /> *# with the &quot;left&quot;/&quot;right&quot; arrow keys you can choose between &quot;Select&quot;, &quot;Exit&quot; or &quot;Help&quot; buttons<br /> *# &quot;space&quot;/&quot;enter&quot;:<br /> *#* selects the currently highlighted item if you are on the &quot;Select&quot; button<br /> *#* go back in previous menu if you are on &quot;Exit&quot; button<br /> *#* show you some Help for current item if you are on &quot;Help&quot; button<br /> *# for more Help about Buildroot commands, select &quot;Help&quot; in the main configuration screen<br /> <br /> *In menu:<br /> :&lt;pre class=&quot;config&quot;&gt;Target options ---&gt; <br /> :[*] Armadeus Device Support ---&gt;&lt;/pre&gt;<br /> :you can check and change the quantity of RAM available on your Armadeus board. For [[APF27]] it could be either 64MB or 128MB (2 x 64MB) (in that case be sure to select 2 chips of 64MB instead of 1 chip of 128MB).<br /> <br /> *In menu:<br /> :&lt;pre class=&quot;config&quot;&gt;Target filesystem options --&gt; &lt;/pre&gt;<br /> :for each type of filesystems to build, you have the option (''also copy the image to...'') to copy the binary file to secondary location like your tftp server folder (for example ''/tftpboot'').&lt;br&gt;<br /> :Even U-Boot can be copied to a second location (like ''/tftpboot''). You will find the U-Boot options at the end of the list.<br /> <br /> *In menu:<br /> :&lt;pre class=&quot;config&quot;&gt;Kernel --&gt;<br /> :Destination for linux kernel binaries --&gt; &lt;/pre&gt;<br /> :you will find options to copy Linux to a secondary location (like ''/tftpboot'')<br /> <br /> * You may decrease the compilation time by increasing the number of parallel jobs running simultaneously on your system (the result is not guaranteed). This option is located in<br /> :&lt;pre class=&quot;config&quot;&gt;Build Options ---&gt;<br /> :(1) Number of jobs to run simultaneously&lt;/pre&gt;<br /> <br /> * During the toolchain/distribution automatic build, a lot of software archives are downloaded from Internet. The downloaded files are put by default in the ''armadeus/downloads/'' directory. '''If you have several views or plan to build the toolchain several times''', we advise you to put all the downloaded files in ''/local/downloads'' (for example). This is done by configuring Buildroot to use this directory for all your views. Nevertheless, buildroot will be downloaded separately for each build environment you set up.<br /> :&lt;pre class=&quot;config&quot;&gt;Build options ---&gt; <br /> :(...) Download dir&lt;/pre&gt;<br /> :[[Image:Build_config_menu_download.png]]&lt;br&gt; &lt;br&gt;<br /> :[[Image:Build_config_download.png]]<br /> '''Of course, ''/local/downloads'' should exists on your system and you should have writing rights on it !'''<br /> <br /> * After the build, we advise you too to copy all the files in ''downloads/'' on a removable medium, in case you want to install the development tools on several systems.<br /> <br /> * Now, Exit the configuration tool and save your configuration<br /> <br /> * You can come back to this configuration menu after, typing : <br /> &lt;pre class=&quot;host&quot;&gt;<br /> make menuconfig<br /> &lt;/pre&gt;<br /> <br /> ==Launch build==<br /> $ make<br /> The toolchain and the full distribution are automatically built. During this procedure, several files are downloaded from Internet. &lt;br&gt;<br /> '''Please wait for a while.... it takes at least one hour for the first run!'''&lt;br&gt;<br /> By default, the downloaded files/tarball are put in the ''armadeus/downloads/'' directory. Please see the previous chapter to know how to optimize that if you plan to build several views.<br /> <br /> ==Enjoy the result==<br /> The generated binary files can be found in the subdirectory ''buildroot/output/images'':<br /> *''apf9328-u-boot.brec'' (only on [[APF9328]]): BRecord image that can be used with the bootstrap, if U-Boot is not installed or not working (see [[BootLoader]] page)<br /> *''XX-u-boot.bin'': U-Boot image file to be used with U-Boot itself, (see [[BootLoader#Update_U-Boot | updating U-Boot]])<br /> *''XX-linux.bin'': Linux image to use with U-Boot, (see [[Target_Software_Installation#Linux_kernel_installation | updating Linux]])<br /> *''XX-rootfs.jffs2'': JFFS2 filesystem/rootfs image to use with U-Boot, (see [[Target_Software_Installation#Linux_rootfs_installation | updating rootfs]])<br /> *''XX-rootfs.ubi'' (not supported on [[APF9328]]): [[UBIFS|UBI]] filesystem/rootfs image to use with U-Boot, (see [[Target_Software_Installation#Linux_rootfs_installation | updating rootfs]])<br /> *''apfXX-rootfs.tar'': for an NFS/MMC based rootfs, (see [[Network_Configuration#Boot_from_NFS | Booting from NFS]] &amp; [[MultiMediaCard#Booting_from_MMC.2FSD | Booting from a MMC/SD]])<br /> <br /> '''Please note the new naming convention of binary files and directories (since Armadeus 4.0)'''<br /> <br /> &lt;strike&gt;<br /> The toolchain and project files share a new naming convention too (YY is ''4t'' for APF9328 and ''5te'' for APF27):<br /> *''buildroot/build_armvYY'': contains all non configurable user-space tools and staging dir.<br /> *''buildroot/project_build_armvYY/apfXX'': contains all configurable user-space tools: target filesystem, &lt;b&gt;linux&lt;/b&gt;, busybox and &lt;b&gt;u-boot&lt;/b&gt;...<br /> *''buildroot/toolchain_build_armvYY'': cross compilation toolchain's build dir. Binaries are in ''buildroot/build_armvYY/staging_dir/usr/bin''.<br /> &lt;/strike&gt;<br /> <br /> More information is available in the [http://buildroot.uclibc.org/buildroot.html buildroot documentation]<br /> <br /> * Note: Previous versions (3.x) of Armadeus SDK stored the generated binary files at a different place: '' ''buildroot/binaries/XX/'' (where XX was the name of your board).<br /> <br /> &lt;noinclude&gt;<br /> <br /> ==To keep your local copy/repository up-to-date with the armadeus GIT repository==<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ git pull<br /> &lt;/pre&gt;<br /> This will update your working directory to the latest release.<br /> <br /> Note: if &quot;git pull&quot; fails because a directory or a file already exists, then do:<br /> $ rm -rf &lt;this-directory/file&gt;<br /> $ git pull<br /> <br /> You can do a:<br /> $ make apfXX_defconfig<br /> to have the latest features automatically activated.<br /> <br /> You have to do a '''make''' to rebuild binary files and then upload the binary files to your target.<br /> <br /> Note: if definitively everything goes wrong while it worked before the last update.<br /> You can apply the following procedure (all your modifications in buildroot will be lost):<br /> $ rm -rf buildroot/<br /> $ rm Makefile<br /> $ git pull<br /> $ make apfXX_defconfig<br /> $ make<br /> <br /> Enjoy!<br /> &lt;/noinclude&gt;</div> DenisB http://www.armadeus.org/wiki/index.php?title=RedHat/Fedora_installation_prerequisites&diff=10035 RedHat/Fedora installation prerequisites 2011-09-16T14:52:52Z <p>DenisB: /* Fedora 14 */ make-3.82 worries can be worked around with a generic solution, and this solution is not Fedora's</p> <hr /> <div>==Mandatory packages==<br /> *the following commands should install all the needed prerequisites (assuming root shell):<br /> &lt;pre class=&quot;host&quot;&gt;<br /> yum install gcc gcc-c++ make autoconf automake libtool bison flex gettext<br /> yum install patch subversion texinfo git wget<br /> yum install zlib-devel gettext-devel ncurses-devel lzo-devel libacl-devel<br /> yum install uuid-devel<br /> &lt;/pre&gt;<br /> <br /> ==Distribution specific tips==<br /> ===Fedora 13 &amp; 14===<br /> * as ''uuid-devel'' seems not installed at the right place, you may also need to do the following:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> cd /usr/include<br /> mkdir uuid<br /> cp uuid.h uuid<br /> cd /usr/lib<br /> ln -s ../../lib64/libuuid.so.1 libuuid.so<br /> &lt;/pre&gt;<br /> <br /> ===Fedora 14===<br /> * following operations are needed:<br /> ** downgrade make-3.82 to make-3.81 (Fedora 14 uses make-3.82 which is too restrictive) :<br /> *** First you need to download the correct key (https://fedoraproject.org/static/E8E40FDE.txt) and import this by :<br /> &lt;pre class=&quot;host&quot;&gt;<br /> rpm --import E8E40FDE.txt<br /> &lt;/pre&gt;<br /> *** Now you can downgrade make<br /> &lt;pre class=&quot;host&quot;&gt;<br /> yum downgrade make --releasever=13<br /> &lt;/pre&gt;<br /> *** And to avoid futur upgrade, you need to add <br /> &lt;pre class=&quot;host&quot;&gt;<br /> exclude=make*<br /> &lt;/pre&gt;<br /> in /etc/yum.conf<br /> ** install glibc-static to allow insmod.static compilation:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> rpm -ivh glibc-static-2.12.90-15.i686.rpm<br /> &lt;/pre&gt;<br /> <br /> ===RedHat Enterprise 5.2===<br /> * not all packages are available by default. You can get extra packages here: http://download.fedora.redhat.com/pub/epel/5/i386/ (for example missing ''lzo'' and ''lzo-devel'' can be found here).<br /> <br /> ==Optional packages==<br /> * Not mandatory but useful to add some extra packages:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> yum install glib2-devel lzo2-devel<br /> &lt;/pre&gt;<br /> <br /> To compile java jamvm and gnu-classpath:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> yum install java-*-openjdk<br /> &lt;/pre&gt;</div> DenisB http://www.armadeus.org/wiki/index.php?title=LinuxInstall&diff=10003 LinuxInstall 2011-09-03T13:48:38Z <p>DenisB: /* RPM-based systems */ added a generic solution to solve issues wih make-3.82, if any</p> <hr /> <div>&lt;noinclude&gt;<br /> &lt;big&gt;How-To install Armadeus Software Development Kit (SDK) on Linux systems. This SDK is currently based on the (excellent) [http://buildroot.net/ Buildroot].&lt;/big&gt;<br /> &lt;/noinclude&gt;<br /> <br /> The installation was successfully tested on the following distributions:<br /> * Debian Sarge (3.1), Etch (4.0) &amp; Lenny (5.0)<br /> * Fedora Core 3 &amp; 4<br /> * Fedora 10, Laughlin (14)<br /> * KUbuntu Edgy Eft (6.10), Gutsy Gibbon (7.10), Hardy Heron (8.04) &amp; Jaunty Jackalope (9.04)<br /> * Mandriva 2006<br /> * SuSE 10.1<br /> * Ubuntu Dapper Drake (6.04), Hardy Heron (8.04), Intrepid Ibex (8.10) &amp; Lucid Lynx (10.04) (64bits)<br /> * Xubuntu Edgy Eft (6.10)<br /> * Red Hat Enterprise 5.2<br /> * Gentoo 10.0 (32 &amp; 64 bits)<br /> * OpenSUSE 11.3<br /> <br /> '''The installation may fail on:'''<br /> * Ubuntu Karmic Koala (9.10): tslib fails to build<br /> <br /> <br /> ==Prerequisites for Linux installation==<br /> {{Note|From here we assume that your Linux system has a ''make'' version '''greater or equal to''' 3.81. To check it: <br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make -v<br /> GNU Make 3.81<br /> ...<br /> &lt;/pre&gt;<br /> }}<br /> <br /> Depending on your distribution, some additional packages are required.<br /> <br /> ===Debian/Ubuntu based systems===<br /> * you can use the following command to get them (assuming your userid is allowed to use sudo (execution of commands as root)):<br /> &lt;pre class=&quot;host&quot;&gt;<br /> sudo apt-get install build-essential gcc g++ autoconf automake libtool bison flex gettext <br /> sudo apt-get install patch subversion texinfo wget git-core<br /> sudo apt-get install libncurses5 libncurses5-dev<br /> sudo apt-get install zlib1g-dev liblzo2-2 liblzo2-dev<br /> sudo apt-get install libacl1 libacl1-dev gawk cvs curl lzma <br /> sudo apt-get install uuid-dev<br /> &lt;/pre&gt;<br /> <br /> Not mandatory but useful to add for compiling some Buildroot packages:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> sudo apt-get install libglib2.0-dev<br /> sudo apt-get install libnetpbm10-dev (for fbtest)<br /> sudo apt-get install python-xcbgen (for Matchbox)<br /> &lt;/pre&gt;<br /> <br /> {{Warning|For recent Ubuntu and Debian based systems, the following is now required if your ''/bin/sh'' is '''not''' pointing to ''/bin/bash'':<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ ls -al /bin/sh<br /> lrwxrwxrwx 1 root root 4 2007-12-08 18:33 /bin/sh -&gt; dash<br /> $ sudo dpkg-reconfigure dash<br /> and select no<br /> &lt;/pre&gt;<br /> Indeed dash do not support all the capabilities needed by Buildroot (our build system).<br /> }}<br /> <br /> <br /> ====Ubuntu====<br /> <br /> * To compile java jamvm and gnu-classpath:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> sudo apt-get install gcj-jdk <br /> &lt;/pre&gt;<br /> <br /> ====Debian====<br /> To compile java jamvm and gnu-classpath:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> sudo apt-get install java-gcj-compat-dev default-jdk<br /> &lt;/pre&gt;<br /> <br /> ===Mandriva based systems=== <br /> * name of packages are different therefore use the lines hereafter instead (assuming sudo is configured to support root commands):<br /> &lt;pre class=&quot;host&quot;&gt;<br /> sudo urpmi gcc gcc-c++ make autoconf automake libtool bison flex gettext <br /> sudo urpmi patch subversion texinfo wget git<br /> sudo urpmi libncurses5 libncurses-devel<br /> sudo urpmi zlib1-devel liblzo2_2 liblzo-devel<br /> sudo urpmi libacl1 libacl-devel<br /> sudo urpmi uuid-dev<br /> &lt;/pre&gt;<br /> <br /> * If you get this error during compilation (module-init-tools):<br /> &lt;pre class=&quot;host&quot;&gt;<br /> /usr/bin/ld: cannot find -lc<br /> &lt;/pre&gt;<br /> you should install the ''glibc-static'' package. This is because the module-init-tools build process wants to link statically against the C library.<br /> <br /> * Not mandatory but useful to add some Buildroot packages:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> sudo urpmi libglib2.0-devel<br /> &lt;/pre&gt;<br /> <br /> * To compile java jamvm and gnu-classpath:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> sudo urpmi java-gcj-compat-dev <br /> &lt;/pre&gt;<br /> <br /> ===RPM-based systems===<br /> *like RedHat, Fedora, CentOS, the following commands should install all the needed prerequisites (assuming root shell):<br /> &lt;pre class=&quot;host&quot;&gt;<br /> yum install gcc gcc-c++ make autoconf automake libtool bison flex gettext<br /> yum install patch subversion texinfo git wget<br /> yum install zlib-devel gettext-devel ncurses-devel lzo-devel libacl-devel<br /> yum install uuid-devel<br /> &lt;/pre&gt;<br /> * '''On Fedora 13 &amp; 14''', as ''uuid-devel'' seems not installed at the right place, you may also need to do the following:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> cd /usr/include<br /> mkdir uuid<br /> cp uuid.h uuid<br /> cd /usr/lib<br /> ln -s ../../lib64/libuuid.so.1 libuuid.so<br /> &lt;/pre&gt;<br /> <br /> * '''On Fedora 14''', following operations are needed:<br /> ** downgrade make-3.82 to make-3.81 (Fedora 14 uses make-3.82 which is too restrictive) :<br /> *** First you need to download the correct key (https://fedoraproject.org/static/E8E40FDE.txt) and import this by :<br /> &lt;pre class=&quot;host&quot;&gt;<br /> rpm --import E8E40FDE.txt<br /> &lt;/pre&gt;<br /> *** Now you can downgrade make<br /> &lt;pre class=&quot;host&quot;&gt;<br /> yum downgrade make --releasever=13<br /> &lt;/pre&gt;<br /> *** And to avoid futur upgrade, you need to add <br /> &lt;pre class=&quot;host&quot;&gt;<br /> exclude=make*<br /> &lt;/pre&gt;<br /> in /etc/yum.conf<br /> ** install glibc-static to allow insmod.static compilation:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> rpm -ivh glibc-static-2.12.90-15.i686.rpm<br /> &lt;/pre&gt;<br /> <br /> Other recent distributions such as mageia1 also have make-3.82, and a more generic solution, based on <br /> configure&amp;&amp; make&amp;&amp; sudo make install can be used to install make-3.81 (which can be retrieved from http://ftp.gnu.org/gnu/make/make-6.81.tar.gz) in /usr/local/bin (and , according to one's PATH, make 3-81 can be invoked directly or as /usr/local/bin/make)<br /> <br /> * Not mandatory but useful to add some extra packages:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> yum install glib2-devel lzo2-devel<br /> &lt;/pre&gt;<br /> <br /> To compile java jamvm and gnu-classpath:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> yum install java-*-openjdk<br /> &lt;/pre&gt;<br /> <br /> * '''On RedHat Enterprise 5.2''' not all packages are available by default. You can get extra packages here: http://download.fedora.redhat.com/pub/epel/5/i386/ (for example missing ''lzo'' and ''lzo-devel'' can be found here).<br /> * '''On OpenSUSE 11.3''', following operations might be needed:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> sudo zypper install gcc gcc-c++ autoconf automake libtool bison flex make<br /> sudo zypper install subversion texinfo git-core ncurses-devel<br /> sudo zypper install libacl-devel<br /> sudo zypper install libuuid-devel<br /> sudo zypper install libnetpbm-devel<br /> sudo zypper install tcpd<br /> sudo zypper install tcpd-devel<br /> sudo zypper install java-1_5_0-gcj-compat libgcj-devel<br /> sudo zypper install lzo-devel<br /> &lt;/pre&gt;<br /> <br /> ==Get Armadeus software==<br /> * '''If you are a &quot;careful&quot; user''', then download [https://sourceforge.net/projects/armadeus/files/ the latest stable installation tarball from SourceForge] and detar it wherever you want:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ tar xjvf armadeus-4.0.tar.bz2<br /> &lt;/pre&gt;<br /> * '''If you want the latest snapshot''', the whole development tree can checked out from the [[GIT]] repository. (SVN repository is no more maintained !!!)<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ git clone git://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus armadeus<br /> &lt;/pre&gt; <br /> <br /> * depending on your previous choice, a directory named ''armadeus/'' or ''armadeus-4.0/'' will be created on your hard-disk and will contain all the files you need.<br /> <br /> '''Remarks''':<br /> * '''Do not use spaces''' in the directory name !<br /> * GIT write/push accesses are limited to the integrators ([[User:JulienB|JulienB]], [[User:Salocin68|Salocin68]], [[User:Jorasse|Jorasse]], [[User:FabienM|FabienM]])<br /> <br /> ==Configure SDK options==<br /> {{Note|If you are new to Armadeus and have troubles compiling armadeus-4.0 using the following instructions, you may find some hints here: [[Armadeus 4.0 Troubleshots]]}}<br /> *Go to the directory where you put the Armadeus sources:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ cd armadeus/ (or armadeus-4.0/)<br /> &lt;/pre&gt;<br /> *The first time you compile an Armadeus distribution you have to specify the target (here the apf9328) to work with. <br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make apf9328_defconfig<br /> &lt;/pre&gt;<br /> This command reloads the default configuration to support your target and automatically start a Buildroot's configuration menu.<br /> <br /> * Current valid default configurations are:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> apf9328_defconfig apf27_defconfig pps_defconfig<br /> &lt;/pre&gt;<br /> <br /> For PPS, please see [[APF27_PPS]] for details on specific build<br /> <br /> *After some downloads, you will get the Buildroot configuration interface:<br /> <br /> {{Note|If you ever made changes in the following steps, at any time you can reload the default configuration with the same command}}<br /> <br /> [[Image:Menuconfig3.png]]&lt;br&gt;<br /> *If you are not familiar with Buildroot here are some tips:<br /> *# you can move the highlighted item with the &quot;up&quot;/&quot;down&quot; arrow keys<br /> *# with the &quot;left&quot;/&quot;right&quot; arrow keys you can choose between &quot;Select&quot;, &quot;Exit&quot; or &quot;Help&quot; buttons<br /> *# &quot;space&quot;/&quot;enter&quot;:<br /> *#* selects the currently highlighted item if you are on the &quot;Select&quot; button<br /> *#* go back in previous menu if you are on &quot;Exit&quot; button<br /> *#* show you some Help for current item if you are on &quot;Help&quot; button<br /> *# for more Help about Buildroot commands, select &quot;Help&quot; in the main configuration screen<br /> <br /> *In menu:<br /> :&lt;pre class=&quot;config&quot;&gt;Target options ---&gt; <br /> :[*] Armadeus Device Support ---&gt;&lt;/pre&gt;<br /> :you can check and change the quantity of RAM available on your Armadeus board. For [[APF27]] it could be either 64MB or 128MB (2 x 64MB) (in that case be sure to select 2 chips of 64MB instead of 1 chip of 128MB).<br /> <br /> *In menu:<br /> :&lt;pre class=&quot;config&quot;&gt;Target filesystem options --&gt; &lt;/pre&gt;<br /> :for each type of filesystems to build, you have the option (''also copy the image to...'') to copy the binary file to secondary location like your tftp server folder (for example ''/tftpboot'').&lt;br&gt;<br /> :Even U-Boot can be copied to a second location (like ''/tftpboot''). You will find the U-Boot options at the end of the list.<br /> <br /> *In menu:<br /> :&lt;pre class=&quot;config&quot;&gt;Kernel --&gt;<br /> :Destination for linux kernel binaries --&gt; &lt;/pre&gt;<br /> :you will find options to copy Linux to a secondary location (like ''/tftpboot'')<br /> <br /> * You may decrease the compilation time by increasing the number of parallel jobs running simultaneously on your system (the result is not guaranteed). This option is located in<br /> :&lt;pre class=&quot;config&quot;&gt;Build Options ---&gt;<br /> :(1) Number of jobs to run simultaneously&lt;/pre&gt;<br /> <br /> * During the toolchain/distribution automatic build, a lot of software archives are downloaded from Internet. The downloaded files are put by default in the ''armadeus/downloads/'' directory. '''If you have several views or plan to build the toolchain several times''', we advise you to put all the downloaded files in ''/local/downloads'' (for example). This is done by configuring Buildroot to use this directory for all your views. Nevertheless, buildroot will be downloaded separately for each build environment you set up.<br /> :&lt;pre class=&quot;config&quot;&gt;Build options ---&gt; <br /> :(...) Download dir&lt;/pre&gt;<br /> :[[Image:Build_config_menu_download.png]]&lt;br&gt; &lt;br&gt;<br /> :[[Image:Build_config_download.png]]<br /> '''Of course, ''/local/downloads'' should exists on your system and you should have writing rights on it !'''<br /> <br /> * After the build, we advise you too to copy all the files in ''downloads/'' on a removable medium, in case you want to install the development tools on several systems.<br /> <br /> * Now, Exit the configuration tool and save your configuration<br /> <br /> * You can come back to this configuration menu after, typing : <br /> &lt;pre class=&quot;host&quot;&gt;<br /> make menuconfig<br /> &lt;/pre&gt;<br /> <br /> ==Launch build==<br /> $ make<br /> The toolchain and the full distribution are automatically built. During this procedure, several files are downloaded from Internet. &lt;br&gt;<br /> '''Please wait for a while.... it takes at least one hour for the first run!'''&lt;br&gt;<br /> By default, the downloaded files/tarball are put in the ''armadeus/downloads/'' directory. Please see the previous chapter to know how to optimize that if you plan to build several views.<br /> <br /> ==Enjoy the result==<br /> The generated binary files can be found in the subdirectory ''buildroot/output/images'':<br /> *''apf9328-u-boot.brec'' (only on [[APF9328]]): BRecord image that can be used with the bootstrap, if U-Boot is not installed or not working (see [[BootLoader]] page)<br /> *''XX-u-boot.bin'': U-Boot image file to be used with U-Boot itself, (see [[BootLoader#Update_U-Boot | updating U-Boot]])<br /> *''XX-linux.bin'': Linux image to use with U-Boot, (see [[Target_Software_Installation#Linux_kernel_installation | updating Linux]])<br /> *''XX-rootfs.jffs2'': JFFS2 filesystem/rootfs image to use with U-Boot, (see [[Target_Software_Installation#Linux_rootfs_installation | updating rootfs]])<br /> *''XX-rootfs.ubi'' (not supported on [[APF9328]]): [[UBIFS|UBI]] filesystem/rootfs image to use with U-Boot, (see [[Target_Software_Installation#Linux_rootfs_installation | updating rootfs]])<br /> *''apfXX-rootfs.tar'': for an NFS/MMC based rootfs, (see [[Network_Configuration#Boot_from_NFS | Booting from NFS]] &amp; [[MultiMediaCard#Booting_from_MMC.2FSD | Booting from a MMC/SD]])<br /> <br /> '''Please note the new naming convention of binary files and directories (since Armadeus 4.0)'''<br /> <br /> &lt;strike&gt;<br /> The toolchain and project files share a new naming convention too (YY is ''4t'' for APF9328 and ''5te'' for APF27):<br /> *''buildroot/build_armvYY'': contains all non configurable user-space tools and staging dir.<br /> *''buildroot/project_build_armvYY/apfXX'': contains all configurable user-space tools: target filesystem, &lt;b&gt;linux&lt;/b&gt;, busybox and &lt;b&gt;u-boot&lt;/b&gt;...<br /> *''buildroot/toolchain_build_armvYY'': cross compilation toolchain's build dir. Binaries are in ''buildroot/build_armvYY/staging_dir/usr/bin''.<br /> &lt;/strike&gt;<br /> <br /> More information is available in the [http://buildroot.uclibc.org/buildroot.html buildroot documentation]<br /> <br /> * Note: Previous versions (3.x) of Armadeus SDK stored the generated binary files at a different place: '' ''buildroot/binaries/XX/'' (where XX was the name of your board).<br /> <br /> &lt;noinclude&gt;<br /> <br /> ==To keep your local copy/repository up-to-date with the armadeus GIT repository==<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ git pull<br /> &lt;/pre&gt;<br /> This will update your working directory to the latest release.<br /> <br /> Note: if &quot;git pull&quot; fails because a directory or a file already exists, then do:<br /> $ rm -rf &lt;this-directory/file&gt;<br /> $ git pull<br /> <br /> You can do a:<br /> $ make apfXX_defconfig<br /> to have the latest features automatically activated.<br /> <br /> You have to do a '''make''' to rebuild binary files and then upload the binary files to your target.<br /> <br /> Note: if definitively everything goes wrong while it worked before the last update.<br /> You can apply the following procedure (all your modifications in buildroot will be lost):<br /> $ rm -rf buildroot/<br /> $ rm Makefile<br /> $ git pull<br /> $ make apfXX_defconfig<br /> $ make<br /> <br /> Enjoy!<br /> &lt;/noinclude&gt;</div> DenisB http://www.armadeus.org/wiki/index.php?title=QEMU&diff=10002 QEMU 2011-08-31T12:52:25Z <p>DenisB: /* Launch it */ made consistent with writing rules...</p> <hr /> <div>{{Under_Construction}}<br /> <br /> Well, you don't have enough money to buy an Armadeus board and just want to be part of the &quot;Software&quot; side of the project ? Then QEMU can be a good choice for you !! &lt;br&gt;&lt;br&gt;<br /> {{Warning|<br /> Just be aware that currently Armadeus hardware is not emulated under QEMU, we are just using an other board hardware emulation (ARM Versatile) and Linux kernel to launch our rootfs and test our software which is not hardware related (ie User interface, Network, etc...)<br /> }}<br /> <br /> In order to build a hardware matching machine for Armadeus boards under Qemu, follow this link and add devices you are interested to see emulated in Qemu: <br /> [[QemuMachineDevelopment | Qemu machine development]]<br /> <br /> ==Installation==<br /> * on Debian, *Ubuntu just do a:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils vde<br /> * on Kubuntu 9.10 do:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils qemu-kvm-extras vde<br /> <br /> ==Configuration==<br /> <br /> QEMU has several ways of emulating the network:<br /> * user mode (by default): you can access Internet from your emulated target or an internal Samba/TFTP server but your are not directly accessible<br /> * bridge mode: you can communicate directly with the Host<br /> <br /> &lt;br&gt;<br /> {{Note|For a first try you can skip following part and go directly [[QEMU#Get.2Fgenerate_simulation_images_.28Linux_.26_rootfs.29|here.]]}}<br /> As we want to mimic the devt environment with a real target (that has its own IP adress and is eccesible from the host) we will use &quot;bridged mode&quot;.<br /> This mode require some configuration on your Host:<br /> * Install ''bridge_utils'' package<br /> * Activate IPv4 forwarding, for example on Ubuntu, uncomment the following line in ''/etc/sysctl.conf'':<br /> &lt;pre class=host&gt;<br /> $ sudo vim /etc/sysctl.conf<br /> <br /> # Uncomment the next line to enable packet forwarding for IPv4<br /> #net/ipv4/ip_forward=1<br /> &lt;/pre&gt;<br /> * In ''/etc/network/interface'' comment the line referring to your current Ethernet card and replace them with:<br /> <br /> auto br0<br /> iface br0 inet dhcp<br /> bridge_ports eth0<br /> bridge_fd 9<br /> bridge_hello 2<br /> bridge_maxage 12<br /> bridge_stp off <br /> <br /> #auto eth0<br /> #iface eth0 inet dhcp<br /> {{Note|If you are using a modern linux distribution like Ubuntu, also be sure NetworkManager is disabled/not configured. Otherwise conflict occur and network does not work at all.}}<br /> <br /> * Create a script ''/etc/qemu-ifup'' that will be executed upon the start of QEMU:<br /> #!/bin/sh<br /> echo &quot;Executing /etc/qemu-ifup&quot;<br /> echo &quot;Bringing up $1 for bridged mode...&quot;<br /> sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br /> echo &quot;Adding $1 to br0...&quot;<br /> sudo /usr/sbin/brctl addif br0 $1<br /> sleep 2<br /> <br /> * Now you can append the following options to the qemu command line:<br /> -net nic,vlan=0,macaddr=00:16:3e:00:00:01 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup<br /> You don't need to give a MAC address if you are emulating only one machine, as QEMU will use a default one. However if you have more than one emulated machine (don't forget QEMU can also emulate other architectures than ARM), you will have to specify a unique MAC address for each machine.<br /> <br /> * Once booted, on your guest you can configure the network simply as follows:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # udhcpc -i eth0<br /> &lt;/pre&gt;<br /> <br /> ==Get/generate simulation images (Linux &amp; rootfs)==<br /> * As QEMU doesn't support (yet) the APF, we will use the Versatile PB emulated hardware. To get a compatible Linux kernel for this board do:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ cd your_armadeus_view/<br /> $ wget ftp://ftp2.armadeus.com/armadeusw/download/qemu/vmlinuz-2.6.29.6-versatile-armadeus<br /> &lt;/pre&gt;<br /> one wanting to rebuild this image itself will find the correspondig config file in the same dir. (after compiling, take ''arch/arm/boot/zImage'')<br /> * get some useful environment variables:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make shell_env<br /> $ source armadeus_env.sh<br /> &lt;/pre&gt;<br /> * deactivate login on serial port:<br /> ** in Buildroot menuconfig:<br /> &lt;pre class=&quot;config&quot;&gt;<br /> System configuration ---&gt;<br /> () Port to run a getty (login prompt) on<br /> &lt;/pre&gt;<br /> : * and in ''$ARMADEUS_ROOTFS_DIR/etc/inittab'', comment following lines:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> # Put a getty on the serial port<br /> ttymxcX::respawn:/sbin/getty -L ttymxcX 115200 vt100 # GENERIC_SERIAL<br /> <br /> This can be achieved with sed :<br /> sed --in-place -e &quot;s/^ttymcX/#ttymcX/&quot; $ARMADEUS_ROOTFS_DIR/etc/inittab <br /> &lt;/pre&gt;<br /> * Re-generate your Armadeus rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make<br /> &lt;/pre&gt;<br /> * check the size of your rootfs image<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ ls -al $ARMADEUS_ROOTFS_TAR<br /> &lt;/pre&gt;<br /> * generate a dummy image larger than your rootfs; here 60 MBytes for a 45 MBytes tared rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ dd if=/dev/zero of=armadeus-qemu.img bs=1MB count=60<br /> $ sudo mke2fs -F -m 0 -b 1024 armadeus-qemu.img<br /> &lt;/pre&gt;<br /> * mount it and copy it your rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ mkdir qemu_mnt<br /> $ sudo mount -t ext2 -o loop armadeus-qemu.img qemu_mnt/<br /> $ sudo tar xf $ARMADEUS_ROOTFS_TAR -C qemu_mnt/<br /> $ sudo umount qemu_mnt/<br /> &lt;/pre&gt;<br /> * now you have all you need to launch Qemu<br /> <br /> ==Launch it==<br /> * Example with 64 MBytes of RAM:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ qemu-system-arm -M versatilepb -kernel ./vmlinuz-2.6.29.6-versatile-armadeus -hda armadeus-qemu.img -m 64 \<br /> -append &quot;root=/dev/sda mem=64M ro&quot; (rw for read/write works, too instead of tw two last characters ro)<br /> &lt;/pre&gt;<br /> option ''-cpu arm926'' can be added on APF27 &lt;br&gt;<br /> [[Image:qemu_apf_ramdisk.png]]<br /> <br /> * When system has booted, if you are French, load a usable keymap:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # loadkmap &lt; /etc/i18n/fr.kmap<br /> &lt;/pre&gt;<br /> &lt;pre class=&quot;host&quot;&gt;<br /> =&gt; loqdk,qp &lt; !etc!i&amp;_n!fr:k,qp on your PC keyboard<br /> &lt;/pre&gt;<br /> Another solution is to generate the command one wants to lanch on your PC, with a normal keyboard layout<br /> <br /> &lt;pre class=&quot;host&quot;&gt;<br /> $echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; kfr<br /> &lt;/pre&gt;<br /> <br /> or<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; kde<br /> <br /> chmod +x k*<br /> &lt;/pre&gt;<br /> <br /> and to copy it on the virtual image, before it is unmounted and qemu is launched<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $cp -uv k* $IMAGE/usr/local/bin/. # it will be in the guest PATH<br /> &lt;/pre&gt;<br /> <br /> Once qemu has been launched, and one is connected, just type kfr (or kde) to get a keyboard layout one is accustomed to (these letters are layout agnostic, and they can be directly executed).<br /> <br /> ==To Be Continued... ;-) ==<br /> <br /> ==Links==<br /> * [http://fabrice.bellard.free.fr/qemu/ QEMU WebPage]<br /> * [http://www.aurel32.net/info/debian_arm_qemu.php Debian on an emulated ARM machine tutorial by Aurel32] + [http://qemu-forum.ipi.fi/viewtopic.php?t=3919 comments about it]<br /> * [http://909ers.apl.washington.edu/~dushaw/ARM/ Debian ARM Linux on Qemu]<br /> * http://www.gnome.org/~markmc/qemu-networking.html<br /> * [http://compsoc.dur.ac.uk/~djw/qemu.html QEMU - Debian - Linux - TUN/TAP - network bridge]<br /> * [http://gumstix.net/wiki/index.php?title=Running_qemu Gumstix's way of using QEmu]<br /> * [http://gumstix.net/wiki/index.php?title=Making_qemu_images Gumstix's way of generating QEmu's images]<br /> * [https://wiki.ubuntu.com/ARM/RootfsFromScratch Generating Ubuntu for ARM with QEMU]<br /> * [http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/ compiling-linux-kernel-for-qemu-arm-emulator]<br /> <br /> <br /> [[Category:Emulation]]</div> DenisB http://www.armadeus.org/wiki/index.php?title=QEMU&diff=10001 QEMU 2011-08-28T15:44:32Z <p>DenisB: /* Launch it */</p> <hr /> <div>{{Under_Construction}}<br /> <br /> Well, you don't have enough money to buy an Armadeus board and just want to be part of the &quot;Software&quot; side of the project ? Then QEMU can be a good choice for you !! &lt;br&gt;&lt;br&gt;<br /> {{Warning|<br /> Just be aware that currently Armadeus hardware is not emulated under QEMU, we are just using an other board hardware emulation (ARM Versatile) and Linux kernel to launch our rootfs and test our software which is not hardware related (ie User interface, Network, etc...)<br /> }}<br /> <br /> In order to build a hardware matching machine for Armadeus boards under Qemu, follow this link and add devices you are interested to see emulated in Qemu: <br /> [[QemuMachineDevelopment | Qemu machine development]]<br /> <br /> ==Installation==<br /> * on Debian, *Ubuntu just do a:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils vde<br /> * on Kubuntu 9.10 do:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils qemu-kvm-extras vde<br /> <br /> ==Configuration==<br /> <br /> QEMU has several ways of emulating the network:<br /> * user mode (by default): you can access Internet from your emulated target or an internal Samba/TFTP server but your are not directly accessible<br /> * bridge mode: you can communicate directly with the Host<br /> <br /> &lt;br&gt;<br /> {{Note|For a first try you can skip following part and go directly [[QEMU#Get.2Fgenerate_simulation_images_.28Linux_.26_rootfs.29|here.]]}}<br /> As we want to mimic the devt environment with a real target (that has its own IP adress and is eccesible from the host) we will use &quot;bridged mode&quot;.<br /> This mode require some configuration on your Host:<br /> * Install ''bridge_utils'' package<br /> * Activate IPv4 forwarding, for example on Ubuntu, uncomment the following line in ''/etc/sysctl.conf'':<br /> &lt;pre class=host&gt;<br /> $ sudo vim /etc/sysctl.conf<br /> <br /> # Uncomment the next line to enable packet forwarding for IPv4<br /> #net/ipv4/ip_forward=1<br /> &lt;/pre&gt;<br /> * In ''/etc/network/interface'' comment the line referring to your current Ethernet card and replace them with:<br /> <br /> auto br0<br /> iface br0 inet dhcp<br /> bridge_ports eth0<br /> bridge_fd 9<br /> bridge_hello 2<br /> bridge_maxage 12<br /> bridge_stp off <br /> <br /> #auto eth0<br /> #iface eth0 inet dhcp<br /> {{Note|If you are using a modern linux distribution like Ubuntu, also be sure NetworkManager is disabled/not configured. Otherwise conflict occur and network does not work at all.}}<br /> <br /> * Create a script ''/etc/qemu-ifup'' that will be executed upon the start of QEMU:<br /> #!/bin/sh<br /> echo &quot;Executing /etc/qemu-ifup&quot;<br /> echo &quot;Bringing up $1 for bridged mode...&quot;<br /> sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br /> echo &quot;Adding $1 to br0...&quot;<br /> sudo /usr/sbin/brctl addif br0 $1<br /> sleep 2<br /> <br /> * Now you can append the following options to the qemu command line:<br /> -net nic,vlan=0,macaddr=00:16:3e:00:00:01 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup<br /> You don't need to give a MAC address if you are emulating only one machine, as QEMU will use a default one. However if you have more than one emulated machine (don't forget QEMU can also emulate other architectures than ARM), you will have to specify a unique MAC address for each machine.<br /> <br /> * Once booted, on your guest you can configure the network simply as follows:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # udhcpc -i eth0<br /> &lt;/pre&gt;<br /> <br /> ==Get/generate simulation images (Linux &amp; rootfs)==<br /> * As QEMU doesn't support (yet) the APF, we will use the Versatile PB emulated hardware. To get a compatible Linux kernel for this board do:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ cd your_armadeus_view/<br /> $ wget ftp://ftp2.armadeus.com/armadeusw/download/qemu/vmlinuz-2.6.29.6-versatile-armadeus<br /> &lt;/pre&gt;<br /> one wanting to rebuild this image itself will find the correspondig config file in the same dir. (after compiling, take ''arch/arm/boot/zImage'')<br /> * get some useful environment variables:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make shell_env<br /> $ source armadeus_env.sh<br /> &lt;/pre&gt;<br /> * deactivate login on serial port:<br /> ** in Buildroot menuconfig:<br /> &lt;pre class=&quot;config&quot;&gt;<br /> System configuration ---&gt;<br /> () Port to run a getty (login prompt) on<br /> &lt;/pre&gt;<br /> : * and in ''$ARMADEUS_ROOTFS_DIR/etc/inittab'', comment following lines:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> # Put a getty on the serial port<br /> ttymxcX::respawn:/sbin/getty -L ttymxcX 115200 vt100 # GENERIC_SERIAL<br /> <br /> This can be achieved with sed :<br /> sed --in-place -e &quot;s/^ttymcX/#ttymcX/&quot; $ARMADEUS_ROOTFS_DIR/etc/inittab <br /> &lt;/pre&gt;<br /> * Re-generate your Armadeus rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make<br /> &lt;/pre&gt;<br /> * check the size of your rootfs image<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ ls -al $ARMADEUS_ROOTFS_TAR<br /> &lt;/pre&gt;<br /> * generate a dummy image larger than your rootfs; here 60 MBytes for a 45 MBytes tared rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ dd if=/dev/zero of=armadeus-qemu.img bs=1MB count=60<br /> $ sudo mke2fs -F -m 0 -b 1024 armadeus-qemu.img<br /> &lt;/pre&gt;<br /> * mount it and copy it your rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ mkdir qemu_mnt<br /> $ sudo mount -t ext2 -o loop armadeus-qemu.img qemu_mnt/<br /> $ sudo tar xf $ARMADEUS_ROOTFS_TAR -C qemu_mnt/<br /> $ sudo umount qemu_mnt/<br /> &lt;/pre&gt;<br /> * now you have all you need to launch Qemu<br /> <br /> ==Launch it==<br /> * Example with 64 MBytes of RAM:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ qemu-system-arm -M versatilepb -kernel ./vmlinuz-2.6.29.6-versatile-armadeus -hda armadeus-qemu.img -m 64 \<br /> -append &quot;root=/dev/sda mem=64M ro&quot; (rw for read/write works, too instead of tw two last characters ro)<br /> &lt;/pre&gt;<br /> option ''-cpu arm926'' can be added on APF27 &lt;br&gt;<br /> [[Image:qemu_apf_ramdisk.png]]<br /> <br /> * When system has booted, if you are French, load a usable keymap:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # loadkmap &lt; /etc/i18n/fr.kmap<br /> &lt;/pre&gt;<br /> &lt;pre class=&quot;host&quot;&gt;<br /> =&gt; loqdk,qp &lt; !etc!i&amp;_n!fr:k,qp on your PC keyboard<br /> &lt;/pre&gt;<br /> Another solution is to generate the command one wants to lanch on your PC, with a normal keyboard layout<br /> <br /> echo &quot;loadkmap&lt;/etc/i18n/fr.kmap&quot; &gt; kfr<br /> <br /> or<br /> <br /> echo &quot;loadkmap&lt;/etc/i18n/de.kmap&quot; &gt; kde<br /> <br /> chmod +x k*<br /> <br /> and to copy it on the virtual image, before it is unmounted and qemu is launched<br /> <br /> cp -uv k* $IMAGE/usr/local/bin/. # it will be in the guest PATH<br /> <br /> Once qemu has been launched, and one is connected, just type kfr (or kde) to get a keyboard layout one is accustomed to (these letters are layout agnostic)<br /> <br /> ==To Be Continued... ;-) ==<br /> <br /> ==Links==<br /> * [http://fabrice.bellard.free.fr/qemu/ QEMU WebPage]<br /> * [http://www.aurel32.net/info/debian_arm_qemu.php Debian on an emulated ARM machine tutorial by Aurel32] + [http://qemu-forum.ipi.fi/viewtopic.php?t=3919 comments about it]<br /> * [http://909ers.apl.washington.edu/~dushaw/ARM/ Debian ARM Linux on Qemu]<br /> * http://www.gnome.org/~markmc/qemu-networking.html<br /> * [http://compsoc.dur.ac.uk/~djw/qemu.html QEMU - Debian - Linux - TUN/TAP - network bridge]<br /> * [http://gumstix.net/wiki/index.php?title=Running_qemu Gumstix's way of using QEmu]<br /> * [http://gumstix.net/wiki/index.php?title=Making_qemu_images Gumstix's way of generating QEmu's images]<br /> * [https://wiki.ubuntu.com/ARM/RootfsFromScratch Generating Ubuntu for ARM with QEMU]<br /> * [http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/ compiling-linux-kernel-for-qemu-arm-emulator]<br /> <br /> <br /> [[Category:Emulation]]</div> DenisB http://www.armadeus.org/wiki/index.php?title=QEMU&diff=10000 QEMU 2011-08-28T15:36:26Z <p>DenisB: /* Launch it */ automatically generating commands to get a french or german layout</p> <hr /> <div>{{Under_Construction}}<br /> <br /> Well, you don't have enough money to buy an Armadeus board and just want to be part of the &quot;Software&quot; side of the project ? Then QEMU can be a good choice for you !! &lt;br&gt;&lt;br&gt;<br /> {{Warning|<br /> Just be aware that currently Armadeus hardware is not emulated under QEMU, we are just using an other board hardware emulation (ARM Versatile) and Linux kernel to launch our rootfs and test our software which is not hardware related (ie User interface, Network, etc...)<br /> }}<br /> <br /> In order to build a hardware matching machine for Armadeus boards under Qemu, follow this link and add devices you are interested to see emulated in Qemu: <br /> [[QemuMachineDevelopment | Qemu machine development]]<br /> <br /> ==Installation==<br /> * on Debian, *Ubuntu just do a:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils vde<br /> * on Kubuntu 9.10 do:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils qemu-kvm-extras vde<br /> <br /> ==Configuration==<br /> <br /> QEMU has several ways of emulating the network:<br /> * user mode (by default): you can access Internet from your emulated target or an internal Samba/TFTP server but your are not directly accessible<br /> * bridge mode: you can communicate directly with the Host<br /> <br /> &lt;br&gt;<br /> {{Note|For a first try you can skip following part and go directly [[QEMU#Get.2Fgenerate_simulation_images_.28Linux_.26_rootfs.29|here.]]}}<br /> As we want to mimic the devt environment with a real target (that has its own IP adress and is eccesible from the host) we will use &quot;bridged mode&quot;.<br /> This mode require some configuration on your Host:<br /> * Install ''bridge_utils'' package<br /> * Activate IPv4 forwarding, for example on Ubuntu, uncomment the following line in ''/etc/sysctl.conf'':<br /> &lt;pre class=host&gt;<br /> $ sudo vim /etc/sysctl.conf<br /> <br /> # Uncomment the next line to enable packet forwarding for IPv4<br /> #net/ipv4/ip_forward=1<br /> &lt;/pre&gt;<br /> * In ''/etc/network/interface'' comment the line referring to your current Ethernet card and replace them with:<br /> <br /> auto br0<br /> iface br0 inet dhcp<br /> bridge_ports eth0<br /> bridge_fd 9<br /> bridge_hello 2<br /> bridge_maxage 12<br /> bridge_stp off <br /> <br /> #auto eth0<br /> #iface eth0 inet dhcp<br /> {{Note|If you are using a modern linux distribution like Ubuntu, also be sure NetworkManager is disabled/not configured. Otherwise conflict occur and network does not work at all.}}<br /> <br /> * Create a script ''/etc/qemu-ifup'' that will be executed upon the start of QEMU:<br /> #!/bin/sh<br /> echo &quot;Executing /etc/qemu-ifup&quot;<br /> echo &quot;Bringing up $1 for bridged mode...&quot;<br /> sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br /> echo &quot;Adding $1 to br0...&quot;<br /> sudo /usr/sbin/brctl addif br0 $1<br /> sleep 2<br /> <br /> * Now you can append the following options to the qemu command line:<br /> -net nic,vlan=0,macaddr=00:16:3e:00:00:01 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup<br /> You don't need to give a MAC address if you are emulating only one machine, as QEMU will use a default one. However if you have more than one emulated machine (don't forget QEMU can also emulate other architectures than ARM), you will have to specify a unique MAC address for each machine.<br /> <br /> * Once booted, on your guest you can configure the network simply as follows:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # udhcpc -i eth0<br /> &lt;/pre&gt;<br /> <br /> ==Get/generate simulation images (Linux &amp; rootfs)==<br /> * As QEMU doesn't support (yet) the APF, we will use the Versatile PB emulated hardware. To get a compatible Linux kernel for this board do:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ cd your_armadeus_view/<br /> $ wget ftp://ftp2.armadeus.com/armadeusw/download/qemu/vmlinuz-2.6.29.6-versatile-armadeus<br /> &lt;/pre&gt;<br /> one wanting to rebuild this image itself will find the correspondig config file in the same dir. (after compiling, take ''arch/arm/boot/zImage'')<br /> * get some useful environment variables:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make shell_env<br /> $ source armadeus_env.sh<br /> &lt;/pre&gt;<br /> * deactivate login on serial port:<br /> ** in Buildroot menuconfig:<br /> &lt;pre class=&quot;config&quot;&gt;<br /> System configuration ---&gt;<br /> () Port to run a getty (login prompt) on<br /> &lt;/pre&gt;<br /> : * and in ''$ARMADEUS_ROOTFS_DIR/etc/inittab'', comment following lines:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> # Put a getty on the serial port<br /> ttymxcX::respawn:/sbin/getty -L ttymxcX 115200 vt100 # GENERIC_SERIAL<br /> <br /> This can be achieved with sed :<br /> sed --in-place -e &quot;s/^ttymcX/#ttymcX/&quot; $ARMADEUS_ROOTFS_DIR/etc/inittab <br /> &lt;/pre&gt;<br /> * Re-generate your Armadeus rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make<br /> &lt;/pre&gt;<br /> * check the size of your rootfs image<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ ls -al $ARMADEUS_ROOTFS_TAR<br /> &lt;/pre&gt;<br /> * generate a dummy image larger than your rootfs; here 60 MBytes for a 45 MBytes tared rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ dd if=/dev/zero of=armadeus-qemu.img bs=1MB count=60<br /> $ sudo mke2fs -F -m 0 -b 1024 armadeus-qemu.img<br /> &lt;/pre&gt;<br /> * mount it and copy it your rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ mkdir qemu_mnt<br /> $ sudo mount -t ext2 -o loop armadeus-qemu.img qemu_mnt/<br /> $ sudo tar xf $ARMADEUS_ROOTFS_TAR -C qemu_mnt/<br /> $ sudo umount qemu_mnt/<br /> &lt;/pre&gt;<br /> * now you have all you need to launch Qemu<br /> <br /> ==Launch it==<br /> * Example with 64 MBytes of RAM:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ qemu-system-arm -M versatilepb -kernel ./vmlinuz-2.6.29.6-versatile-armadeus -hda armadeus-qemu.img -m 64 \<br /> -append &quot;root=/dev/sda mem=64M ro&quot; (rw for read/write works, too instead of tw two last characters ro)<br /> &lt;/pre&gt;<br /> option ''-cpu arm926'' can be added on APF27 &lt;br&gt;<br /> [[Image:qemu_apf_ramdisk.png]]<br /> <br /> * When system has booted, if you are French, load a usable keymap:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # loadkmap &lt; /etc/i18n/fr.kmap<br /> &lt;/pre&gt;<br /> &lt;pre class=&quot;host&quot;&gt;<br /> =&gt; loqdk,qp &lt; !etc!i&amp;_n!fr:k,qp on your PC keyboard<br /> &lt;/pre&gt;<br /> Another solution is to generate the command one wants to lanch on your PC, with a normal keyboard layout<br /> <br /> echo &quot;loadkeymap&lt;/etc/i18n/fr.kmap&quot; &gt; kfr<br /> <br /> or<br /> <br /> echo &quot;loadkeymap&lt;/etc/i18n/de.kmap&quot; &gt; kde<br /> <br /> chmod +x k*<br /> <br /> and to copy it on the virtual image, before it is unmounted and qemu is launched<br /> <br /> cp -uv k* $IMAGE/usr/local/bin/.<br /> <br /> Once qemu has been launched, and one is connected, just type kfr (or kde) to get a keyboard layout one is accustomed to (these letters are layout agnostic)<br /> <br /> ==To Be Continued... ;-) ==<br /> <br /> ==Links==<br /> * [http://fabrice.bellard.free.fr/qemu/ QEMU WebPage]<br /> * [http://www.aurel32.net/info/debian_arm_qemu.php Debian on an emulated ARM machine tutorial by Aurel32] + [http://qemu-forum.ipi.fi/viewtopic.php?t=3919 comments about it]<br /> * [http://909ers.apl.washington.edu/~dushaw/ARM/ Debian ARM Linux on Qemu]<br /> * http://www.gnome.org/~markmc/qemu-networking.html<br /> * [http://compsoc.dur.ac.uk/~djw/qemu.html QEMU - Debian - Linux - TUN/TAP - network bridge]<br /> * [http://gumstix.net/wiki/index.php?title=Running_qemu Gumstix's way of using QEmu]<br /> * [http://gumstix.net/wiki/index.php?title=Making_qemu_images Gumstix's way of generating QEmu's images]<br /> * [https://wiki.ubuntu.com/ARM/RootfsFromScratch Generating Ubuntu for ARM with QEMU]<br /> * [http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/ compiling-linux-kernel-for-qemu-arm-emulator]<br /> <br /> <br /> [[Category:Emulation]]</div> DenisB http://www.armadeus.org/wiki/index.php?title=QEMU&diff=9999 QEMU 2011-08-28T15:26:59Z <p>DenisB: /* Get/generate simulation images (Linux &amp; rootfs) */ : automatically remove serail getty</p> <hr /> <div>{{Under_Construction}}<br /> <br /> Well, you don't have enough money to buy an Armadeus board and just want to be part of the &quot;Software&quot; side of the project ? Then QEMU can be a good choice for you !! &lt;br&gt;&lt;br&gt;<br /> {{Warning|<br /> Just be aware that currently Armadeus hardware is not emulated under QEMU, we are just using an other board hardware emulation (ARM Versatile) and Linux kernel to launch our rootfs and test our software which is not hardware related (ie User interface, Network, etc...)<br /> }}<br /> <br /> In order to build a hardware matching machine for Armadeus boards under Qemu, follow this link and add devices you are interested to see emulated in Qemu: <br /> [[QemuMachineDevelopment | Qemu machine development]]<br /> <br /> ==Installation==<br /> * on Debian, *Ubuntu just do a:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils vde<br /> * on Kubuntu 9.10 do:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils qemu-kvm-extras vde<br /> <br /> ==Configuration==<br /> <br /> QEMU has several ways of emulating the network:<br /> * user mode (by default): you can access Internet from your emulated target or an internal Samba/TFTP server but your are not directly accessible<br /> * bridge mode: you can communicate directly with the Host<br /> <br /> &lt;br&gt;<br /> {{Note|For a first try you can skip following part and go directly [[QEMU#Get.2Fgenerate_simulation_images_.28Linux_.26_rootfs.29|here.]]}}<br /> As we want to mimic the devt environment with a real target (that has its own IP adress and is eccesible from the host) we will use &quot;bridged mode&quot;.<br /> This mode require some configuration on your Host:<br /> * Install ''bridge_utils'' package<br /> * Activate IPv4 forwarding, for example on Ubuntu, uncomment the following line in ''/etc/sysctl.conf'':<br /> &lt;pre class=host&gt;<br /> $ sudo vim /etc/sysctl.conf<br /> <br /> # Uncomment the next line to enable packet forwarding for IPv4<br /> #net/ipv4/ip_forward=1<br /> &lt;/pre&gt;<br /> * In ''/etc/network/interface'' comment the line referring to your current Ethernet card and replace them with:<br /> <br /> auto br0<br /> iface br0 inet dhcp<br /> bridge_ports eth0<br /> bridge_fd 9<br /> bridge_hello 2<br /> bridge_maxage 12<br /> bridge_stp off <br /> <br /> #auto eth0<br /> #iface eth0 inet dhcp<br /> {{Note|If you are using a modern linux distribution like Ubuntu, also be sure NetworkManager is disabled/not configured. Otherwise conflict occur and network does not work at all.}}<br /> <br /> * Create a script ''/etc/qemu-ifup'' that will be executed upon the start of QEMU:<br /> #!/bin/sh<br /> echo &quot;Executing /etc/qemu-ifup&quot;<br /> echo &quot;Bringing up $1 for bridged mode...&quot;<br /> sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br /> echo &quot;Adding $1 to br0...&quot;<br /> sudo /usr/sbin/brctl addif br0 $1<br /> sleep 2<br /> <br /> * Now you can append the following options to the qemu command line:<br /> -net nic,vlan=0,macaddr=00:16:3e:00:00:01 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup<br /> You don't need to give a MAC address if you are emulating only one machine, as QEMU will use a default one. However if you have more than one emulated machine (don't forget QEMU can also emulate other architectures than ARM), you will have to specify a unique MAC address for each machine.<br /> <br /> * Once booted, on your guest you can configure the network simply as follows:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # udhcpc -i eth0<br /> &lt;/pre&gt;<br /> <br /> ==Get/generate simulation images (Linux &amp; rootfs)==<br /> * As QEMU doesn't support (yet) the APF, we will use the Versatile PB emulated hardware. To get a compatible Linux kernel for this board do:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ cd your_armadeus_view/<br /> $ wget ftp://ftp2.armadeus.com/armadeusw/download/qemu/vmlinuz-2.6.29.6-versatile-armadeus<br /> &lt;/pre&gt;<br /> one wanting to rebuild this image itself will find the correspondig config file in the same dir. (after compiling, take ''arch/arm/boot/zImage'')<br /> * get some useful environment variables:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make shell_env<br /> $ source armadeus_env.sh<br /> &lt;/pre&gt;<br /> * deactivate login on serial port:<br /> ** in Buildroot menuconfig:<br /> &lt;pre class=&quot;config&quot;&gt;<br /> System configuration ---&gt;<br /> () Port to run a getty (login prompt) on<br /> &lt;/pre&gt;<br /> : * and in ''$ARMADEUS_ROOTFS_DIR/etc/inittab'', comment following lines:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> # Put a getty on the serial port<br /> ttymxcX::respawn:/sbin/getty -L ttymxcX 115200 vt100 # GENERIC_SERIAL<br /> <br /> This can be achieved with sed :<br /> sed --in-place -e &quot;s/^ttymcX/#ttymcX/&quot; $ARMADEUS_ROOTFS_DIR/etc/inittab <br /> &lt;/pre&gt;<br /> * Re-generate your Armadeus rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make<br /> &lt;/pre&gt;<br /> * check the size of your rootfs image<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ ls -al $ARMADEUS_ROOTFS_TAR<br /> &lt;/pre&gt;<br /> * generate a dummy image larger than your rootfs; here 60 MBytes for a 45 MBytes tared rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ dd if=/dev/zero of=armadeus-qemu.img bs=1MB count=60<br /> $ sudo mke2fs -F -m 0 -b 1024 armadeus-qemu.img<br /> &lt;/pre&gt;<br /> * mount it and copy it your rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ mkdir qemu_mnt<br /> $ sudo mount -t ext2 -o loop armadeus-qemu.img qemu_mnt/<br /> $ sudo tar xf $ARMADEUS_ROOTFS_TAR -C qemu_mnt/<br /> $ sudo umount qemu_mnt/<br /> &lt;/pre&gt;<br /> * now you have all you need to launch Qemu<br /> <br /> ==Launch it==<br /> * Example with 64 MBytes of RAM:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ qemu-system-arm -M versatilepb -kernel ./vmlinuz-2.6.29.6-versatile-armadeus -hda armadeus-qemu.img -m 64 \<br /> -append &quot;root=/dev/sda mem=64M ro&quot; (rw for read/write works, too instead of tw two last characters ro)<br /> &lt;/pre&gt;<br /> option ''-cpu arm926'' can be added on APF27 &lt;br&gt;<br /> [[Image:qemu_apf_ramdisk.png]]<br /> <br /> * When system has booted, if you are French, load a usable keymap:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # loadkmap &lt; /etc/i18n/fr.kmap<br /> &lt;/pre&gt;<br /> &lt;pre class=&quot;host&quot;&gt;<br /> =&gt; loqdk,qp &lt; !etc!i&amp;_n!fr:k,qp on your PC keyboard<br /> &lt;/pre&gt;<br /> <br /> ==To Be Continued... ;-) ==<br /> <br /> ==Links==<br /> * [http://fabrice.bellard.free.fr/qemu/ QEMU WebPage]<br /> * [http://www.aurel32.net/info/debian_arm_qemu.php Debian on an emulated ARM machine tutorial by Aurel32] + [http://qemu-forum.ipi.fi/viewtopic.php?t=3919 comments about it]<br /> * [http://909ers.apl.washington.edu/~dushaw/ARM/ Debian ARM Linux on Qemu]<br /> * http://www.gnome.org/~markmc/qemu-networking.html<br /> * [http://compsoc.dur.ac.uk/~djw/qemu.html QEMU - Debian - Linux - TUN/TAP - network bridge]<br /> * [http://gumstix.net/wiki/index.php?title=Running_qemu Gumstix's way of using QEmu]<br /> * [http://gumstix.net/wiki/index.php?title=Making_qemu_images Gumstix's way of generating QEmu's images]<br /> * [https://wiki.ubuntu.com/ARM/RootfsFromScratch Generating Ubuntu for ARM with QEMU]<br /> * [http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/ compiling-linux-kernel-for-qemu-arm-emulator]<br /> <br /> <br /> [[Category:Emulation]]</div> DenisB http://www.armadeus.org/wiki/index.php?title=QEMU&diff=9991 QEMU 2011-08-19T14:22:40Z <p>DenisB: /* Launch it */ I tested it with rw, it could write on the disk; the result could be displayed with remounting the armadeus image under the native (x86) system</p> <hr /> <div>{{Under_Construction}}<br /> <br /> Well, you don't have enough money to buy an Armadeus board and just want to be part of the &quot;Software&quot; side of the project ? Then QEMU can be a good choice for you !! &lt;br&gt;&lt;br&gt;<br /> {{Warning|<br /> Just be aware that currently Armadeus hardware is not emulated under QEMU, we are just using an other board hardware emulation (ARM Versatile) and Linux kernel to launch our rootfs and test our software which is not hardware related (ie User interface, Network, etc...)<br /> }}<br /> <br /> In order to build a hardware matching machine for Armadeus boards under Qemu, follow this link and add devices you are interested to see emulated in Qemu: <br /> [[QemuMachineDevelopment | Qemu machine development]]<br /> <br /> ==Installation==<br /> * on Debian, *Ubuntu just do a:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils vde<br /> * on Kubuntu 9.10 do:<br /> [armadeus]$ sudo apt-get install qemu bridge-utils qemu-kvm-extras vde<br /> <br /> ==Configuration==<br /> <br /> QEMU has several ways of emulating the network:<br /> * user mode (by default): you can access Internet from your emulated target or an internal Samba/TFTP server but your are not directly accessible<br /> * bridge mode: you can communicate directly with the Host<br /> <br /> &lt;br&gt;<br /> {{Note|For a first try you can skip following part and go directly [[QEMU#Get.2Fgenerate_simulation_images_.28Linux_.26_rootfs.29|here.]]}}<br /> As we want to mimic the devt environment with a real target (that has its own IP adress and is eccesible from the host) we will use &quot;bridged mode&quot;.<br /> This mode require some configuration on your Host:<br /> * Install ''bridge_utils'' package<br /> * Activate IPv4 forwarding, for example on Ubuntu, uncomment the following line in ''/etc/sysctl.conf'':<br /> &lt;pre class=host&gt;<br /> $ sudo vim /etc/sysctl.conf<br /> <br /> # Uncomment the next line to enable packet forwarding for IPv4<br /> #net/ipv4/ip_forward=1<br /> &lt;/pre&gt;<br /> * In ''/etc/network/interface'' comment the line referring to your current Ethernet card and replace them with:<br /> <br /> auto br0<br /> iface br0 inet dhcp<br /> bridge_ports eth0<br /> bridge_fd 9<br /> bridge_hello 2<br /> bridge_maxage 12<br /> bridge_stp off <br /> <br /> #auto eth0<br /> #iface eth0 inet dhcp<br /> {{Note|If you are using a modern linux distribution like Ubuntu, also be sure NetworkManager is disabled/not configured. Otherwise conflict occur and network does not work at all.}}<br /> <br /> * Create a script ''/etc/qemu-ifup'' that will be executed upon the start of QEMU:<br /> #!/bin/sh<br /> echo &quot;Executing /etc/qemu-ifup&quot;<br /> echo &quot;Bringing up $1 for bridged mode...&quot;<br /> sudo /sbin/ifconfig $1 0.0.0.0 promisc up<br /> echo &quot;Adding $1 to br0...&quot;<br /> sudo /usr/sbin/brctl addif br0 $1<br /> sleep 2<br /> <br /> * Now you can append the following options to the qemu command line:<br /> -net nic,vlan=0,macaddr=00:16:3e:00:00:01 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup<br /> You don't need to give a MAC address if you are emulating only one machine, as QEMU will use a default one. However if you have more than one emulated machine (don't forget QEMU can also emulate other architectures than ARM), you will have to specify a unique MAC address for each machine.<br /> <br /> * Once booted, on your guest you can configure the network simply as follows:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # udhcpc -i eth0<br /> &lt;/pre&gt;<br /> <br /> ==Get/generate simulation images (Linux &amp; rootfs)==<br /> * As QEMU doesn't support (yet) the APF, we will use the Versatile PB emulated hardware. To get a compatible Linux kernel for this board do:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ cd your_armadeus_view/<br /> $ wget ftp://ftp2.armadeus.com/armadeusw/download/qemu/vmlinuz-2.6.29.6-versatile-armadeus<br /> &lt;/pre&gt;<br /> one wanting to rebuild this image itself will find the correspondig config file in the same dir. (after compiling, take ''arch/arm/boot/zImage'')<br /> * get some useful environment variables:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make shell_env<br /> $ source armadeus_env.sh<br /> &lt;/pre&gt;<br /> * deactivate login on serial port:<br /> ** in Buildroot menuconfig:<br /> &lt;pre class=&quot;config&quot;&gt;<br /> System configuration ---&gt;<br /> () Port to run a getty (login prompt) on<br /> &lt;/pre&gt;<br /> : * and in ''$ARMADEUS_ROOTFS_DIR/etc/inittab'', comment following lines:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> # Put a getty on the serial port<br /> ttymxcX::respawn:/sbin/getty -L ttymxcX 115200 vt100 # GENERIC_SERIAL<br /> &lt;/pre&gt;<br /> * Re-generate your Armadeus rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ make<br /> &lt;/pre&gt;<br /> * check the size of your rootfs image<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ ls -al $ARMADEUS_ROOTFS_TAR<br /> &lt;/pre&gt;<br /> * generate a dummy image larger than your rootfs; here 60 MBytes for a 45 MBytes tared rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ dd if=/dev/zero of=armadeus-qemu.img bs=1MB count=60<br /> $ sudo mke2fs -F -m 0 -b 1024 armadeus-qemu.img<br /> &lt;/pre&gt;<br /> * mount it and copy it your rootfs:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ mkdir qemu_mnt<br /> $ sudo mount -t ext2 -o loop armadeus-qemu.img qemu_mnt/<br /> $ sudo tar xf $ARMADEUS_ROOTFS_TAR -C qemu_mnt/<br /> $ sudo umount qemu_mnt/<br /> &lt;/pre&gt;<br /> * now you have all you need to launch Qemu<br /> <br /> ==Launch it==<br /> * Example with 64 MBytes of RAM:<br /> &lt;pre class=&quot;host&quot;&gt;<br /> $ qemu-system-arm -M versatilepb -kernel ./vmlinuz-2.6.29.6-versatile-armadeus -hda armadeus-qemu.img -m 64 \<br /> -append &quot;root=/dev/sda mem=64M ro&quot; (rw for read/write works, too instead of tw two last characters ro)<br /> &lt;/pre&gt;<br /> option ''-cpu arm926'' can be added on APF27 &lt;br&gt;<br /> [[Image:qemu_apf_ramdisk.png]]<br /> <br /> * When system has booted, if you are French, load a usable keymap:<br /> &lt;pre class=&quot;apf&quot;&gt;<br /> # loadkmap &lt; /etc/i18n/fr.kmap<br /> &lt;/pre&gt;<br /> &lt;pre class=&quot;host&quot;&gt;<br /> =&gt; loqdk,qp &lt; !etc!i&amp;_n!fr:k,qp on your PC keyboard<br /> &lt;/pre&gt;<br /> <br /> ==To Be Continued... ;-) ==<br /> <br /> ==Links==<br /> * [http://fabrice.bellard.free.fr/qemu/ QEMU WebPage]<br /> * [http://www.aurel32.net/info/debian_arm_qemu.php Debian on an emulated ARM machine tutorial by Aurel32] + [http://qemu-forum.ipi.fi/viewtopic.php?t=3919 comments about it]<br /> * [http://909ers.apl.washington.edu/~dushaw/ARM/ Debian ARM Linux on Qemu]<br /> * http://www.gnome.org/~markmc/qemu-networking.html<br /> * [http://compsoc.dur.ac.uk/~djw/qemu.html QEMU - Debian - Linux - TUN/TAP - network bridge]<br /> * [http://gumstix.net/wiki/index.php?title=Running_qemu Gumstix's way of using QEmu]<br /> * [http://gumstix.net/wiki/index.php?title=Making_qemu_images Gumstix's way of generating QEmu's images]<br /> * [https://wiki.ubuntu.com/ARM/RootfsFromScratch Generating Ubuntu for ARM with QEMU]<br /> * [http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/ compiling-linux-kernel-for-qemu-arm-emulator]<br /> <br /> <br /> [[Category:Emulation]]</div> DenisB http://www.armadeus.org/wiki/index.php?title=MTF-T035&diff=2745 MTF-T035 2007-09-02T14:55:13Z <p>DenisB: /* LCD orders */</p> <hr /> <div>== TFT Specifications ==<br /> The MTF-T035 320x240 3.5&quot; color TFT display from Microtips is the default TFT display supported.<br /> Two pin compatible versions of this LCD are available: one with touchscreen (analog outputs) and one without.<br /> The MTF-T035 is provided with a 4 white led backlight.<br /> <br /> The specification can be found here:<br /> [http://www.microtipsusa.com/product_pdfs/Color%20TFT/MTF-T035DHSLP-A%20(24BIT,%20parallel,%20external%20BL%20control,%20anti-glare,%20TP).pdf]<br /> <br /> Some photos are although available here:<br /> [[Board Pictures]]<br /> <br /> == Adapter Board ==<br /> [[Image:MTF_035_Adapt.jpg|center]]<br /> <br /> This kind of LCD requires an adapter board. <br /> The small board generates the required bias voltages, integrates a white led driver and provides a standard 2.54 connector interface. <br /> It has to be noted that only a 3.3V supply is required.<br /> <br /> The &lt;strong&gt;specification&lt;/strong&gt; can be found here:<br /> [http://www.armadeus.com/downloads/lcd_adapt_MTFT035/datasheet.pdf]<br /> <br /> The &lt;strong&gt;schematics&lt;/strong&gt; can be found here:<br /> [http://www.armadeus.com/downloads/lcd_adapt_MTFT035/schematics.pdf]<br /> <br /> The &lt;strong&gt;assembly drawings&lt;/strong&gt; can be found here:<br /> [http://www.armadeus.com/downloads/lcd_adapt_MTFT035/assembly.pdf]<br /> <br /> Note that the pin 1 of the connectors are although written in the top layer copper.<br /> <br /> ==Connecting the LCD to the adapter board==<br /> {|border=0 summary=&quot;Connecting the LCD&quot;<br /> |----------------<br /> | [[Image:LCD_Adapt_align.jpg|thumb|left|Open connector, plug &amp; align LCD Flex pin 1 and PCB pin 1]] || [[Image:LCD_Adapt_closed.jpg|thumb|Close connector]]<br /> |----------------<br /> |}<br /> <br /> == Connections with the DevLight ==<br /> Just connect signals with same names together. &lt;strong&gt;Use the shortest wires you can !&lt;/strong&gt;<br /> <br /> The DevLight schematics and specification may be usefull:<br /> [http://www.armadeus.com/products_APF9328DevLight.html]<br /> <br /> Once done verify the connections by means of your multimeter. <br /> &lt;strong&gt;Do not forget to check the 3.3V supply polarity on the LCD_adapt board before to power up the system !&lt;/strong&gt;<br /> <br /> == Troubleshooting ==<br /> If your LCD shows too much White then set the potar on the LCD_Adapt to the minimum value.<br /> [[Image:LCD_Adapt_potar.jpg|thumb|center]]<br /> <br /> == LCD orders ==<br /> Please add your name and the LCD type you want to the list below. <br /> The LCD_Adapter boards have been received and are working so far so good.<br /> '''15 TFT pcs arrived !!!'''<br /> <br /> *Rachid Koucha: 1x LCD_Touchscreen '''-&gt;en attente de confirmation'''<br /> *ThomasB: 1x LCD_touchscreen '''-&gt;confirmé'''<br /> *Sonzerro: 1x LCD_Touchscreen '''-&gt;livré'''<br /> *Olivier Coutanceau: 1x LCD_Touchscreen '''-&gt;confirmé'''<br /> *Arnaud Coffinet : 1x LCD_Touchscreen '''-&gt;livré'''<br /> *Henri Geist : 1x LCD_Touchscreen '''-&gt;livré'''<br /> *JulienB: 1x LCD_Touchscreen '''-&gt;confirmé'''<br /> *JeanMichelN: 1x LCD_Touchscreen '''-&gt;livré'''<br /> *FabienG: 1x LCD_Touchscreen '''-&gt;confirmé'''<br /> *Nicolas Aguirre: 1x LCD_Touchscreen '''-&gt;en attente de confirmation'''<br /> *Cédric Pineau: 1x LCD_Touchscreen '''-&gt;en attente de confirmation'''<br /> *KarlB: 1x LCD_touchscreen '''-&gt;livré'''<br /> *ChristopheF: 1x LCD_touchscreen '''-&gt;en attente de confirmation'''<br /> *Reserved : 1x LCD_touchscreen<br /> *Reference board : 1x LCD_touchscreen<br /> <br /> <br /> Second list for next order<br /> *MichelT : 1x LCD_touchscreen <br /> *Stephane Falck : 1x LCD_touchscreen<br /> *Julien Nicolas : 1x LCD_touchscreen<br /> *Mickael Toumi : 1x LCD_touchscreen (attente adhésion)<br /> *Denis Brion : 1x LCD_touchscreen<br /> <br /> ==Linux drivers==<br /> * [[FrameBuffer | How to activate FrameBuffer driver]]<br /> * [[BackLight | How to use Backlight control interface]]<br /> <br /> ==Screenshots==<br /> [[Image:MTF-T035_jim.jpg|thumb|left|SNES emulator running on the LCD]]<br /> [[Image:MTF-T035_street.jpg|thumb|center|SNES emulator running on the LCD]]</div> DenisB