I cant create new folders in the mounted (nfs-)filesystem on the virtual usb-drive for rar2fs to mount the rar files in.
Right now I scan the entire virtual usb stick for %filename%.rar files, create folders /tmp/%filename%/ and mount the rar file into this tmp-folder. Works, but you can't access the files via the TV. I tried creating symlink in the mounted filesystem linking to the /tmp/... folder, but that doesn't work, either.
Does anyone have any ideas how to create folders in the mounted drive?
What I got so far (WIP, ignore my path and -maxdepth in find):
Code: Select all
#!/bin/sh
#
# . Copyright 2012,
# by juuso <juuso@gmail.com>
#
# Version: SamyGO svn $Id: 04_09.rar2fs.init 1205 2012-04-15 12:15:26Z arris69 $
#
# TODO: more sysv style, more error handling
#
. /dtv/SGO.env
case $1 in
start)
for i in `find ${MOUNT_PATH}/nfs/192.168.1.127/_volume1_downloads/series/ -name '*.rar' -maxdepth 1`
do
echo ${i}
tmpdir=${i%.ra*}
dir=${tmpdir##*/}
if [ ! -d "/tmp/$dir" ]; then
mkdir "/tmp/${dir}"
echo "/tmp/$dir created"
else
echo "/tmp/$dir exists"
fi
if [ `$SYSROOT/bin/busybox mount | grep -c "/tmp/$dir"` == 1 ] ; then
echo "/tmp/$dir already mounted"
else
echo "rar2fs $i /tmp/$dir"
rar2fs $i /tmp/$dir
fi
done
# find . -type d -empty -exec rmdir {} \;
# echo "empty directories deleted"
;;
stop)
for i in `$SYSROOT/bin/busybox mount | grep "fuse.rar2fs" | awk '{print $3}'`; do
umount $i
echo "$i unmounted"
done
;;
status)
$SYSROOT/bin/busybox mount | grep "fuse.rar2fs" | awk '{print $3}'
;;
*)
echo "Usage: $0 {start|stop|status}" 1>&2
exit 0
;;
esac
Reference: viewtopic.php?f=16&t=3173