Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:additional-software:opkg [2023/03/27 17:06] – [Local repository] vgaeteradocs: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 << "EOF" > opkg-update.sh cat << "EOF" > opkg-update.sh
 #!/bin/sh #!/bin/sh
Line 319: Line 320:
 done < /etc/opkg/distfeeds.conf done < /etc/opkg/distfeeds.conf
 EOF EOF
-chmod +x ./opkg-update.sh+chmod +x opkg-update.sh 
 + 
 +# Run the script
 ./opkg-update.sh ./opkg-update.sh
 </code> </code>
Line 349: Line 352:
 done done
 EOF EOF
-chmod +x ./opkg-rm-pkg-deps.sh+chmod +x opkg-rm-pkg-deps.sh 
 +</code> 
 + 
 +<code bash>
  
 # Run the script # Run the script
-./opkg-rm-pkg-deps.sh <package_name>+./opkg-rm-pkg-deps.sh package_name
  
 # Reboot to make the free space visible # Reboot to make the free space visible
Line 373: Line 379:
 opkg install rsync opkg install rsync
  
-Create a local repository+Save the script 
 +cat << "EOF" > opkg-sync-local-repo.sh 
 +#!/bin/sh
 . /etc/os-release . /etc/os-release
 +REPO_LOCAL="file://${1:-/${ID}}/"
 REPO_URL="https://downloads.${HOME_URL#*//}" REPO_URL="https://downloads.${HOME_URL#*//}"
-REPO_LOCAL="file:///${ID}/+case "${VERSION_ID}" in 
-REPO_CORE="releases/${VERSION_ID}/targets/${OPENWRT_BOARD}" +(snapshot) REPO_DIR="downloads/snapshots" ;; 
-REPO_PKGS="releases/${VERSION_ID}/packages/${OPENWRT_ARCH}" +(*) REPO_DIR="downloads/releases/${VERSION_ID}" ;; 
-mkdir -p ${REPO_LOCAL#*//}${REPO_CORE} ${REPO_LOCAL#*//}${REPO_PKGS} +esac 
-rsync --bwlimit=8M --del -r -t -v \ +REPO_CORE="${REPO_DIR}/targets/${OPENWRT_BOARD}" 
-    ${REPO_URL/https/rsync}downloads/${REPO_CORE}/ \ +REPO_PKGS="${REPO_DIR}/packages/${OPENWRT_ARCH}" 
-    ${REPO_LOCAL#*//}${REPO_CORE}/ +for REPO_DIR in "${REPO_CORE}" "${REPO_PKGS}" 
-rsync --bwlimit=8M --del -r -t -v \ +do mkdir -p "${REPO_LOCAL#*//}${REPO_DIR#*/}" 
-    ${REPO_URL/https/rsync}downloads/${REPO_PKGS}/+rsync --bwlimit="8M--del -r -t -v \ 
-    ${REPO_LOCAL#*//}${REPO_PKGS}/+"${REPO_URL/https/rsync}${REPO_DIR}/
 +"${REPO_LOCAL#*//}/${REPO_DIR#*/}/" 
 +done 
 +EOF 
 +chmod +x opkg-sync-local-repo.sh
  
-# Configure Opkg+# Run the script 
 +./opkg-sync-local-repo.sh /openwrt 
 + 
 +# Configure Opkg to use local repo 
 +. /etc/os-release 
 +REPO_LOCAL="file:///${ID}/" 
 +REPO_URL="https://downloads.${HOME_URL#*//}"
 sed -i -e "s|${REPO_URL}|${REPO_LOCAL}|" /etc/opkg/distfeeds.conf sed -i -e "s|${REPO_URL}|${REPO_LOCAL}|" /etc/opkg/distfeeds.conf
  
Line 395: Line 414:
 # Configure Opkg on the clients # Configure Opkg on the clients
 . /etc/os-release . /etc/os-release
-REPO_URL="https://downloads.${HOME_URL#*//}" 
 REPO_LOCAL="http://192.168.1.1/${ID}/" REPO_LOCAL="http://192.168.1.1/${ID}/"
 +REPO_URL="https://downloads.${HOME_URL#*//}"
 sed -i -e "s|${REPO_URL}|${REPO_LOCAL}|" /etc/opkg/distfeeds.conf sed -i -e "s|${REPO_URL}|${REPO_LOCAL}|" /etc/opkg/distfeeds.conf
 </code> </code>
  • Last modified: 2024/04/12 10:08
  • by virtualguy