From 3a35becca8bf8c925e1d9e3bd4e19b9bc8bf82e9 Mon Sep 17 00:00:00 2001 From: iamromulan <50184035+iamromulan@users.noreply.github.com> Date: Sat, 5 Oct 2024 21:05:36 -0400 Subject: [PATCH] Update: sdxpinn-mount-fix 1.0.11 RC -Improved stopping mount-fix - Now restores stock filesystem completely when stopped. - / is still rw after but a reboot or setting it to ro will make it be read only again - Improved echo and comments --- ipk-source/sdxpinn-mount-fix/CONTROL/control | 2 +- ipk-source/sdxpinn-mount-fix/CONTROL/preinst | 9 +++++---- ipk-source/sdxpinn-mount-fix/CONTROL/prerm | 3 ++- .../sdxpinn-mount-fix/root/etc/init.d/mount-fix | 12 ++++++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ipk-source/sdxpinn-mount-fix/CONTROL/control b/ipk-source/sdxpinn-mount-fix/CONTROL/control index 2f10874..2fee76f 100755 --- a/ipk-source/sdxpinn-mount-fix/CONTROL/control +++ b/ipk-source/sdxpinn-mount-fix/CONTROL/control @@ -1,5 +1,5 @@ Package: sdxpinn-mount-fix -Version: 1.0.10 +Version: 1.0.11 Architecture: aarch64_cortex-a53 Maintainer: Cameron Thompson iamromulan@github.com Description: Creates a usable mount space and overlay for SDXPINN modems. Dependencies bundled: libinotifytools and inotifywait diff --git a/ipk-source/sdxpinn-mount-fix/CONTROL/preinst b/ipk-source/sdxpinn-mount-fix/CONTROL/preinst index e883afd..8b52a2d 100644 --- a/ipk-source/sdxpinn-mount-fix/CONTROL/preinst +++ b/ipk-source/sdxpinn-mount-fix/CONTROL/preinst @@ -4,19 +4,20 @@ DETECTED_PACKAGES_FILE="/tmp/detected_packages.tmp" LIST_FILE_DELETED=false -# Function to check if a specific package is installed and delete its list file +# Function to check if a specific bundled package is already installed and delete its list file detect_and_remove_list_files() { local package_name="$1" local list_file="/usr/lib/opkg/info/${package_name}.list" - # Check if the package is installed by checking its .list file + # Check if the bundled package is installed by checking its .list file if [ -f "$list_file" ]; then - echo "$package_name is already installed. Deleting $list_file to avoid conflicts." + echo "$package_name is already installed. Deleting its $list_file to avoid future conflicts." rm -f "$list_file" echo "$package_name" >> "$DETECTED_PACKAGES_FILE" LIST_FILE_DELETED=true else - echo "$package_name is not installed." + echo "$package_name is not currently installed." + echo "$package_name is included in this package and will be installed." fi } diff --git a/ipk-source/sdxpinn-mount-fix/CONTROL/prerm b/ipk-source/sdxpinn-mount-fix/CONTROL/prerm index 7ebf798..34d30d9 100644 --- a/ipk-source/sdxpinn-mount-fix/CONTROL/prerm +++ b/ipk-source/sdxpinn-mount-fix/CONTROL/prerm @@ -5,5 +5,6 @@ service mount-fix stop sleep 1 service mount-fix disable service init-overlay-watchdog disable - +echo "Filesystem structure returned to Quectel Stock" +echo "Backup exists at /data/rootfs" exit 0 \ No newline at end of file diff --git a/ipk-source/sdxpinn-mount-fix/root/etc/init.d/mount-fix b/ipk-source/sdxpinn-mount-fix/root/etc/init.d/mount-fix index fd3e55a..fe229f1 100755 --- a/ipk-source/sdxpinn-mount-fix/root/etc/init.d/mount-fix +++ b/ipk-source/sdxpinn-mount-fix/root/etc/init.d/mount-fix @@ -124,6 +124,18 @@ stop() { /bin/echo "Reverted pivot_root" >> /tmp/mount-fix.log /bin/echo "Previous root overlay available at /rootfs" >> /tmp/mount-fix.log + + # Unmount /rootfs overlay + /bin/umount -lf /rootfs >/dev/null 2>&1 + + # Mount the location of etc-upper back + mount -t ubifs /dev/ubi0_3 /overlay + + # Mount the old overlay filesystem back for etc + /bin/mount -t overlay overlay -o lowerdir=/etc,upperdir=/overlay/etc-upper,workdir=/overlay/.etc-work /etc >> /tmp/mount-fix.log + + echo -e "\e[31m / is read-write right now. Be careful\e[0m" + echo -e "\e[31m Reboot or run mount -o remount,ro / \e[0m" } restart() {