Re: [lime] Ways to update librerouter packages

このメッセージを削除

このメッセージに返信
著者: Ilario Gelmetti
日付:  
To: libremesh
題目: Re: [lime] Ways to update librerouter packages
On 12/15/22 09:28, Selan Kon via LibreMesh wrote:> Selan Kon via LibreMesh:
>> I want to try a modified version of lime packages on a librerouter and
>> I'm looking for a good way to send the packages from my computer to
>> there.


Helooo!
What I would do is to compile the package with the updated code, serving
the packages directory on the local network and install it on the router
using OPKG [1].
Some of this has been explained here: [2]

In order to use your laptop as a repository you have to compile the
image and the packages yourself using the buildroot method (the one
described on the LibreMesh website: [3]) so that OpenWrt will recognize
as valid the signature of the packages.

Once you have your router flashed, you can modify the code on your
laptop, and then you have a couple of different ways to proceed: the
classic online one (commit the changes, push them to a fork of
lime-packages, pull the new changes with the buildroot from the online
repository) or the offline one. In any case, then you have to compile
the modified packages and install them on the router.
I always used the first online way, but the second should be faster, so
here goes some instructions on the offline way:

in the feeds.conf file in the buildroot, use the absolute path of the
lime-packages repository on your computer, like:

cd openwrt
cat feeds.conf
[...]
src-link libremesh /home/ilario/projects/gsoc2019/lime-packages-backup
src-git profiles https://github.com/libremesh/network-profiles.git

(in the online method, the first line would have been something like:
src-git libremesh
https://github.com/ilario/lime-packages.git;staging202210 )

Then pull the new code from the buildroot using:

scripts/feeds update libremesh
scripts/feeds install -a

Then I think you should update the .config file with:

make defconfig

(or make menuconfig that should also do the same)

Now you can re-compile only the package you modified, for example if you
modified the code of lime-system:

make package/lime-system/clean
make package/lime-system/compile
make package/index

(the third command here will update the list of the packages in the
repository and sign it again [4])
In the meanwhile, you can keep the bin/ folder shared with:

cd bin/
python -m http.server

On the router, you will need to have the location of your laptop's
repository in /etc/opkg/customfeeds.conf [5]. If your router still has
the IP 192.168.0.1 you can use the lines from [1]. If your router
already has lime-system, you will have to adapt the IP of your laptop to
the new subnet and indicate it in the customfeeds.conf. It will be like
this:

src/gz local1 http://?.¿.?.¿:8000/packages/!¡!¡!¡!¡!¡/base
src/gz local2 http://?.¿.?.¿:8000/packages/!¡!¡!¡!¡!¡/libremesh
src/gz local3 http://?.¿.?.¿:8000/packages/!¡!¡!¡!¡!¡/luci
src/gz local4 http://?.¿.?.¿:8000/packages/!¡!¡!¡!¡!¡/packages
src/gz local5 http://?.¿.?.¿:8000/packages/!¡!¡!¡!¡!¡/profiles
src/gz local6 http://?.¿.?.¿:8000/packages/!¡!¡!¡!¡!¡/routing
src/gz local7 http://?.¿.?.¿:8000/packages/!¡!¡!¡!¡!¡/telephony
src/gz local8 http://?.¿.?.¿:8000/targets/?!?!?/!?!?!?!?/packages

where you need to adapt the content with ??? and !!! to the actual IP of
your computer and the directories you have inside of bin/packages and
bin/targets.
Make sure that this IP on your computer is set on the interface you use
for connecting to the router.
For making things faster, you can comment out all the other repositories
that will not be used, they are in /etc/opkg/distfeeds.conf

Then you can run, on the router:

opkg update

and for reinstalling, let's say, lime-system:

opkg install --force-reinstall lime-system

This whole procedure is a bit long, but when you got used to it, it gets
quite simple.

I am not sure if this works also if the package was included in the
firmware at compilation time...
Please let us know if you have any doubt or any improvement to this
workflow!

Ciao!
Ilario

[1] https://openwrt.org/docs/guide-user/additional-software/opkg
[2] https://lists.autistici.org/message/20221109.090057.ddaf23c4.en.html
[3] https://libremesh.org/development.html
[4] https://openwrt.org/docs/techref/buildroot#make_sequence
[5]
https://openwrt.org/docs/guide-developer/feeds#adding_your_package_to_your_own_feed

--
Ilario
iochesonome@???
ilario@???