From 2feecf15e142f4e9e42909101cee613022291a9f Mon Sep 17 00:00:00 2001 From: Cameron Thompson <50184035+iamromulan@users.noreply.github.com> Date: Thu, 3 Oct 2024 04:07:28 -0400 Subject: [PATCH] Add sdxpinn-mount-fix -Source Added -build-ipk executable script added -ipk added --- ipk-source/sdxpinn-mount-fix/CONTROL/control | 6 + ipk-source/sdxpinn-mount-fix/CONTROL/postinst | 33 +++++ ipk-source/sdxpinn-mount-fix/CONTROL/preinst | 13 ++ ipk-source/sdxpinn-mount-fix/CONTROL/prerm | 8 ++ ipk-source/sdxpinn-mount-fix/build-ipk | 74 ++++++++++ .../root/etc/init.d/init-overlay-watchdog | 20 +++ .../root/etc/init.d/mount-fix | 133 ++++++++++++++++++ .../sdxpinn-mount-fix/root/tmp/distfeeds.conf | 44 ++++++ .../root/usr/sbin/init-overlay-watchdog.sh | 39 +++++ ...xpinn-mount-fix_1.0_aarch64_cortex-a53.ipk | Bin 0 -> 3810 bytes 10 files changed, 370 insertions(+) create mode 100644 ipk-source/sdxpinn-mount-fix/CONTROL/control create mode 100644 ipk-source/sdxpinn-mount-fix/CONTROL/postinst create mode 100644 ipk-source/sdxpinn-mount-fix/CONTROL/preinst create mode 100644 ipk-source/sdxpinn-mount-fix/CONTROL/prerm create mode 100644 ipk-source/sdxpinn-mount-fix/build-ipk create mode 100644 ipk-source/sdxpinn-mount-fix/root/etc/init.d/init-overlay-watchdog create mode 100644 ipk-source/sdxpinn-mount-fix/root/etc/init.d/mount-fix create mode 100644 ipk-source/sdxpinn-mount-fix/root/tmp/distfeeds.conf create mode 100644 ipk-source/sdxpinn-mount-fix/root/usr/sbin/init-overlay-watchdog.sh create mode 100644 ipk/sdxpinn-mount-fix_1.0_aarch64_cortex-a53.ipk diff --git a/ipk-source/sdxpinn-mount-fix/CONTROL/control b/ipk-source/sdxpinn-mount-fix/CONTROL/control new file mode 100644 index 0000000..418385b --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/CONTROL/control @@ -0,0 +1,6 @@ +Package: sdxpinn-mount-fix +Version: 1.0 +Architecture: aarch64_cortex-a53 +Maintainer: Cameron Thompson iamromulan@github.com +Description: Creates a usable mount space and overlay for SDXPINN modems +Depends: libc diff --git a/ipk-source/sdxpinn-mount-fix/CONTROL/postinst b/ipk-source/sdxpinn-mount-fix/CONTROL/postinst new file mode 100644 index 0000000..01c90db --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/CONTROL/postinst @@ -0,0 +1,33 @@ +#!/bin/ash + +# Replace distfeeds.conf with non-working sources commented out +# Check if the temporary distfeeds.conf file exists +if [ -f /tmp/distfeeds.conf ]; then + # Backup the existing /etc/opkg/distfeeds.conf if it exists + if [ -f /etc/opkg/distfeeds.conf ]; then + cp /etc/opkg/distfeeds.conf /etc/opkg/distfeeds.conf.bak + echo "Backed up original /etc/opkg/distfeeds.conf to /etc/opkg/distfeeds.conf.bak" + fi + + # Move the new distfeeds.conf from /tmp to /etc/opkg + mv /tmp/distfeeds.conf /etc/opkg/distfeeds.conf + echo "Replaced /etc/opkg/distfeeds.conf with the custom version." +else + echo "Error: /tmp/distfeeds.conf not found. Cannot replace /etc/opkg/distfeeds.conf." + exit 1 +fi + + +# Make the init script executable +chmod +x /etc/init.d/mount-fix +chmod +x /etc/init.d/init-overlay-watchdog +chmod +x /usr/sbin/init-overlay-watchdog.sh + +# Enable and start the service +service mount-fix enable +service init-overlay-watchdog enable +service mount-fix start +opkg update +opkg install inotifywait inotifywatch +service init-overlay-watchdog start +exit 0 diff --git a/ipk-source/sdxpinn-mount-fix/CONTROL/preinst b/ipk-source/sdxpinn-mount-fix/CONTROL/preinst new file mode 100644 index 0000000..fe6f7d1 --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/CONTROL/preinst @@ -0,0 +1,13 @@ +#!/bin/ash + +# Check if /etc is mounted +if grep -qs '/etc ' /proc/mounts; then + echo "Unmounting /etc..." + umount -lf /etc +fi + +# Remount original rootfs as read-write +echo "Mounting / as read-write" +mount -o remount,rw / + +exit 0 diff --git a/ipk-source/sdxpinn-mount-fix/CONTROL/prerm b/ipk-source/sdxpinn-mount-fix/CONTROL/prerm new file mode 100644 index 0000000..e9c48b3 --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/CONTROL/prerm @@ -0,0 +1,8 @@ +#!/bin/ash + +service stop mount-fix +service stop init-overlay-watchdog +service disable mount-fix +service disable init-overlay-watchdog + +exit 0 \ No newline at end of file diff --git a/ipk-source/sdxpinn-mount-fix/build-ipk b/ipk-source/sdxpinn-mount-fix/build-ipk new file mode 100644 index 0000000..eb83cf6 --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/build-ipk @@ -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." + diff --git a/ipk-source/sdxpinn-mount-fix/root/etc/init.d/init-overlay-watchdog b/ipk-source/sdxpinn-mount-fix/root/etc/init.d/init-overlay-watchdog new file mode 100644 index 0000000..74c4c04 --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/root/etc/init.d/init-overlay-watchdog @@ -0,0 +1,20 @@ +#!/bin/ash /etc/rc.common + +START=04 +USE_PROCD=1 + +start_service() { + procd_open_instance + procd_set_param command /usr/sbin/init-overlay-watchdog.sh + procd_set_param respawn 3600 5 5 + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_set_param pidfile /var/run/init-overlay-watchdog.pid + procd_set_param tracking + procd_close_instance +} + +stop_service() { + echo "Stopping init-overlay-watchdog service" + # `procd` will handle stopping the service and its processes +} 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 new file mode 100644 index 0000000..382ce4c --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/root/etc/init.d/mount-fix @@ -0,0 +1,133 @@ +#!/bin/sh /etc/rc.common + +START=03 + +start() { + # Log to tmp + rm /tmp/mount-fix.log + /bin/touch /tmp/mount-fix.log + /bin/echo "Begin mount fix process to make a usable userspace" >> /tmp/mount-fix.log + + # Forcefully unmount /etc + /bin/echo "Unmounting the tiny overlay at /etc" >> /tmp/mount-fix.log + /bin/umount -lf /etc >> /tmp/mount-fix.log + + # Remount root filesystem as read-write + /bin/echo "Remounting / as read-write" >> /tmp/mount-fix.log + /bin/mount -o remount,rw / >> /tmp/mount-fix.log + + # Check if /overlay/etc-upper/merged.done exists + /bin/echo "First time this is ran the stuff you have been putting in the old overlay needs merged." >> /tmp/mount-fix.log + /bin/echo "Looking for evidence that this has already happened..." >> /tmp/mount-fix.log + if [ ! -f /overlay/etc-upper/merged.done ]; then + /bin/echo "/overlay/etc-upper/merged.done not found, merging /overlay/etc-upper/* to /etc/" >> /tmp/mount-fix.log + cp -rf /overlay/etc-upper/* /etc/ >> /tmp/mount-fix.log + /bin/touch /overlay/etc-upper/merged.done >> /tmp/mount-fix.log + else + /bin/echo "/overlay/etc-upper/merged.done found, skipping merge" >> /tmp/mount-fix.log + fi + + # Unmount /overlay + /bin/echo "Unmounting the no longer needed /overlay" >> /tmp/mount-fix.log + /bin/umount /overlay >> /tmp/mount-fix.log + + # Check if /etc/opkg.conf has a line containing "option overlay_root /overlay" and remove it if it exists + /bin/echo "Lets be sure your opkg config isn't using the old overlay" >> /tmp/mount-fix.log + if grep -q "option overlay_root /overlay" /etc/opkg.conf; then + /bin/echo "Removing 'option overlay_root /overlay' from /etc/opkg.conf" >> /tmp/mount-fix.log + sed -i '/option overlay_root \/overlay/d' /etc/opkg.conf >> /tmp/mount-fix.log + else + /bin/echo "'option overlay_root /overlay' not found in /etc/opkg.conf, no changes made" >> /tmp/mount-fix.log + fi + + # Ensure necessary directories exist for overlay and pivot_root + /bin/echo "Creating new overlay system" >> /tmp/mount-fix.log + if [ ! -d /data/rootfs ]; then + mkdir -p /data/rootfs + fi + if [ ! -d /data/rootfs-workdir ]; then + mkdir -p /data/rootfs-workdir + fi + if [ ! -d /rootfs ]; then + mkdir -p /rootfs + fi + + # Mount the new overlay filesystem + /bin/mount -t overlay overlay -o lowerdir=/,upperdir=/data/rootfs,workdir=/data/rootfs-workdir /rootfs >> /tmp/mount-fix.log + + # Create the real_rootfs directory in the new root + if [ ! -d /rootfs/real_rootfs ]; then + mkdir -p /rootfs/real_rootfs + fi + + # Pivot root to the new root + /bin/echo "Pivoting Root / to /rootfs; Be back soon!!" >> /tmp/mount-fix.log + /sbin/pivot_root /rootfs /rootfs/real_rootfs >> /tmp/mount-fix.log + + # Move the mounted filesystems to the new locations + /bin/mount --move /real_rootfs/sys /sys >> /tmp/mount-fix.log + /bin/mount --move /real_rootfs/proc /proc >> /tmp/mount-fix.log + /bin/mount --move /real_rootfs/tmp /tmp >> /tmp/mount-fix.log + /bin/mount --move /real_rootfs/dev /dev >> /tmp/mount-fix.log + /bin/mount --move /real_rootfs/firmware /firmware >> /tmp/mount-fix.log + /bin/mount --move /real_rootfs/persist /persist >> /tmp/mount-fix.log + /bin/mount --move /real_rootfs/cache /cache >> /tmp/mount-fix.log + /bin/mount --move /real_rootfs/data /data >> /tmp/mount-fix.log + + # Synchronize /etc/rc.d/ and /real_rootfs/etc/rc.d/ + /bin/echo "Synchronizing /etc/rc.d/ and /real_rootfs/etc/rc.d/" >> /tmp/mount-fix.log + for link in /etc/rc.d/*; do + if [ -L "$link" ]; then + link_name=$(basename "$link") + if [ ! -e "/real_rootfs/etc/rc.d/$link_name" ]; then + /bin/echo "Copying $link_name to /real_rootfs/etc/rc.d/" >> /tmp/mount-fix.log + cp -a "$link" "/real_rootfs/etc/rc.d/$link_name" >> /tmp/mount-fix.log + fi + fi + done + + for link in /real_rootfs/etc/rc.d/*; do + if [ -L "$link" ]; then + link_name=$(basename "$link") + if [ ! -e "/etc/rc.d/$link_name" ]; then + /bin/echo "Removing $link_name from /real_rootfs/etc/rc.d/" >> /tmp/mount-fix.log + rm "/real_rootfs/etc/rc.d/$link_name" >> /tmp/mount-fix.log + fi + fi + done + + # Final logs and remount the original root as read-only + /bin/echo "...and we're back! The original root now lives at /real_rootfs" >> /tmp/mount-fix.log + /bin/echo "Lets mount it as read-only for now, If you need it just remount it as read-write" >> /tmp/mount-fix.log + /bin/mount -o remount,ro /real_rootfs >> /tmp/mount-fix.log + /bin/echo "Overlay and pivot_root setup completed" >> /tmp/mount-fix.log +} + +stop() { + /bin/echo "Stopping and reverting overlay and pivot_root" >> /tmp/mount-fix.log + + # Remount the original root filesystem as read-write + /bin/mount -o remount,rw /real_rootfs >> /tmp/mount-fix.log + + # Move the mounted filesystems back to the original locations + /bin/mount --move /sys /real_rootfs/sys >> /tmp/mount-fix.log + /bin/mount --move /proc /real_rootfs/proc >> /tmp/mount-fix.log + /bin/mount --move /tmp /real_rootfs/tmp >> /tmp/mount-fix.log + /bin/mount --move /dev /real_rootfs/dev >> /tmp/mount-fix.log + /bin/mount --move /firmware /real_rootfs/firmware >> /tmp/mount-fix.log + /bin/mount --move /persist /real_rootfs/persist >> /tmp/mount-fix.log + /bin/mount --move /cache /real_rootfs/cache >> /tmp/mount-fix.log + /bin/mount --move /data /real_rootfs/data >> /tmp/mount-fix.log + + # Pivot root back to the original root + /sbin/pivot_root /real_rootfs /real_rootfs/rootfs >> /tmp/mount-fix.log + + /bin/echo "Reverted pivot_root" >> /tmp/mount-fix.log + /bin/echo "Previous root overlay available at /rootfs" >> /tmp/mount-fix.log +} + +restart() { + /bin/echo "This script should only be executed once at boot" + /bin/echo "Use Stop to undo the pivot" + /bin/echo "Use Start to put it back" +} diff --git a/ipk-source/sdxpinn-mount-fix/root/tmp/distfeeds.conf b/ipk-source/sdxpinn-mount-fix/root/tmp/distfeeds.conf new file mode 100644 index 0000000..b1b2120 --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/root/tmp/distfeeds.conf @@ -0,0 +1,44 @@ +# src/gz openwrt_core https://downloads.openwrt.org/releases/22.03.5/targets/sdx75/generic/packages +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_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 +src/gz openwrt_routing https://downloads.openwrt.org/releases/22.03.5/packages/aarch64_cortex-a53/routing diff --git a/ipk-source/sdxpinn-mount-fix/root/usr/sbin/init-overlay-watchdog.sh b/ipk-source/sdxpinn-mount-fix/root/usr/sbin/init-overlay-watchdog.sh new file mode 100644 index 0000000..92a8d02 --- /dev/null +++ b/ipk-source/sdxpinn-mount-fix/root/usr/sbin/init-overlay-watchdog.sh @@ -0,0 +1,39 @@ +#!/bin/ash + +# Paths to monitor and synchronize +WATCH_DIR="/etc/rc.d" +TARGET_DIR="/real_rootfs/etc/rc.d" + +# Function to synchronize init scripts +synchronize_init_scripts() { + mount -o remount,rw /real_rootfs + # Copy new or updated symlinks from WATCH_DIR to TARGET_DIR + for link in "$WATCH_DIR"/*; do + if [ -L "$link" ]; then + link_name=$(basename "$link") + if [ ! -e "$TARGET_DIR/$link_name" ] || [ "$link" -nt "$TARGET_DIR/$link_name" ]; then + cp -af "$link" "$TARGET_DIR/$link_name" + fi + fi + done + + # Remove symlinks in TARGET_DIR that no longer exist in WATCH_DIR + for link in "$TARGET_DIR"/*; do + if [ -L "$link" ]; then + link_name=$(basename "$link") + if [ ! -e "$WATCH_DIR/$link_name" ]; then + rm -f "$TARGET_DIR/$link_name" + fi + fi + done + mount -o remount,ro /real_rootfs +} + +# Initial synchronization +synchronize_init_scripts + +# Monitor WATCH_DIR for changes using inotifywait +while true; do + inotifywait -e create,delete,modify,move "$WATCH_DIR" + synchronize_init_scripts +done diff --git a/ipk/sdxpinn-mount-fix_1.0_aarch64_cortex-a53.ipk b/ipk/sdxpinn-mount-fix_1.0_aarch64_cortex-a53.ipk new file mode 100644 index 0000000000000000000000000000000000000000..72e0fdd0c2da40ca2058cf32522b25e30fbef6e8 GIT binary patch literal 3810 zcmV<84ju6yiwFP!000001MSv#P*dBY25=OVu80&NARwJkL(>S-JJM^Ugd#}q(p%^O z1Y)E~l`5cg5D+3F(gRWiq)8_PP(Vnix!(6?-n@J6%sYRb^WK}`H+%NlGi%S@d-j^| zn`Qsl*2%_Q$kxf-#ygPcuOa%Il!U~8jKBSH{7sxlOhQUpT0%?=1QH_>{e2b{BVrf* zi@xVy`1$zSc(bz;d3$*H{!jP)+5G=gAmP8|FJJgS%Fe^x*W1HY_;(0|9fSUwcl=5I z#iYa~{+NGpX^D&c{~g#8$^P?#c-!=0%CZ#I&@>8`dvB|-k(JkrN?XLu5jWB$$S`xA zjt{PwhEa|eYC*{Kot_wYe|}!vw}zZz=Z4!qkws{Zewh&Cp;Ot(k6tcgbF2^4 z*G{yx8dS3a0~EqSCsm8kW~G-@A^a!&Em~NDK9^IazPis4;VI@scOSEe8?M8INWpgL zLz#cZgcD|}M`Kd?#Vh$*V@~MzB;zRz8d#zuRsBY7nZAr0*ir6UU!BKyOUv`B?T%|@ zdUU?kQXD($*7bujjSjTM903;raP&N4s z5E4`zuME3I$M$wX`TiW7=j3!A8WwsE7*Bz5-m3hTcjU$06gQ?w0jN|PmkfqW5AGSiPLEROr+PFVV7tHHk2$*! z58Hu;M6#a)?W$*pEWQ)C0J?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