Question

I wanted to download Linux kernel module source code from http://lxr.free-electrons.com/source/net/bluetooth/. Is there any tool like SVN to download the source code generated by LXR engine? Thanks in advance!

Was it helpful?

Solution

If you're still looking for an answer, here is a procedure based on a low documented feature of LXR.

  1. Display the file you are interested in
  2. Modify the URL in the browser address bar, adding at the end ?_raw=1 and go there (i.e. press return key)
  3. The file is then displayed "as is", without any decoration (it is sent as text/plain)
  4. You can now save the file from browser menu command File->Save as

NOTES:

  1. The ?_raw=1 argument can be used to have HTML files interpreted by your browser, i.e. displayed as HTML because they will be sent as text/html.
  2. The feature has been present in LXR for ages, though in versions older than 0.10 the argument is spelled ?raw=1 (without underscore).
  3. I checked that ?raw=1 works with free-electrons though they use 0.3.1 which was released in 2003!

OTHER TIPS

The documentation on lxr states that there is a git repo. http://lxr.linux.no/ I have never tried it, but it may be what you are looking for

Not exactly an answer, but I was looking for a related thing - the possibility to download individual C files from LXR as plain text. If it was possible to download files as text, in principle you could write some sort of a parser/automatic downloader for a whole directory.

The documentation for the LXR engine seems to be here:

... and as far as I could see from the 1.0 PDF manual (note that lxr.free-electrons.com seems to run on version 0.3.1, though), there is no mention of plain-text source files being exported (in addition) to the HTML.

So, very likely, as the plain-text source files seem not to be available in an LXR export, there will be no tool that will be able to download. (Btw, I too wish there was a tool like this, otherwise the only option is to clone the entire Linux source tree via git).

 

Note, however, that there is also an experimental version of LXR from lxr.linux.no ; that one generates HTML that requires JavaScript, and it will show a "download" button in its interface; then one can download the plain-text source file. As lxr.linux.no is down for me for the moment, here's a link to an annotated HTML page to another site, that seems to use the same engine (there is no note ATM for the LXR engine numeric version):

... and this is how the link looks like to obtain plain-text version:

Note that this is a different URL format than what lxr.free-electrons.com would use:

... and there is a note on the start page ( http://lxr.missinglinkelectronics.com/ ) once you enable JavaScript, which states that:

lxr.missinglinkelectronics.com is currently running an experimental fork of the LXR software provided by lxr.linux.no.

... or, in other words: the link format for downloading plain-text source files from lxr.linux.no, will not work for the (current) lxr.free-electrons.com installation.

Here you can browse the references and also can download the source file https://code-grep.com/view/project/54b083273b2082684a000008/linux-3.19-rc2

On free-electrons.com, it works by adding the argument "raw=1" in the URL. For example, this URL...

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8

... will become this :

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8&raw=1

The resulting page can then be saved using the "file saving" feature of your browser. On Linux and Windows, this is usually mapped to the ctrl+s keyboard shortcut.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top