Simple recipe to build your own LXRed Linux Kernel Source in Fedora 13

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
$ yum install git inkscape postgresql postgresql-server texlive ctags perl-CGI-Ajax perl-CGI-Simple perl-DBD-Pg perl-HTML-Parser perl-Template-Toolkit perl-Term-ProgressBar.noarch perl-Term-Size perl-TermReadKey perl-Devel-Size gcc gcc-c++ texlive-utils texlive-latex perl-ExtUtils-MakeMaker perl-CPAN perl-YAML libpng libpng-devel texinfo perl-Digest-SHA1 wget http make icoutils xapian-core perl-Search-Xapian perl-CPAN perl-Search-Xapian gifsicle<p> </p>
 
 
<p>$ cd /tmp &amp;&amp; wget http://www.ctan.org/get/fonts/bbding/bbding.ins  http://www.ctan.org/get/fonts/bbding/bbding.dtx</p>
 
<p>$ cpan
$ cpan -fi Search::Xapian</p>
 
<p>$ mkdir /opt; cd /opt
$ git clone git://lxr.linux.no/git/lxrng.git
$ cd lxrng
$ cp lxrng.conf-dist lxrng.conf
$ cp apache2-site.conf-dist-cgi apache2-site.conf
$ chkconfig httpd on
$ chkconfig postgresql on
$ service postgresql initdb
$ service postgresql start</p>
 
<p>$ iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
$ iptables -I INPUT 1 -p tcp --dport 5432 -j ACCEPT
$ service iptables save</p>
 
<p>$ cd /tmp
$ cp /usr/share/texmf/fonts/tfm/public/niceframe/bbding10.tfm .
$ tex bbding.ins
$ mkdir /usr/share/texmf/tex/latex/bbding
$ mv bbding.sty /usr/share/texmf/tex/latex/bbding/.
$ texhash
$ fmtutil-sys --all</p>
 
<p>$ set -i 's/ident sameuser/password/' /var/lib/pgsql/data/pg_hba.conf</p>
 
<p>$ su - postgres</p>
 
<p>-bash-4.1$ createuser -P lxr
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
-bash-4.1$ createuser -P lxradmin
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n
-bash-4.1$ createuser -P apache
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
-bash-4.1$
-bash-4.1$ createdb lxrng -O lxr
-bash-4.1$ exit</p>
 
 
<p>$ service postgresql restart</p>
 
<p>$ mkdir /var/lib/lxrng/text-db -p
$ mkdir /var/lib/lxrng/cache
$ chmod a+rw /var/lib/lxrng
$ chmod a+rw /var/lib/lxrng/cache/</p>
 
<p>$ make -C /opt/lxrng/webroot/.static/gfx
$ mkdir -p /var/lib/lxrng/repos/
$ cd /var/lib/lxrng/repos/
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
$ cd linux-2.6/
$ git tag</p>
 
 
<p>$ cd /opt/lxrng/
$ sed -i 's:@@LXRURL@@::' apache2-site.conf
$ sed -i 's:@@LXRROOT@@:/opt/lxrng:' apache2-site.conf
$ vi apache2-site.conf</p>
 
<p>...
# For LXRng installed directly in the web site root, use
ScriptAlias /            "/opt/lxrng/webroot/lxr.cgi/"
# otherwise use (no trailing slash):
#   ScriptAlias /  "/opt/lxrng/webroot/lxr.cgi"
...</p>
 
<p>$ vi lxrng.conf</p>
 
<p>...
        'base_url'    =&gt; 'http://localhost/',
...
        'ver_default' =&gt; 'v2.6.34',
...</p>
 
 
<p>$ ./lxr-db-admin linux --init</p>
 
<p>$ ln -s /opt/lxrng/apache2-site.conf /etc/httpd/conf.d/.</p>
 
<p>$ service httpd restart
$ setenforce 0
$ ./lxr-genxref linux</p>
 
 
<p>If you are willing to database for a downloaded source, change following stuff in lxrng.conf</p>
 
<p>use LXRng::Repo::Plain;</p>
 
<p>my $plainrepo = LXRng::Repo::Plain -&gt;new('Source Path');</p>
 
<p>ver_list =&gt; ['Project Name'],
ver_default =&gt; 'Project Name',
</p>

 

Possible lxrng.conf example with two applications.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- mode: perl -*-
# Configuration file
#
# 
 
use LXRng::Index::PgBatch;
use LXRng::Repo::Git;
use LXRng::Search::Xapian;
use LXRng::Repo::Plain;
 
my $linuxindex   = LXRng::Index::PgBatch->new(db_spec => 'dbname=lxrng;port=5432', 
					 db_user => "", db_pass => "",
					 # table_prefix => 'lxr'
					 );
 
my $linuxrepo = LXRng::Repo::Git
    ->new('/var/lib/lxrng/repos/linux-2.6/.git',
	  release_re => qr/^v[^-]*$/,
	  author_timestamp => 0);
 
my $linuxsearch  = LXRng::Search::Xapian->new('/var/lib/lxrng/text-db/linux-2.6');
 
my $rhevindex   = LXRng::Index::PgBatch->new(db_spec => 'dbname=rhev;port=5432', 
					 db_user => "", db_pass => "",
					 # table_prefix => 'lxr'
					 );
my $rhevrepo = LXRng::Repo::Plain->new('/var/lib/lxrng/repos/rhev');
 
my $rhevsearch  = LXRng::Search::Xapian->new('/var/lib/lxrng/text-db/rhev');
 
 
return {
    'linux' => {
	'repository'  => $linuxrepo,
	'index'       => $linuxindex,
	'search'      => $linuxsearch,
 
	'base_url'    => 'http://localhost/',
	# Must be writable by httpd user:
	'cache'	      => '/var/lib/lxrng/cache/linux',
 
	'fs_charset'  => 'iso-8859-1',
	# Tried successively
	'content_charset' => ['utf-8', 'iso-8859-1'],
 
	'languages'   => ['C', 'GnuAsm', 'Kconfig'],
	'ctags_flags' => ["-I\@$LXRng::ROOT/lxr-ctags-quirks"],
	'ver_list'    => [$linuxrepo->allversions],
 
	'ver_default' => 'v2.6.34',
 
	'include_maps' => 
	    [
	     [qr|^arch/(.*?)/|, qr|^asm/(.*)|,
	      sub { "include/asm-$_[0]/$_[1]" }],
	     [qr|^include/asm-(.*?)/|, qr|^asm/(.*)|,
	      sub { "include/asm-$_[0]/$_[1]" }],
	     [qr|^|, qr|^asm/(.*)|,
	      sub { map { "include/asm-$_/$_[0]" }
		    qw(i386 alpha arm ia64 m68k mips mips64),
		    qw(ppc s390 sh sparc sparc64 x86_64) }],
	     [qr|^|, qr|(.*)|,
	      sub { "include/$_[0]" }],
	     ],
    },
 
    'rhev' => {
	'repository'  => $rhevrepo,
	'index'       => $rhevindex,
	'search'      => $rhevsearch,
 
	'base_url'    => 'http://localhost/',
	# Must be writable by httpd user:
	'cache'	      => '/var/lib/lxrng/cache/rhev',
 
	'fs_charset'  => 'iso-8859-1',
	# Tried successively
	'content_charset' => ['utf-8', 'iso-8859-1'],
 
	'languages'   => ['C', 'GnuAsm', 'Kconfig', 'Generic' ],
	'ctags_flags' => ["-I\@$LXRng::ROOT/lxr-ctags-quirks"],
	'ver_list'    => [$rhevrepo->allversions],
 
#	'ver_default' => 'rhev',
 
    },
 
};

I’m still suffering to make it to show hyperlink lists shows up. I guess it’s because it failed to execute ‘ctags-exuberant’ because I saw lots of messages regarding that as is shown below.

Can’t execute “ctags-exuberant”: No such file or directory at ./lxr-genxref line 191.”

Leave a Reply

You must be logged in to post a comment.