Initial Changes
- Renamed index.html to login.html to allow postinst to handle preserving orginal index.html during install -Edited Control file for new package -Created new script to automate rebulding Packages, Packages.gz, and Packages.sig for the feed (Work in progress) -Added complied x64 usign binary -Removed extra tailscale package
This commit is contained in:
@@ -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
|
||||
|
||||
84
opkg-feed/rebuild-feed.sh
Executable file
84
opkg-feed/rebuild-feed.sh
Executable file
@@ -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"
|
||||
|
||||
Binary file not shown.
BIN
opkg-feed/usign_x64
Executable file
BIN
opkg-feed/usign_x64
Executable file
Binary file not shown.
Reference in New Issue
Block a user