{"id":533,"date":"2011-04-22T15:00:23","date_gmt":"2011-04-22T14:00:23","guid":{"rendered":"http:\/\/www.blaess.fr\/christophe\/?p=533"},"modified":"2013-12-04T14:57:03","modified_gmt":"2013-12-04T13:57:03","slug":"nouveau-patch-linux-preempt-rt-2-6-33-9-rt31","status":"publish","type":"post","link":"https:\/\/www.blaess.fr\/christophe\/2011\/04\/22\/nouveau-patch-linux-preempt-rt-2-6-33-9-rt31\/","title":{"rendered":"[ACTU] Nouveau Patch Linux Preempt-RT 2.6.33.9-rt31"},"content":{"rendered":"<p style=\"text-align: justify;\">Le 11 avril dernier Thomas Gleixner a publi\u00e9 un <a title=\"patch-2.6.33.9-rt31\" href=\"http:\/\/www.kernel.org\/pub\/linux\/kernel\/projects\/rt\/patch-2.6.33.9-rt31.bz2\" target=\"_blank\">nouveau patch<\/a> pour le projet Linux Preempt RT.\u00a0Celui-ci s&rsquo;applique sur les noyaux de la branche long terme 2.6.33 (<a title=\"linux-2.6.33.9.tar.bz2\" href=\"http:\/\/www.kernel.org\/pub\/linux\/kernel\/v2.6\/longterm\/v2.6.33\/linux-2.6.33.9.tar.bz2\" target=\"_blank\">linux 2.6.33.9<\/a> en particulier). Ce patch impl\u00e9mente des am\u00e9liorations par rapport au pr\u00e9c\u00e9dent, sans ajouter de v\u00e9ritables nouveaut\u00e9s. Il peut toutefois \u00eatre int\u00e9ressant de le mettre en \u0153uvre et de le tester pour v\u00e9rifier si les performances temps-r\u00e9el d&rsquo;un syst\u00e8me sont am\u00e9lior\u00e9es.<\/p>\n<p>\n<!--more-->\n<\/p>\n<p style=\"text-align: justify;\">Voici un exemple de mise en service sur une carte Igep v2.<\/p>\n<h2>1 &#8211; T\u00e9l\u00e9chargement du nouveau patch Linux-Preempt-RT<\/h2>\n<p>[EDIT] Attention&nbsp;! l&rsquo;adresse du patch a chang\u00e9 depuis la r\u00e9daction de cet article, voir le commentaire de Thierry Gayet ci-dessous.<\/p>\n<p>&nbsp;<\/p>\n<pre># <strong>cd ~\/tmp\/<\/strong>\n# <strong>wget http:\/\/www.kernel.org\/pub\/linux\/kernel\/projects\/rt\/patch-2.6.33.9-rt31.bz2<\/strong>\n --2011-04-16 00:17:17--  http:\/\/www.kernel.org\/pub\/linux\/kernel\/projects\/rt\/patch-2.6.33.9-rt31.bz2\nResolving www.kernel.org... 199.6.1.164, 130.239.17.4\nConnecting to www.kernel.org|199.6.1.164|:80... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 275667 (269K) [application\/x-bzip2] Saving to: \u201cpatch-2.6.33.9-rt31.bz2\u201d  100%\n[===============================================================================&gt;] 275,667      761K\/s   in 0.4s\n2011-04-16 00:17:18 (761 KB\/s) - \u201cpatch-2.6.33.9-rt31.bz2\u201d saved [275667\/275667]\n#<\/pre>\n<h2>2 &#8211; T\u00e9l\u00e9chargement du noyau Linux 2.6.33.9<\/h2>\n<pre># <strong>wget http:\/\/www.kernel.org\/pub\/linux\/kernel\/v2.6\/longterm\/v2.6.33\/linux-2.6.33.9.tar.bz2<\/strong>\n--2011-04-16 00:32:10--  http:\/\/www.kernel.org\/pub\/linux\/kernel\/v2.6\/longterm\/v2.6.33\/linux-2.6.33.9.tar.bz2\nResolving www.kernel.org... 199.6.1.164, 130.239.17.4\nConnecting to www.kernel.org|199.6.1.164|:80... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 66226244 (63M) [application\/x-bzip2]\nSaving to: \u201clinux-2.6.33.9.tar.bz2\u201d\n100%[=========================================================================&gt;] 66,226,244  1.58M\/s   in 40s\n2011-04-16 00:32:50 (1.58 MB\/s) - \u201clinux-2.6.33.9.tar.bz2\u201d saved [66226244\/66226244]\n#<\/pre>\n<h2>3 &#8211; D\u00e9compression des sources de Linux et du patch<\/h2>\n<pre># <strong>tar xjf linux-2.6.33.9.tar.bz2<\/strong>\n# <strong>bunzip2 patch-2.6.33.9-rt31.bz2<\/strong>\n#<\/pre>\n<h2>4 &#8211; Application du patch Preempt-RT<\/h2>\n<pre># <strong>cd linux-2.6.33.9<\/strong>\n# <strong>patch -p1 &lt; ..\/patch-2.6.33.9-rt31 <\/strong>\npatching file Documentation\/hwlat_detector.txt\npatching file Documentation\/trace\/histograms.txt\npatching file MAINTAINERS\npatching file Makefile\n[...]\npatching file sound\/drivers\/pcsp\/pcsp.h\npatching file sound\/drivers\/pcsp\/pcsp_input.c\npatching file sound\/drivers\/pcsp\/pcsp_lib.c\npatching file virt\/kvm\/kvm_main.c\n#<\/pre>\n<h2>5 &#8211; Compilation du noyau<\/h2>\n<p style=\"text-align: justify;\">Nous utilisons un fichier de configuration pour la carte Igep v2 d\u00e9j\u00e0 pr\u00e9par\u00e9 avec une version ant\u00e9rieure.<\/p>\n<pre># <strong>cp ..\/config-linux-2.6.33-rt  .\/.config<\/strong>\n# <strong>make ARCH=arm menuconfig<\/strong><\/pre>\n<p style=\"text-align: justify;\">On v\u00e9rifie que la configuration semble correcte. En particulier l&rsquo;option \u00ab\u00a0<em>Preemption Mode<\/em>\u00a0\u00bb du menu \u00ab\u00a0<em>Kernel Features<\/em>\u00ab\u00a0, qui doit \u00eatre configur\u00e9e avec la valeur \u00ab\u00a0<em>Complete Preemption (Real-time)<\/em>\u00ab\u00a0. Nous quittons en sauvant la configuration et lan\u00e7ons la compilation avec&nbsp;:<\/p>\n<pre><strong># make   ARCH=arm   CROSS_COMPILE=\/cross-arm-linux\/usr\/bin\/arm-linux-  uImage  -j 16<\/strong><\/pre>\n<p style=\"text-align: justify;\">Rappelons que l&rsquo;option \u00ab\u00a0<code>CROSS_COMPILE<\/code> contient un pr\u00e9fixe \u00e0 ajouter avant le nom des outils de la cha\u00eene de compilation Gnu (<code>gcc<\/code>, <code>ld<\/code>, <code>as<\/code>). Ceci permet de s\u00e9lectionner le <em>cross-compiler<\/em> que nous avons g\u00e9n\u00e9r\u00e9 dans un article pr\u00e9c\u00e9dent. On remarquera que nous compilons une \u00ab\u00a0<code>uImage<\/code>\u00a0\u00bb c&rsquo;est-\u00e0-dire une image pr\u00e9par\u00e9e pour <em>uBoot<\/em>, le <em>boot-loader<\/em> pr\u00e9install\u00e9 sur la carte Igep. Enfin l&rsquo;option \u00ab\u00a0<code>-j 16<\/code>\u00a0\u00bb permet d&rsquo;acc\u00e9l\u00e9rer la compilation en faisant tourner 16 jobs en parall\u00e8le (on optimise ainsi l&rsquo;utilisation des quatre c\u0153urs de ce processeur).<\/p>\n<h2>6 &#8211; Installation du noyau compil\u00e9<\/h2>\n<p style=\"text-align: justify;\">Apr\u00e8s quelques minutes, le noyau est pr\u00eat, on peut le copier sur la carte micro-SD utilis\u00e9e pour le boot de la carte Igep&nbsp;:<\/p>\n<pre>[...]\nImage Name:   Linux-2.6.33.9-rt31-rt-cpb\nCreated:      Sat Apr 16 00:43:14 2011\nImage Type:   ARM Linux Kernel Image (uncompressed)\nData Size:    1870284 Bytes = 1826.45 kB = 1.78 MB\nLoad Address: 80008000\nEntry Point:  80008000\n  Image arch\/arm\/boot\/uImage is ready\n# <strong>cp arch\/arm\/boot\/uImage  \/media\/boot\/<\/strong>\n# <strong>umount \/media\/boot\/<\/strong>\n#<\/pre>\n<h2>7 &#8211; Test du nouveau noyau<\/h2>\n<p style=\"text-align: justify;\">La carte micro-SD est ins\u00e9r\u00e9e dans la carte Igep v2, celle-ci est mise sous tension. D\u00e8s que les LEDs affichent le signe de vie habituel (dans un script de d\u00e9marrage personnalis\u00e9), on peut se connecter depuis le PC par le r\u00e9seau&nbsp;:<\/p>\n<pre># <strong>ssh root@192.168.3.152<\/strong>\nroot@192.168.3.152's password:\nBusyBox v1.16.1 (2011-03-10 12:17:29 CET) built-in shell (ash)\nEnter 'help' for a list of built-in commands.\n[IGEP]# <strong>uname -a<\/strong>\nLinux (none) 2.6.33.9-rt31-rt-cpb #1 PREEMPT RT Sat Apr 16 00:43:05 CEST 2011 armv7l GNU\/Linux\n[IGEP]#<\/pre>\n<p>Il ne reste plus qu&rsquo;\u00e0 tester et v\u00e9rifier si le comportement des t\u00e2ches temps-r\u00e9el d&rsquo;un projet voient leur comportement s&rsquo;am\u00e9liorer sur ce nouveau patch, et \u00e9ventuellement poster ses remarques dans la mailing-list \u00ab\u00a0<code>linux-rt-users@vger.kernel.org<\/code>\u00ab\u00a0.<\/p>","protected":false},"excerpt":{"rendered":"<p>Le 11 avril dernier Thomas Gleixner a publi&eacute; un nouveau patch pour le projet Linux Preempt RT.&nbsp;Celui-ci s&rsquo;applique sur les noyaux de la branche long terme 2.6.33 (linux 2.6.33.9 en particulier). Ce patch impl&eacute;mente des am&eacute;liorations par rapport au pr&eacute;c&eacute;dent, sans ajouter de v&eacute;ritables nouveaut&eacute;s. Il peut toutefois &ecirc;tre int&eacute;ressant de le mettre en &oelig;uvre [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5,8,14],"tags":[],"class_list":["post-533","post","type-post","status-publish","format-standard","hentry","category-actualite","category-embarque","category-linux-2","category-temps-reel"],"_links":{"self":[{"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/posts\/533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/comments?post=533"}],"version-history":[{"count":1,"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/posts\/533\/revisions"}],"predecessor-version":[{"id":3906,"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/posts\/533\/revisions\/3906"}],"wp:attachment":[{"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/media?parent=533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/categories?post=533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blaess.fr\/christophe\/wp-json\/wp\/v2\/tags?post=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}