From 2cb0638eae2df3079bb175a0824c8452d078de7a Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 7 Jan 2012 12:18:10 +0000 Subject: [PATCH] fb7390 fixes/tests git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1182 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- CHANGED | 1 + FHEM/98_autocreate.pm | 18 +++++++++++------- contrib/FB7390/install | 8 +++----- contrib/FB7390/startfhem | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CHANGED b/CHANGED index d5c04d271..c8bea2847 100644 --- a/CHANGED +++ b/CHANGED @@ -1,5 +1,6 @@ - SVN - feature: internal NotifyOrderPrefix: 98_average.pm is more straightforward + - feature: the usb command tries to flash unflashed CULs on linux - 2011-12-31 (5.2) diff --git a/FHEM/98_autocreate.pm b/FHEM/98_autocreate.pm index d5641f416..69db6a9fb 100644 --- a/FHEM/98_autocreate.pm +++ b/FHEM/98_autocreate.pm @@ -343,12 +343,13 @@ CommandUsb($$) $culType = "CUL_V4" if($lsusb =~ m/03eb:2ff0/); $culType = "CUL_V3" if($lsusb =~ m/03eb:2ff4/); $culType = "CUL_V2" if($lsusb =~ m/03eb:2ffa/); - last if(!$culType); - $msg = "$culType: flash it with: CULflash none $culType"; - Log 4, $msg; $ret .= $msg . "\n"; - if(!$scan) { - CommandCULflash(undef, "none $culType"); - sleep(4); # Leave time for linux to load th drivers + if($culType) { + $msg = "$culType: flash it with: CULflash none $culType"; + Log 4, $msg; $ret .= $msg . "\n"; + if(!$scan) { + CommandCULflash(undef, "none $culType"); + sleep(4); # Leave time for linux to load th drivers + } } } @@ -407,7 +408,10 @@ CommandUsb($$) $msg = "$dev: create as a fhem device with: define $define"; Log 4, $msg; $ret .= $msg . "\n"; - CommandDefine($cl, $define) if($scan); + if(!$scan) { + Log 1, "define $define"; + CommandDefine($cl, $define); + } goto NEXTDEVICE; } diff --git a/contrib/FB7390/install b/contrib/FB7390/install index 5e1712a4e..6d4e8dfb3 100755 --- a/contrib/FB7390/install +++ b/contrib/FB7390/install @@ -57,9 +57,7 @@ if test $r != 0; then fi rm -f /var/nvi.tmp -echo "########################### Starting fhem ############################" -sync -$home/startfhem - +# We have to restart with exit code 1, else the frontend tells us: +# update failed: no error echo "########################### FHEM INSTALL END #########################" -exit 1 # INSTALL_SUCCESS_REBOOT +exit 1 diff --git a/contrib/FB7390/startfhem b/contrib/FB7390/startfhem index c49173e76..7535ecd1b 100755 --- a/contrib/FB7390/startfhem +++ b/contrib/FB7390/startfhem @@ -28,7 +28,7 @@ if [ "$?" -ne "0" ]; then chown -R boxusr80 ${home}/FHEM chown root ${home}/dfu-programmer - chmod 2755 ${home}/dfu-programmer + chmod 4755 ${home}/dfu-programmer fi perl fhem.pl fhem.cfg