Auto Revert Firmware Back Software

Here are software that related with Samsung B series TVs. Like hex editors, new version of BusyBox or internal software, app programs that will run in your TV hardware.:!:This forum is NOT FOR USER QUESTIONS or Problems.

User avatar
erdem_ua
SamyGO Admin
Posts: 3126
Joined: Thu Oct 01, 2009 6:02 am
Location: Istanbul, Turkey
Contact:

Auto Revert Firmware Back Software

Post by erdem_ua »

Since too many people have this issue,
I decided to make a script that enables older firmware...
How it's looking?

Code: Select all

#I planned thet to detecting partition that needed to enable, used to sense PartitionSwithch file....
if [ -f /mtd_rwarea/PartitionSwitch_1_0 ]
then

mkdir /dtv/test
mount -t auto /dev/tbml8 /dtv/test
#OLDVERS = T-CHL7DEUC-2004.1
OLDVERS=$(/bin/busybox egrep -e 'T-CHL7DEUC-[0-9][0-9][0-9][0-9].[0-9]' /dtv/test/exeDSP)
#OLDVERS=2004
OLDVERS=$(echo $OLDVERS | sed s/.*-//g | sed 's/\..*//g')
echo $(sed 's/_00[0-9][0-9][0-9][0-9]_/_00'$OLDVERS'_/g' Version.1) > Version.0

else

mkdir /dtv/test
mount -t auto /dev/tbml10 /dtv/test
#OLDVERS = T-CHL7DEUC-2004.1
OLDVERS=$(/bin/busybox egrep -e 'T-CHL7DEUC-[0-9][0-9][0-9][0-9].[0-9]' /dtv/test/exeDSP)
#OLDVERS=2004
OLDVERS=$(echo $OLDVERS | sed s/.*-//g | sed 's/\..*//g')
echo $(sed 's/_00[0-9][0-9][0-9][0-9]_/_00'$OLDVERS'_/g' Version.0) > Version.1

fi
User avatar
erdem_ua
SamyGO Admin
Posts: 3126
Joined: Thu Oct 01, 2009 6:02 am
Location: Istanbul, Turkey
Contact:

Re: Auto Revert Firmware Back Software

Post by erdem_ua »

Himmm, there is a problem at script. Because you needed to have Version.1 if you have PartitionSwitch_1_0 file.
Problem is that I forgot to place full path names. I think this script is proper now.
Touch is not required because echo will create the destination file automatically.

Code: Select all

if [ -f /mtd_rwarea/PartitionSwitch_1_0 ]
then

mkdir /dtv/test
mount -t auto /dev/tbml8 /dtv/test
#OLDVERS = T-CHL7DEUC-2004.1
OLDVERS=$(/bin/busybox egrep -e 'T-CHL7DEUC-[0-9][0-9][0-9][0-9].[0-9]' /dtv/test/exeDSP)
#OLDVERS=2004
OLDVERS=$(echo $OLDVERS | sed s/.*-//g | sed 's/\..*//g')
echo $(sed 's/_00[0-9][0-9][0-9][0-9]_/_00'$OLDVERS'_/g' /mtd_rwarea/Version.1) > /mtd_rwarea/Version.0

else

mkdir /dtv/test
mount -t auto /dev/tbml10 /dtv/test
#OLDVERS = T-CHL7DEUC-2004.1
OLDVERS=$(/bin/busybox egrep -e 'T-CHL7DEUC-[0-9][0-9][0-9][0-9].[0-9]' /dtv/test/exeDSP)
#OLDVERS=2004
OLDVERS=$(echo $OLDVERS | sed s/.*-//g | sed 's/\..*//g')
echo $(sed 's/_00[0-9][0-9][0-9][0-9]_/_00'$OLDVERS'_/g' /mtd_rwarea/Version.0) > /mtd_rwarea/Version.1

fi
Moving this to Telnet Enabler app will create auto firmware downgrade application :)
But before we needed to change "T-CHL7DEUC" string with auto detected firmware name. I think current version file that exits will help us :)
arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: Auto Revert Firmware Back Software

Post by arris69 »

erdem_ua wrote:...

Moving this to Telnet Enabler app will create auto firmware downgrade application :)
But before we needed to change "T-CHL7DEUC" string with auto detected firmware name. I think current version file that exits will help us :)
think safe way to detect the right firmware-type is from the file /.info
ack?

arris
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Auto Revert Firmware Back Software

Post by juusso »

erdem_ua wrote:I think this script is proper now.
Hi, two questions:

1. Do we need paste this script code between:

Code: Select all

#!/bin/sh

...Your code ...

exit
to have right script file to run it? eg. revert.sh ? (and chmod it to 755 of course)

2. If i understood right, these rows are not important in case if the fw version is different, not 2004.1?

Code: Select all

#OLDVERS = T-CHL7DEUC-2004.1
...
#OLDVERS=2004
...
They are after #, so they`re just comments?
Tx.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
User avatar
erdem_ua
SamyGO Admin
Posts: 3126
Joined: Thu Oct 01, 2009 6:02 am
Location: Istanbul, Turkey
Contact:

Re: Auto Revert Firmware Back Software

Post by erdem_ua »

arris69 wrote:
erdem_ua wrote:...

Moving this to Telnet Enabler app will create auto firmware downgrade application :)
But before we needed to change "T-CHL7DEUC" string with auto detected firmware name. I think current version file that exits will help us :)
think safe way to detect the right firmware-type is from the file /.info
ack?

arris
You are right as always :)
Do you know how could I make it proper? Lines below doesn't look working good...

Code: Select all

FWNAME=$(cat /.info)
OLDVERS=$(/bin/busybox egrep -e '$(FWNAME)-[0-9][0-9][0-9][0-9].[0-9]' /dtv/test/exeDSP)
User avatar
erdem_ua
SamyGO Admin
Posts: 3126
Joined: Thu Oct 01, 2009 6:02 am
Location: Istanbul, Turkey
Contact:

Re: Auto Revert Firmware Back Software

Post by erdem_ua »

juuso wrote:
erdem_ua wrote:I think this script is proper now.
Hi, two questions:

1. Do we need paste this script code between:

Code: Select all

#!/bin/sh

...Your code ...

exit
to have right script file to run it? eg. revert.sh ? (and chmod it to 755 of course)

2. If i understood right, these rows are not important in case if the fw version is different, not 2004.1?

Code: Select all

#OLDVERS = T-CHL7DEUC-2004.1
...
#OLDVERS=2004
...
They are after #, so they`re just comments?
Tx.
1. I don't know if bash scripts are terminated with exit :)
But It's good thing to put #!/bin/sh to header...

2.Those are just for testing, developing :) Not important.
arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: Auto Revert Firmware Back Software

Post by arris69 »

erdem_ua wrote: ...
Do you know how could I make it proper? Lines below doesn't look working good...

Code: Select all

FWNAME=$(cat /.info)
OLDVERS=$(/bin/busybox egrep -e '$(FWNAME)-[0-9][0-9][0-9][0-9].[0-9]' /dtv/test/exeDSP)
i'm not shure what you need in your variable, but grepping in a binary is a pain ;-)

Code: Select all

FWNAME=`head -n 1 /.info`
OLDVERS=$(egrep -a "$FWNAME-[0-9][0-9][0-9][0-9].[0-9]" /dtv/test/exeDSP)
ver=${OLDVERS#*$FWNAME-}
fver="$FWNAME-$ver"
len=$((${#FWNAME} + 7))
rver=${fver:0:len}

echo $rver
hope samy's egrep supports -a option, can't test it

hth
arris
User avatar
erdem_ua
SamyGO Admin
Posts: 3126
Joined: Thu Oct 01, 2009 6:02 am
Location: Istanbul, Turkey
Contact:

Re: Auto Revert Firmware Back Software

Post by erdem_ua »

arris69 wrote:
erdem_ua wrote: ...
hope samy's egrep supports -a option, can't test it

hth
arris

Code: Select all

# OLDVERS=$(egrep -a "$FWNAME-[0-9][0-9][0-9][0-9].[0-9]" /dtv/test/exeDSP)
egrep: invalid option -- a
but

Code: Select all

OLDVERS=$(grep $(echo "$FWNAME-[0-9][0-9][0-9][0-9].[0-9]") /dtv/test/exeDSP)
makes the job. :D


THE LATEST SCRIPT:

Code: Select all

if [ -f /mtd_rwarea/PartitionSwitch_1_0 ]
then

mkdir /dtv/test
mount -t auto /dev/tbml8 /dtv/test
FWNAME=$(cat /.info)
OLDVERS=$(/bin/busybox egrep -e $(echo "$FWNAME-[0-9][0-9][0-9][0-9].[0-9]") /dtv/test/exeDSP)
OLDVERS=$(echo $OLDVERS | sed s/.*-//g | sed 's/\..*//g')
echo $(sed 's/_00[0-9][0-9][0-9][0-9]_/_00'$OLDVERS'_/g' /mtd_rwarea/Version.1) > /mtd_rwarea/Version.0

else

mkdir /dtv/test
mount -t auto /dev/tbml10 /dtv/test

OLDVERS=$(/bin/busybox egrep -e $(echo "$FWNAME-[0-9][0-9][0-9][0-9].[0-9]") /dtv/test/exeDSP)
OLDVERS=$(echo $OLDVERS | sed s/.*-//g | sed 's/\..*//g')
echo $(sed 's/_00[0-9][0-9][0-9][0-9]_/_00'$OLDVERS'_/g' /mtd_rwarea/Version.0) > /mtd_rwarea/Version.1

fi
Looks working on here :)

Post Reply

Return to “[B] Software”