LXR-0.11.1 + glimpse-4.18.6 on Fedora 15… reading linux kernel 0.12

Recently I’m reading linux kernel 0.12. I setup lxr+glimpse on my Fedora 15 node.
Following is the steps:

1. Prepare…

with following packages installed:

2. Install glimpse…
http://webglimpse.net/trial/glimpse-4.18.6.tar.gz

download/congfigure/make/make install
If any package lost, use yum/cpan to install.
You can inst as default(/usr/local)…
I use prefix=/usr/suse/lxr/glimpse

3. Install lxr…
http://sourceforge.net/projects/lxr/
I download lxr-0.11.1.tgz, no necessary to compile
extra/untar the package and

4. Configuration…
I configure a single tree here.

.htaccess file will be generated into lxrroot, no need to modify…
config file will be generated into lxrconf.d/

5. handle the configuration files…
modify apache-lxrserver.conf,   erase following caret:  “alias ^/lxr” –> “alias /lxr”

mysql import lxrconf.d/initdb-mysql-custom.sql with correct user/passwd/dbname.
6. copy lxrconf.d/lxr.conf to ${LXRROOT} and configure…
I paste a copy of my lxr.conf here
lxr.conf

 

7. prepare some templates html file, ensure httpserver can access the files…

 

8. all ready..

ln or cp folder of kernel0.12 here, name as “0.12”

9. go to folder ${LXRROOT}, generate Index…

we can see records into db…

10. re/start httpd server.
access http://localhost/lxr/source

all should be ok now…

[debug]
1. Cannot show ident correctly, httpd server errorlog shows
[Thu Jul  5 18:24:33 2012] warning: LXR::Template, line 105: Template file ‘htmlident’ => ‘/usr/suse/lxr/lxr/http/html-ident.html’ does not exist
[Thu Jul  5 18:24:33 2012] fatal: ModPerl::ROOT::ModPerl::RegistryPrefork::usr_suse_lxr_lxr_ident, line 188: ‘htmlident’ template not configured at /usr/suse/lxr/lxr/ident line 188, <FILETYPE> line 4.

just ensure lxr.conf matches step#7. and give folder html enough privilege.

2. No need to copy ${LXRROOT}/lib files to other perl @INC path.
/etc/httpd/conf.d/apache-lxrserver.conf will call following file to include…
/usr/suse/lxr/lxr/lxrconf.d/apache2-require.pl

—————————-

Well , glimpse here can be replaced with swish-e, I have another post to provide swish-e RPMs for fedora15/16.
Any problems on similar configuration, plz feel free to drop me a message.

-s

 

[update] Aug.17th

About the “src” folder:
In the configure file, writes:

 

I didnt comment out “range ” values  for new versions of linux kernel contains such code.

 

About the Step8. first time I use  “>” and when new version trees come, I use “>>” instead.. like following

So, if other users who dont handle version intro with this file, please just  configure above code, and hard-code modify “range” array.

above I mentioned “ln or cp”  trees here, just as Andre suggested it’s not a good idea to put source code inside the app folder.
well I’m now not installing lxr in a standard prefix(like: /usr/local/ or /usr/), so I would like the data integrated

I place source code trees  in other place and use soft link to keep update.

I think the soft link is alternatively a good choice to avoid data loosing when app update/deinstall.

And of course when new install/upgrade needed, I think we can move away the src folder and softlink back here.

 

About the err mesg#1  and step7. on folder “/lxr/lxrconf.d/html/”

here I didnt successfully configured the server as I didnt grant enough privilege to the “/lxr/lxrconf.d/html/” dir. it’s why failed.
I mv the folder to “/lxr/http” and grant privilege, it’s ok to access now.

I think it ok not move the folder, just chown/chmod to give enough privilege to let httpserver to access the folder.
My change is not a must, I just think it ok to delete dir “”/lxr/lxrconf.d/” after server successfully running.  and the server not rely on this folder now.

and before step#7,  invoke  “cd ” to  ${LXRROOT}, already updated.

 

Thanks Andre pointing out these issues,

-s

 

Compile swish-e RPM for Fedora15/16

swish-e is a very useful tool that helps for indexing…
http://swish-e.org/index.html

they dont provides RPMs for Fedora system, so I prepared for anybody who need it.

1) About Repo of this RPM, suspect that you can resolve all dependencies by yourself. or configure rpmfusion as guide.
http://rpmfusion.org/Configuration

2) Download the RPM and use yum like: (for fedora15.i686)
# yum localinstall swish-e-2.4.7-1.fc15.i686.rpm

3) yum can resolve all dependencies except “perl(MP3::Tag)”, Fedora RPMfusion doesnt provide it.
I packaged another package on this perl package.

4) so download the both package to same folder and use yum localinstall
# yum localinstall swish-e-2.4.7-1.fc15.i686.rpm perl-MP3-Tag-1.11-2.rf.noarch.rpm

5) I’ll also provide Fedora16.i686/x64 package here:
https://www.shisaihua.com/upload/120705/

gvim/gs打印中文文件

今天正好在看一段代码,然后突发其想用gvim打开,居然色彩渲染得不错,便顺手用来打印。发现报错:

于是仔细看了一下,应该是没指定打印设备,

去打印机旁把纸拿过来,看着打印效果还成,但上面的中文全都成了乱码了(倒问号),
回来继续捣腾,花了半天时间终于把中文乱码的问题解决了,网上的可借鉴资料不多,写下来希望对别人有些帮助。

相关环境/软件版本:


配置步骤:

分析gvim利用lpr的调用来打印成ps,这边中文的问题主要出现在gs部分,因为平时利用其他软件打印均无此问题。

1.  启用ghostscript中文支持

yum install ghostscript-chinese-zh_CN

这个软件包,主要是在/usr/share/ghostscript/conf.d/下生成一个可用的配置文件cidfmap.zh_CN ,该文件指向的中文字体是附带的wqy-zhenhei.*
          (此处仅以wqy-zhenhei为例,可自行配置cidfmap.zh_CN文件来选择自己需要的字体)

2.   配置gvim,以配合gs的格式
(此处BousungEG-Light-GB见配置文件cidfmap.zh_CN)

3.  按步骤打印成ps文件,利用gs来查看。发现出错

4. 按照出错提示

5. 检查我手上的TeXLive包的cmap设置,发现相关的文件都有,所以直接拿来建一个软链

6. 重新查看ps文件 一切正常。

VirtualBox doesnt work with kernel-2.6.41.fc15

My Env:

launching VirtualBox failed since it needs to re-compile driver:

check the logs and see the err:

Double check that Fedora Kernel 2.6.41 not provides this header again.
not like in 2.6.40(also called 3.1 and 3.0 in mainline kernel.)

Still working on a workaround….
an obvious w/r is to rollback to 2.6.40 kernel.

Thu Dec 8 23:19:43 CST 2011
seems it’s a reported issue…
upgrade to 4.1.6 and change scripts:

VirtualBox-4.1-4.1.6_74713_fedora15-1.x86_64

w/r

Following links may also help:
Default Fedora 15 kernel 2.6.41.1-1: asm/amd_iommu.h missing; bad kernel upgrade!
VirtualBox 4.1.6 on Fedora 15 with Kernel 2.6.41.1: module compilation error

Recover from root partition lost

I ran into troubles on my Dell box, which hosting Fedora(2.6.41.1-1.fc15.i686 ) and WinXP Dual OS.

My OS partition table looks like the following(After recovery)

 

Actually I dont especially partition for /home or /tmp,  it’s directed to the root partition.
***I think it a not smart design in Fedora using /etc/mtab
***Which may cause duplicated mount.
***If you dont like it ,just change mtab solution.

[Please Dont Copy following Steps, danger! ]

1. umount /dev/sda7
It’s good that /home umounted.

2. re-run the cmd1 , umount several times. with option ‘-l’, which may dismount root partition.

3. os in bad state although running applications keep working, but /dev/sda is no visible now.

4. fdisk or df not work.

5. reboot and try above codes…and finally…. system down.

[Time to Rescue]

1. reboot nodes doesn’t work, grub seems ok .
/boot is not affected, but cannot boot, incidentally turn to debug dracut shell.

2. use cmd fsck.ext4 and e2fsck  seems not have obvious problems.
mount all my Linux partitions one-by-one, found the problem that my root partition lost.

3. seems I find the root cause that partition table is not in good condition.
cannot find /root.
But all other partitions are work fine.

4. After a while I decide to continue.
I’ve a iso image of “Fedora-15-i686-Live-XFCE.iso” on my Windows partition.
It’s prepared for the first installation from iso.

5. so use this iso for a live linux rescue env.
editing the grub command
(my /boot is not affected, so grub still works, even if it fail, I have grub4dos ready. )

6. boot the LiveCD,  mount the disk partitions and check. seems all ok except the root partition.
TestDisk is a well-known free tool that can help repair the partition table and find the lost partitions…..
It’s however fine my LiveOS can connect internet and download TestDisk binary….
Use TestDisk Analyze to find the partition table, write back to Disk…
<Caution: the write back operation is not safe, backup current table if necessary>

7. reboot OS but ‘m still blocked on GRUB page, so I had to turned back to LiveOS as in step5

8. from my notes, noticed that the disk sequence has already changed…
for example, the /dev/sda5 windows partition is now marked as /dev/sda3
/boot which was /dev/sda8 is now /dev/sda5

need to change following files, replace the changed disk id:

for example change (hd0,8)->(hd0,4) on my env. for /boot
change /dev/sda05 mount point in fstab to /dev/sda03
those records in fstab using UUID is not necessary. if the uuid of disk partition is not changed.
<use cmd blkid to verify>

9. since the boot partition id changed and last reboot blocked on the grub page.
need to re-install grub

10. reboot  and OS can correctly restart… all partitions found.
using e2fsck to check and verify.

—————————————————
Fri Dec  9 10:36:22 CST 2011

update:
Another issue after the partition table recover.

My Oracle DB cannot startup

To Fix:

so, umount all bind mount point on tmpfs, and remount with a larger size.