#!/bin/sh
. /dtv/SGO.env
#### Change-your-stuff START
L1='/core/layer1' # /core is the only tmpfs with more than 10MB available, you may change this to some permanent storage location on TV / USB-Drive
MPL1='/dtv/ly1mnt'
L2="$MPL1/layer2"
MPL2="$MPL1/ly2mnt"
# Change only if you know what you're doing
USE4PVR="0"
#### Change-your-stuff END
GOON="1"
WriteToLog ()
{
case $2 in
1)
NOW=`date +%Y%m%d-%H%M%S`
echo "$3" "$NOW $1" >>$LOGFILE
;;
2)
echo "$3" "$1" >>$LOGFILE
;;
esac
}
case $1 in
start)
touch $LOGFILE
WriteToLog "start of beatfreaks 03_01_xfsimg.init script" 1
WriteToLog "1st layer image: " 2 '-n'
if [ ! -e $L1 ]; then
mkfs.xfs -f -d file,name=$L1,size=18m >> $LOGFILE
WriteToLog "created" 2
else
WriteToLog "found" 2
fi
WriteToLog "1st layer mountpoint : " 2 '-n'
if [ ! -d $MPL1 ]; then
mkdir $MPL1
WriteToLog "created" 2
else
WriteToLog "found" 2
fi
if [ `/bin/busybox mount | grep -c "$MPL1"` -lt "1" ] ; then
mount -o loop $L1 $MPL1/
WriteToLog "mounting layer1 : " 2 '-n'
if [ `/bin/busybox mount | grep -c "$MPL1"` -lt "1" ] ; then
WriteToLog "failed, aborting..." 2
GOON="0"
else
WriteToLog "successful" 2
fi
else
WriteToLog "layer1 already mounted" 2
fi
if [ $GOON = "1" ]; then
WriteToLog "2nd layer image : " 2 '-n'
if [ ! -e $L2 ]; then
mkfs.xfs -f -d file,name=$L2,size=1536m >> $LOGFILE
WriteToLog "created" 2
else
WriteToLog "found" 2
fi
WriteToLog "2nd layer mountpoint : " 2 '-n'
if [ ! -d $MPL2 ]; then
mkdir $MPL2
WriteToLog "created" 2
else
WriteToLog "found" 2
fi
if [ `/bin/busybox mount | grep -c "$MPL2"` -lt "1" ] ; then
mount -o loop $L2 $MPL2/
WriteToLog "mounting layer2 : " 2 '-n'
if [ `/bin/busybox mount | grep -c "$MPL2"` -lt "1" ] ; then
WriteToLog "failed, aborting..." 2
GOON="0"
else
WriteToLog "successful" 2
fi
else
WriteToLog "layer 2already mounted" 2
fi
if [ $GOON = "1" ]; then
WriteToLog "PVR Flag : " 2 '-n'
if [ ! -f $MPL2/.PlaceHolderDO-NOT-REMOVE ]; then
touch $MPL2/.PlaceHolderDO-NOT-REMOVE
WriteToLog "created" 2
else
WriteToLog "found" 2
fi
if [ $USE4PVR != "0" ]; then
umount $MPL2
echo "PVRIMAGE=\"$L2\"" >> /dtv/SGO.env #this will be overwritten in vusb.remi71 if you don't fit it
fi
fi
fi
WriteToLog "end of beatfreaks 03_01_xfsimg.init script" 1
;;
stop)
[ $USE4PVR = "0" ] && umount $MPL2
umount $MPL1
rm -r $MPL1
rm $L1
;;
restart)
$0 stop && $0 start || exit 1
;;
status)
;;
*)
echo "Usage: $0 {start|stop|restart}" 1>&2
exit 0
;;
esac
it seems to be fast enough to be executed as a init.d script, i think it has become a little too big to be included as a subfunction in vusb.remis71.init
Last edited by beatfreak on Mon Jun 09, 2014 2:15 pm, edited 3 times in total.
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS // >> decommissioned due to tuner death
//UE46F8090 @ T-FXPDEUC 1136 // rooted by new Widget // root starting with empty usb drive
FYI: you can close your ssh session with SamyGO with
what is your model and firmware?
i have tested it only with T-VALDEUC 3011 and samyGO Extensions v0.03.6-r15
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS // >> decommissioned due to tuner death
//UE46F8090 @ T-FXPDEUC 1136 // rooted by new Widget // root starting with empty usb drive
FYI: you can close your ssh session with SamyGO with
yes, it should be ok for samba shares too, it only generates the 1,5GB pvrimage with xfs filesystem so you dont have to keep it on usb or nw-share anymore
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS // >> decommissioned due to tuner death
//UE46F8090 @ T-FXPDEUC 1136 // rooted by new Widget // root starting with empty usb drive
FYI: you can close your ssh session with SamyGO with
just saw the updated script in SF svn repo
DEUS has put the 18m xfs image in $SYSROOT, he checks if it is existing, if not creates it but then he always runs mkfs.xfs over it
this way on every boot/SamyGO init there is a unnecessary write on flash memory
/core is 230MB tmpfs but what is it used for?
@juuso i would have appreciated a hint that we already use this method in current version of vusb script ^^
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS // >> decommissioned due to tuner death
//UE46F8090 @ T-FXPDEUC 1136 // rooted by new Widget // root starting with empty usb drive
FYI: you can close your ssh session with SamyGO with
because on F the SamyGO in the Virt.USB drive name somehow gets swallowed
you may also want to add an a usbPopDown here similar to the standard vusb-script
root@tv:/mnt $ cat etc/init.d/02_03_ext4img.init
#!/bin/sh
. /dtv/SGO.env
#### Change-your-stuff START
L1='/core/layer1' # /core is the only tmpfs with more than 60MB available, you may change this to some permanent storage location on TV / USB-Drive
MPL1='/dtv/ly1mnt'
#L2="/core/layer2"
#MPL2="$MPL1/ly2mnt"
# Change only if you know what you're doing
USE4PVR="1"
#### Change-your-stuff END
GOON="1"
WriteToLog ()
{
case $2 in
1)
NOW=`date +%Y%m%d-%H%M%S`
echo "$3" "$NOW $1" >>$LOGFILE
;;
2)
echo "$3" "$1" >>$LOGFILE
;;
esac
}
case $1 in
start)
touch $LOGFILE
WriteToLog "start of beatfreaks 02_03_ext4img.init script" 1
WriteToLog "1st layer image: " 2 '-n'
if [ ! -e $L1 ]; then
busybox dd of=$L1 bs=1k seek=1536k </dev/null
mkfs.ext4 -F -t ext4 $L1 >> $LOGFILE
WriteToLog "created" 2
else
WriteToLog "found" 2
fi
WriteToLog "1st layer mountpoint : " 2 '-n'
if [ ! -d $MPL1 ]; then
mkdir -p $MPL1
WriteToLog "created" 2
else
WriteToLog "found" 2
fi
if [ `/bin/busybox mount | grep -c "$MPL1"` -lt "1" ] ; then
mount -o loop $L1 $MPL1/
WriteToLog "mounting layer1 : " 2 '-n'
if [ `/bin/busybox mount | grep -c "$MPL1"` -lt "1" ] ; then
WriteToLog "failed, aborting..." 2
GOON="0"
else
WriteToLog "successful" 2
fi
else
WriteToLog "layer1 already mounted" 2
fi
if [ $GOON = "1" ]; then
WriteToLog "PVR Flag : " 2 '-n'
if [ ! -f $MPL1/.PlaceHolderDO-NOT-REMOVE ]; then
touch $MPL1/.PlaceHolderDO-NOT-REMOVE
WriteToLog "created" 2
else
WriteToLog "found" 2
fi
if [ $USE4PVR != "0" ]; then
umount $MPL1
echo "PVRIMAGE=\"$L1\"" >> /dtv/SGO.env #this will be overwritten in vusb.remi71 if you don't fit it
fi
fi
WriteToLog "end of beatfreaks 02_03_ext4img.init script" 1
;;
stop)
[ $USE4PVR = "0" ] && umount $MPL1
#umount $MPL1
rm -r $MPL1
rm $L1
;;
restart)
$0 stop && $0 start || exit 1
;;
status)
;;
*)
echo "Usage: $0 {start|stop|restart}" 1>&2
exit 0
;;
esac
root@tv:/mnt $
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS // >> decommissioned due to tuner death
//UE46F8090 @ T-FXPDEUC 1136 // rooted by new Widget // root starting with empty usb drive
FYI: you can close your ssh session with SamyGO with