Create a custom repository

You are here:
Estimated reading time: 1 min

OpenWrt allows to easily create custom package repositories so the end-user can install and update the software from the web interface of its router.

In order to do so, create a specific folder in your local machine, for instance:

mkdir -p ~/workspace/repo

After that, it will be needed to copy the specific packages (i.e. .ipk files) from the folder ~/code/barrier_breaker/bin/ramips/packages/ to this folder. Let’s do this for the three packages created so far in this tutorial.

Create a shell script that copies all packages from the maestrotutorial repository to this folder and then generates the ‘Packages.gz’ which indexes all the available packages from the repository:

cd ~/workspace/repo
touch ~/workspace/repo/update_repo.sh
chmod u+x ~/workspace/repo/update_repo.sh

Paste the following content into the shell script you have created:

#!/bin/sh

rsync -azv /home/vagrant/workspace/openwrt/bin/ramips/packages/maestrotutorial/ ./
/home/vagrant/workspace/openwrt/scripts/ipkg-make-index.sh ./ | gzip > ./Packages.gz

Run the shell script to create the index file for your packages:

cd ~/workspace/repo; ./update-repo.sh

After the operation is completed, the folder repo will have all the .ipk files that you have copied into it and also a ‘Packages.gz’ that indexes them. In order to make all this information available in a remote repository, you have to upload to your FTP server the .ipk files and also the ‘Packages.gz’ file. Then, in your Maestro router, you can configure the remote repository by going to System > Software > Configuration and declaring your remote repository adding the following line at the bottom of the text area. For the purpose of this tutorial, you can add following line at the bottom of the text area:

src/gz maestrotutorial http://repo.maestro-wireless.eu/maestrotutorial

 

Click on Submit at the bottom of the page.

After that, go back to System > Software > Actions and click on Update lists:

You should see the following confirmation message:

Downloading http://repo.maestro-wireless.eu/maestrotutorial/Packages.gz.
Updated list of available packages in /var/opkg-lists/maestrotutorial.

Now, you will be able to browse the available packages or filter them by typing their name. For instance, type ‘hello’ in the Filter input box and click on Find package. You should see the three packages listed as installed (or as available if you had removed them from the router):

You can install the package directly from the GUI by clicking on the ‘Install’ link on the left of the screen.

Was this article helpful?
Dislike 0 0 of 0 found this article helpful.
Views: 131
Back to Top