Progress for: mount-fix

Slowly working on patch to account for new mounts on December firmware
This commit is contained in:
Cameron Thompson
2025-01-08 01:41:08 -05:00
parent 871bc0f645
commit 47c1ea44ad
4 changed files with 231 additions and 58 deletions

14
ipk-source/sdxpinn-mount-fix/CONTROL/preinst Normal file → Executable file
View File

@@ -1,5 +1,9 @@
#!/bin/ash
# Remount original rootfs as read-write
echo "Mounting / as read-write"
mount -o remount,rw /
# Define the location of detected packages file
DETECTED_PACKAGES_FILE="/tmp/detected_packages.tmp"
LIST_FILE_DELETED=false
@@ -49,13 +53,15 @@ if [ "$LIST_FILE_DELETED" = true ]; then
fi
# Check if /etc is mounted
if grep -qs '/etc ' /proc/mounts; then
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 /
# Check if /usrdata is mounted
if grep -qs '/usrdata' /proc/mounts; then
echo "/usrdata is mounted. Unmounting /etc again to access rootfs /etc..."
umount -lf /etc
fi
exit 0