Search code examples
linuxmodulekernellxr

How can I download source code from Linux Cross Reference library (generated by LXR engine)?


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!


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!