Wednesday, June 22, 2011

How to : Oscam compile tutorial

How to : Oscam compile tutorial

IN TERMINAL AS ROOT USER TYPE THE FOLLOWING COMMANDS

FIRST INSTALL REQUIRED PACKAGES
apt-get install proftpd gcc g++ make cmake bzip2 libpcsclite1 libpcsclite-dev subversion
OR
apt-get install gcc g++ cmake libpcsclite1 libpcsclite-dev subversion

NEXT DRIVERS DOWNLOAD FOR USB DEVICES
cd /usr/src
wget Download libusb from SourceForge.net
tar xjvf libusb-1.0.8.tar.bz2 (if you missing bzip2 then - apt-get install bzip2 and repeat previous command)
cd libusb-1.0.8
./configure --enable-shared=no
make (if command not found then - apt-get install make and repeat previous command)
make install

NOW WE DOWNLOAD OSCAM SOURCES AND COMPILE
cd /usr/src
svn co oscam - Revision 4971: /trunk oscam
cd oscam
mkdir buid
cd build
cmake .. (those two dots important, if WEBIF is wanted then - cmake -DWEBIF=1 ..)
(if command not found then - apt-get install cmake and repeat previous command)
make

NOW WE WILL COPY OSCAM TO /USR/LOCAL/BIN
cp oscam /usr/local/bin
cd /usr/local/bin
ls
(oscam should be listed here. Next: )
chmod 755 oscam

(Before you start the server make sure you got all 3 oscam config files in /usr/local/etc directory.)

(Don't delete compiling directories, so you can later easily update your oscam version)

TO COMPILE LATEST VERSION NEXT TIME
cd /usr/src
svn co oscam - Revision 4971: /trunk oscam
cd /usr/src/oscam/build
cmake ..
make

If you need to re-complie Oscam, first delete all files from the build directory -otherwise Oscam won't re-compile.
Also, you can determine which modules are compiled using the config.sh shell in the oscam-svn directory (dvapi etc.)
sudo sh config.sh

As long as you are using one of the latest builds the following modules are automatic : -

Active modules:
Webif support: yes
OpenSSL support: no
Dvbapi support: no
Anticasc support: yes
ECM doublecheck: no
Irdeto guessing: yes
Debug: yes
LED support: no
Qboxhd-LED support: no
Log history: yes
Monitor: yes
Camd33: yes
Camd35 UDP: yes
Camd35 TCP: yes
Newcamd: yes
Cccam: yes
Gbox: yes
Radegast: yes
Serial: yes
ConstCW: yes
Cardreader: yes
Nagra: yes
Irdeto: yes
Conax: yes

The ecm doublecheck is an interesting feature if you have identical cards. The Dvbapi feature would not be apllicable on a linux build

Here is the config file at build stage

#!/bin/bash
tempfile=/tmp/test$$
tempfileconfig=/tmp/oscam-config.h
configfile=oscam-config.h
DIALOG=${DIALOG:-`which dialog`}

height=30
width=65
listheight=11

if [ -z "${DIALOG}" ]; then
echo "Please install dialog package." 1>&2
exit 1
fi

cp -f $configfile $tempfileconfig

addons="WEBIF HAVE_DVBAPI IRDETO_GUESSING CS_ANTICASC WITH_DEBUG CS_WITH_DOUBLECHECK CS_LED QBOXHD_LED CS_LOGHISTORY MODULE_MONITOR WITH_SSL"
protocols="MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_GBOX MODULE_RADEGAST MODULE_SERIAL MODULE_CONSTCW"
readers="WITH_CARDREADER READER_NAGRA READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG"

check_test() {
if [ "$(cat $tempfileconfig | grep "^#define $1$")" != "" ]; then
echo "on"
else
echo "off"
fi
}

disable_all() {
for i in $1; do
sed -i -e "s/^#define ${i}$/\/\/#define ${i}/g" $tempfileconfig
done
}

enable_package() {
for i in $(cat $tempfile); do
strip=$(echo $i | sed "s/\"//g")
sed -i -e "s/\/\/#define ${strip}$/#define ${strip}/g" $tempfileconfig
done
}

print_components() {
clear
echo "You have selected the following components:"
echo -e "\nAdd-ons:"
for i in $addons; do
printf "\t%-20s: %s\n" $i $(check_test "$i")
done

echo -e "\nProtocols:"
for i in $protocols; do
printf "\t%-20s: %s\n" $i $(check_test "$i")
done

echo -e "\nReaders:"
for i in $readers; do
printf "\t%-20s: %s\n" $i $(check_test "$i")
done
cp -f $tempfileconfig $configfile
}

menu_addons() {
${DIALOG} --checklist "\nChoose add-ons:\n " $height $width $listheight \
WEBIF "Web Interface" $(check_test "WEBIF") \
HAVE_DVBAPI "DVB API" $(check_test "HAVE_DVBAPI") \
IRDETO_GUESSING "Irdeto guessing" $(check_test "IRDETO_GUESSING") \
CS_ANTICASC "Anti cascading" $(check_test "CS_ANTICASC") \
WITH_DEBUG "Debug messages" $(check_test "WITH_DEBUG") \
CS_WITH_DOUBLECHECK "ECM doublecheck" $(check_test "CS_WITH_DOUBLECHECK") \
CS_LED "LED" $(check_test "CS_LED") \
QBOXHD_LED "QboxHD LED" $(check_test "QBOXHD_LED") \
CS_LOGHISTORY "Log history" $(check_test "CS_LOGHISTORY") \
MODULE_MONITOR "Monitor" $(check_test "MODULE_MONITOR") \
WITH_SSL "OpenSSL support" $(check_test "WITH_SSL") \
2> ${tempfile}

opt=${?}
if [ $opt != 0 ]; then return; fi

disable_all "$addons"
enable_package
}

menu_protocols() {
${DIALOG} --checklist "\nChoose protocols:\n " $height $width $listheight \
MODULE_CAMD33 "camd 3.3" $(check_test "MODULE_CAMD33") \
MODULE_CAMD35 "camd 3.5 UDP" $(check_test "MODULE_CAMD35") \
MODULE_CAMD35_TCP "camd 3.5 TCP" $(check_test "MODULE_CAMD35_TCP") \
MODULE_NEWCAMD "newcamd" $(check_test "MODULE_NEWCAMD") \
MODULE_CCCAM "CCcam" $(check_test "MODULE_CCCAM") \
MODULE_GBOX "gbox" $(check_test "MODULE_GBOX") \
MODULE_RADEGAST "radegast" $(check_test "MODULE_RADEGAST") \
MODULE_SERIAL "Serial" $(check_test "MODULE_SERIAL") \
MODULE_CONSTCW "constant CW" $(check_test "MODULE_CONSTCW") \
2> ${tempfile}

opt=${?}
if [ $opt != 0 ]; then return; fi

disable_all "$protocols"
enable_package
}

menu_reader() {
${DIALOG} --checklist "\nChoose reader:\n " $height $width $listheight \
READER_NAGRA "Nagravision" $(check_test "READER_NAGRA") \
READER_IRDETO "Irdeto" $(check_test "READER_IRDETO") \
READER_CONAX "Conax" $(check_test "READER_CONAX") \
READER_CRYPTOWORKS "Cryptoworks" $(check_test "READER_CRYPTOWORKS") \
READER_SECA "Seca" $(check_test "READER_SECA") \
READER_VIACCESS "Viaccess" $(check_test "READER_VIACCESS") \
READER_VIDEOGUARD "NDS Videoguard" $(check_test "READER_VIDEOGUARD") \
READER_DRE "DRE Crypt" $(check_test "READER_DRE") \
READER_TONGFANG "Tongfang" $(check_test "READER_TONGFANG") \
2> ${tempfile}

opt=${?}
if [ $opt != 0 ]; then return; fi

menuitem=`cat $tempfile`
if [ "$menuitem" != "" ]; then
echo -n " \"WITH_CARDREADER\"" >> ${tempfile}
fi
disable_all "$readers"
enable_package
}

while true; do
${DIALOG} --menu "\nSelect category:\n " $height $width $listheight \
Add-ons "Add-ons" \
Protocols "Network protocols" \
Reader "Reader" \
Save "Save" \
2> ${tempfile}

opt=${?}
if [ $opt != 0 ]; then clear; rm $tempfile; rm $tempfileconfig; exit; fi

menuitem=`cat $tempfile`
case $menuitem in
Add-ons) menu_addons;;
Protocols) menu_protocols;;
Reader) menu_reader;;
Save) print_components; rm $tempfile; rm $tempfileconfig; exit;;
esac
done


That is the standard config file but which parameters are amended.

No comments:

Post a Comment