最終更新:2014-04-11 (金) 13:33:49 (3660d)  

LXR 0.3.1
Top / LXR 0.3.1

インストール

  • Perl 5?
    yum install flex

Glimpse

  • cd ~
    wget http://webglimpse.net/trial/glimpse-latest.tar.gz
    tar xf glimpse-latest.tar.gz
    cd glimpse-4.18.6/
    ./configure
    make
    make install
    
    glimpse -V

ディレクトリ構造

  • INSTALLPREFIX=/var/www/lxr
  • /var/www/lxr/bin
  • /var/www/lxr/http
  • /var/www/lxr/source
  • /var/www/lxr/source/3.0/linux/Kbuild

手順

  • 展開
    cd ~
    wget http://sourceforge.net/projects/lxr/files/old/lxr-0.3.1/lxr-0.3.1.tar.gz
    tar zxvf lxr-0.3.1.tar.gz
    cd lxr-0.3
  • MakefileのPERLBINとINSTALLPREFIXを編集
    vi Makefile
    INSTALLPREFIX=/var/www/lxr
  • インストール
    make install

Apacheの設定

  • Linux/etc/httpd/conf.dに追加
    Alias /lxr /var/www/lxr/http
    <Directory /var/www/lxr/http>
    	   Options All
    	   AllowOverride All
    </Directory>
  • /var/www/lxr/http/.htaccess
    <Files ~ (search|source|ident|diff)$>
    SetHandler cgi-script
    </Files>

LXRの設定

  • lxr.conf
    # Configuration file.
    
    # Define typed variable "v", read valueset from file.
    variable: v, Version, [/var/www/lxr/source/versions], [/var/www/lxr/source/defversion]
    
    # Define typed variable "a".  First value is default.
    variable: a, Architecture, (i386, alpha, m68k, mips, ppc, sparc, sparc64)
    
    # Define the base url for the LXR files.
    baseurl: http://localhost/lxr/
    
    # These are the templates for the HTML heading, directory listing and
    # footer, respectively.
    htmlhead: /var/www/lxr/http/template-head
    htmltail: /var/www/lxr/http/template-tail
    htmldir:  /var/www/lxr/http/template-dir
    
    # The source is here.
    sourceroot: /var/www/lxr/source/$v/linux/
    srcrootname: Linux
    
    # "#include <foo.h>" is mapped to this directory (in the LXR source
    # tree)
    incprefix: /include
    
    # The database files go here.
    dbdir: /var/www/lxr/source/$v/
    
    # Glimpse can be found here.
    glimpsebin: /usr/local/bin/glimpse
    
    # The power of regexps.  This is pretty Linux-specific, but quite
    # useful.  Tinker with it and see what it does.  (How's that for
    # documentation?)
    map: /include/asm[^\/]*/ /include/asm-$a/
    map: /arch/[^\/]+/ /arch/$a/
    
  • baseurl,glimpsebinと/var/www/lxrへのパスを修正

カーネルソースの設置

  • cd ~
    wget https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz
    tar zxvf linux-3.0.tar.gz
    mkdir -p /var/www/lxr/source/3.0
    mv linux-3.0 /var/www/lxr/source/3.0/linux
    cd /var/www/lxr/source
    ls -1 | grep -v versions > versions
    chown -R apache.apache *

メモ

  • SELinuxをoffに。
    sestatus
    setenforce 0

xref生成

  • cd /var/www/lxr/source/3.0/
    ../../bin/genxref linux
    chmod 644 fileidx xref

Glimpse

  • cd /var/www/lxr/source/3.0/
    glimpseindex -H . linux
    chmod 644 .glimpse_*

バージョン設定ファイルを作成

  • versions
  • defversion

Linux 3.0.1の容量

  • ソースコード:410MB
  • fileidx:2.5MB
  • xref:213MB
  • Glimpse:約30MB
  • 計655MB

追加

  • sudo su -
    wget https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.14.tar.gz
    tar zxf linux-3.14.tar.gz
    mkdir /var/www/lxr/source/3.14
    mv linux-3.14 /var/www/lxr/source/3.14/linux
    cd /var/www/lxr/source/3.14/
    ../../bin/genxref linux
    chmod 644 fileidx xref
    glimpseindex -H . linux
    chmod 644 .glimpse_*

参考