diff --git a/ipk-source/sdxpinn-quecmanager-beta/CONTROL/control b/ipk-source/sdxpinn-quecmanager-beta/CONTROL/control index 599ccb9..4de6798 100644 --- a/ipk-source/sdxpinn-quecmanager-beta/CONTROL/control +++ b/ipk-source/sdxpinn-quecmanager-beta/CONTROL/control @@ -1,6 +1,7 @@ -Package: sdxpinn-quecmanager -Version: 0.0.3 +Package: sdxpinn-quecmanager-beta +Version: 0.0.1 Architecture: aarch64_cortex-a53 Maintainer: Russel Yasol dr-dolomite@github.com Cameron Thompson iamromulan@github.com Description: A custom web UI desgined to run alongside luci for Quectel RM55x modems Depends: libc sdxpinn-mount-fix atinout +Conflicts: sdxpinn-quecmanager diff --git a/ipk-source/sdxpinn-quecmanager-beta/root/www/index.html b/ipk-source/sdxpinn-quecmanager-beta/root/www/login.html similarity index 100% rename from ipk-source/sdxpinn-quecmanager-beta/root/www/index.html rename to ipk-source/sdxpinn-quecmanager-beta/root/www/login.html diff --git a/opkg-feed/rebuild-feed.sh b/opkg-feed/rebuild-feed.sh new file mode 100755 index 0000000..26b8612 --- /dev/null +++ b/opkg-feed/rebuild-feed.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +# Check if the script is run as root. If not, rerun with sudo. +if [ "$(id -u)" -ne 0 ]; then + echo "Script is not running as root. Re-executing with sudo..." + exec sudo "$0" "$@" +fi + +# Define Constants +PACKAGES=./Packages +PACKAGESGZ=./Packages.gz +PACKAGESSIG=./Packages.sig +PUBLICKEY=./iamromulan-SDXPINN-repo.key +PRIVKEY=/home/iamromulan/Documents/GitHub/priv/iamromulan-SDXPINN-repo-private.key +USIGN=./usign_x64 +LOGFILE=./Packages.log + +# Start logging +echo "Starting package analysis - $(date)" > "$LOGFILE" + +# Function to calculate MD5 and file size for a given .ipk file +calculate_md5_and_size() { + local file=$1 + md5sum=$(md5sum "$file" | awk '{print $1}') + filesize=$(stat -c%s "$file") + echo "$md5sum $filesize" +} + +# Iterate over each .ipk file in the current directory +for ipk_file in *.ipk; do + # Extract package name and version from the filename + pkg_name_version=$(echo "$ipk_file" | sed -E 's/(_[a-zA-Z0-9_]+)?.ipk$//') + pkg_name=$(echo "$pkg_name_version" | cut -d '_' -f 1) + version=$(echo "$pkg_name_version" | cut -d '_' -f 2) + + # Find the package entry in the Packages file + pkg_start_line=$(grep -n "^Package: $pkg_name$" "$PACKAGES" | cut -d ':' -f 1) + + if [ -z "$pkg_start_line" ]; then + echo "Package $pkg_name not found in $PACKAGES. Skipping..." | tee -a "$LOGFILE" + continue + fi + + # Find the end of the package entry (two consecutive empty lines) + pkg_end_line=$(sed -n "$pkg_start_line,\$p" "$PACKAGES" | grep -n -m 1 -A 1 '^$' | tail -1 | cut -d '-' -f 1) + pkg_end_line=$((pkg_start_line + pkg_end_line - 1)) + + # Extract existing package details + pkg_version=$(sed -n "${pkg_start_line},${pkg_end_line}p" "$PACKAGES" | grep "^Version:" | awk '{print $2}') + pkg_md5sum=$(sed -n "${pkg_start_line},${pkg_end_line}p" "$PACKAGES" | grep "^MD5Sum:" | awk '{print $2}') + pkg_size=$(sed -n "${pkg_start_line},${pkg_end_line}p" "$PACKAGES" | grep "^Size:" | awk '{print $2}') + + # Get the current MD5 and size for the .ipk file + read current_md5 current_size < <(calculate_md5_and_size "$ipk_file") + + # Check if the version, MD5, or size differs and update if necessary + if [ "$version" != "$pkg_version" ] || [ "$current_md5" != "$pkg_md5sum" ] || [ "$current_size" != "$pkg_size" ]; then + echo "Updating package info for $pkg_name..." | tee -a "$LOGFILE" + + # Update the relevant fields in the Packages file + sed -i "${pkg_start_line},${pkg_end_line}s/^Version: .*/Version: $version/" "$PACKAGES" + sed -i "${pkg_start_line},${pkg_end_line}s/^MD5Sum: .*/MD5Sum: $current_md5/" "$PACKAGES" + sed -i "${pkg_start_line},${pkg_end_line}s/^Size: .*/Size: $current_size/" "$PACKAGES" + sed -i "${pkg_start_line},${pkg_end_line}s|^Filename: .*|Filename: $ipk_file|" "$PACKAGES" + echo "Updated $pkg_name to version $version with MD5: $current_md5 and size: $current_size" | tee -a "$LOGFILE" + else + echo "No update needed for $pkg_name (version $pkg_version, MD5: $pkg_md5sum, size: $pkg_size)" | tee -a "$LOGFILE" + fi +done + +# Regenerate Packages.gz and sign with usign +if [ -f "$PACKAGESGZ" ]; then + rm "$PACKAGESGZ" +fi +gzip -k "$PACKAGES" + +if [ -f "$PACKAGESSIG" ]; then + rm "$PACKAGESSIG" +fi +"$USIGN" -S -m "$PACKAGES" -s "$PRIVKEY" + +echo "Package file and signature updated successfully." | tee -a "$LOGFILE" +echo "Package analysis completed - $(date)" | tee -a "$LOGFILE" + diff --git a/opkg-feed/tailscale_1.76.1-1_aarch64_cortex-a53.ipk b/opkg-feed/tailscale_1.76.1-1_aarch64_cortex-a53.ipk deleted file mode 100644 index 29529cc..0000000 Binary files a/opkg-feed/tailscale_1.76.1-1_aarch64_cortex-a53.ipk and /dev/null differ diff --git a/opkg-feed/usign_x64 b/opkg-feed/usign_x64 new file mode 100755 index 0000000..58dffa5 Binary files /dev/null and b/opkg-feed/usign_x64 differ