Elixir Cross Referencer Bootlin

Hi,

it took me more than a while to figure out how to make

https://github.com/bootlin/elixir

working on my Ubuntu VM.

Is there anybody out there @jeff @lleachii @psyborg that could ask somebody at Bootlin nicely

to have Openwrt indexed on their servers ? I don't think It will need a lot of resources

on my PC the indexing took no more than 5 minutes.

Thanks

Why don't you post the steps?

While I doubt Bootlin would post the index, it is probably interesting to some.

(Note that it would have to be done for every target/subtarget, as otherwise you just get the upstream distro, not any of the target/subtarget-specific patches)

instructions are here:

https://github.com/bootlin/elixir/blob/master/README.md

my project specific file: elixir/projects/openwrt.sh reads

# Elixir definitions for openwrt


list_tags()
{
    echo "$tags"
   
}



list_tags_h()
{
    echo "$tags" | 
    grep '^v' |
    tac |
    sed -r 's/^(((v18)\.([0-9]*)(.*))|(v[0-9])\.([0-9]*)(.*))$/\3\6 \3\6.\4\7 \3\6.\4\7\5\8/' |
    sed -r 's/^(((v17)\.([0-9]*)(.*))|(v[0-9])\.([0-9]*)(.*))$/\3\6 \3\6.\4\7 \3\6.\4\7\5\8/'
}

my cloned openwrt git repos gives:

 git tag
reboot
v17.01.0
v17.01.0-rc1
v17.01.0-rc2
v17.01.1
v17.01.2
v17.01.3
v17.01.4
v17.01.5
v17.01.6
v18.06.0
v18.06.0-rc1
v18.06.0-rc2
v18.06.1
v18.06.2

Note that it would have to be done for every target/subtarget, as otherwise you just get the upstream distro, not any of the target/subtarget-specific patches

Not sure what you meant but apparently my cloned repo is short of some targets (i.e. ath79) that's maybe why was fast indexed compared to old LXR (I tried that one too but with only partial success).

And all of the OpenWrt modifications.

Look into how make target/linux/{clean,prepare} works, then you'll realize that right now you've probably just got upstream Linux, which is not what OpenWrt builds.

Python not Elixir lang

Missing

./scripts/feeds update -a
./scripts/feeds install -a

or something else ?

yep they choose a misleading name

Elixir is a source code cross-referencer inspired by LXR. It's written in Python and its main purpose is to index every release of a C or C++ project (like the Linux kernel) while keeping a minimal footprint.

It uses Git as a source-code file store and Berkeley DB for cross-reference data. Internally, it indexes Git blobs rather than trees of files to avoid duplicating work and data. It has a straightforward data structure (reminiscent of older LXR releases) to keep queries simple and fast.

Something else. If you don’t include all the OpenWrt kernel patches for all targets and sub-targets, you’ve just replicated upstream Linux that is already available at Bootlin

1 Like

these patches or other ones ?

Those don't help me very much unless they're applied to the source. That they are different for every target and subtarget make it a complicated task.

As a specific example, init code is wildly modified for each target in the ways that it handles command-line arguments. Every target that I've looked at handles it differently resulting in a different set of sources for init with very different behavior.

The rest of OpenWrt, at least for me, isn't so complicated that I need symbol search and cross-reference.

Hi @jeff, sorry to bother again.

My question are:

the way Buidroot(or whatever is called right now) uses only one copy of source for many target/subtarget and everyone of them gets their patches ?

no way to have a clean patched source code because the repo doenst have a copy of sources for every target/subtarget ?

if it is like that (and most likely will not, I am trying to grasp the basic of the build system and patches here)
is there a way to remove everything that is not my target/subtarget and generate a copy of openwrt source code with all the patches relevant to my target/subtarget applied to have abetter overview of the system ?

Sorry again I did patch the sources for my gl-ar150 switch modding, but everything is still confusing to me.

That is correct, if "have" means in a git repo that you don't create yourself.

The build system downloads the kernel sources, applies the patches to them, for the target/sub-target specified in .config. The only place that the actual sources used for compiling the kernel "appear" is under build_dir, not in the OpenWrt git repo.

I've only done it with the kernel, using make target/linux/{clean,prepare}

One might be able to do the same for the rest of the packages, many of which are highly modified as well.