OSCam/en/Self-made: Unterschied zwischen den Versionen

Aus Streamboard Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
(Translated to English.)
Zeile 2: Zeile 2:
{{OSCamHomeLinks}}
{{OSCamHomeLinks}}


[[Datei:WarningS.png|text-bottom]] '''Attention:''' The content of the english pages are partially still in german. Please register here to help us completing and translating the articles.
== Self-made OSCam ==
=== Introduction ===
This article describes the steps one must execute in order to build OSCam from source.
All instructions quoted here have been tested on a Linux PC running '''[http://www.debian.org/ Debian]''' 6 - Squeeze.


== OSCam selbstgemacht ==
=== Environment ===
=== Intro ===
You need a Linux PC. Of course, it doesn't have to be a physical box, a virtual machine (VM) works just as well [[Datei:Smiley_wink.png]].
Nachfolgend wird der Weg vom Auschecken bis hin zur kompilierten OSCam '''im Groben''' beschrieben.
We recommend the free [http://www.vmware.com/products/player/ VMware Player].
Alle aufgeführten Linux-Beispiele und Code-Fragmente wurden auf einem Linux-PC mit '''[http://www.debian.org/ Debian]''' 6 getestet.


=== Umgebung ===
You can download your preferred [http://en.wikipedia.org/wiki/Linux_distribution Linux distribution], as an ISO or as a virtual machine.
Ein Linux-PC wird vorausgesetzt. Selbstverständlich '''muss es kein physikalischer PC sein''', eine '''virtuelle Maschine''' (VM) macht es genauso gut [[Datei:Smiley_wink.png]].
As mentioned above, the contents of this article were tested on a Debian distribution. It should work almost the same way with Ubuntu.
Der kostenlose [http://www.vmware.com/products/player/ VMware Player] ist z.B. sehr empfehlenswert.


Lade Dir ein [http://de.wikipedia.org/wiki/Linux-Distribution Linux] Deiner Wahl herunter, entweder als ISO zum Installieren oder als fertige VM.
=== Required Packages ===
Wie oben bereits erwähnt, basieren die ''Linux-Inhalte'' in diesem Artikel auf eine Debian-Distribution. Bei Ubuntu sollte es allerdings fast genauso funktionieren.
The following packages are needed for building OSCam:
 
=== Benötigte Pakete ===
Folgende Pakete werden zum Erstellen von OSCam benötigt:
  apt-get install cvs subversion
  apt-get install cvs subversion
  apt-get install autoconf libccid automake libtool gettext make cmake
  apt-get install autoconf libccid automake libtool gettext make cmake
Zeile 33: Zeile 31:
  apt-get install libusb-1.0-0 libusb-1.0-0-dev
  apt-get install libusb-1.0-0 libusb-1.0-0-dev


=== Verzeichnisstruktur ===
=== Directory Contents ===
  root@srv01:/var/shares/linux# tree oscam -L 2 -d
  root@srv01:/var/shares/linux# tree oscam -L 2 -d
  oscam
  oscam
  +-- bin                # hier landen die fertigen OSCam`s
  +-- bin                # this is where the compiled binary will be placed
  ¦  +-- archive        # hierein archivieren wir "alte" OSCam-Binaries
  ¦  +-- archive        # here we archive other OScam binaries
  +-- make              # in diesem Verzeichnis "machen" wir OSCam
  +-- make              # this directory is where we "make" OScam
  +-- svn-sb            # hier wird der OSCam-Sourcecode abgelegt
  +-- svn-sb            # this is where the code is downloaded
  ¦  +-- branches      # NICHT manuell erstellen! Wird beim ersten Auschecken erstellt
  ¦  +-- branches      # Don't create this! It is automatically created by subversion
  ¦  +-- tags          # NICHT manuell erstellen! Wird beim ersten Auschecken erstellt
  ¦  +-- tags          # Don't create this! It is automatically created by subversion
  ¦  +-- trunk          # NICHT manuell erstellen! Wird beim ersten Auschecken erstellt
  ¦  +-- trunk          # Don't create this! It is automatically created by subversion
  +-- toolchains        # optional, dient zum Erstellen der OSCam für andere Plattformen - [http://de.wikipedia.org/wiki/Cross-Compiler Cross-Compiling]
  +-- toolchains        # optional, contains toolchains for building OScam for other platforms; see [http://en.wikipedia.org/wiki/Cross_compiler Cross-Compiler]
     +-- mipsel        # optional - mipsel-Toolchain, z.B. für Dream-Boxen
     +-- mipsel        # optional - mipsel-Toolchain, e.g. for Dbox2
     +-- ppc            # optional - ppc-Toolchain, z.B. für die DBox2
     +-- ppc            # optional - ppc-Toolchain, e.g. for Dbox
     +-- tdt            # optional - sh4-Toolchain, z.B. für Kathrein-Boxen
     +-- tdt            # optional - sh4-Toolchain, e.g. for Kathrein


=== Sourcecode "''auschecken''" (SVN) ===
=== Checking out the source code with Subversion ===
==== Erstes Auschecken ====
==== Initial checkout ====
Wir holen zum ersten Mal die OSCam-Sourcen. Dies machen wir nur einmal:
We execute this only once, when we checkout the sources for the first time:
  oscamRoot='/var/shares/linux/oscam' # anpassen!
  oscamRoot='/var/shares/linux/oscam' # modify this path to suit!
  svnDir='svn-sb' # anpassen!
  svnDir='svn-sb' # change this name to suit!
  cd $oscamRoot
  cd $oscamRoot
  svn co http://streamboard.gmc.to/svn/oscam $svnDir
  svn co http://streamboard.gmc.to/svn/oscam $svnDir


==== Update ====
==== Update ====
Nachdem wir die OSCam-Sourcen einmal komplett geholt haben, müssen wir unser lokales [http://de.wikipedia.org/wiki/Repository Repository] nur noch aktualisieren, wenn sich am Quellcode etwas geändert hat:
After the initial checkout, you only need to update the source code when something is changed in the [http://en.wikipedia.org/wiki/Apache_Subversion#Repository_access Repository]. Like so:
  oscamRoot='/var/shares/linux/oscam'
  oscamRoot='/var/shares/linux/oscam'   # path where we have the source code
  svnDir='svn-sb'
  svnDir='svn-sb'                       # matches the name in initial checkout
  svnBranch='trunk'
  svnBranch='trunk'                     # this is the subversion branch
  cd $oscamRoot
  cd $oscamRoot
  svn up $svnDir/$svnBranch
  svn up $svnDir/$svnBranch


=== Kompilieren ===
=== Compilation ===
Es ist absolut nichts magisches und in ein paar Sekunden erledigt [[Datei:Smiley_wink.png]]:
There's nothing magic about this process, even though it only takes a few seconds [[Datei:Smiley_wink.png]]:
  # Variablen anpassen! **************************************
  # Modify variables as needed! ******************************
  oscamRoot='/var/shares/linux/oscam'
  oscamRoot='/var/shares/linux/oscam'
  ver='1.00'
  ver='1.00'
Zeile 74: Zeile 72:
  # **********************************************************
  # **********************************************************
  cd $oscamRoot
  cd $oscamRoot
  # aktuelle Sourcen auschecken ******************************
  # update the source code ***********************************
  svn up $svnDir/$svnBranch
  svn up $svnDir/$svnBranch
  # "alte" OSCam`s archivieren (optional) ********************
  # archive the current build (optional) *********************
  mv $oscamRoot/bin/oscam* $oscamRoot/bin/archive/
  mv $oscamRoot/bin/oscam* $oscamRoot/bin/archive/
  #
  #
  cd $oscamRoot/make
  cd $oscamRoot/make
  # i686 mit Webinterface ************************************
  # building for i686 with a Web Interface *******************
  rm -fr $oscamRoot/make/*
  rm -fr $oscamRoot/make/*
  cmake -DLIBUSBDIR=/usr -DWEBIF=1 -DCS_CONFDIR=/var/keys ../$svnDir/$svnBranch/$svnBuildDir
  cmake -DLIBUSBDIR=/usr -DWEBIF=1 -DCS_CONFDIR=/var/keys ../$svnDir/$svnBranch/$svnBuildDir
  # wenn mehrere CPU-Kerne zur Verfügung stehen...
  # if you have a multi-core CPU...
  make -j4 # wir nutzen 4 CPU-Kerne zum Kompilieren
  make -j4 # issue 4 parallel compiler jobs
  # ...ansonsten nur "make" ausführen
  # ... otherwise running 'make' will suffice
  # erstellte Binaries verschieben...
  # rename the binary to reflect version number...
  if [ -x "oscam" ]; then mv -f oscam ../bin/oscam-i686-$ver-$(svnversion -n ../$svnDir/$svnBranch/$svnBuildDir)-wi; fi;
  if [ -x "oscam" ]; then mv -f oscam ../bin/oscam-i686-$ver-$(svnversion -n ../$svnDir/$svnBranch/$svnBuildDir)-wi; fi;
  if [ -x "utils/list_smargo" ]; then mv -f utils/list_smargo ../bin/; fi;
  if [ -x "utils/list_smargo" ]; then mv -f utils/list_smargo ../bin/; fi;


=== Für andere Plattformen kompilieren ===
=== Compiling for other platforms ===
[http://de.wikipedia.org/wiki/Cross-Compiler Cross-Compiling] ist das magische Wort.
[http://de.wikipedia.org/wiki/Cross-Compiler Cross-Compiling] is the magic word.
Um OSCam für andere Plattformen zu kompilieren sind so genannte [http://de.wikipedia.org/wiki/Toolchain Toolchains] notwendig.
To compile OSCam for other platforms, we need additional [http://en.wikipedia.org/wiki/Toolchain Toolchains].
Einige Toolchains und weitere Informationen zum "'''''Cross-Compiling'''''" findest Du [http://streamboard.gmc.to:8001/wiki/crosscompiling '''»hier«'''].
You can find more information on Toolchains and  "'''''Cross-Compiling'''''" [http://streamboard.gmc.to:8001/wiki/crosscompiling '''»here«'''].


==== Beispiel DM800 ====
==== Example: DM800 ====
Toolchain-Datei:
Toolchain-Data:
  # toolchain-mipsel.cmake
  # toolchain-mipsel.cmake
  set (OSCAM_SYSTEM_NAME Tuxbox)
  set (OSCAM_SYSTEM_NAME Tuxbox)
Zeile 102: Zeile 100:
  set (CMAKE_C_COMPILER /var/shares/linux/oscam/toolchains/mipsel/bin/mipsel-unknown-linux-gnu-gcc)
  set (CMAKE_C_COMPILER /var/shares/linux/oscam/toolchains/mipsel/bin/mipsel-unknown-linux-gnu-gcc)
  set (CMAKE_SYSTEM_PROCESSOR mips)
  set (CMAKE_SYSTEM_PROCESSOR mips)
Auschecken und kompilieren:
Checking out the source code and compilation:
  # Variablen anpassen! **************************************
  # Modify variables as needed! ******************************
  oscamRoot='/var/shares/linux/oscam'
  oscamRoot='/var/shares/linux/oscam'
  ver='1.00'
  ver='1.00'
Zeile 111: Zeile 109:
  # **********************************************************
  # **********************************************************
  cd $oscamRoot
  cd $oscamRoot
  # aktuelle Sourcen auschecken ******************************
  # update the source code ***********************************
  svn up $svnDir/$svnBranch
  svn up $svnDir/$svnBranch
  # "alte" OSCam`s archivieren (optional) ********************
  # archive previous build (optional) ************************
  mv $oscamRoot/bin/oscam* $oscamRoot/bin/archive/
  mv $oscamRoot/bin/oscam* $oscamRoot/bin/archive/
  #
  #

Version vom 15. März 2011, 19:59 Uhr

OSCam Übersicht OSCam Home OSCam Accueil OSCam Home

Self-made OSCam

Introduction

This article describes the steps one must execute in order to build OSCam from source. All instructions quoted here have been tested on a Linux PC running Debian 6 - Squeeze.

Environment

You need a Linux PC. Of course, it doesn't have to be a physical box, a virtual machine (VM) works just as well . We recommend the free VMware Player.

You can download your preferred Linux distribution, as an ISO or as a virtual machine. As mentioned above, the contents of this article were tested on a Debian distribution. It should work almost the same way with Ubuntu.

Required Packages

The following packages are needed for building OSCam:

apt-get install cvs subversion
apt-get install autoconf libccid automake libtool gettext make cmake
apt-get install patch ncurses-bin gcc g++ flex bison pkg-config libpng3
# zlib (development headers) - zlib1g-dev
apt-get install tar bzip2 gzip zlib1g-dev

# for sa and aes:
apt-get install libssl-dev libssl0.9.8

# for pcsc:
apt-get install libpcsclite1 libpcsclite-dev

# for smartreader branch:
apt-get install libusb-1.0-0 libusb-1.0-0-dev

Directory Contents

root@srv01:/var/shares/linux# tree oscam -L 2 -d
oscam
+-- bin                # this is where the compiled binary will be placed
¦   +-- archive        # here we archive other OScam binaries
+-- make               # this directory is where we "make" OScam
+-- svn-sb             # this is where the code is downloaded
¦   +-- branches       # Don't create this! It is automatically created by subversion
¦   +-- tags           # Don't create this! It is automatically created by subversion
¦   +-- trunk          # Don't create this! It is automatically created by subversion
+-- toolchains         # optional, contains toolchains for building OScam for other platforms; see Cross-Compiler
    +-- mipsel         # optional - mipsel-Toolchain, e.g. for Dbox2
    +-- ppc            # optional - ppc-Toolchain, e.g. for Dbox
    +-- tdt            # optional - sh4-Toolchain, e.g. for Kathrein

Checking out the source code with Subversion

Initial checkout

We execute this only once, when we checkout the sources for the first time:

oscamRoot='/var/shares/linux/oscam' # modify this path to suit!
svnDir='svn-sb' # change this name to suit!
cd $oscamRoot
svn co http://streamboard.gmc.to/svn/oscam $svnDir

Update

After the initial checkout, you only need to update the source code when something is changed in the Repository. Like so:

oscamRoot='/var/shares/linux/oscam'   # path where we have the source code
svnDir='svn-sb'                       # matches the name in initial checkout
svnBranch='trunk'                     # this is the subversion branch
cd $oscamRoot
svn up $svnDir/$svnBranch

Compilation

There's nothing magic about this process, even though it only takes a few seconds :

# Modify variables as needed! ******************************
oscamRoot='/var/shares/linux/oscam'
ver='1.00'
svnDir='svn-sb'
svnBranch='trunk'
svnBuildDir=''
# **********************************************************
cd $oscamRoot
# update the source code ***********************************
svn up $svnDir/$svnBranch
# archive the current build (optional) *********************
mv $oscamRoot/bin/oscam* $oscamRoot/bin/archive/
#
cd $oscamRoot/make
# building for i686 with a Web Interface *******************
rm -fr $oscamRoot/make/*
cmake -DLIBUSBDIR=/usr -DWEBIF=1 -DCS_CONFDIR=/var/keys ../$svnDir/$svnBranch/$svnBuildDir
# if you have a multi-core CPU...
make -j4 # issue 4 parallel compiler jobs
# ... otherwise running 'make' will suffice
# rename the binary to reflect version number...
if [ -x "oscam" ]; then mv -f oscam ../bin/oscam-i686-$ver-$(svnversion -n ../$svnDir/$svnBranch/$svnBuildDir)-wi; fi;
if [ -x "utils/list_smargo" ]; then mv -f utils/list_smargo ../bin/; fi;

Compiling for other platforms

Cross-Compiling is the magic word. To compile OSCam for other platforms, we need additional Toolchains. You can find more information on Toolchains and "Cross-Compiling" »here«.

Example: DM800

Toolchain-Data:

# toolchain-mipsel.cmake
set (OSCAM_SYSTEM_NAME Tuxbox)
set (CMAKE_SYSTEM_NAME Linux)
set (CMAKE_C_COMPILER /var/shares/linux/oscam/toolchains/mipsel/bin/mipsel-unknown-linux-gnu-gcc)
set (CMAKE_SYSTEM_PROCESSOR mips)

Checking out the source code and compilation:

# Modify variables as needed! ******************************
oscamRoot='/var/shares/linux/oscam'
ver='1.00'
svnDir='svn-sb'
svnBranch='trunk'
svnBuildDir=''
# **********************************************************
cd $oscamRoot
# update the source code ***********************************
svn up $svnDir/$svnBranch
# archive previous build (optional) ************************
mv $oscamRoot/bin/oscam* $oscamRoot/bin/archive/
#
cd $oscamRoot/make
# mipsel ***************************************************
rm -fr $oscamRoot/make/*
cmake -DLIBUSBDIR=/var/shares/linux/oscam/lib-mipsel/usr -DWEBIF=1 -DCS_CONFDIR=/var/keys -DCMAKE_TOOLCHAIN_FILE=../toolchains/toolchain-mipsel.cmake ../$svnDir/$svnBranch/$svnBuildDir
make -j4
if [ -x "oscam" ]; then mv oscam ../bin/oscam-mipsel-$ver-$(svnversion -n ../$svnDir/$svnBranch/$svnBuildDir)-wi; fi;


Diese Seite in anderen Sprachen - This page in other languages - Cette page dans d'autres langues - Queste pagine in altre Lingue

[[OSCam/de/{{#titleparts:OSCam/en/Self-made|3|3}}|Deutsch]] [[OSCam/en/{{#titleparts:OSCam/en/Self-made|3|3}}|English]] [[OSCam/fr/{{#titleparts:OSCam/en/Self-made|3|3}}|Français]] [[OSCam/it/{{#titleparts:OSCam/en/Self-made|3|3}}|Italiano]]