Hi all!
Testing with a router from the ATH79 target I realized that the
instructions I wrote in my previous email are not sufficient for every
router.
I wrote an extended guide on the website:
Contributions to the targets table are welcome!
Ciao,
Ilario
On 9/4/20 3:32 PM, SAn wrote:
Thanks Ilario for taking the time to investigate and
document your findings!
On September 4, 2020 8:28:30 AM GMT-03:00, Ilario Gelmetti <iochesonome(a)gmail.com>
wrote:
TL;DR to compile a LibreMesh image compatible
with all the packages
from OpenWrt repositories is possible and easy.
Long (and messy) version:
It should definitely be possible to use the packages on the OpenWrt
repository when compiling a tagged (and released) version.
So I did a bit of research on this.
The kernel shipped with OpenWrt 19.07.3 has version number:
4.14.180-1-2e88863ccdd594fb8e842df3c25842ee
but the one compiled following the instructions on our website has
version number (check it using "opkg info kernel"):
4.14.180-1-5e4cae9b310636f0484e8ed34f1b94b0
as you can see, the kernel version is the same but what changes is the
last part.
**This string at the end of the version is a hash of the options used
for compiling the kernel.**
This means that even if the version is the same, when we select some of
the LibreMesh packages which activate some functions in the kernel, we
make our image incompatible with part (only the packages which are
related somehow to the kernel, like tc) of OpenWrt's repositories.
Some good information can be found here:
https://forum.openwrt.org/t/compiling-image-with-same-kernel-as-the-repos/4…
and here:
https://forum.openwrt.org/t/kernel-version-incompatible/59784/6
and most importantly here:
https://openwrt.org/docs/guide-developer/build-system/use-buildsystem#compi…
The hash of the configuration gets calculated here:
https://github.com/openwrt/openwrt/blob/4791afa734d4754cd92c65feffc60e62e4d…
and in my case (compiling for YouHua WR1200JS) refers to this file:
build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-4.14.180/.config.set
So, the compilation should be done starting from the config.buildinfo
present in the OpenWrt repository in
https://downloads.openwrt.org/releases/[stable
release]/targets/[architecture]/[target]/config.buildinfo
and after this, the packages we select should not set kernel options.
And neither their dependencies.
The downside is that the compilation takes much longer and 9 GB of
additional disk space.
Instead of starting from the full config.buildinfo, I tested which are
the lines which actually cause a kernel version change (in case you
wanted to try, a fast way to generate the .config.set from the .config
is using the command "make target/linux/compile").
This is the bare minimum .config (at least when compiling for ramips)
for having the correct kernel vermagic:
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
# CONFIG_KERNEL_KALLSYMS is not set
CONFIG_KERNEL_BUILD_DOMAIN="buildhost"
CONFIG_KERNEL_BUILD_USER="builder"
You can set these options in the menuconfig (inside the "Global build
settings" menu) or (maybe easier?) start from a .config file with only
these lines and then select target (which router to compile for) and
packages (like selecting LibreMesh packages).
Going this way, I obtained a kernel with the right options, which
therefore should be compatible with all the packages in OpenWrt's
repositories.
Ciao!
Ilario
PS we have other settings in our packages that do not change the kernel
configuration but create an image which has some features which images
created with official image builder (SDK) cannot contain. Are these
options really needed in LibreMesh?
bmx7-auto-gw-bw-mode/Makefile: CONFIG_BUSYBOX_CONFIG_CROND
bmx7-auto-gw-bw-mode/Makefile: CONFIG_BUSYBOX_CONFIG_CRONTAB
bmx7-mdns/Makefile: CONFIG_BUSYBOX_CONFIG_CROND
bmx7-mdns/Makefile: CONFIG_BUSYBOX_CONFIG_CRONTAB
lime-debug/Makefile: select BUSYBOX_CONFIG_NC
lime-debug/Makefile: select BUSYBOX_CONFIG_NC_SERVER
check-date-http/Makefile: BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
hotplug-initd-services/Makefile: BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
shared-state-babeld_hosts/Makefile: BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
shared-state-bat_hosts/Makefile: BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
shared-state-dnsmasq_hosts/Makefile: BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
shared-state-nodes_and_links/Makefile:
BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
shared-state-pirania/Makefile: BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
I am not sure about BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT I would say that it is not a need
if it is used it could be replaced to reads to /dev/urandom instead of using $RANDOM ?
>
> If these are really needed, can we ask upstream OpenWrt to have them
> activated by default in the next releases?
>
>
> On 8/30/20 7:29 PM, SAn via lime-users wrote:
>> I think that the original problem is that a few programs (the kernel
> modules for example) are forced to depend to exactly the same kernel
> with exactly the same configuration. So using a different kernel
> version or config will raise a "invalid version", that was what
> happened. That is beacause the openwrt feed had one version but you
> compiled another version of the kernel.
>>
>>
>> On 8/29/20 6:37 PM, amuza wrote:
>>>
>>>
>>> amuza:
>>>>
>>>>
>>>> amuza:
>>>>>
>>>>>
>>>>> amuza:
>>>>>>
>>>>>>
>>>>>> Ilario Gelmetti:
>>>>>>> On 8/26/20 7:38 PM, amuza wrote:
>>>>>>>> I need to install a program in a Lime router (built based
on
> OpenWRT 18.06)
>>>>>>>>
>>>>>>>> First I have done `opkg update`. It updated some lists
of
> packages but I
>>>>>>>> also got the following errors:
>>>>>>>>
>>>>>>>> --------------------
>>>>>>>> * opkg_download: Failed to download
>>>>>>>>
>
http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mips_24kc/lib…,
>>>>>>>> wget returned 8.
>>>>>>>> * opkg_download: Failed to download
>>>>>>>>
>
http://downloads.openwrt.org/releases/18.06-SNAPSHOT/packages/mips_24kc/lib…,
>>>>>>>> wget returned 8.
>>>>>>>> * opkg_download: Failed to download
>>>>>>>>
>
http://snapshots.libremesh.org/packages/mips_24kc/libremesh/Packages.gz,
>>>>>>>> wget returned 4.
>>>>>>>> --------------------
>>>>>>>
>>>>>>> Sorry, it's because we're compiling the
"openwrt-18.06" branch
> instead
>>>>>>> of the "v18.06.8" tag (you can see all the tags
here [1]). When
> I edited
>>>>>>> the development page on the website I didn't think about
the
> drawbacks
>>>>>>> (at that time the reason was that we needed a commit which
was
> not
>>>>>>> included yet in any tag).
>>>>>>> The binary repositories are available only for tagged
releases,
> that's
>>>>>>> why you cannot find the packages using OPKG.
>>>>>>> I just edited the webpage (just changed one line) indicating
the
> tag: [2].
>>>>>>>
>>>>>>> So that now the command for downloading the OpenWrt code is:
>>>>>>>
>>>>>>> git clone -b v18.06.8 --single-branch
>>>>>>>
https://git.openwrt.org/openwrt/openwrt.git
>>>>>>>
>>>>>>> Maybe you can use the same directory you were using, after
some
> clean
>>>>>>> and dirclean, but it's better if you just download again
in a
> clean way.
>>>>>>> Sorry for the mess.
>>>>>>> Ciao,
>>>>>>> Ilario
>>>>>>>
>>>>>>> PS in the same way, if you want to compile on top of OpenWrt
> 19.07, just
>>>>>>> replace v18.06.8 with v19.07.3
>>>>>>>
>>>>>>> [1]
https://git.openwrt.org/?p=openwrt/openwrt.git;a=tags
>>>>>>>
>>>>>>> [2]
>>>>>>>
>
https://libremesh.org/development.html#compiling_libremesh_from_source_code
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Sooo nice message Ilario!! I was fighting now with another
> program I
>>>>>> wanted to install, which was giving me the same kind of
problems.
> I will
>>>>>> do everything again. Thank you!
>>>>>>
>>>>>
>>>>>
>>>>> I tried with 18.06.8 but got similar results when using opkg.
> "opkg
>>>>> update" gave me some errors too:
>>>>>
>>>>> * opkg_download: Failed to download
>>>>>
>
http://downloads.openwrt.org/releases/18.06.8/packages/mips_24kc/libremap/P…,
>>>>> wget returned 8.
>>>>> * opkg_download: Failed to download
>>>>>
>
http://downloads.openwrt.org/releases/18.06.8/packages/mips_24kc/libremesh/…,
>>>>> wget returned 8.
>>>>> * opkg_download: Failed to download
>>>>>
>
http://snapshots.libremesh.org/packages/mips_24kc/libremesh/Packages.gz,
>>>>> wget returned 4.
>>>>> * opkg_download: Check your network settings and connectivity.
>>>>>
>>>>>
>>>>> And when trying to install the program I got this:
>>>>>
>>>>> root@MV-7ab7ec:~# opkg install tc
>>>>> Installing tc (4.16.0-8) to root...
>>>>> Downloading
>>>>>
>
http://downloads.openwrt.org/releases/18.06.8/packages/mips_24kc/base/tc_4.…
>>>>> Collected errors:
>>>>> * satisfy_dependencies_for: Cannot satisfy the following
> dependencies
>>>>> for tc:
>>>>> * kernel (= 4.9.214-1-2b8f9dfe583e5c09aadd9474da55137f)
>>>>> * opkg_install_cmd: Cannot install package tc.
>>>>> root@MV-7ab7ec:~#
>>>>>
>>>>
>>>> Now I have compiled it based on v19.07.3 but I keep having the same
>>>> problems. "opkg update" shows these erorrs:
>>>>
>>>> Collected errors:
>>>> * opkg_download: Failed to download
>>>>
>
http://downloads.openwrt.org/releases/19.07.3/packages/mips_24kc/libremap/P…,
>>>> wget returned 8.
>>>> * opkg_download: Failed to download
>>>>
>
http://downloads.openwrt.org/releases/19.07.3/packages/mips_24kc/libremesh/…,
>>>> wget returned 8.
>>>> * opkg_download: Failed to download
>>>>
>
http://snapshots.libremesh.org/packages/mips_24kc/libremesh/Packages.gz,
>>>> wget returned 4.
>>>> * opkg_download: Check your network settings and connectivity.
>>>>
>>>>
>>>> And again I cannot install some programs:
>>>>
>>>> root@MV-7ab7ec:~# opkg install tc
>>>> Installing tc (5.0.0-2.1) to root...
>>>> Downloading
>>>>
>
http://downloads.openwrt.org/releases/19.07.3/packages/mips_24kc/base/tc_5.…
>>>> Collected errors:
>>>> * satisfy_dependencies_for: Cannot satisfy the following
> dependencies
>>>> for tc:
>>>> * kernel (= 4.14.180-1-342af9e4f67b3447c53216ab8e3b12a1)
>>>> * opkg_install_cmd: Cannot install package tc.
>>>> root@MV-7ab7ec:~#
>>>>
>>>>
>>>> Any advice on how to solve this problem? I would like to have some
>>>> programs installed.
>>>>
>>>>
>>>
>>> I still don't know why I had that problem when installing some
> programs,
>>> but anyway, I don't need help there anymore. I added them to the
>>> compilation.
>>>
>>> Cheers
>>>
>>>
>>> _______________________________________________
>>> lime-users mailing list
>>> lime-users(a)lists.libremesh.org
>>>
https://lists.libremesh.org/mailman/listinfo/lime-users
>>>
>> _______________________________________________
>> lime-users mailing list
>> lime-users(a)lists.libremesh.org
>>
https://lists.libremesh.org/mailman/listinfo/lime-users
>>
>
>
> --
> Ilario
> iochesonome(a)gmail.com
> ilario(a)sindominio.net
>
>
>
>
> _______________________________________________
> lime-users mailing list
> lime-users(a)lists.libremesh.org
>
https://lists.libremesh.org/mailman/listinfo/lime-users