Merge branch 'development-SDXPINN' into SDXPINN

This commit is contained in:
Cameron Thompson
2025-01-21 22:03:19 -05:00
11 changed files with 287 additions and 7 deletions

View File

@@ -0,0 +1,7 @@
Package: sdxpinn-patch
Depends: sdxpinn-mount-fix
Version: 1
Architecture: all
Maintainer: Cameron Thompson iamromulan@github.com
Source: github.com/iamromulan
Description: A general first system patch for SDXPINN OpenWRT

View File

@@ -0,0 +1,5 @@
#!/bin/ash
echo "Complete"
exit 0

View File

@@ -0,0 +1,175 @@
#!/bin/ash
clean_distfeeds() {
# Define the list of items to comment out
items_to_comment=$(cat <<EOF
src/gz openwrt_core https://downloads.openwrt.org/releases/22.03.5/targets/sdx75/generic/packages
src/gz openwrt_qtiagm https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiagm
src/gz openwrt_qtiargs https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiargs
src/gz openwrt_qtiaudio https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiaudio
src/gz openwrt_qtiaudioprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiaudioprop
src/gz openwrt_qtibsp https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtibsp
src/gz openwrt_qtibspprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtibspprop
src/gz openwrt_qtibt https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtibt
src/gz openwrt_qtibtprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtibtprop
src/gz openwrt_qticore https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qticore
src/gz openwrt_qticoreinternal https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qticoreinternal
src/gz openwrt_qticoreprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qticoreprop
src/gz openwrt_qtictainternal https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtictainternal
src/gz openwrt_qtidata https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtidata
src/gz openwrt_qtidatainternal https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtidatainternal
src/gz openwrt_qtidataprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtidataprop
src/gz openwrt_qtiipq https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiipq
src/gz openwrt_qtiipqezmesh https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiipqezmesh
src/gz openwrt_qtiipqprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiipqprop
src/gz openwrt_qtilocation https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtilocation
src/gz openwrt_qtilocationinternal https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtilocationinternal
src/gz openwrt_qtilocationprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtilocationprop
src/gz openwrt_qtimsdcprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtimsdcprop
src/gz openwrt_qtinternal https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtinternal
src/gz openwrt_qtipal https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtipal
src/gz openwrt_qtiperfprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiperfprop
src/gz openwrt_qtippatprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtippatprop
src/gz openwrt_qtiquectel https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiquectel
src/gz openwrt_qtiquectelprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiquectelprop
src/gz openwrt_qtirilprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtirilprop
src/gz openwrt_qtisecurity https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtisecurity
src/gz openwrt_qtisecurityinternal https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtisecurityinternal
src/gz openwrt_qtisecurityprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtisecurityprop
src/gz openwrt_qtisensorsinternal https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtisensorsinternal
src/gz openwrt_qtisensorsprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtisensorsprop
src/gz openwrt_qtissdk https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtissdk
src/gz openwrt_qtissmgr https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtissmgr
src/gz openwrt_qtissmgrprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtissmgrprop
src/gz openwrt_qtiwlan https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiwlan
src/gz openwrt_qtiwlanprop https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/qtiwlanprop
EOF
)
# Define the list of items to ensure are uncommented
items_to_keep=$(cat <<EOF
src/gz openwrt_base https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/base
src/gz openwrt_luci https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/luci
src/gz openwrt_packages https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/packages
src/gz openwrt_routing https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/routing
src/gz openwrt_telephony https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/telephony/
EOF
)
# Input file to process
INPUT_FILE="/etc/opkg/distfeeds.conf"
# Backup the original file
cp "$INPUT_FILE" "${INPUT_FILE}.bak"
# Create a temporary file for the modified content
TEMP_FILE="${INPUT_FILE}.tmp"
: > "$TEMP_FILE" # Clear/create the temp file
# Process each line in the input file
while IFS= read -r line || [ -n "$line" ]; do
# Skip empty lines
[ -z "$line" ] && continue
# Skip malformed lines
echo "$line" | grep -qE '^(#[[:space:]]*)?src/gz ' || continue
# Remove any existing comment marks for comparison
clean_line=$(echo "$line" | sed 's/^#[[:space:]]*//')
# Check if line should be commented
if echo "$items_to_comment" | grep -Fxq "$clean_line"; then
echo "# $clean_line" >> "$TEMP_FILE"
continue
fi
# Check if line should be kept uncommented
if echo "$items_to_keep" | grep -Fxq "$clean_line"; then
echo "$clean_line" >> "$TEMP_FILE"
continue
fi
# Preserve other lines as-is
echo "$line" >> "$TEMP_FILE"
done < "$INPUT_FILE"
# Add any missing items_to_keep entries
echo "$items_to_keep" | while IFS= read -r keep_item; do
[ -z "$keep_item" ] && continue
if ! grep -Fxq "$keep_item" "$TEMP_FILE"; then
echo "$keep_item" >> "$TEMP_FILE"
fi
done
# Replace the original file with the modified one
mv "$TEMP_FILE" "$INPUT_FILE"
echo "Processed '$INPUT_FILE'. Backup saved as '${INPUT_FILE}.bak'."
}
repo_iamromulanSDXPINN_check() {
# Define the repository and key details
STABLE_REPO_LINE="src/gz iamromulan-SDXPINN-repo https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/SDXPINN/opkg-feed"
DEV_REPO_LINE="src/gz iamromulan-SDXPINN-repo https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development-SDXPINN/opkg-feed"
FEEDS_FILE="/etc/opkg/customfeeds.conf"
PUBLIC_KEY_URL="https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/SDXPINN/opkg-feed/iamromulan-SDXPINN-repo.key"
TMP_KEY="/tmp/iamromulan-SDXPINN-repo.key"
KEYS_DIR="/etc/opkg/keys"
# Remove duplicate and development repo lines
if grep -q "iamromulan-SDXPINN-repo" "$FEEDS_FILE"; then
echo "Cleaning up duplicate or development repo entries in $FEEDS_FILE."
sed -i "/iamromulan-SDXPINN-repo/d" "$FEEDS_FILE"
fi
# Add the stable repository to customfeeds.conf
echo "Adding stable repository to $FEEDS_FILE."
echo "$STABLE_REPO_LINE" >> "$FEEDS_FILE" || {
echo "Error: Could not add repository to $FEEDS_FILE."
return 1
}
# Download the key temporarily for verification
curl -fsSL "$PUBLIC_KEY_URL" -o "$TMP_KEY" || {
echo "Error: Failed to download public key from $PUBLIC_KEY_URL."
return 1
}
# Check if the key already exists in /etc/opkg/keys/
local key_installed=0
for key in "$KEYS_DIR"/*; do
if cmp -s "$TMP_KEY" "$key"; then
echo "Public key already installed: $(basename "$key")."
key_installed=1
break
fi
done
# If the key is not installed, add it
if [ "$key_installed" -eq 0 ]; then
echo "Installing public key..."
opkg-key add "$TMP_KEY" || {
echo "Error: Failed to add public key."
rm -f "$TMP_KEY"
return 1
}
echo "Public key installed successfully."
fi
# Clean up temporary key file
rm -f "$TMP_KEY"
return 0
}
# Begin Patch Process
echo -e "\e[92mBegining sdxpinn-patch process...\e[0m"
echo -e "\e[92mEnsuring distfeeds is clean of any non-working sources and has stock OpenWRT ones...\e[0m"
clean_distfeeds
echo -e "\e[92mEnsuring iamromulan's SDXPINN repo is listed in customfeeds and public key is installed...\e[0m"
repo_iamromulanSDXPINN_check
echo -e "\e[92miamromulan's SDXPINN repo source and key is installed.\e[0m"
echo -e "\e[92msdxpinn-patch process complete.\e[0m"
exit 0

View File

@@ -0,0 +1,5 @@
#!/bin/ash
echo -e "\e[38;5;196mINFO: This package can not be removed by opkg\e[0m"
echo -e "\e[38;5;40mINFO: This package can be upgraded...\e[0m"
exit 0

View File

@@ -0,0 +1,74 @@
#!/bin/sh
# Script for building OpenWRT .ipk packages using tar by iamromulan
# Works with SDXPPINN OpenWRT - iamromulan
# This script accepts an optional path to the directory containing the `CONTROL` and `root` directories.
# Usage: ./build-ipk.sh [path]
# If no path is provided, the script will look in the current directory for `CONTROL` and `root` directories.
# This will spit out an ipk in the current directory
# 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
# Set the default build path to the current directory
build_path="."
# Check if a path is provided as the first argument
if [ "$1" ]; then
build_path="$1"
fi
# Check if the required directories are present in the specified path
if [ ! -d "${build_path}/CONTROL" ] || [ ! -d "${build_path}/root" ]; then
echo "Error: CONTROL and root directories must be present in the specified path (${build_path})."
exit 1
fi
# Extract values from the CONTROL/control file in the specified path
pkgname=$(grep -i '^Package:' "${build_path}/CONTROL/control" | awk '{print $2}')
version=$(grep -i '^Version:' "${build_path}/CONTROL/control" | awk '{print $2}')
architecture=$(grep -i '^Architecture:' "${build_path}/CONTROL/control" | awk '{print $2}')
# Check if values are extracted correctly
if [ -z "$pkgname" ] || [ -z "$version" ] || [ -z "$architecture" ]; then
echo "Error: Failed to extract Package, Version, or Architecture from ${build_path}/CONTROL/control."
exit 1
fi
# Set the final IPK name based on the extracted values
ipkname="${pkgname}_${version}_${architecture}.ipk"
# Ensure all CONTROL scripts are executable
echo "Setting permissions for CONTROL scripts..."
chmod +x "${build_path}/CONTROL"/*
# Set ownership for CONTROL and root files
echo "Setting ownership for all package files..."
chown -R root:root "${build_path}/CONTROL"/*
chown -R root:root "${build_path}/root"/*
# Create control.tar.gz from the CONTROL directory
echo "Creating control.tar.gz..."
tar -czvf control.tar.gz -C "${build_path}/CONTROL" .
# Create data.tar.gz from the root directory
echo "Creating data.tar.gz..."
tar -czvf data.tar.gz -C "${build_path}/root" .
# Create debian-binary file (must contain exactly "2.0" without a newline)
echo -n "2.0" > debian-binary
chown -R root:root debian-binary
# Combine the components into the final .ipk file using tar
echo "Packaging ${ipkname}..."
tar -czvf "$ipkname" debian-binary control.tar.gz data.tar.gz
# Clean up intermediate files
echo "Cleaning up temporary files..."
rm -f control.tar.gz data.tar.gz debian-binary
echo "IPK package ${ipkname} created successfully using tar."

View File

@@ -0,0 +1 @@
1

View File

@@ -82,6 +82,19 @@ Description: Creates a usable mount space and overlay for SDXPINN modems. Depend
License: GPLv3
Package: sdxpinn-patch
Version: 1
Depends: sdxpinn-mount-fix
Section: base
Architecture: all
Maintainer: Cameron Thompson iamromulan@github.com
MD5Sum: 325bba5d51b1d0579e6b12f1cb608c08
Size: 2768
Filename: sdxpinn-patch_1_all.ipk
Source: github.com/iamromulan
Description: A general first system patch for SDXPINN OpenWRT
Package: sdxpinn-quecmanager
Version: 1.0.1
Depends: libc, sdxpinn-mount-fix, atinout

Binary file not shown.

View File

@@ -1,17 +1,17 @@
Starting package analysis - Mon Jan 20 04:17:54 PM EST 2025
Starting package analysis - Tue Jan 21 09:49:15 PM EST 2025
No update needed for atinout (version 0.9.1, MD5: 444eb87488bad1927b6ed069dedf7393, size: 4323)
No update needed for luci-app-atinout-mod (version 1.3.4-20250119, MD5: 1ffee9ec8fe5723b8140bf2c21fea508, size: 4864)
No update needed for luci-app-tailscale (version 1.2.3-2, MD5: 53c84c947c42d7518aecb4a6b8a9c5a8, size: 6501)
No update needed for ookla-speedtest (version 1.2.0, MD5: b26e1909599f73cab40ea0281c5a6283, size: 1075696)
No update needed for sdxpinn-console-menu (version 0.0.2, MD5: de75d2889510e92b57fc8a7ca087ced4, size: 7361)
No update needed for sdxpinn-mount-fix (version 1.2.0, MD5: 1ba897b1b1abf14a81ecd0635f5d6082, size: 55650)
Updating package info for sdxpinn-patch...
Updated sdxpinn-patch to version 1 with MD5: 325bba5d51b1d0579e6b12f1cb608c08 and size: 2768
No update needed for sdxpinn-quecmanager (version 1.0.1, MD5: cb96c5ec96c2166f39d989f277ebc0f7, size: 722109)
Updating package info for sdxpinn-quecmanager-beta...
Updated sdxpinn-quecmanager-beta to version 1.1.1-1 with MD5: ec8d3a84bead2f35cc6e60460f306efd and size: 904782
No update needed for sdxpinn-quecmanager-beta (version 1.1.1-1, MD5: ec8d3a84bead2f35cc6e60460f306efd, size: 904782)
No update needed for sms-tool (version 2025.1.19-APmod-iamromulan, MD5: 83dc8bfd2d4ac8d8952a2a95b2be943f, size: 13687)
Updating package info for socat-at-bridge...
Updated socat-at-bridge to version 1.1.1 with MD5: 2fd73d7679b3db54113d93bb5949077a and size: 1969
No update needed for socat-at-bridge (version 1.1.1, MD5: 2fd73d7679b3db54113d93bb5949077a, size: 1969)
No update needed for tailscale (version 1.78.1-2, MD5: baa4d97ba49aa42ef104accba2dc2fd8, size: 9882856)
No update needed for tailscaled (version 1.78.1-4, MD5: 647b4d3c6e51f700dd96362f92f20b54, size: 17960998)
Package file and signature updated successfully.
Package analysis completed - Mon Jan 20 04:17:55 PM EST 2025
Package analysis completed - Tue Jan 21 09:49:17 PM EST 2025

View File

@@ -1,2 +1,2 @@
untrusted comment: signed by key 6262698f038d1226
RWRiYmmPA40SJrNZ74BhlrW6XHVVVSuG9sVWM3U21lRbP5wDuRigR9Lf180BX6P8IwYj5UH4V2g3Oo/I9F4fA1yuIoHfMGnghw8=
RWRiYmmPA40SJoQly5VXAVUe+VGOF168TjNzC6TpLQyt0apm9QKvd36SduBrQg5PP9vqXjacdWE1wi60v8S6sc/3wwQZoIVtkQE=

Binary file not shown.