OSCam is an Open Source Conditional Access Module software, based on the very good MpCS
How to install Oscam:
svn checkout https://svn.streamboard.tv/oscam/trunk oscam-svn
Building Oscam:
cd oscam-svn
svn update
# You'll see a list of the updated files
After the update is finished build the OSCAM like you normally do.
NOTE: Do not use svn checkout to update the source tree, that is the wrong thing to do! svn checkout should be used only for getting the source for the first time, to update the source to latest version you must use svn update.
# Get info about the currently checkout revision
svn info .
make config
Other useful configuration targets are:
# Disable everything in the config
make allnoconfig
# Enable everything in the config
make allyesconfig
# Restore default config values
make defconfig
The above targets are shortcuts that are running config.sh tool which deals with OSCAM configuration. You can use the tool to control and view OSCAM build parameters from the command line. You can read config.sh --help to see what the tool offers. Here are some examples:
# Enable WEBIF and SSL
./config.sh --enable WEBIF WITH_SSL
# Disable WEBIF but enable WITH_SSL
./config.sh --disable WEBIF --enable WITH_SSL
# Restore defaults and disable WEBIF and READER_NAGRA
./config.sh --restore --disable WEBIF READER_NAGRA
# Use default config with only one enabled reader
./config.sh --restore --disable readers --enable READER_BULCRYPT
# Disable everything and enable webif, one module and one card reader
./config.sh --disable all --enable WEBIF MODULE_NEWCAMD READER_BULCRYPT
patch -p1 < file.patch
# or
patch -p0 < file.patch
The -p1 instruct patch program how much directories to cut from file names in the patch description.
If the patch is applied you'll see something like this:
$ patch -p1 < test.diff
patching file globals.h
patching file module-camd35.c
patching file module-cccam.c
Hunk #1 succeeded at 3200 (offset -2 lines).
Hunk #2 succeeded at 3251 (offset -2 lines).
patching file module-gbox.c
patching file module-lcd.c
patching file module-serial.c
Once the patch is applied build OSCAM like you normally do, test it and post the results.
To install libusb from source, just download libusb (or libusbx) from their site, unarchive it and build it without any options. These following commands would download, compile and install libusb in /usr/local.
cd /tmp
wget https://github.com/libusb/libusb/releases/download/v1.0.23/libusb-1.0.23.tar.bz2
tar -xf libusb-1.0.23.tar.bz2
cd libusb-1.0.23
./configure
make
sudo make install
Now to build OSCAM with libusb support you need the following commands:
make USE_LIBUSB=1
# To build OSCAM with static libusb you have to change LIBUSB_LIB variable to point to the static library
make USE_LIBUSB=1 LIBUSB_LIB=/usr/local/lib/libusb-1.0.a
# Since OS X is kind of special to build with static libusb you have to use the following command
make USE_LIBUSB=1 LIBUSB_LIB="/usr/local/lib/libusb-1.0.a -lobjc -framework IOKit -framework CoreFoundation"
# If libusb is installed by macports or with different than the default prefix (for example /opt/local)
make USE_LIBUSB=1 EXTRA_FLAGS="-I/opt/local/include -L/opt/local/lib"
# Using predefined libusb target
make libusb
To install PCSC from source, just download pcsclite from their site, unarchive it and build it without any options. These following commands would download, compile and install pcsclite in /usr/local.
cd /tmp
wget https://pcsclite.apdu.fr/files/pcsc-lite-1.9.0.tar.bz2
tar -xf pcsc-lite-1.9.0.tar.bz2
cd pcsc-lite-1.9.0
./configure
make
sudo make install
Now to build OSCAM with PCSC support you need the following commands:
make USE_PCSC=1
# build with smartreader and PCSC support
make USE_PCSC=1 USE_LIBUSB=1
# Using predefined pcsc target
make pcsc
make pcsc-libusb
How to install Oscam:
Download: Source Repository
You can get OSCam source code from SVN, using the following command:svn checkout https://svn.streamboard.tv/oscam/trunk oscam-svn
Building Oscam:
Staying current
To update the source code from SVN, run this:cd oscam-svn
svn update
# You'll see a list of the updated files
After the update is finished build the OSCAM like you normally do.
NOTE: Do not use svn checkout to update the source tree, that is the wrong thing to do! svn checkout should be used only for getting the source for the first time, to update the source to latest version you must use svn update.
Building specific revisions
Sometimes a certain svn revision is not working or you want to test something specific. In that case you can use svn to switch to the revision you want by running the following:cd oscam-svn
# Update to revision 7400
svn update -r 7400
# Go to newest revision
svn update -r HEAD
# Get info about the currently checkout revision
svn info .
Cross compiling
If you want to build OSCAM for different system than yours, you probably should take look at OSCAM cross compilation page.Build configuration
OSCAM contains a lot of features that can be removed from the final binary in order to save space. To configure the OSCAM features that you want, start the graphical configuration utility (dialog program must be installed in order for this to work) and select/unselect options:make config
Other useful configuration targets are:
# Disable everything in the config
make allnoconfig
# Enable everything in the config
make allyesconfig
# Restore default config values
make defconfig
The above targets are shortcuts that are running config.sh tool which deals with OSCAM configuration. You can use the tool to control and view OSCAM build parameters from the command line. You can read config.sh --help to see what the tool offers. Here are some examples:
# Enable WEBIF and SSL
./config.sh --enable WEBIF WITH_SSL
# Disable WEBIF but enable WITH_SSL
./config.sh --disable WEBIF --enable WITH_SSL
# Restore defaults and disable WEBIF and READER_NAGRA
./config.sh --restore --disable WEBIF READER_NAGRA
# Use default config with only one enabled reader
./config.sh --restore --disable readers --enable READER_BULCRYPT
# Disable everything and enable webif, one module and one card reader
./config.sh --disable all --enable WEBIF MODULE_NEWCAMD READER_BULCRYPT
Testing patches
Patches are files that contain code changes and are often posted in trouble tickets or forum threads from developers. Usually users are asked to test them in order to confirm that certain bug is fixed. Once the patch is saved in oscam-svn directory you have to apply it by running patch program:patch -p1 < file.patch
# or
patch -p0 < file.patch
The -p1 instruct patch program how much directories to cut from file names in the patch description.
If the patch is applied you'll see something like this:
$ patch -p1 < test.diff
patching file globals.h
patching file module-camd35.c
patching file module-cccam.c
Hunk #1 succeeded at 3200 (offset -2 lines).
Hunk #2 succeeded at 3251 (offset -2 lines).
patching file module-gbox.c
patching file module-lcd.c
patching file module-serial.c
Once the patch is applied build OSCAM like you normally do, test it and post the results.
Special OSCAM builds
Building OSCAM with support for smartreader (libusb)
To build OSCAM with libusb (smartreader) support on you have to install libusb first. If your distribution do not have libusb or libusb-dev package installed you have to install them or install libusb from source.To install libusb from source, just download libusb (or libusbx) from their site, unarchive it and build it without any options. These following commands would download, compile and install libusb in /usr/local.
cd /tmp
wget https://github.com/libusb/libusb/releases/download/v1.0.23/libusb-1.0.23.tar.bz2
tar -xf libusb-1.0.23.tar.bz2
cd libusb-1.0.23
./configure
make
sudo make install
Now to build OSCAM with libusb support you need the following commands:
make USE_LIBUSB=1
# To build OSCAM with static libusb you have to change LIBUSB_LIB variable to point to the static library
make USE_LIBUSB=1 LIBUSB_LIB=/usr/local/lib/libusb-1.0.a
# Since OS X is kind of special to build with static libusb you have to use the following command
make USE_LIBUSB=1 LIBUSB_LIB="/usr/local/lib/libusb-1.0.a -lobjc -framework IOKit -framework CoreFoundation"
# If libusb is installed by macports or with different than the default prefix (for example /opt/local)
make USE_LIBUSB=1 EXTRA_FLAGS="-I/opt/local/include -L/opt/local/lib"
# Using predefined libusb target
make libusb
Building OSCAM with PCSC support
To build OSCAM with PCSC support on you have to install pcsclite first. For example for Debian: apt-get install libpcsclite-dev. If your distribution do not have pcsclite installed you have to install it from source.To install PCSC from source, just download pcsclite from their site, unarchive it and build it without any options. These following commands would download, compile and install pcsclite in /usr/local.
cd /tmp
wget https://pcsclite.apdu.fr/files/pcsc-lite-1.9.0.tar.bz2
tar -xf pcsc-lite-1.9.0.tar.bz2
cd pcsc-lite-1.9.0
./configure
make
sudo make install
Now to build OSCAM with PCSC support you need the following commands:
make USE_PCSC=1
# build with smartreader and PCSC support
make USE_PCSC=1 USE_LIBUSB=1
# Using predefined pcsc target
make pcsc
make pcsc-libusb