Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:additional-software:opkg [2023/03/27 12:29] – [Local repository] vgaetera | docs:guide-user:additional-software:opkg [2023/04/03 00:34] – [Local repository] update vgaetera | ||
|---|---|---|---|
| Line 305: | Line 305: | ||
| ==== Verbose opkg update ==== | ==== Verbose opkg update ==== | ||
| <code bash> | <code bash> | ||
| + | # Save the script | ||
| cat << " | cat << " | ||
| #!/bin/sh | #!/bin/sh | ||
| Line 319: | Line 320: | ||
| done < / | done < / | ||
| EOF | EOF | ||
| - | chmod +x ./opkg-update.sh | + | chmod +x opkg-update.sh |
| + | |||
| + | # Run the script | ||
| ./ | ./ | ||
| </ | </ | ||
| Line 349: | Line 352: | ||
| done | done | ||
| EOF | EOF | ||
| - | chmod +x ./opkg-rm-pkg-deps.sh | + | chmod +x opkg-rm-pkg-deps.sh |
| + | </ | ||
| + | |||
| + | <code bash> | ||
| # Run the script | # Run the script | ||
| - | ./ | + | ./ |
| # Reboot to make the free space visible | # Reboot to make the free space visible | ||
| Line 359: | Line 365: | ||
| ==== Local repository ==== | ==== Local repository ==== | ||
| - | There may be use cases where having a package repository on the device itself is advantageous. Such cases may include: | + | There may be use cases where having a package repository on the device itself is advantageous: |
| - | * Unreliable WANs, where the connectivity upstream of the device to a remote repository goes down for an unacceptable period of time | + | * Unreliable WANs, where the connectivity upstream of the device to a remote repository goes down for an unacceptable period of time. |
| - | * Bandwidth Caps, where the connectivity upstream of the device to a remote repository has a limited amount of data that can be fetched before the connectivity is throttled or goes down until the next period where the cap resets | + | * Bandwidth Caps, where the connectivity upstream of the device to a remote repository has a limited amount of data that can be fetched before the connectivity is throttled or goes down until the next period where the cap resets. |
| - | * A repository with customization; | + | * A repository with customization; |
| - | * The device acts as a reference device for other systems, to ensure that the package versions across the devices local to the network remain consistent | + | * The device acts as a reference device for other systems, to ensure that the package versions across the devices local to the network remain consistent. |
| - | + | Set up a local repository for your target. | |
| - | FIXME Convert this into LEDE and explain what it is actually doing. | + | Assuming about 2-3 GB of free space is available. |
| - | + | ||
| - | An example | + | |
| <code bash> | <code bash> | ||
| - | r=44685 | + | # Install packages |
| - | search=" | + | opkg update |
| - | replace=" | + | opkg install rsync |
| - | sed -i -e " | + | |
| - | </ | + | |
| - | To share the repository with other devices | + | # Save the script |
| + | cat << " | ||
| + | #!/bin/sh | ||
| + | . / | ||
| + | REPO_LOCAL=" | ||
| + | REPO_URL=" | ||
| + | case " | ||
| + | (snapshot) REPO_DIR=" | ||
| + | (*) REPO_DIR=" | ||
| + | esac | ||
| + | REPO_CORE=" | ||
| + | REPO_PKGS=" | ||
| + | for REPO_DIR in " | ||
| + | do mkdir -p " | ||
| + | rsync --bwlimit=" | ||
| + | " | ||
| + | " | ||
| + | done | ||
| + | EOF | ||
| + | chmod +x opkg-sync-local-repo.sh | ||
| - | <code bash> | + | # Run the script |
| - | ln -s / | + | ./opkg-sync-local-repo.sh |
| - | </code> | + | |
| - | On the second device, perform a similar search and replace using sed, but instead point to the first device' | + | # Configure Opkg to use local repo |
| + | . / | ||
| + | REPO_LOCAL=" | ||
| + | REPO_URL=" | ||
| + | sed -i -e " | ||
| - | <code bash> | + | # Share the repository on the LAN |
| - | r=44685 | + | ln -f -s ${REPO_LOCAL# |
| - | search=" | + | |
| - | replace=" | + | # Configure Opkg on the clients |
| - | sed -i -e "s!$search!$replace!" / | + | . / |
| + | REPO_LOCAL="http://192.168.1.1/ | ||
| + | REPO_URL=" | ||
| + | sed -i -e "s|${REPO_URL}|${REPO_LOCAL}|" /etc/opkg/distfeeds.conf | ||
| </ | </ | ||
| + | |||
| + | See also: [[: | ||
| ===== Non-standard installation destinations ===== | ===== Non-standard installation destinations ===== | ||
| Line 421: | Line 450: | ||
| If you want to install kernel modules on any other destination than root, you might want to read this first: [[https:// | If you want to install kernel modules on any other destination than root, you might want to read this first: [[https:// | ||
| - | |||
| - | ===== Local repository ===== | ||
| - | Set up a local repository for your target. | ||
| - | Assuming about 2-3 GB of free space is required. | ||
| - | |||
| - | <code bash> | ||
| - | # Create local repo | ||
| - | . / | ||
| - | REPO_PFX="/ | ||
| - | REPO_TARGET=" | ||
| - | REPO_ARCH=" | ||
| - | mkdir -p ${REPO_PFX}/ | ||
| - | rsync --bwlimit=8M --del -r -t -v \ | ||
| - | rsync:// | ||
| - | ${REPO_PFX}/ | ||
| - | rsync --bwlimit=8M --del -r -t -v \ | ||
| - | rsync:// | ||
| - | ${REPO_PFX}/ | ||
| - | |||
| - | # Configure Opkg | ||
| - | sed -i -e " | ||
| - | |file:// | ||
| - | </ | ||