How to create a custom package repository

Since updater.sh (the updater-ng version) is uninstalling any custom-installed packages, it gets a little tricky to install your own packages on the Turris (Omnia) router. You can avoid uninstallations by creating your own repository, like this:

EDIT: Current version of updater does not uninstall custom installed packages, so creating a repository is not necessary anymore. Anyway, the howto here can be still used so you have a better track of what custom packages have you installed.

  1. Create directory where you put the packages. I use /root/repo.

  2. Put there any packages (.ipk files) you want.

  3. Put the file ipkg-make-index.sh into the same directory.

  4. Create a wrapper script makeindex.sh and make it executable:

    cat >makeindex.sh <<EOF

    #!/bin/sh
    DIR="/root/repo"
    cd "$DIR"
    sh ./ipkg-make-index.sh . | gzip > Packages.gz
    EOF

    chmod +x makeindex.sh

  5. Run the wrapper script whenever you change packages in the directory.

  6. Put respository definiton into the file /etc/updater/user.lua, together with install commands for your packages:

    cat /etc/updater/user.lua

    Repository “local” "file:///root/repo"
    Install “myownpackage”

  7. Run updater.sh. It should notice the new repository and install all requested packages.

3 Likes

In my case it was not necessery.
Following @cynerd directions I just reinstalled all local ipks after update.
And that’s all. Updater does not remove them.

OK, I somehow missed that local packages are going to get some support in updater. So the howto was actually valid until today. :wink:

I wanted to comment on the missing “cd” in the makeindex.sh :smile: …but looked again and you changed already

I moved the current “user.lua” to user.lua.bak and made a new user.lua with those lines. I put the kmod-ath9k-htc*.ipk file in the /root/repo folder, and this is the output…

root@K-Router:~# updater.sh
WARN:Script revision-specific not found, but ignoring its absence as requested
WARN:Script serial-specific not found, but ignoring its absence as requested
DIE:
inconsistent: Package kmod-ath9k-htc requires package ath9k-htc-firmware that is not available.

Well i guess… just to have to remove all the changes back to normal :)…if it is not necessary anymore.

No, the cd was there all the time, see the changelog of the post.

This should work. Please double check the repository definition in user.lua and check that the package is in the index file (# gunzip < /root/repo/Packages.gz).

@Ondrej_Caletka, i meant to say “$Dir”

I thought this script meant for something else…to keep current local packages, did not know the firmware file or everything with it were downloaded to the *Packages.gz". Well doesn’t matter, just have to configure it again.

Path obcviously changed from 3.9

Put respository definiton into the file /etc/updater/conf.d/user.lua, together with install commands for your packages:

cat /etc/updater/conf.d/user.lua

Repository “local” "file:///root/repo"
Install “myownpackage”

I followed this instructions but how to get rid of this :

WARN:Script file:///usr/share/updater/localrepo/localrepo.lua not found, but ignoring its absence as requested
WARN:Morpher is obsoleted! You have used morpher syntax with function: Repositor

I tried to summarize this area:
https://doc.turris.cz/doc/en/public/custom_packages

WARN:Script file:///usr/share/updater/localrepo/localrepo.lua not found I believe this was bug in 3.9 and should be fixed in 3.9.1

No that is not a bug. That means that you are not using localrepo. If you don’t use localrepo then it won’t create that file and updater informs you that it doesn’t exists. If you don’t expect it to be there then you can ignore it. If you expect to use localrepo then there is something wrong because updater doesn’t found it.

Bug in 3.9 was that this file wasn’t created even if you used localrepo. So yes this message is manifestation of 3.9 bug but if you see it it doesn’t mean that you encountered bug.

Hello,
is there any way to add custom repository on web server?
Adding:

Repository("cz.vyskocil.eu", "https://cz.vyskocil.eu/omnia/")
Install("netdata")

to /etc/updater/conf.d/user.lua creates errors:

Index cz.vyskocil.eu/https://cz.vyskocil.eu/omnia//Packages.gz is broken (missing): https://cz.vyskocil.eu/omnia//Packages.gz: No OCSP response received
unreachable: https://cz.vyskocil.eu/omnia//Packages.gz: No OCSP response received

Is this about web server configuration? Or should I add somewhere links to SSL keys?
Thans in advance.

OK, it works with:

Repository("cz.vyskocil.eu", "https://cz.vyskocil.eu/omnia/", { verification = "none" })

But, how to setup verification?

You don’t have ocsp stamping enabled on you server. Either enable it on you server or disable ocsp (Repository("..", "...", {ocsp = false})) (reference https://turris.pages.labs.nic.cz/updater/docs/language.html)

Thank you,
after enabling OCSP stapling on server it works with:

Repository("cz.vyskocil.eu", "https://cz.vyskocil.eu/omnia/", { verification = "cert" })