And here is a basic upstart script for mounting/unmounting filesystem (described earlier):
Code:
start on started system and started syslog
stop on stopping filesystems
pre-start script
source /etc/upstart/functions
losetup -o 1075838976 /dev/loop/1 /dev/mmcblk0p4
mount -t ext3 /dev/loop/1 /mnt/newpart
f_log I newpart mount "newpart is mounted"
end script
post-stop script
source /etc/upstart/functions
umount /mnt/newpart
losetup -d /dev/loop/1
f_log I newpart umount "newpart is unmounted"
end script
It's really basic, if you'll use it as-is, expect some (rare?) ignored edge cases (can't imagine any example right now, though).