New updated instructions - as nice script - automatically adds all sqx files created, discards the rest.
You have access to the image directly at /tmp/input of course to fetch your already changed sqx files for backup purpose.
I use that together with a vbox image that directly works on the IMG.
Code:
#!/bin/sh
IMAGE="FILE.IMG"
offset=$(($(sfdisk -d $IMAGE|grep start=|head -n1|sed 's/.*start=\s*//;s/,.*//')*512))
OPTIONS="umask=000,shortname=mixed,quiet,utf8"
INPUT=/tmp/input
FIX=/tmp/fix
rm -rf $FIX
mkdir -p $INPUT $FIX
umount $INPUT
mount -o loop,offset=$offset,$OPIONS $IMAGE $INPUT
cd $INPUT
for x in *.sqx; do unsquashfs -dest $FIX/${x/.sqx} $x; done
cat <<EOT
You can edit now using this way:
a) Change files in the dir you want to edit.
b) Create new package like this:
mksquashfs va-xxx va-xxx.sqx -noappend
c) Enter "exit" when done to apply changes.
EOT
cd $FIX
bash
cd $INPUT
cp -v $FIX/*.sqx $INPUT
dd of=$INPUT/version bs=1 seek=32 count=0
umount $INPUT
rm -rf $FIX