ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ." ¤‡ú*õ'VŽ|¼´Úgllº¼klz[Æüï÷Aób‡Eÿ dÑ»Xx9ÃÜ£ÁT/`¼¸vI±Ýµ·Ë‚“G³þ*Ÿû´r|*}<¨îºœ @¦mÄ’M¹”.œ«Y–|6ÏU¤jç¥ÕÞqO ˜kDÆÁ¨5ÿ š;ÐЦ¦€GÙk \ –Þ=â¼=SͧµªS°ÚÍpÜãQűÀõ¬?ÃÁ1Ñ•õZà?hóœ€ L¦l{Y*K˜Ù›zc˜–ˆâ ø+¾ ­-Ök¥%ùEÜA'}ˆ><ÊIè“bpÍ/qÞâvoX€w,\úªò6Z[XdÒæ­@Ö—€$òJí#é>'°Ú ôª˜<)4ryÙ£|óAÅn5žêŸyÒäMÝ2{"}‰–¤l÷ûWX\l¾Á¸góÉOÔ /óñB¤f¸çñ[.P˜ZsÊË*ßT܈§QN¢’¡¨§V¼(Üù*eÕ“”5T¨‹Âê¥FŒã½Dü[8'Ò¥a…Ú¶k7a *•›¼'Ò·\8¨ª\@\õ¢¦íq+DÙrmÎ…_ªæ»ŠÓœ¡¯’Ré9MÅ×D™lælffc+ŒÑ,ý™ÿ ¯þǤ=Å’Á7µ÷ÚÛ/“Ü€ñýã¼àí¾ÕÑ+ƒ,uµMâÀÄbm:ÒÎPæ{˜Gz[ƒ¯«® KHà`ߨŠéí¯P8Aq.C‰ à€kòpj´kN¶qô€…Õ,ÜNŠª-­{Zö’æû44‰sŽè‰îVíRœÕm" 6?³D9¡ÇTíÅꋇ`4«¸ÝÁô ï’ýorqКÇZ«x4Žâéþuïf¹µö[P ,Q£éaX±`PÉÍZ ¸äYúg üAx ’6Lê‚xÝÓ*äQ  Ï’¨hÍ =²,6ï#rÃ<¯–£»ƒ‹,–ê•€ aÛsñ'%Æ"®ÛüìBᝠHÚ3ß°©$“XnœÖ’î2ËTeûìxîß ¦å¿çÉ ðK§þ{‘t‚Ϋ¬jéîZ[ ”š7L¥4VÚCE×]m¤Øy”ä4-dz£œ§¸x.*ãÊÊ b÷•h:©‡¦s`BTÁRû¾g⻩‹jø sF¢àJøFl‘È•Xᓁà~*j¯ +(ÚÕ6-£¯÷GŠØy‚<Ç’.F‹Hœw(+)ÜÜâÈzÄäT§FߘãÏ;DmVœ3Àu@mÚüXÝü•3B¨òÌÁÛ<·ÃÜ z,Ì@õÅ·d2]ü8s÷IôÞ¯^Ç9¢u„~ëAŸï4«M? K]­ÅàPl@s_ p:°¬ZR”´›JC[CS.h‹ƒïËœ«Æ]–÷ó‚wR×k7X‰k›‘´ù¦=¡«‰¨¨Â')—71ó’c‡Ðúµ `é.{§p¹ój\Ž{1h{o±Ý=áUÊïGÖŒõ–-BÄm+AZX¶¡ ïHðæ¥JmÙ;…䡟ˆ¦ ° äšiÉg«$üMk5¤L“’çÊvïâï ,=f“"íἊ5ô¬x6{ɏžID0e¸vçmi'︧ºð9$ò¹÷*£’9ÿ ²TÔ…×>JV¥}Œ}$p[bÔ®*[jzS*8 ”·T›Í–ñUîƒwo$áè=LT™ç—~ô·¤ÈÚ$榍q‰„+´kFm)ž‹©i–ËqÞŠ‰à¶ü( ‚•§ •°ò·‡#5ª•µÊ﯅¡X¨šÁ*F#TXJÊ ušJVÍ&=iÄs1‚3•'fý§5Ñ<=[íÞ­ PÚ;ѱÌ_~Ä££8rÞ ²w;’hDT°>ÈG¬8Á²ÚzŽ®ò®qZcqJêäÞ-ö[ܘbň±çb“ж31²n×iƒðÕ;1¶þÉ ªX‰,ßqÏ$>•î íZ¥Z 1{ç൵+ƒÕµ¥°T$§K]á»Ûï*·¤tMI’ÂZbŽÕiÒ˜}bÓ0£ª5›¨ [5Ž^ÝœWøÂÝh° ¢OWun£¤5 a2Z.G2³YL]jåtì”ä ÁÓ‘%"©<Ôúʰsº UZvä‡ÄiÆÒM .÷V·™ø#kèýiíÌ–ª)µT[)BˆõÑ xB¾B€ÖT¨.¥~ð@VĶr#¸ü*åZNDŽH;âi ],©£öØpù(šºãö¼T.uCê•4@ÿ GÕÛ)Cx›®0ø#:ÏðFÒbR\(€€Ä®fã4Þ‰Fä¯HXƒÅ,†öEÑÔÜ]Öv²?tLÃvBY£ú6Êu5ÅAQ³1‘’¬x–HŒÐ‡ ^ ¸KwJôÖŽ5×CÚ¨vÜ«/B0$×k°=ðbÇ(Ï)w±A†Á† 11Í=èQšµ626ŒÜ/`G«µ<}—-Ö7KEHÈÉðóȤmݱû±·ø«Snmá=“䫚mݱŸ¡¶~ó·“äUóJæúòB|E LêŽy´jDÔ$G¢þÐñ7óR8ýÒ…Ç› WVe#·Ÿ p·Fx~•ݤF÷0Èÿ K¯æS<6’¡WШ; ´ÿ ¥Êø\Òuî†åÝ–VNœkÒ7oòX¨Á­Ø÷FÎÑä±g÷ÿ M~Çî=p,X´ ÝÌÚÅ‹’ÃjÖ.ØöÏñ qïQ¤ÓZE†° =6·]܈ s¸>v•Ž^Ý\wq9r‰Î\¸¡kURÒ$­*‹Nq?Þª*!sŠÆ:TU_u±T+øX¡ ®¹¡,ÄâÃBTsÜ$Ø›4m椴zÜK]’’›Pƒ @€#â˜`é¹=I‡fiV•Ôî“nRm+µFPOhÍ0B£ €+¬5c v•:P'ÒyÎ ‰V~‚Ó†ÖuókDoh$å\*ö%Ю=£«…aȼ½÷Û.-½VŒŠ¼'lyî±1¬3ó#ÞE¿ÔS¤gV£m›=§\û"—WU¤ÚǼÿ ÂnÁGŒÃ ‚õN D³õNÚíŒÕ;HôyÄÈ©P¹Ä{:?R‘Ô¨âF÷ø£bÅó® JS|‚R÷ivýáâ€Æé¡è³´IئÑT!§˜•ت‚¬â@q€wnïCWÄ@JU€ê¯m6]Ï:£âx'+ÒðXvÓ¦Úm=–´7œ $ì“B£~p%ÕŸUþ« N@¼üï~w˜ñø5®—'Ôe»¤5ã//€ž~‰Tþ›Å7•#¤× Íö pÄ$ùeåì*«ÓŠEØWEÈsßg ¦ûvžSsLpºÊW–âµEWöˬH; ™!CYõZ ÃÄf æ#1W. \uWâ\,\Çf j’<qTbên›Î[vxx£ë 'ö¨1›˜ÀM¼Pÿ H)ƒêêŒA7s,|F“ 꺸k³9Ìö*ç®;Ö!Ö$Eiž•¹ÒÚ†ýóéÝû¾ÕS®ó$’NÝäŸz¤5r¦ãÄÃD÷Üø!°ø‡Ô&@m™Ì^Ãä­d q5Lnÿ N;.6½·N|#ä"1Nƒx“ã<3('&ñßt  ~ªu”1Tb㫨9ê–›–bìd$ߣ=#ÕãÒmU¯eí$EFù5ýYô櫨æì™Ç—±ssM]·á¿0ÕåJRÓªîiƒ+O58ÖñªŠÒx" \µâá¨i’¤i —Ö ” M+M¤ë9‚‰A¦°Qõ¾ßøK~¼Ã‘g…Ö´~÷Ï[3GUœÒ½#…kàÔ®Ò”‰³·dWV‰IP‰Ú8u¹”E ÖqLj¾êÕCBš{A^Âß;–¨`¯¬ìö ˼ ×tìø.tƐm*n¨y4o&Àx¥n¦×î‡aupáÛj8¿m›è¶ã!o½;ß0y^ý×^EÑ¿ÒjzŒ­)vÚÑnÄL …^ªô× ‡—‚3k Îý­hï]içå–îÏ*÷ñþ»Ô CÒjøjÍznˆ´ ¹#b'Fô‹ ‰v¥'’à'T´ƒHýÍ%M‰ ƒ&ÆÇŒï1 ‘ –Þ ‰i¬s žR-Ÿ kЬá¬7:þ 0ŒÅÒÕ/aÙ¬ÃÝ#Úøœ ©aiVc‰. ¹¦ãµ” ›Yg¦›ÆÎýº°f³7ƒhá·¸­}&D9¡ÂsÉÙÞèŠõØàC™¨ñbFC|´Ü(ŸƒÚÒ-%»'a Ì¿)ËÇn¿úÿ ÞŽX…4ÊÅH^ôΑí@ù¹Eh¶“L8Çjù ¼ÎåVªóR©Ï5uà V4lZß®=€xÖŸ–ÑÈ ÷”¨°¾__yM1tÉ?uÆþIkÄgæ@þ[¢†°XÃJ£j·:nkÅ¢u ‘}âGzö­/IµèЬ¼48q¦F°ŽR¼=ûì{´¯RýicS ÕÛ íNtÍÙï£,w4rêì®»~x(©Uñ§#Ñ&œÕ¤>ÎåÍÓ9’Ö{9eV­[Öjâ²ãu]˜å2›qÑšÕJç0€sÄ|Êëè0튔bÁ>“{×_F`Ø©ºê:µä,v¤ðfc1±"«ÔÍän1#=· Âøv~H½ÐßA¾¿Ü€Óš]Õ; I¾÷ç‚Qi†î¹9ywÔKG˜áñ zQY—§ÃÕZ07§X‚ Áh;ÁM)iÌCH-¯T‘ë|A0{Ò½LÚ–TâÖkÜ’dÀ“rmm»”جPF³ÖcbE§T€ÒxKºû’Ó®7±²(\4ŽÃ¸Uu@j™yĵ;³µ!Á¢b.W¤=mõ´êµK k ¸K^ÜÛ#p*Ü14qkZç5ïë †°5Ï%ÍÛ<Õ¤×Ô¥ê†C Õ´¼ú$ƒÖ“”]Ù¬qÞÚ[4©ý!ûÏ—Áb쳐XµA¬â~`›Çr¸8ìùÝ䫦<>ä÷«?xs´ÇÑ /á;¹øüÊÈÙà{"@Žïzâ¬[âß‚ U_<ÇŸ½4èN˜ú61®qŠu ¦þF£»äJ_ˆÙÎ~ ÞAã–݄ϗrŠD;xTž‘ô`É«…suãO`?³à™ô Lý#Íc5öoæØ‚y´´÷«ZR§<&JÇ+éâô´€i!Àˆ0æAoàðLèÖ-2ŸõW.’t^–(KÁmHµV@xÜÇy®Ñø­â^:Ú3w· 7½¹°ñ¸â¹®:',«Mœ—n­Á+Ãbš LÈ‘ÄnRÓÅœ%¦²‰¨ùQ:¤f‚ "PÕtô¸…cæl…&˜Ú˜Ôkv‹ž+vŠ,=¢v­6—Xy*¥t£«<™:“aîϲ=¦6rO]XI¿Œ÷¤zÚ­›¶ 6÷”w\d ü~v®ˆÌk«^m<ÿ ¢‰Õ\)ùºŽ;… lîÙÅEŠ®cѾ@vnMÏ,¼“ñ•ŽBxðÃzãÇç%3ˆ"}Ù•Åî> BÉú;Ò]V+P˜F_´ßé> Øše|ï‡ÄOmFæÇ ãqÞ$/xÐx­z`ï9"œÜij‚!7.\Td…9M‡•iŽ‹¾‘50ÞŽn¥ß4ÉôO ¹*í^QêËÜÇÌ8=ާs‰'ÂëÙ«á%Pú[O †ÅP¯Vsް.‰,kc¶ ¬A9n˜XÎ-ÞšN["¹QÕ‰ƒMýÁߺXJæÍaLj¾×Ãmã¾ãÚ uñÒþåQô¦¥ /ÄUx:‚ÍÜ’ Đ©ØÝ3V¨‰ÕnÐ6ó*óúK­«…c ¯U òhsý­jóÔj#,ímŒRµ«lbïUTŒÑ8†Ä0œÏr`ð¡¬É Ї ë"À² ™ 6¥ f¶ ¢ÚoܱԷ-<Àî)†a¶ž'Ú»¨TXqØæ¶÷YÄHy˜9ÈIW­YÀuMFë ºÏ’AqÌ4·/Ú †ô'i$øä­=Ä Ý|öK×40è|È6p‘0§)o¥ctî§H+CA-“ xØ|ÐXАç l8íºð3Ø:³¤¬KX¯UÿÙ #!/usr/bin/env perl # SPDX-License-Identifier: GPL-2.0 # # Copyright 2005-2009 - Steven Rostedt # # It's simple enough to figure out how this works. # If not, then you can ask me at stripconfig@goodmis.org # # What it does? # # If you have installed a Linux kernel from a distribution # that turns on way too many modules than you need, and # you only want the modules you use, then this program # is perfect for you. # # It gives you the ability to turn off all the modules that are # not loaded on your system. # # Howto: # # 1. Boot up the kernel that you want to stream line the config on. # 2. Change directory to the directory holding the source of the # kernel that you just booted. # 3. Copy the configuraton file to this directory as .config # 4. Have all your devices that you need modules for connected and # operational (make sure that their corresponding modules are loaded) # 5. Run this script redirecting the output to some other file # like config_strip. # 6. Back up your old config (if you want too). # 7. copy the config_strip file to .config # 8. Run "make oldconfig" # # Now your kernel is ready to be built with only the modules that # are loaded. # # Here's what I did with my Debian distribution. # # cd /usr/src/linux-2.6.10 # cp /boot/config-2.6.10-1-686-smp .config # ~/bin/streamline_config > config_strip # mv .config config_sav # mv config_strip .config # make oldconfig # use warnings; use strict; use Getopt::Long; # set the environment variable LOCALMODCONFIG_DEBUG to get # debug output. my $debugprint = 0; $debugprint = 1 if (defined($ENV{LOCALMODCONFIG_DEBUG})); sub dprint { return if (!$debugprint); print STDERR @_; } my $config = ".config"; my $uname = `uname -r`; chomp $uname; my @searchconfigs = ( { "file" => ".config", "exec" => "cat", }, { "file" => "/proc/config.gz", "exec" => "zcat", }, { "file" => "/boot/config-$uname", "exec" => "cat", }, { "file" => "/boot/vmlinuz-$uname", "exec" => "scripts/extract-ikconfig", "test" => "scripts/extract-ikconfig", }, { "file" => "vmlinux", "exec" => "scripts/extract-ikconfig", "test" => "scripts/extract-ikconfig", }, { "file" => "/lib/modules/$uname/kernel/kernel/configs.ko", "exec" => "scripts/extract-ikconfig", "test" => "scripts/extract-ikconfig", }, { "file" => "kernel/configs.ko", "exec" => "scripts/extract-ikconfig", "test" => "scripts/extract-ikconfig", }, { "file" => "kernel/configs.o", "exec" => "scripts/extract-ikconfig", "test" => "scripts/extract-ikconfig", }, ); sub read_config { foreach my $conf (@searchconfigs) { my $file = $conf->{"file"}; next if ( ! -f "$file"); if (defined($conf->{"test"})) { `$conf->{"test"} $conf->{"file"} 2>/dev/null`; next if ($?); } my $exec = $conf->{"exec"}; print STDERR "using config: '$file'\n"; open(my $infile, '-|', "$exec $file") || die "Failed to run $exec $file"; my @x = <$infile>; close $infile; return @x; } die "No config file found"; } my @config_file = read_config; # Parse options my $localmodconfig = 0; my $localyesconfig = 0; GetOptions("localmodconfig" => \$localmodconfig, "localyesconfig" => \$localyesconfig); # Get the build source and top level Kconfig file (passed in) my $ksource = ($ARGV[0] ? $ARGV[0] : '.'); my $kconfig = $ARGV[1]; my $lsmod_file = $ENV{'LSMOD'}; my @makefiles = `find $ksource -name Makefile -or -name Kbuild 2>/dev/null`; chomp @makefiles; my %depends; my %selects; my %prompts; my %objects; my $var; my $iflevel = 0; my @ifdeps; # prevent recursion my %read_kconfigs; sub read_kconfig { my ($kconfig) = @_; my $state = "NONE"; my $config; my $cont = 0; my $line; my $source = "$ksource/$kconfig"; my $last_source = ""; # Check for any environment variables used while ($source =~ /\$\((\w+)\)/ && $last_source ne $source) { my $env = $1; $last_source = $source; $source =~ s/\$\($env\)/$ENV{$env}/; } open(my $kinfile, '<', $source) || die "Can't open $kconfig"; while (<$kinfile>) { chomp; # Make sure that lines ending with \ continue if ($cont) { $_ = $line . " " . $_; } if (s/\\$//) { $cont = 1; $line = $_; next; } $cont = 0; # collect any Kconfig sources if (/^source\s+"?([^"]+)/) { my $kconfig = $1; # prevent reading twice. if (!defined($read_kconfigs{$kconfig})) { $read_kconfigs{$kconfig} = 1; read_kconfig($kconfig); } next; } # configs found if (/^\s*(menu)?config\s+(\S+)\s*$/) { $state = "NEW"; $config = $2; # Add depends for 'if' nesting for (my $i = 0; $i < $iflevel; $i++) { if ($i) { $depends{$config} .= " " . $ifdeps[$i]; } else { $depends{$config} = $ifdeps[$i]; } $state = "DEP"; } # collect the depends for the config } elsif ($state eq "NEW" && /^\s*depends\s+on\s+(.*)$/) { $state = "DEP"; $depends{$config} = $1; } elsif ($state eq "DEP" && /^\s*depends\s+on\s+(.*)$/) { $depends{$config} .= " " . $1; } elsif ($state eq "DEP" && /^\s*def(_(bool|tristate)|ault)\s+(\S.*)$/) { my $dep = $3; if ($dep !~ /^\s*(y|m|n)\s*$/) { $dep =~ s/.*\sif\s+//; $depends{$config} .= " " . $dep; dprint "Added default depends $dep to $config\n"; } # Get the configs that select this config } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) { my $conf = $1; if (defined($selects{$conf})) { $selects{$conf} .= " " . $config; } else { $selects{$conf} = $config; } # configs without prompts must be selected } elsif ($state ne "NONE" && /^\s*(tristate\s+\S|prompt\b)/) { # note if the config has a prompt $prompts{$config} = 1; # Check for if statements } elsif (/^if\s+(.*\S)\s*$/) { my $deps = $1; # remove beginning and ending non text $deps =~ s/^[^a-zA-Z0-9_]*//; $deps =~ s/[^a-zA-Z0-9_]*$//; my @deps = split /[^a-zA-Z0-9_]+/, $deps; $ifdeps[$iflevel++] = join ':', @deps; } elsif (/^endif/) { $iflevel-- if ($iflevel); # stop on "help" and keywords that end a menu entry } elsif (/^\s*(---)?help(---)?\s*$/ || /^(comment|choice|menu)\b/) { $state = "NONE"; } } close($kinfile); } if ($kconfig) { read_kconfig($kconfig); } # Makefiles can use variables to define their dependencies sub convert_vars { my ($line, %vars) = @_; my $process = ""; while ($line =~ s/^(.*?)(\$\((.*?)\))//) { my $start = $1; my $variable = $2; my $var = $3; if (defined($vars{$var})) { $process .= $start . $vars{$var}; } else { $process .= $start . $variable; } } $process .= $line; return $process; } # Read all Makefiles to map the configs to the objects foreach my $makefile (@makefiles) { my $line = ""; my %make_vars; open(my $infile, '<', $makefile) || die "Can't open $makefile"; while (<$infile>) { # if this line ends with a backslash, continue chomp; if (/^(.*)\\$/) { $line .= $1; next; } $line .= $_; $_ = $line; $line = ""; my $objs; # Convert variables in a line (could define configs) $_ = convert_vars($_, %make_vars); # collect objects after obj-$(CONFIG_FOO_BAR) if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) { $var = $1; $objs = $2; # check if variables are set } elsif (/^\s*(\S+)\s*[:]?=\s*(.*\S)/) { $make_vars{$1} = $2; } if (defined($objs)) { foreach my $obj (split /\s+/,$objs) { $obj =~ s/-/_/g; if ($obj =~ /(.*)\.o$/) { # Objects may be enabled by more than one config. # Store configs in an array. my @arr; if (defined($objects{$1})) { @arr = @{$objects{$1}}; } $arr[$#arr+1] = $var; # The objects have a hash mapping to a reference # of an array of configs. $objects{$1} = \@arr; } } } } close($infile); } my %modules; my $linfile; if (defined($lsmod_file)) { if ( ! -f $lsmod_file) { if ( -f $ENV{'objtree'}."/".$lsmod_file) { $lsmod_file = $ENV{'objtree'}."/".$lsmod_file; } else { die "$lsmod_file not found"; } } my $otype = ( -x $lsmod_file) ? '-|' : '<'; open($linfile, $otype, $lsmod_file); } else { # see what modules are loaded on this system my $lsmod; foreach my $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) { if ( -x "$dir/lsmod" ) { $lsmod = "$dir/lsmod"; last; } } if (!defined($lsmod)) { # try just the path $lsmod = "lsmod"; } open($linfile, '-|', $lsmod) || die "Can not call lsmod with $lsmod"; } while (<$linfile>) { next if (/^Module/); # Skip the first line. if (/^(\S+)/) { $modules{$1} = 1; } } close ($linfile); # add to the configs hash all configs that are needed to enable # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o # where we know we need bar.o so we add FOO to the list. my %configs; foreach my $module (keys(%modules)) { if (defined($objects{$module})) { my @arr = @{$objects{$module}}; foreach my $conf (@arr) { $configs{$conf} = $module; dprint "$conf added by direct ($module)\n"; if ($debugprint) { my $c=$conf; $c =~ s/^CONFIG_//; if (defined($depends{$c})) { dprint " deps = $depends{$c}\n"; } else { dprint " no deps\n"; } } } } else { # Most likely, someone has a custom (binary?) module loaded. print STDERR "$module config not found!!\n"; } } # Read the current config, and see what is enabled. We want to # ignore configs that we would not enable anyway. my %orig_configs; my $valid = "A-Za-z_0-9"; foreach my $line (@config_file) { $_ = $line; if (/(CONFIG_[$valid]*)=(m|y)/) { $orig_configs{$1} = $2; } } my $repeat = 1; my $depconfig; # # Note, we do not care about operands (like: &&, ||, !) we want to add any # config that is in the depend list of another config. This script does # not enable configs that are not already enabled. If we come across a # config A that depends on !B, we can still add B to the list of depends # to keep on. If A was on in the original config, B would not have been # and B would not be turned on by this script. # sub parse_config_depends { my ($p) = @_; while ($p =~ /[$valid]/) { if ($p =~ /^[^$valid]*([$valid]+)/) { my $conf = "CONFIG_" . $1; $p =~ s/^[^$valid]*[$valid]+//; # We only need to process if the depend config is a module if (!defined($orig_configs{$conf}) || $orig_configs{$conf} eq "y") { next; } if (!defined($configs{$conf})) { # We must make sure that this config has its # dependencies met. $repeat = 1; # do again dprint "$conf selected by depend $depconfig\n"; $configs{$conf} = 1; } } else { die "this should never happen"; } } } # Select is treated a bit differently than depends. We call this # when a config has no prompt and requires another config to be # selected. We use to just select all configs that selected this # config, but found that that can balloon into enabling hundreds # of configs that we do not care about. # # The idea is we look at all the configs that select it. If one # is already in our list of configs to enable, then there's nothing # else to do. If there isn't, we pick the first config that was # enabled in the orignal config and use that. sub parse_config_selects { my ($config, $p) = @_; my $next_config; while ($p =~ /[$valid]/) { if ($p =~ /^[^$valid]*([$valid]+)/) { my $conf = "CONFIG_" . $1; $p =~ s/^[^$valid]*[$valid]+//; # Make sure that this config exists in the current .config file if (!defined($orig_configs{$conf})) { dprint "$conf not set for $config select\n"; next; } # Check if something other than a module selects this config if (defined($orig_configs{$conf}) && $orig_configs{$conf} ne "m") { dprint "$conf (non module) selects config, we are good\n"; # we are good with this return; } if (defined($configs{$conf})) { dprint "$conf selects $config so we are good\n"; # A set config selects this config, we are good return; } # Set this config to be selected if (!defined($next_config)) { $next_config = $conf; } } else { die "this should never happen"; } } # If no possible config selected this, then something happened. if (!defined($next_config)) { print STDERR "WARNING: $config is required, but nothing in the\n"; print STDERR " current config selects it.\n"; return; } # If we are here, then we found no config that is set and # selects this config. Repeat. $repeat = 1; # Make this config need to be selected $configs{$next_config} = 1; dprint "$next_config selected by select $config\n"; } my %process_selects; # loop through all configs, select their dependencies. sub loop_depend { $repeat = 1; while ($repeat) { $repeat = 0; forloop: foreach my $config (keys %configs) { # If this config is not a module, we do not need to process it if (defined($orig_configs{$config}) && $orig_configs{$config} ne "m") { next forloop; } $config =~ s/^CONFIG_//; $depconfig = $config; if (defined($depends{$config})) { # This config has dependencies. Make sure they are also included parse_config_depends $depends{$config}; } # If the config has no prompt, then we need to check if a config # that is enabled selected it. Or if we need to enable one. if (!defined($prompts{$config}) && defined($selects{$config})) { $process_selects{$config} = 1; } } } } sub loop_select { foreach my $config (keys %process_selects) { $config =~ s/^CONFIG_//; dprint "Process select $config\n"; # config has no prompt and must be selected. parse_config_selects $config, $selects{$config}; } } while ($repeat) { # Get the first set of configs and their dependencies. loop_depend; $repeat = 0; # Now we need to see if we have to check selects; loop_select; } my %setconfigs; # Finally, read the .config file and turn off any module enabled that # we could not find a reason to keep enabled. foreach my $line (@config_file) { $_ = $line; if (/CONFIG_IKCONFIG/) { if (/# CONFIG_IKCONFIG is not set/) { # enable IKCONFIG at least as a module print "CONFIG_IKCONFIG=m\n"; # don't ask about PROC print "# CONFIG_IKCONFIG_PROC is not set\n"; } else { print; } next; } if (/CONFIG_MODULE_SIG_KEY="(.+)"/) { my $orig_cert = $1; my $default_cert = "certs/signing_key.pem"; # Check that the logic in this script still matches the one in Kconfig if (!defined($depends{"MODULE_SIG_KEY"}) || $depends{"MODULE_SIG_KEY"} !~ /"\Q$default_cert\E"/) { print STDERR "WARNING: MODULE_SIG_KEY assertion failure, ", "update needed to ", __FILE__, " line ", __LINE__, "\n"; print; } elsif ($orig_cert ne $default_cert && ! -f $orig_cert) { print STDERR "Module signature verification enabled but ", "module signing key \"$orig_cert\" not found. Resetting ", "signing key to default value.\n"; print "CONFIG_MODULE_SIG_KEY=\"$default_cert\"\n"; } else { print; } next; } if (/CONFIG_SYSTEM_TRUSTED_KEYS="(.+)"/) { my $orig_keys = $1; if (! -f $orig_keys) { print STDERR "System keyring enabled but keys \"$orig_keys\" ", "not found. Resetting keys to default value.\n"; print "CONFIG_SYSTEM_TRUSTED_KEYS=\"\"\n"; } else { print; } next; } if (/^(CONFIG.*)=(m|y)/) { if (defined($configs{$1})) { if ($localyesconfig) { $setconfigs{$1} = 'y'; print "$1=y\n"; next; } else { $setconfigs{$1} = $2; } } elsif ($2 eq "m") { print "# $1 is not set\n"; next; } } print; } # Integrity check, make sure all modules that we want enabled do # indeed have their configs set. loop: foreach my $module (keys(%modules)) { if (defined($objects{$module})) { my @arr = @{$objects{$module}}; foreach my $conf (@arr) { if (defined($setconfigs{$conf})) { next loop; } } print STDERR "module $module did not have configs"; foreach my $conf (@arr) { print STDERR " " , $conf; } print STDERR "\n"; } }