I want a binary directr from your device to play with it. Best one is busybox. To find where it is located do in you stb
- #whereis busybox
Then pull it from your android and post it here. Thank ahead.
I want a binary directr from your device to play with it. Best one is busybox. To find where it is located do in you stb
Then pull it from your android and post it here. Thank ahead.
Wao I did put many hours on this. Still swimming against current. Getting not where yet.
I have run the Debian Arm emulation. Have not set top network yet. To setup please use
Oscam CPU target emulation using qemu in Ubuntu. as reference. Almost all is the same . Create your $HOME/bin. Place
But now we do not use the malta script instead we will use a new one for ARM. It is attached.
Save your Arm Debian files
You need to open your drive: debian_wheezy_armel_standard.qcow2 and save the oscam binaries
Note this file system do open as "/" in Debian. So $HOME/bin/arm/versatile/mnt = / in Debian.
Now get the files needed from the attachment home.tar.xz. And copy them to /home/user/oscam ...
Press special attention. This one create the necesary devices in /dev/nd0-8
This one translate qcow2 image format to Ubuntu system
***See now how we do the mount and umount with the handler nbdp1 instead of the qcow2. As the handler take to job to translate qcow2.
After the umount, the qcow2 image still attached to the handler. So we need to delete that
Now our qcow2 image is free for us to use. And files where saved.
Now we only need to call quemu with
After about 1.5 minute you will get:
Debian GNU/Linux 7 debian-armel ttyAMA0
debian-armel login:
#user[Enter]
#user[Enter]
Linux debian-armel 3.2.0-4-versatile #1 Debian 3.2.51-1 armv5tejl
Display More
Yes user = user
user password = user
root = root
root password = root.
Enjoy
A none working oscam is at /home/user/oscam/oscam
QuoteLinux version 3.18.24_hi3798cv2x (hychoi@hychoi-desktop) (gcc version 4.9.2 20140904 (prerelease) (gcc-4.9.2 + glibc-2.22 (Build by czyong) Tue Oct 27 16:32:03 CST 2015) ) #7 SMP Mon Jul 10 16:07:01 KST 2017Nice.
I had spent a lot of time today. I did saw the Linux images that where base on Debian. I was expecting Debian will be the kernel use in android. Now you confirm and gave the kernel Linux version 3.18.24.
And after ours searching for an image I think we can use the following tutorial to get images working. So here is next steps to do. Read tutorial, download next 3 files.
_https://www.aurel32.net/info/debian_arm_qemu.php
In particular I am downloading
_https://people.debian.org/~aurel32/qemu/armel/initrd.img-3.2.0-4-versatile 2.5M
_https://people.debian.org/~aurel32/qemu/armel/vmlinuz-3.2.0-4-versatile 1.3M
_https://people.debian.org/~aurel32/qemu/armel/debian_wheezy_armel_standard.qcow2 218M
Later if I can I will try download
_https://people.debian.org/~aurel32/qemu/armel/debian_wheezy_armel_desktop.qcow2 1.7G
I hope to be able to have a workable Debian using
qemu-system-arm -M versatilepb -kernel vmlinuz-3.2.0-4-versatile -initrd initrd.img-3.2.0-4-versatile -hda debian_wheezy_armel_standard.qcow2 -append "root=/dev/sda1 console=ttyAMA0" -m 256
and I need to add the bridges to have network working.
Will download
_https://github.com/dizzdizzy/HiOSCAM/tree/master/u5sdk
and try to compile the oscam image to test qemu. I know that is an old oscam. Will build from there.
PD: Also this two links seems very interesting:
_https://github.com/96boards-poplar/Documentation/blob/master/debian/debian_build_instructions.md#flash-images-onto-the-poplar-board-emmc
_http://snapshots.linaro.org/96boards/poplar/linaro/aosp/
See you latter.
What I been gather so far:
I did received some off forum/manufactuer info by PM. In general it claim sources for building are at:
_https://github.com/dizzdizzy/HiOSCAM
This is very interesting product as they seems to post openly the sources. I do not know if they are good and complete but still an intersting product to me. I wonder how good/sensitive/modes the tuners are and the cost of this device.
Going back to objective, in general posted info of a guy who try to patch github sources said:
QuoteI've been able to add tandberg to the oscam Android. But due to the old source from the github link, I can't patch for the powervu.
I then use the latest svn source from oscam development server (r11425), but still manage to get the dvbapi work as on the Enigma2. There's still error on decoding the audio and video even the ecm has been found by the emu.
Anyway, thank you for the link.
Bud sadly that guy did not said what vesrion of android 7.1 he did use.
DANNYPS4 said he has install android 7.1 and Enigma 2 OpenATV. I asume in dual boot. And that even when he can have Enigma 2 OpenATV, he do have a preference for Android. That is why we are here.
1rst problem in github I do not see sources for android 7.1. In git hub we nan find sources for
android9-gcc4.7-toolchain
android9-gcc4.8-toolchain
But the make-u5.sh point to
HISILICON_TOOLCHAIN=$OSCAM_PATH/arm-histbv310-linux/bin
ANDROID_TOOLCHAIN=$OSCAM_PATH/android9-gcc4.8-toolchain/bin
And as a few had said this old oscam compile my guess is that the toolchain is good any way for android 7.1. We still need toverify this our self.
DANNYPS4 provided me with this Hardware info:
CPU: Hisilicon Hi3798C V200 quad core Cortex A53 processor + multi-core ARM Mali-T720 processor
Android 7.1
sdk: https://github.com/dizzdizzy/HiOSCAM/tree/master/u5sdk
What you need to know.
Old oscam / tvheadend used to share single key / all encrpted pids. Our friend joeuser some time ago created patches to allow the used of multple keys for various audio pids in pvu. Now this days all had adopted this new thing in their code. But I bet you this receiver never got this patch. if you create a new oscam and do not patch and recompile tvheadend you get audio problems at least. My best guess is that this had been the problem in the past with the people that tryied. So keep this in mind, we may need to reconpile a new version of tvheadend.
Now what next?
About me.
1rst lets start saying that I am no expert. But like to play. Sadly I have no harware to try it. I the need to try to see if I can find or build an image to run under qemu to emulate under Ubuntu. So if any can sugest where I can find a Cortex A53 processor image to be used in qemu please let me know.
Lets start asking for more info. Some of this commads may not work. Just C&P to a File.txt what you get. Please open ssh terminal and do
uname -a
lscpu
/proc/cpuinfo
cat /proc/cpuinfo | grep 'core id'
df -h
mount
cat /proc/version
dmesg | grep Linux
lsblk
lsusb
lspci
lshw
lshw -short
ldd --version
ldd /usr/bin/touch
whereis libc.so
this will produce a address ( ex /lib/libc.so), the use the addres with next like in
objdump -p /lib/libc.so
/lib/libc.so --version
When asking for help better to give all info.
Lets leave this tread as a general tutorial. Lets use one of the few post I found on this. Guess lets use:
Display MoreTeam,
this is the deal, My set top box which is an U5PVR Deluxe has an old version of OSCAM which cannot be updated because of some sort of drivers issue which only vivant can solve, however I can install any Amiko OSCAM on it but since Amiko and the U5PVR have different DVBAPI the Amiko OSCAM does not descramble any channel, so I have been wondering if I can make the old default OSCAM connect to the Amiko OSCAM both running under the same box and have the Amiko OSCAM do all the job, for example do all the emu thing for PowerVU since the Amiko OSCAM is more recent and is having a lot more support than the one from vivant??
so is it possible and how can I make it work??
Thanks.
So that was I guess february 2018. Please update me there on your findings.
I am no expert but willing to help you. Now I need more info.
Who own that github _https://github.com/dizzdizzy/HiOSCAM. What makes you think it is official
If that is official and there is problem with oscam why there is no post about it?
From what I see the github explained how to build!!
Please send me a PM with out of this forum info like:
Please post about your skills.
Do own PC with Ubuntu?
How are your skill in: Linux, Android, C, Programming, compiling.
Do you know how to access ssh Linux kernel in a Android?
Is your device rooted?
Is your device boot unlock?
What image do you run now.?
What other images you now can be used?
Now I really need to know about CPU/Kernel/os version and in particular C Libs installed. So that we can identify the best tool-chain matching you hardware/software.
Any other info you think will help.
PLEASE again do not post about this here. Use you own Thread.
I will be waiting your response.
To others, same suggestion. You can post a request like this here. But lets move on quickly to your own request/need on personal thread. This way we keep all nice and clean Thanks
You can do all this none sense handwork to run a oscam mipsel server and it will work. BUT this is to hard. Why do it if you can just run and oscam x86 version natively in Ubuntu.
Your answer is in 1rst post.
QuoteDisplay More1) Objective, Qemu emulation to test OS/programs in hardware we do not have. Like android boxes or routers with weird CPUs. Or may be any of those generic arduinos
For example take a look in:
looking for oscam binary to LEDE 17 - OpenWRT based FW on router MIPS (D-Link)
So what is all this thread about?. You can use this method to test any variety of oscam version you build for other CPU/OS. All test done not with actual hardware but simulating the hardware in your own Ubuntu PC. Hope this explain a little more.
See ansample where it may help:
looking for oscam binary to LEDE 17 - OpenWRT based FW on router MIPS (D-Link)
Our friend s3n0 ask for help. But I guess no one has his own router so he did not got his expected simple easy answer. Or at least some one that can offer him a working oscam version for his "MediaTek MT7621" mipsel CPU runing "Linux LEDE 4.4.92" OS. All the offered oscam bin did not work for him as they where not compatible with his CPU/OS version.
Now Let me clarify what I said on that thread. That thread was answered as we could do best. And in fact mcsshare did a wonderful explanation on how to build oscam our self. Thanks again.
Part#6
Last time we had a working malta image running in qemu. Lets start again. Open a terminal:
But wait until you see
"[ 19.907046] pcnet32 0000:00:0b.0 eth0: link up”
Now you can pres [ENTER] and you will see the LEDE Banner.
Lets see what is in /root
Nothing, Lets check our unfinished Network
You will see ONLY etho & lo. You have missing bridges so no REAL network access. But a fake one.
root@LEDE:/# ip route
default via 10.0.2.2 dev eth0 src 10.0.2.15
10.0.2.0/24 dev eth0 scope link src 10.0.2.15
10.0.2.2 dev eth0 scope link src 10.0.2.15
Lets ping google dns and it will not show
Now Lets bring up the network. First we need to mount our hardisk. I have not been able to do it automatically.
Lets see if we see our files now
There we go now we see our files
root@LEDE:/# ls /root
lost+found openwrt-wan-setup.sh oscam
Now lets bring up the bridges and the network.
root@LEDE:/# /root/openwrt-wan-setup.sh
'radio0' is disabled
'radio1' is disabled
'radio0' is disabled
'radio1' is disabled
The warning errors on radios, is telling you that wireless have not been setup. But never mind as it is an emulation and in fact it does not have a wireless!!!
Now lest see again our new network.
You will see something like this
br-lan Link encap:Ethernet HWaddr 52:54:00:33:12:02
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe33:1202/64 Scope:Link
inet6 addr: fd15:6b1b:8228::1/60 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:38 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6556 (6.4 KiB) TX bytes:3106 (3.0 KiB)
eth0 Link encap:Ethernet HWaddr 52:54:00:47:5E:C0
inet addr:192.168.7.2 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe47:5ec0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:33 errors:0 dropped:0 overruns:0 frame:0
TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3412 (3.3 KiB) TX bytes:9203 (8.9 KiB)
Interrupt:10 Base address:0x1060
Display More
OpenWrt router Lan address still as 192.168.1.1. But beware on your host Ubuntu it will be at 192.168.7.1
OpenWrt router Wan address is at 192.168.7.2. But beware on your host Ubuntu it will be at 192.168.1.1
lets see if we got network, lets ping google DNS
This time we have access to network. We can ping our Host Ubuntu.
Now Open another terminal in Ubuntu. Lets ping from Ubuntu to router WAN side.
Lets ping from Ubuntu to router LAN side.
Now let ssh from Ubuntu to the router as if we where a client of the LAN router. To do shh we need first to change the password in the router. Go back to the qemu screen and do
Change the password, I will use “admin” as password.
Now go back to Ubuntu terminal and do
And there you go no you can access your router direct from Ubuntu
OSCAM:
Lets make sure our x86 oscam is disabled
verify webif do not answer
Now lets fire up oscam in router. Go back to qemu or do it from shh Ubuntu. lets see 1rst oscan help:
Now that we know it runs, you can go to the config and adjust to your needs. If you feel more conftable you can quit qemu and mount the hdd image in ubuntu as we did. Make changes to /$HOME/bin/malta/mnt/oscam/config directory. Unmount and restart qemu. Then do
Now go back to ubuntu explore and test if it has webif. It should not answer
Now lets try instead with router address
Yes this time respond from router. You may need to adjust your call to oscam as you have an oscam with new address.
In the future, after installation and test: you will only have to do this to test oscam
Open a terminal
And play the TV. Enjoy.
This is it. I know Long to try. Now imaging the effort I put to write all this.
Since nobody answered and thread is finish, I guess a moderator can move this thread to the tutorial section. Thanks.
Part #5
Ok lets continue.
keep those handy in my case it shows:
WAN_GATEWAY="192.168.3.1"
WAN_IPADDRESS="192.168.3.52"
C&P the following
#!/bin/sh
uci batch <<EOF
delete network.wan
set network.wan=interface
set network.wan.ifname=eth0
set network.wan.proto=static
set network.wan.ipaddr=192.168.7.2
set network.wan.netmask=255.255.255.0
set network.wan.gateway=192.168.7.1
add_list network.wan.dns=208.67.222.222
add_list network.wan.dns=208.67.220.220
commit
EOF
/etc/init.d/network reload
Display More
Save and Exit.
Now lest download the malta image:
Please download also the files for oscam
rootfs:
I do not know how to do this correctly so that we can have a permanent root files and any opkg upgrade we make!. Sorry. But we can set up mount to have disk point to our \root area. Now lets create our own sda disk, to store our files.
creating a 516 mg unformatted disk image
Formatting the image to ext4
mounting the empty image
Now we can copy/setup all the files we need to have on /root. Please notice that when in LEDE/Openwrt user files are normally store at /root. But our Hardisk will be mounted like this “mount /dev/sda /root”. This means that even when in OpenWrt we use /root. In fact files in malta-le-root.ext4 are store at /. One more time all the files we store in $HOME/bin/malta/mnt/ will show later in Openwrt /root. I hope you go it.
Lets copy the files:
Lets unmount our disk image.
Now Lets test it all. Reboot your PC. Then make sure you have network by using explore and navigating to google. Lets move to bin folder
Lets see how our Network Looks first.
Lets try to set up our bridges. NOTE: if you choose not to do PART#3 then You are required to do #sudo host-network-setup.sh
You should see the new 2 interfaces “br-wan" & “br-lan".
IMPORTAT: after you execute qemu without guy you feel you bcan not quit. To bring up qemu menu you need to do
To get help write HELP [ENTER]
Now to exit do
Now lets start quemu with malta image
Your router should start booting. You will see the console info from the kernel posted to the screen:
"[ 0.000000] Linux version 4.9.58 (buildbot@builds) (gcc version 5.5.0 (LEDE GCC 5.5.0 r5217-098afa1) ) #0 SMP Tue Oct 31 02:43:10 2017“
***
“Please press Enter to activate this console”
But wait until you see
"[ 19.907046] pcnet32 0000:00:0b.0 eth0: link up”
Now you can pres [ENTER] and you will see the LEDE Banner.
continue>>
Part #4
If you are here we assume you got your /etc/sudoers.d/qemu working or decided to postpone and then use sudo with the qemu script temporally. Now lets continue.
Let me start by saying all this is not new nor created by me. I am only adding all pieces together to make it easy for you. Just search for “CCreate Linux bridge $BR_WAN $BR_LAN”
Lets now create our scripts.
WE will need 3 scripts. 1rst one set the bridges in Ubuntu. WE will need some info from our network. Make sure your network is up and working. So go to Explorer and open google to test it. Then just close it not needed anymore. if you get error latter you can always do ifconfig to get the manual info:
If you recalled from my example it show that my network is at
See my example:
enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
But more simple, keep this handy you will need to:
C&P the following
#!/usr/bin/env bash
# The following script will
# - Create Linux bridge $BR_WAN, $BR_LAN
# - Install IP addresses and basic routes
# - Enable proxy_arp on $BR_WAN
# - Enable ip_forward
# - Enable MASQUERADE on $IF_INET
# - $BR_LAN, $BR_WAN has to be allowed in ~/.usr/etc/qemu/bridge.conf
#
# Sample content:
#
# allow br-lan
# allow br-wan
#
# See qemu-bridge-helper.c of QEMU source code for details (`allow all`, `deny all`, `include xxx` can also be used).
#
# config variables
#IF_INET="enp0s25"
IF_INET=$(/sbin/ip route | awk '/default/ { print $5 }')
BR_WAN="br-wan"
BR_LAN="br-lan"
# - qemu-bridge-help has to be root setuid program.
##HELPER="$HOME/.usr/libexec/qemu-bridge-helper"
HELPER="/usr/local/libexec/qemu-bridge-helper"
mac_rand() {
hexdump -n 3 -e '"52:54:00:" 2/1 "%02x:" 1/1 "%02x"' /dev/urandom
}
# setup bridge for LAN network
sudo ip link add dev "$BR_LAN" type bridge
sudo ip link set dev "$BR_LAN" up
sudo ip addr add 192.168.1.3 dev "$BR_LAN"
sudo ip route add 192.168.1.0/24 dev "$BR_LAN"
# setup bridge for WAN network
sudo ip link add dev "$BR_WAN" type bridge
sudo ip addr add 192.168.7.1 dev "$BR_WAN"
sudo ip link set dev "$BR_WAN" up
#sudo ip link set dev tap0 master "$BR_WAN"
sudo ip route add 192.168.7.0/24 dev "$BR_WAN"
# Internet access setup
sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl -w net.ipv4.conf."$BR_WAN".proxy_arp=1
sudo iptables -t nat -A POSTROUTING -o "$IF_INET" -j MASQUERADE
Display More
C&P the following
#!/usr/bin/env bash
mac_rand() {
hexdump -n 3 -e '"52:54:00:" 2/1 "%02x:" 1/1 "%02x"' /dev/urandom
}
MAC_LAN="$(mac_rand)"
MAC_WAN="$(mac_rand)"
HELPER="/usr/local/libexec/qemu-bridge-helper"
BR_WAN="br-wan"
BR_LAN="br-lan"
qemu-system-mipsel -nographic \
-M malta -kernel $HOME/bin/malta/lede-malta-le-vmlinux-initramfs.elf
-m 516 \
-drive file=$HOME/bin/malta/malta-le-root.ext4,format=raw,index=0,media=disk \
-netdev bridge,id=wan,br="$BR_WAN,helper=$HELPER" -device pcnet,netdev=wan,mac="$MAC_WAN" \
-netdev bridge,id=lan,br="$BR_LAN,helper=$HELPER" -device pcnet,netdev=lan,mac="$MAC_LAN
Display More
Save and Exit.
continue>>
Part #3
To prevent confusion, I am trying to take small explanation breaks from time to time. I know this is hard stuff. Last time we spoke about the router image and how it need a LAN and WAN network port. To day I will explain a qemu start cmd a little so you know what is needed and why we do things.
Lets explained qemu cmd.
qemu-system-mipsel
qemu-system-mipsel = main emulator for mipsel
-M malta = tell it uses a malta image, I am not sure as why it is needed
-kernel [file] = point to the file containing the kernel
-append "root=/dev/sda” = a way for qemu to allow us to pass boot cmds to the kernel at boot time.
-nographic = clearly we do not have a dedicated monitor hook to the emulation. nographic will forward then all stdio output to the qemu monitor screen.
-m # = this tell how much ram memory we will emulate
DISK’s: -hda [file] or -Disk etc.
Network
other usefull
rootfs
-initrd [file] - normally for linux bootloaders this is required. I may used it in the future.
Why I tell you this? Well most of the time in Ubuntu we run programs as users. But there are stuff that setup the Linux environment that requires root access or “sudo”. In our example “sudo” is required to establish the bridge. But we do not want to give qemu root privileges!! As we quickly will think and worry that the images been tested will have root acces!!!! Wao what a dilemma!!!
Many Ubuntu users uses virtio for this. I never had used it. More stuff to learn, but you can try. qemu suggest to use the “helper” it is in HELPER="/usr/local/libexec/qemu-bridge-helper". Then we give root access only to HELPER that is only uses to set network, and no other program or image have root access.
IMPORTANT PLEASE DO NOT DO THIS IF YOU FEEL UNCONFORTABLE, I AM ONLY EXPLAINING HOW IS DONE. IF YOU BREAK /etc/sudoers.d/ YOU MAY NOT GET SUDO ACCES AGAIN!!! WILL REQUIRE SYSTEM REPAIR. SO WHEN DOING MODS TO THIS SYSTEM FILES WE NEED TO BE CAREFUL AND HAVE LINUX LIVE CD AROUND JUST IN CASE WE NEED TO REPAIR THIS. YOU BEEN WARNED PLEASE READ FOR MORE INFO
_https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file-on-ubuntu-and-centos
_https://help.ubuntu.com/community/Sudoers
So You can then ignore for now the following steps in this Part 3, until you feel confortable or others posted they done it. It is not that important. As you can overcome the problem by addinf sudo when you call the script. I will then proceed to explain anyway how to give "/usr/local/libexec/qemu-bridge-helper". For this we use /etc/sudoers.
Setting up /etc/sudoers:
IMPORTANT
This is what I do prevent looking me out of sudo PLEASE use careful at your own risk. I will be leaving a Filmanager Opened and ready just in case sudo does not work again. I open a separate cmd and do:
A new File Manager opens but with root privileges. Please leave this open and untouched. Is here just in case we need it. After using visudo and exiting we my find “sudo" broken leaving us out. This will allow us to test we have not broken sudo and return to this elevated File manager all ready open and ready to do any repairs. So to test sudo, go an open a new terminal and run any program in sudo like “#sudo leafpad test.txt”. If sudo is broken it will complain. But as we have leave the previews File Manager we can still use it to delete old /etc/sudoers.d/qemu. Got it.
1rst make sure you had read:
_https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file-on-ubuntu-and-centos
It should have opened nano. Be careful. C & P the following 2 lines:
Now let exit and save: [ctrl]+X, y, [enter] *** I know you saw .tmp but it does not matters it does save the correct file .
Now open a new terminal test sudo, for example
if sudo is broken please delete /etc/sudoers.d/qemu
And test that sudo works again. Then retry to edit sudo visudo -f /etc/sudoers.d/qemu
continue >>
Part2
Qemu:
Please read wiki to inform you what is qemu.
For the emulation we use qemu. Most people just do “apt install qemu”. But that is trouble. As some of new images available will not execute correctly as the version install is old 2.11!! Instead we need to compile the latest 3.0. You can get info:
note: I suggest you do
this is the fastest build ONLY for mipsel. But if you what it all then do
Now Trial and error corrections. After many hours of test I found we need to create some more manual setup.
Now let me make a small explanation on br-lan & br-wan. And why we need to config qemu to allow this two.
Please do
See my example:
enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.02 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 FFFF::FFFF:FFFF:FFFF:FFFF prefixlen 64 scopeid 0x20<link>
ether 00:00:00:00:00:01 txqueuelen 1000 (Ethernet)
RX packets 77458 bytes 109465919 (109.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 52941 bytes 4531156 (4.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 19 memory 0xf0500000-f0520000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2387 bytes 149460 (149.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2387 bytes 149460 (149.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I have two REAL Network Devices that have a nickname, in my example “lo” the loop and "enp0s25“ an Ethernet Port. If you have Wifi then it may be a third.
Now normally one of them have Internet access. We will need to share this access with the image running inside qemu. So that the mipsel oscam can communicate with your VLC and tuni8g front-end. I am sure you understand this. Now we are emulating/visualizing a Router. A router have at least two side or Ports. Normally Called WAN and LAN. Its is tru WAN that the Router Talk to the WEB. It is tru the LAN that the Router share that connection with the PC/phone/printers or Users. But we want to bridge our Internet Access in the Ubuntu PC. To do that we create to new Virtual Network Devices and bridge them that we are going to call “br-lan” & “br-wan”. In the future when we do ifconfig we will see this two new virtual devices. But ONLY when we Manually add them. To add/activate them we will use a script the we will call “host-network-setup.sh”
continue>> we need to allow sudo access to the helper( I have this broken need to fix),
we need to set up scripts to set bridges,call qemu
and enable rootfs/hda, set network and finally call oscam inside emu emulation.
Part1
Not enough time to do all I want. Then the little time I had spent it searching for more info. So to start rolling the ball I will change tactics. Instead of a Full Tested Tutorial, lets start little at a time.
Objective:
First lets start by saying that the main objective is not show you how to do oscam in your PC. For that there hundred of thread in this forum. Instead we will focus in how to prepare our PC to emulate other CPU targets, like Mips, Mipsel, ARM, etc.
Prerequisites:
So I assume that you know, have available and working - source of encrypted ts stream ( Linux receiver like Dreambox or generics, USB/PCI PC SAT device, and a front-end tuner program like TVHeadend.), and you have VLC or similar. Final that you have a PC with Linux. Ubuntu/Debian derivatives for the most part is the standard. I use Lubuntu 18.4 for this test. And in general I strongly suggest you have oscam running on your Linux PC. So you all ready learn how to deal with it and have all the necessary con fig files in your hand ready.
Notes:
All web link will be shown as _http instead of http to prevent hot links.
I will place a # in front of required Linux command. like
It is assume that $HOME points to your user area in Ubuntu. And $USER show user. So test it to verify correctness
On every session/boot you will start your date with
Text Editor - I always used Lubuntu text editor called “leafpad” you can any you like, nano, vi, visudo etc. Just adjust my cmd line every time you see leafpad.
File manager. Lubuntu default file manager is “pcmanfm” but if you are in Ubuntu you may use nautilus. Again adjust as needed. To get access to root file manger I do, #sudo pcmanfm. You may try #sudo nautilus or maybe #sudogtk nautilus.
make. make compilation speed can be do it faster using ccache. Also if you have a PC/CPU with multi core. STOP all other process, close all windows and allow the PC to use ALL core to compile. then you add option “-j#” to make. Where # is the number of cores +1. So if you have an 8 core machine you use 9. or do “#make -j9“ to compile. So you will see that I post “#make -j9“ you need to adjust to your needs.
Requirements for development:
wget - Easy cmd downloads
Compiling Tools
ccache - this improves speed when using repetitive “make” as it should store a cache of compiled files to prevent recompilation.
lets test it with
bridge-utils net-tools - we need this to create network bridge between Ubuntu and qemu running image. Yes to provide network to oscam inside qemu.
$HOME/bin - this directory is not automatically created by Ubuntu. But it is all ready setup to pick up and use if it is in the path available. So lets create it for future use
$HOME/workspace - to prevent having all files around lets have a single workspace area.
continue>>
1) I did try but it did not work. here is the output
root@LEDE:~# ls -la /root/oscam
drwxr-xr-x 6 root root 1024 Aug 19 17:52 .
drwxr-xr-x 5 root root 1024 Aug 19 17:51 ..
drwxrwxrwx 2 root root 1024 Aug 19 07:15 config
-rwxrwxr-x 1 root root 1348312 Aug 18 05:18 oscam
root@LEDE:~# ls -la /root/oscam/oscam
-rwxrwxr-x 1 root root 1348312 Aug 18 05:18 /root/oscam/oscam
root@LEDE:~# /root/oscam/oscam --help
/bin/ash: /root/oscam/oscam: not found
2) If I analyze this issue, both mipsel seems to be build for identical machines MIPS R3000
3) The fact is that your build ask for more dependencies
it seems we have installed
0x00000001 (NEEDED) Shared library: [libpthread.so.0] ==============> libpthread - 1.1.16-1
0x00000001 (NEEDED) Shared library: [libc.so.6] ==============> libc - 1.1.16-1
Missing
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libdl.so.2]
0x00000001 (NEEDED) Shared library: [librt.so.1]
4) Now what I think is the main problem is that our LEDE/Openwrt build is base on different GCC & GLIBC
In LEDE oscam build
#readelf -V oscam
Version needs section '.gnu.version_r' contains 1 entry:
Addr: 0x0000000000402198 Offset: 0x002198 Link: 6 (.dynstr)
000000: Version: 1 File: libgcc_s.so.1 Cnt: 4
0x0010: Name: GCC_3.4 Flags: none Version: 5
0x0020: Name: GLIBC_2.0 Flags: none Version: 4
0x0030: Name: GCC_4.2.0 Flags: none Version: 3
0x0040: Name: GCC_3.0 Flags: none Version: 2
In Dreambox oscam build
Version needs section '.gnu.version_r' contains 2 entries:
Addr: 0x0000000000408cb8 Offset: 0x008cb8 Link: 5 (.dynstr)
000000: Version: 1 File: libpthread.so.0 Cnt: 4
0x0010: Name: GLIBC_2.3.3 Flags: none Version: 8
0x0020: Name: GLIBC_2.2 Flags: none Version: 6
0x0030: Name: GLIBC_2.3.2 Flags: none Version: 4
0x0040: Name: GLIBC_2.0 Flags: none Version: 3
0x0050: Version: 1 File: libc.so.6 Cnt: 3
0x0060: Name: GLIBC_2.3 Flags: none Version: 7
0x0070: Name: GLIBC_2.2 Flags: none Version: 5
0x0080: Name: GLIBC_2.0 Flags: none Version: 2
5) installing missing dependencies
produce errors
root@LEDE:~# opkg install libm
Unknown package 'libm'.
Collected errors:
* opkg_install_cmd: Cannot install package libm.
root@LEDE:~# opkg install libdl
Unknown package 'libdl'.
Collected errors:
* opkg_install_cmd: Cannot install package libdl.
root@LEDE:~# opkg install librt
Installing librt (1.1.16-1) to root...
Downloading http://downloads.lede-project.…_1.1.16-1_mipsel_24kc.ipk
root@LEDE:~# /root/oscam/oscam -h
/bin/ash: /root/oscam/oscam: not found
See best practice is to find toolchain version use to buid our OS, so that most dependecies get satisfyed. And if needed we then install mising ones that match original build versions. But it is a nice experimenting, getting experience on this.
Let me correct my self for what I am going to say 1rst, just to make it clear. oscam.zip posted in post 23 may work for many using LEDE/OpenWrt. Problem is not if mcsshare's oscam buid for Dreambox may work or not in other mipsel routers. I will expect it will work for a few people. But this thread objective is if it can work for
So I do not have a D-Link DIR-860L B1 that do not allow me to test in real thing. Instead I am testing it by emulating a Mipsel CPU under quemu. But running in a a x64 Ubuntu PC. Go it!
The closed firmware image of LEDE/OpenWrt image is base on
Linux version 4.9.58 (buildbot@builds) (gcc version 5.5.0 (LEDE GCC 5.5.0 r5217-098afa1) )
BusyBox v1.27.2 () built-in shell (ash)
(SNAPSHOT, r5218-f90f94d)
Notice there still difference as I could not find exact Malta image match. s3n0 said his is
But I hope to hear from s3n0 in the future that my assumptions are correct. I will post my test result in next post.
To be honest most of the time I watch TV using a Win7 HTTP, yes no Linux for that to simplify for the family. But when I am sick or lazy I do start my Ubuntu Server and used oscam. In this way I can watch TV in any Phone or Tablet. So in general my oscam needs/experience are very limited
I have limited hijack this tread to learn from mcsshare . But please notice we are providing solutions to the objective of this tread request. Please forgime a few more questions.
mcsshare Can you suggest how to pick the minimum config for make. So I guess Newcamd, and the basic emus like Powervu, Tanberg, Biss, etc, I guess just config fie can help me. But if possible please suggest any other important hint. Or even sources for your redesign. I am very thankful to you. Keep the good job. Admins please notice that we keep withing objectives of threas as smallest oscam build can help to run in limited LEDE/Openwr routers.
So tonight I got oscam working under qemu emulation and tested with VLC+tvheadend. I hope to have time tomorrow to post the tutorial. File binary mipsel files for oscam created where posted in looking for oscam binary to LEDE 17 - OpenWRT based FW on router MIPS (D-Link) if interested.
This is like a joke. WE are providing solutions and he may not have time to use it.
Now I did it becouse I wanted to test oscam under qemu emulation. So why not use a target that is in need here. By the way see my new thread at
Oscam CPU target emulation using qemu in Ubuntu.
Now 1rst thing. mcsshare THANK YOU. That is a nice Tutorial. I even follow it and tested just to see diference.
Well the truth is that I am lazy and do not like to patch. So instead of that svn I use
_https://github.com/oscam-emu/oscam-patched
May not have the latest but it is already patched.
QuoteDisplay More1) Toolchain
As I said I downloaded from
_http://archive.openwrt.org/releases/17.01.4/targets/ramips/mt7621/lede-sdk-17.01.4-ramips-mt7621_gcc-5.4.0_musl-1.1.16.Linux-x86_64.tar.xz
mkdir $HOME/lede-sdk/
and unzip to $HOME/lede-sdk/
2)Oscam
Dowloaded from github.com/oscam-emu/oscam-patched
unzip to $HOME/oscam-patched-master
As a Test, I will build to $HOME/oscam-patched-master/build so that it does not install
cd $HOME/oscam-patched-master
mkdir $HOME/oscam-patched-master/build
mkdir $HOME/oscam-patched-master/build/config
3) Lets test x86 compilation to make sure it does compile.
make config
make -j9 OSCAM_BIN=$HOME/oscam-patched-master/build/oscam CONF_DIR=$HOME/oscam-patched-master/build/config/
check your binaries at mkdir $HOME/oscam-patched-master/build
4) Now lets cross compile for mipsel
export STAGING_DIR=$HOME/lede-sdk/staging_dir
export TOOLCHAIN=$STAGING_DIR/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16
make -j9 CROSS=$TOOLCHAIN/bin/mipsel-openwrt-linux- OSCAM_BIN=$HOME/oscam-patched-master/build/oscam OSCAM_BIN=$HOME/oscam-patched-master/build/oscam
check your binaries at mkdir $HOME/oscam-patched-master/build
Note -j9 is used to speed up compilation Number is #core+1, in my case i7 4 REAL core, that work as 8 virtual cores. I know confusing, But in my case 8+1=9.
note "OSCAM_BIN=$HOME/oscam-patched-master/build/oscam" I am not sure why this is need. Some one claim it points to defaults.
In any case we will not need as we will force config latter.
As for directories, the ones provides are for simplification. But you can pace your file any place you like. Just then adjust command lines
As for oscam TARGET files In my case I place all of them in: /root/oscam + /root/oscam/config. This is because the limitations I have under emulation.
I did add a password to the file as I originally intended to upload to a server.
password: oscam-patched
Tested for mipsel in malta. Hope it works for you.
PD: user/pass and IPs are fake or generic. To comply with forum rules of not showing my real ones. But they work as tested.
Oscam CPU target emulation using qemu in Ubuntu.
To admins, I am posting in this area as I could not find any other appropriate area. Who knows then, maybe we should not be talking about this here!. In any case, feel free to move or delete any that you may feel is wrong. But please notice that this tool could help many as people with oscam knowledge could try to emulate to guess problem/solution.
1) Objective, Qemu emulation to test OS/programs in hardware we do not have. Like android boxes or routers with weird CPUs. Or may be any of those generic arduinos
For example take a look in:
looking for oscam binary to LEDE 17 - OpenWRT based FW on router MIPS (D-Link)
In that thread our friend s3n0 ask for help for a target router that maybe no one else has! So how can he get help?
We all could emulate it in qemu, do a little test and share our findings. Well that sound easy, but it may not always work as advertise. But worth trying.
2) I had use qemu in the past but never got the Sharing/Bridge network between Ubuntu and qemu. So I had not tested oscam yet as it requires network. Very soon will do.
3) Just today I got a workable Bridge network between Ubuntu 18.4/qemu. Soon I will be posting a tutorial on how to set it your self, Just let me test oscam to make sure I do not hit a wall at the end.
4) My test setup, I will next try to use Ubuntu running TVHeadEnd connected to a USB/PCSAT, Normally it will request/connect to oscam running in same Linux Ubuntu. And a simple play list is use with VLC to change channels.
To emulate we will disable normal AMD x64 oscam in Ubuntu. We will still use, VLC, TVHeadend, USB/PCSAT. But Instead we will open a qemu emulation of a MIPSEL CPU router running Lede/Openwrt. In the emulation, we will install the appropriate mipsel version of oscam and expect it to answer VLC.by returning decoded TS stream.
This is not new, possibly some one here has do it hundred of time. But I have not seen it posted. So hopefully I can do some test and post my results in the next days. See you soon.
HE HE HE HE, strong words. I do not have to protect him, but he in fact was clear. He said he has little time, and only interested in a clear easy tutorial. Yes the quick solution as many others. In the other hand he did mention he knows how to do oscam in x86 PC. So he has done some work, only having issues with running on a router.
But people do not be afraid of Linux. This was, is and still the future on many free programing solutions.
And yes you are correct, "file location is important" and the many settings in oscam that can change from target to target. So maybe the submitted programs do work, just need a little twick.
Now Me, in the other hand have some issues at home and this is a good way to distract my mind. In the PAST, I had never got a virtual mips/mipsel image in qemu sharing the network with HOST Ubuntu. So his problem remind me to try again. And if I learn to do it right, I can clearly play then with a oscam runing in a Virtual target "ramips-mt7621". There is no problem in sharing latter any results with him or any of you.
Yes I guess I am freely working for him but it is just a distraction an learning experience for me. I did spent a few more hours, but still having issues sharing network in Ubuntu 18.04+qemu 3.0.0+lede-malta-le-vmlinux-initramfs.elf. I have not done any oscam work yet. I guess I will latter open a new thread to prevent continue hijacking this one.
I understood you may not have time to continue. To SAD...
Well I guess I can use your oscam problem as an excuse to put my self up to date.
Wao... LEDE vs Opwnwrt! What a mess in the forum and wikis. Their internal division the re-merge got most of the old stuff lost so Google often just get you to dead links.
Listen I did spent a good few hours last night. Just to find my self relearning a lot of stuff.
I know I should had read this thread for second Time. You did post good info of your self, sorry.
wifi-router with installed LEDE v17 firmware:
LEDE Reboot 17.01.4 r3560-79f57e422d / LuCI lede-17.01 branch (git-17.290.79498-d3f0685)
machine: D-Link DIR-860L B1
And you did ask:
Is there a complete tutorial how can I download and compile new Oscam in LEDE firmware for my MIPS router (ar7xx) ?
PLEASE notice router is not of target "ar7xx" NOPE. Instead it is: "ramips/mt7621/"
LEDE v17 firmware: LEDE Reboot 17.01.4
machine: D-Link DIR-860L B1
system type: MediaTek MT7621 ver:1 eco:3
cpu model: MIPS 1004Kc V2.15
isa: mips1 mips2 mips32r1 mips32r2
I guess the close build I can find is in : _https://downloads.openwrt.org/
firmware
_http://archive.openwrt.org/releases/17.01.4/targets/ramips/mt7621/lede-17.01.4-ramips-mt7621-dir-860l-b1-squashfs-factory.bin
SDK
_http://archive.openwrt.org/releases/17.01.4/targets/ramips/mt7621/lede-sdk-17.01.4-ramips-mt7621_gcc-5.4.0_musl-1.1.16.Linux-x86_64.tar.xz
_http://archive.openwrt.org/releases/17.01.4/targets/ramips/mt7621/lede-imagebuilder-17.01.4-ramips-mt7621.Linux-x86_64.tar.xz
Now I do not have your Router model. Best I can do to play is use qemu or vmware to simulate OS in PC.
So we need "malta" image
Do to changes in LEDE/OpenWrt best we can find are in
_http://archive.openwrt.org/snapshots/trunk/malta/generic/
_https://downloads.openwrt.org/snapshots/targets/malta/le/
In current version there is no malta le ONLY Big Endian!!! Weird. _https://downloads.openwrt.org/releases/18.06.0/targets/malta/be/ but this will not work.
For now I am trying to establish a Virtual Image base on
1) _https://downloads.openwrt.org/snapshots/targets/malta/le/
2) And I will try to see if I can execute a copy of the real dir-860l-b1-squashfs-factory.bin but exported to a ext4 image to be use in Virtual machine, some time openwrt can in fact boot ignoring the missing hardware errors.
Listen I know yous said you do not need help any more. But I will try to test anyway. If I get somewhere, I will post code and tutorial. I am doing it to refresh my self in this LEDE stuff.
I know you mention you will like to use a sub reader. I do not have one. I can only make sure oscam boots and for instance decode powervu or tanberg.
And to others reading I am doing nothing new. I am sure, this stuff have been discussed here a few times. It is just that i have not done it myself.