pnd_run: mount squashfs and isofs as readonly
authorGrazvydas Ignotas <notasas@gmail.com>
Thu, 10 Nov 2011 13:26:47 +0000 (15:26 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 10 Nov 2011 13:26:47 +0000 (15:26 +0200)
otherwise kernel opens pnds as writable and pndnotifyd gets
unwanted IN_CLOSE_WRITE event on exit, which causes a rescan and
.desktop regeneration (slow thing).
Not to mention those filesystems are readonly anyway.

testdata/scripts/pnd_run.sh

index 2b52416..c009a3e 100755 (executable)
@@ -314,8 +314,8 @@ mountPnd() {
                        #detect fs
                        case $PND_FSTYPE in
                        ISO)
-                               /sbin/losetup $FREELOOP "$PND" #attach the pnd to the loop device
-                               mntline="mount" #setup the mountline for later
+                               /sbin/losetup -r $FREELOOP "$PND" #attach the pnd to the loop device
+                               mntline="mount -o ro" #setup the mountline for later
                                mntdev="${FREELOOP}"
                                ;;
                        directory)
@@ -325,8 +325,8 @@ mountPnd() {
                                mntdev="${PND}"
                                ;;
                        Squashfs)
-                               /sbin/losetup $FREELOOP "$PND" #attach the pnd to the loop device
-                               mntline="mount -t squashfs"
+                               /sbin/losetup -r $FREELOOP "$PND" #attach the pnd to the loop device
+                               mntline="mount -t squashfs -o ro"
                                mntdev="${FREELOOP}"
                                ;;
                        *)