Вы находитесь на странице: 1из 15

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

Xtreamer Linux Distribution


From Xtreamer
Artice writing discontinued 2010-02-13 I have stopped writing further notes to this wiki page. If you are interested go ahead, some information here may be outdated... best regards, nixda.

Contents
1 Foreword 2 Security issues 3 Firmware issues 4 Directory structure and filesystems 5 mtdblock devices 6 myshortcut 7 Boot process and Kernel 8 Boot procedure 9 Linux 10 Startscrips 11 Services and Deamons 12 RootApp 13 DvdPlayer 14 ushare 15 Syslog 16 Samba 17 Web Services 18 FTP Service 19 Terminal for the internal serial port 20 Others... 21 What is /bin/Inspector doing? 22 What is /usr/local/bin/NAS_Mode_App doing? 23 Write something down about /sbin/udhcpc... 24 hotplug 25 "sleep 300" process 26 Xtreamers busybox 27 Xtreamers applications and configurations 28 Live Radio

Foreword
The following informations base on the firmware 2.2. Xtreamer comes with Realteks RTD1283DD chipset (Referred to as 128x by the official site) and Realtek offers a linux SDK for hardware vendors. It looks like this SDK is the base of the "linux kernel" used on the Xtreamer device.

1 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

Most of the software packages on similar Realtek based products may differ only in a few packages or builds however the latest SDK is still based on a rather old kernel (2.6.12). As this is a linux environment most of the packages are distibuted via the Xtreamer_Source-code releases. Poorly the details of the boot process and the core application and modules (DvdPlayer) are closed source. Some people are working on finding a way to create a boot manager, see the discussion in the xtreamer forum here. The main user application, which supports the GUI, video playback and more is called DvdPlayer. There is a very interesting discussion about DvdPlayer in the forum! Maybe some day we will have the ability to build our own media player OS and research is continuing on this for all Realtek based media players There is a lot of information available on the web discussing units like the Xtreamer. If I am right, then most of them (in this price class) are based on Sigma or Realtek chips. Last year in 2009 Realtek announced an award about their new HD Media chips RTL1073 and RTL1283 which also includes the same enhanced chip at the heart of the Xtreamer, the RTL1283DD (also referred to as RTL128X). Although the announcement from Realtek talks about decoding and encoding for HD videos from the RTL1283 (PVR ability), at this time there are no devices using this chipset making use of this capability. So the Xtreamer is "just a media player". Disappointingly, Realtek has not released detailed specifications about these chips for us. Sigma takes a completely different approach and you will find a lot more information for their chips. If we have a closer look at the Xtreamer and all these other similar boxes we find a very interesting playground for internet services working on this Linux OS. So this theme is the main intention of this article. We would like to give you detailed information about how the Xtreamer core software works - hopefully you will end up with a better understanding of the Linux OS and the proprietary DvdPlayer and how you can configure these, just so that you can have more control over it. Two other very interesting parts you will find in other articles, the software and hardware development. In case of the software development you see that there are many very hard working people out there and they are often forced to find solutions without having access to useful information as Xtreamer themselves are restricted in the details that they can release due to there contractual arrangements with Realtek. This can slow if not stop development and as we continue to work with staff we hope that our work can help convince them to convince Realtek to allow more access to restricted code. The main missing parts may be header files, information about the bootloader and non-GPL code to control video and audio parts of the chip (The DvdPlayer component). You will find short notes and links about this at the chapter with the kernel below. Some of the hesitation shown by Xtreamer can be linked to the fact that their efforts and innovation had previously led to all other Realtek based media player suppliers gaining from their effort without a reciprocal arrangement.

Security issues
WARNING ** WARNING ** WARNING I would hardly recommend not to use the Xtreamer without any firewall connected to the internet! You do not need to "hack" into the xtreamer, it is completely open for root access. Since the Xtreamer - from the view of the software installation - is nothing else than any other linux server, this machine may be _the_ destination for hacker/spammers. As a home media center it may be fine (you never need a password) how the Xtreamer is customized, but if you ever think about plugging it into a "real network" (means: other, untrusted persons are in the same network area) you need to know that your xtreamer is as open as possible. I will show you one demonstration of how this big "security hole" (let us call this a feature)... makes it "more easy" in home use:

2 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

On the xtreamer there is an public write access to a temp path or any other connected storages (usb sticks...) with root rights via samba. The configurations - in parts - looks like this:
[global] ... guest account=root ...

[Xtreamer] path=/tmp/usbmounts/ guest ok=yes writable=yes force create mode=0775 force directory mode=0775

So ok, just put your php code there... mount the cifs share //<the IP>/xtreamer without password as guest and for example place our hello.php there:
<?php system("id"); ?>

Now start your application: http://<the IP>/media/hello.php which prompts:


uid=0(root) gid=0(root)

So, you are all set. :) I would say there is no chance to open the Xtreamer up any more. That does not mean that we cannot hack into it... it is just as open as possible already!

Firmware issues
In this section we do not discuss how to mod, change and patch the Xtreamer. These questions may be answered in other pages. But I think it is good to know some few things about the firmware image file install.img in any case. I got the note to look into the following link HOWTO: Roll Your Own Firmware. There you find some useful information to pack your own, slightly modified firmware. Slightly modified means: Until now we speak about some changes in the packed data, apps, changed configs in the filesystem. But changing partition sizes (see Directory structure and filesystems) could be interesting, too. Changing the images for the audio and video enginge, changing the kernel is not well known or well tested right now. (outdated info: meanwhile we have or firmware with another kernel and changed partitin sizes...) So if you follow the instructions of the link above you see that install.img is a tar file with some other packages and utils - This is slightly different with the Xtreamer which uses a file with a .xtr filetype. In a xml file we can decide which other yaffs packages should be mounted where and how big the partitions should be. The yaffs utilities allowing you to unpack and pack this yaffs images to put your data in there (f.e. adding sshd, changing the password file and so on). Like I said before: More about modding should be found and placed in other documents. Here we describe what we have, how the Xtreamer comes out of the box.

Directory structure and filesystems mtdblock devices


One interesting thing is the mounted volume /dev/mtdblock/2 (yaffs) under /usr/local/etc looks like it will not erased during a firmware flash. It is a 16MB large part of the FLASH on the xtreamers NAND flash. You
3 din 15 30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

will find some informations for example in the wikipedia.org at YAFFS. Besides the /dev/mtdblock/2 there are 4 other mtdblock devices: - /dev/mtdblock/0 seems to be empty (says ls) but df means it is not. Maybe the audio and video fw resists there. - /dev/mtdblock/1 has the same contet as our root filesystem - /dev/mtdblock/2 is the one mounted under /usr/local/etc - /dev/mtdblock/3 seems to be... - /dev/mtdblock/disc seems to be the whole flash So if you mount them by hand you see these sizes:
/dev/mtdblock/0 /dev/mtdblock/1 /dev/mtdblock/3 /dev/mtdblock/disc 24.0M 187.3M 12.8M 256.0M 12.5M 131.1M 1.1M 142.5M 11.5M 56.1M 11.6M 113.5M 52% 70% 9% 56% /tmp/0 /tmp/1 /tmp/3 /tmp/disc

Since we do not know more details about how they are used I would prefer not to touch them (/usr/local/etc seems to be ok). notes: plugged devices will be mounted under /tmp/usbmount/... example... xtreamer with some apps in /opt and a connected usb stick...:
# df -h Filesystem Size Used Available Use% Mounted on /dev/root 187.3M 131.1M 56.1M 70% / /dev/mtdblock/2 32.0M 1.3M 30.7M 4% /usr/local/etc /dev/rd/0 40.0k 40.0k 0 100% /mnt/rd /dev/scsi/host2/bus0/target0/lun0/part1 7.5G 493.0M 7.0G

6% /tmp/usbmounts/sda1

One note: I put some few data in the root filesystem there. Your Xtreamer - out of the box - has more space left on /dev/root (but not that much). So /proc/mounts in our case with a plugged in 8GB sub stick looks like this:

/ # cat /proc/mounts rootfs / rootfs rw 0 0 /dev/root / yaffs2 rw,noatime 0 0 none /dev devfs rw 0 0 none /proc proc rw,nodiratime 0 0 devpts /dev/pts devpts rw 0 0 none /sys sysfs rw 0 0 /dev/mtdblock/2 /usr/local/etc yaffs2 rw,noatime 0 0 none /tmp ramfs rw 0 0 /dev/rd/0 /mnt/rd vfat rw,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1 0 0 /dev/scsi/host2/bus0/target0/lun0/part1 /tmp/usbmounts/sda1 vfat rw,nodiratime,fmask=0000,dmask=0000,codepage=cp

The filesystem hirarchy is not that much FHS compatible (f.e. see the document root of the webservice). You find the whole Xtreamer Linux Directory Tree with a plugged in USB stick (/dev/sda1) on another wiki side.

myshortcut
Location of all favoiurites shortcuts:

4 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

/usr/local/etc/.myshortcut

Boot process and Kernel Boot procedure


...need info... For example see the thread in the Xtreamer forum [1] ...looks like /linuxrc (symlink to busybox) manages futher boot proces... no inittab available... init scripts under /etc/init.d/ smells funny... rcS1 is the most interesting but nearly everythin is commented, things hase gone (script for starting inetd but no inetd there... other notes shows us something about console logins (via serial...)...

Linux
Besides a video and an audio enginge/firmware (needinfo... see firmware images audio_firmware.install.bin video_firmware.install.bin and configuration.xml in the firmware image file) the linux distribution bases on a linux-2.6.12. uname:
Linux myxtreamer 2.6.12.6-VENUS #20 Fri Dec 11 18:04:19 KST 2009 mips unknown

Some additional informations and settings you can find in a introduced directory by realtek:
/sys/realtek_boards/ |-- AES_CCMP |-- board_id |-- bootloader_version |-- bootup_version |-- cpu_id |-- dvrfs_buffer |-- kernel_source_code_info |-- logo_param | |-- image | `-- param |-- misc_operations |-- modelconfig |-- signature |-- system_parameters |-- task_stack |-- tv_encoding_system `-- update

For example if you find/put in /sys/realtek_boards/system_parameters the word SYSLOGDISK the init script rcS1 starts another script for loggin (see the section about init scripts). Another short note: Filesystem support:
/ # cat nodev nodev nodev /proc/filesystems sysfs rootfs bdev

5 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

nodev nodev nodev nodev nodev nodev nodev nodev

nodev nodev nodev nodev nodev nodev

nodev

proc sockfs usbfs pipefs futexfs tmpfs eventpollfs devpts ext3 squashfs dvrfs ramfs vfat devfs nfs cifs jffs2 yaffs yaffs2 rpc_pipefs ufsd

So poorly we have no reiserfs, no xfs... Available kernel modules: (files beneath /lib/modules/...)
./2.6.12.6-VENUS/kernel/crypto/aes.ko ./2.6.12.6-VENUS/kernel/crypto/arc4.ko ./2.6.12.6-VENUS/kernel/crypto/deflate.ko ./2.6.12.6-VENUS/kernel/crypto/michael_mic.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/11n8709/HAL/rtl8192u/r8192_usb.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/11n8709/ieee80211/ieee80211-rsl.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/11n8709/ieee80211/ieee80211_crypt-rsl.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/11n8709/ieee80211/ieee80211_crypt_ccmp-rsl.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/11n8709/ieee80211/ieee80211_crypt_tkip-rsl.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/11n8709/ieee80211/ieee80211_crypt_wep-rsl.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8187/ieee80211/ieee80211-8187.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8187/ieee80211/ieee80211_crypt.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8187/ieee80211/ieee80211_crypt_ccmp.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8187/ieee80211/ieee80211_crypt_tkip.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8187/ieee80211/ieee80211_crypt_wep.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8187/rtl8187/r8187.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8191su/HAL/rtl8192u/r8192s_usb.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8191su/ieee80211/ieee80211-rsi.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8191su/ieee80211/ieee80211_crypt-rsi.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8191su/ieee80211/ieee80211_crypt_ccmp-rsi.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8191su/ieee80211/ieee80211_crypt_tkip-rsi.ko ./2.6.12.6-VENUS/kernel/drivers/net/wireless/realtek/rtl8191su/ieee80211/ieee80211_crypt_wep-rsi.ko ./2.6.12.6-VENUS/kernel/drivers/scsi/libata.ko ./2.6.12.6-VENUS/kernel/drivers/scsi/sata_mars.ko ./2.6.12.6-VENUS/kernel/drivers/usb/host/ehci-hcd.ko ./2.6.12.6-VENUS/kernel/drivers/usb/host/ohci-hcd.ko ./2.6.12.6-VENUS/kernel/drivers/usb/net/rtl8150.ko ./2.6.12.6-VENUS/kernel/fs/isofs/isofs.ko ./2.6.12.6-VENUS/kernel/fs/ptp/ptpfs.ko ./2.6.12.6-VENUS/kernel/fs/udf/udf.ko ./2.6.12.6-VENUS/kernel/fs/ufsd/ufsd.ko ./2.6.12.6-VENUS/kernel/fs/vcd/vcd.ko ./2.6.12.6-VENUS/kernel/net/ipv4/ipcomp.ko ./2.6.12.6-VENUS/kernel/net/ipv4/xfrm4_tunnel.ko ./2.6.12.6-VENUS/modules.alias ./2.6.12.6-VENUS/modules.ccwmap ./2.6.12.6-VENUS/modules.dep ./2.6.12.6-VENUS/modules.ieee1394map ./2.6.12.6-VENUS/modules.inputmap ./2.6.12.6-VENUS/modules.isapnpmap ./2.6.12.6-VENUS/modules.ofmap ./2.6.12.6-VENUS/modules.pcimap ./2.6.12.6-VENUS/modules.seriomap ./2.6.12.6-VENUS/modules.symbols ./2.6.12.6-VENUS/modules.usbmap

You find combiled and working binary packages for this device for example at a optware repository, see Installing ipkg on Xtreamer.

6 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

Startscrips
...needs to be done... f.e. see /etc/init.d/rcS1 and or /usr/local/etc/rcS The /linuxrc (busybox) binary starts /etc/init.d/rcS wich starts /etc/init.d/rcS1...

Services and Deamons


From outer view, means your LAN, network, these tcp ports are listening:
21/tcp 80/tcp 139/tcp 445/tcp 8082/tcp 49152/tcp open open open open open open ftp http netbios-ssn microsoft-ds blackice-alerts unknown

For the internal view I would suggest to first install the Installing ipkg on Xtreamer and then second the utility lsof (right now there seems to be no binary buld of netstat). Besides this tcp services we have deamons for handling the media/GUI called DvdPlayer and ELF binary called RootApp which (? to be continued...). Note: In general every service is running with id 0, with full root privileges!

RootApp
Right now we do not know that much about it. RootApp and DvdPlayer seems to be the two main (and closed source) applications in the Xtreamer. For example see MrWhos comment in the forum on this topic, you will find it here.
...closed source... if you strace it you see... not that much...:

... 727 727 727 ...

write(1, "RootApp AVHDD version...\n", 25) = 25 write(1, "pli initialization...\n", 22) = 22 open("/dev/auth/0", O_RDONLY|O_LARGEFILE) = 4

...grepping... through the sources we find...:

linux-2.6.12_copy/include/asm-mips/signal.h:#define SIGUSR_RTC_ALARM

50

/* The system is woken up by RTC

So it looks like a watchdog... image/service starting tool.

DvdPlayer
This is the media player and it is listening on many ports and holds sessions to foreign media services (streaming...) ...to be continued... Listening UDP ports are: 1900, 8086 and 62397 Listening TCP port is: 8082

7 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

DvdPlayer is started by RootApp, see the process history...:


root root root root root root root root root root root root root root root root root root root root root root root root root root root root root root root 76 78 81 80 86 89 88 97 102 107 105 108 117 123 122 121 126 124 125 127 128 154 158 159 157 172 171 1421 1422 1424 1423 0.0 0.0 0.0 0.9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.1 0.1 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 5.6 400 400 400 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 804752 132 132 132 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 6788 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? S S S S< S SN SN S S S S S S S S S S S S S S S S S S S S S S S S 09:59 09:59 09:59 09:59 09:59 09:59 09:59 09:59 09:59 09:59 09:59 09:59 09:59 10:00 10:00 10:00 10:00 10:00 10:00 10:00 10:00 10:00 10:00 10:00 10:00 10:00 10:00 13:00 13:00 13:00 13:00 0:00 RootApp 0:00 \_ RootApp 0:00 | \_ RootApp 2:16 \_ DvdPlayer 0:00 \_ DvdPlayer 0:00 \_ DvdPlayer 0:00 \_ DvdPlayer 0:00 \_ DvdPlayer 0:00 \_ tty_monitor 0:00 \_ DvdPlayer 0:00 \_ IR_MONITOR 0:00 \_ tts_monitor 0:00 \_ AbsAP_discThrea 0:00 \_ RPC_thread_A 0:00 \_ RPC_thread_A 0:00 \_ RPC_thread_A 0:00 \_ RPC_thread_V 0:00 \_ RPC_thread_V 0:01 \_ RPC_thread_V 0:00 \_ VFD_Updater 0:00 \_ USB 0:00 \_ LoadMedia 0:00 \_ DvdPlayer 0:00 \_ DvdPlayer 0:00 \_ DvdPlayer 0:00 \_ HDMI_MONITOR 0:00 \_ WEBCGI Thread 0:00 \_ FlowManager 0:00 \_ NTSC Closed_Cap 0:00 \_ Teletext 0:00 \_ ATSC Closed_Cap

ushare
GeeXboX uShare, A free UPnP A/V & DLNA Media Server. Listening on UPD 1900 and 1024 only localhost Listening on TCP 1337, 49152 Its configuration file is /sbin/www/ushare.conf to be continued...f.e. see http://ushare.geexbox.org/

Syslog
Syslog is not started by default. You can just start this (build in busybox) by typing in syslogd. Without change something you find it's logs at /tmp/log/messages. Note: /var/log/ is a syslink to /tmp/log/ and beware not to logg to much/long: The logfiles will grow on the Xtreamers internal storage/flash. Todo: Write down notes to log on external device and remote sysloghost. (there is an interesting script in /etc/init.d... seems the Xtreamer people had the same idea...)

Samba
First let me say one really bad thing: The Samba configuration grants local root access to everyone. The good information: So you do not need to care about any security patches... (: Installed is samba 3.0.23c and it resists on /usr/local/daemon/samba/. Its configuration bases/is on /usr/local /daemon/samba/lib/smb.conf. Copies of the samba files resists in /tmp/package/samba/, too. So we need to check out if they modify the config in runtime (I guess).

8 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

/usr/local/daemon/samba/lib/smb.conf:
[global] security=share include=/usr/local/etc/workgroup server string=%h #log file=/usr/local/daemon/samba/var/log.%m #max log size=2000 domain logons=Yes dns proxy=No use sendfile=yes guest account=root #encrypt passwords=yes passdb backend=smbpasswd socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192 read raw=yes write raw=yes oplocks=yes max xmit=65535 dead time=15 getwd cache=yes client NTLMv2 auth=yes veto files=/.cached/.lock/lost+found/System Volume Information/RECYCLER/ get quota command = /usr/local/daemon/samba/sbin/get_quota

[Xtreamer] comment=Xtreamer Storage path=/tmp/usbmounts/ guest ok=yes writable=yes force create mode=0775 force directory mode=0775

You can manually mount a share with for example mount -t cifs //<your ip>/<share> /tmp/somewhere -o username=<MyLogin>,password= <MySecret>,workgroup=<MyGroup> Be awared not to use a sharename with a subdirectory into its name. In such case you will get the error message "...failed: No such device or address". So the first example would not work, the second is fine:
mount -t cifs //192.168.0.1/media/video /tmp/somewhere ... mount -t cifs //192.168.0.1/media /tmp/somewhere ...

Note: Maybe you want to access this manually mounted share via the DvdPlayer. Right now I don't know how I can tell DvdPlayer to open that directory I want to (maybe a hack with the favorites will work). But a (yes, its mad) workaround is: Plug in a usb stick, create the mountpoint there (f.e. /tmp/usbmount /sda1/share) and open the media library for USB...

Web Services
Installed is lighttpd-1.4.19. see below. The web from the Xtreamer is realized with a lot of php scripts. The document-root is /sbin/www. One interesting thing is the symlink media there to /tmp/usbmounts.
lrwxrwxrwx 1 500 500 14 Dec 22 2009 media -> /tmp/usbmounts

Since all plugged in media will be mounted as subdirectories under /tmp/usbmounts/ you have access to this files via http, too. The lighttpd is:
9 din 15 30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

lighttpd-1.4.19 - a light and fast webserver Build-Date: Dec 11 2009 13:26:31 Event Handlers:
+ + + + select (generic) poll (Unix) rt-signals (Linux 2.4+) epoll (Linux 2.6) /dev/poll (Solaris) kqueue (FreeBSD)

Network handler:
+ writev + mmap support

Features:
+ IPv6 support zlib support bzip2 support crypt support SSL Support PCRE support mySQL support LDAP support memcached support FAM support LUA support xml support SQLite support GDBM support

The configfile is /sbin/www/lighttpd.conf:


server.modules = ( "mod_access", "mod_fastcgi", "mod_webdav", "mod_userdir" ) #server.document-root server.document-root = "/tmp/temp" = "/sbin/www"

fastcgi.debug = 1 fastcgi.map-extensions = ( ".php3" => ".php" ) #server.errorlog server.indexfiles = "/tmp/temp/error_log123" = ( "index.php", "index.html", "index.htm", "default.htm" ) = ( "application/pdf", "application/pgp-signature", "application/futuresplash", "application/octet-stream", "application/postscript", "application/x-bittorrent", "application/x-dvi", "application/x-gzip", "application/x-ns-proxy-autoconfig", "application/x-shockwave-flash", "application/x-tgz", "application/x-tgz", "application/x-tar", "application/zip", "audio/mpeg", "audio/x-mpegurl",

mimetype.assign ".pdf" ".sig" ".spl" ".class" ".ps" ".torrent" ".dvi" ".gz" ".pac" ".swf" ".tar.gz" ".tgz" ".tar" ".zip" ".mp3" ".m3u"

=> => => => => => => => => => => => => => => =>

10 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

".wma" ".wax" ".ogg" ".wav" ".gif" ".jpg" ".jpeg" ".png" ".xbm" ".xpm" ".xwd" ".css" ".html" ".htm" ".js" ".asc" ".c" ".conf" ".text" ".txt" ".dtd" ".xml" ".mpeg" ".mpg" ".mov" ".qt" ".avi" ".asf" ".asx" ".wmv" )

=> => => => => => => => => => => => => => => => => => => => => => => => => => => => => =>

"audio/x-ms-wma", "audio/x-ms-wax", "audio/x-wav", "audio/x-wav", "image/gif", "image/jpeg", "image/jpeg", "image/png", "image/x-xbitmap", "image/x-xpixmap", "image/x-xwindowdump", "text/css", "text/html", "text/html", "text/javascript", "text/plain", "text/plain", "text/plain", "text/plain", "text/plain", "text/xml", "text/xml", "video/mpeg", "video/mpeg", "video/quicktime", "video/quicktime", "video/x-msvideo", "video/x-ms-asf", "video/x-ms-asf", "video/x-ms-wmv"

mimetypes.use-xattr = "enable" # file upload #server.upload-dirs = ("/tmp/hdd/volumes/") server.max-request-size = 1048576 #post_max_size = 1048576 #upload_max_filesize = 1048576 server.network-backend="writev" server.max-keep-alive-requests = 0 server.max-keep-alive-idle = 100

server.tag #accesslog.filename url.access-deny server.port #compress.cache-dir fastcgi.server

= "WMI Http Server" = "/tmp/temp/access_log" = ( "~", ".inc" ) = 80 = "/tmp/temp/cache/" = ( ".php" => ( "localhost" => ( "socket" => "/tmp/php.socket", "bin-path" => "/sbin/www/php", "max-procs" => 1, "broken-scriptfilename" => "enable", "allow-x-send-file" => "enable", "bin-environment" => ( "PHP_FCGI_CHILDREN" => "1" ), ) ) )

FTP Service
Xtreamer comes with the tiny Stupid-FTPd. The homepage of this procet is hosted at sourceforge Stupid-FTPd.

11 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

My configuration contained the cleartext password I have entered into the webformular (while accessing and typing in during the setup at the first time) is in there, too. And for sure, yes this file is readable for everyone. So if you ever forgot your password just have a look here. The big letter "A" at the end of the line with the userinformations means that this account is granted for every operations of the ftpd. The "good thing" is that we have no access to other files than under /tmp/usbmounts (in general). /usr/local/etc/stupid-ftpd.conf:
mode=daemon changeroottype=real port=21 maxusers=10 user=MyUsername login-timeout=120 timeout=240

MyCleartextPassword

/tmp/usbmounts 10

Terminal for the internal serial port


If you open the case you can see connectors for a serial port. The binary console_login is binded to the device /dev/tts0 and will (not) welcome you. Looks like it is for debug/maintenance...: strings from console_login:
/lib/ld.so.1 $%0@ '% @ $%0@ $%0@ $%0@ /dev/tts/0 Why you want to enter this system console You are inValid USER /sbin/reboot ================= RTC QC start ========== /tmp/usbmounts/sda1/rtc_qc ================= RTC QC End ========== _init _fini __uClibc_main __deregister_frame_info __register_frame_info open myfd signal ioctl memcpy miscount org_password getpassword stderr fprintf system sleep login_message write strlen read rtc_qc strcmp _DYNAMIC_LINKING __RLD_MAP libc.so.0 _gp_disp _DYNAMIC _GLOBAL_OFFSET_TABLE_ _ftext __etext _fdata _edata

12 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

__bss_start _fbss ___sbss_start ___sbss_end Enter MvixPVR Enter Login ID : rtc_qc >3 @

Others... What is /bin/Inspector doing?


Looks like it has something to do with the "NAS" mode (or perhaps it would be better say that it is running as the opposite of the nas-mode)? It creates the pipe /tmp/app. I never played with the nas mode.

What is /usr/local/bin/NAS_Mode_App doing?


Yes... something with nas... but it is interesting that it communicates with the video/audio "engine", too. Note:- I understand that on entering NAS mode it issues a 'stopall' to shut down rootapp and DvdPlayer. .o(I never played with the nas mode).

Write something down about /sbin/udhcpc...


...todo...

hotplug
We should write down some notes how (where) hotplug mounts the devices and how you can take control of it.

"sleep 300" process


This sleep is caused by a looping shell script for updating DDNS datas. Right now I do not know who is starting the scrip itself. You find the script here /sbin/www/ddns.sh (not that interesting). So now you now why you see your box connecting to 210.109.97.109 port tcp/8000 every 5 minutes.

Xtreamers busybox
The Xtreamer comes with a nice busybox installation. Poorly we have no telnetd into it but utils like wget are there:
BusyBox v1.1.3 (2009.12.11-09:06+0000) multi-call binary Usage: busybox [function] [arguments]... or: [function] [arguments]...

13 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

BusyBox is a multi-call binary that combines many common Unix utilities into a single executable. Most people will create a link to busybox for each function they wish to use and BusyBox will act like whatever it was invoked as!

Currently defined functions: [, [[, addgroup, adduser, ash, basename, busybox, cat, chmod, chown, chroot, clear, cp, cut, date, dd, d deluser, devfsd, df, dirname, dmesg, du, e2fsck, echo, egrep, eject, expr, false, fdisk, fgrep, find, fr fsck.ext2, fsck.ext3, ftpget, ftpput, getopt, grep, gzip, halt, head, hexdump, hostname, hwclock, id, if init, insmod, ipcrm, ipcs, kill, killall, klogd, linuxrc, ln, logger, login, losetup, ls, lsmod, lzmacat mke2fs, mkfs.ext2, mkfs.ext3, mkfs.extk, mknod, mkswap, mktemp, modprobe, more, mount, mv, nice, passwd, ping, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, reboot, rm, rmdir, rmmod, route, sed, sh, sort, stty, swapoff, swapon, sync, syslogd, tail, tar, tee, test, time, top, touch, tr, true, tune2fs, u udhcpd, umount, uname, unlzma, unzip, uptime, usleep, vi, wc, wget, which, yes

Next generation Xtreamer devices (like Prodigy) comes with the following busybox installation:
BusyBox v1.18.4 (2012-02-17 16:24:38 CST) multi-call binary. Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko and others. Licensed under GPLv2. See source distribution for full notice. Usage: busybox [function] [arguments]... or: busybox --list[-full] or: function [arguments]... BusyBox is a multi-call binary that combines many common Unix utilities into a single executable. Most people will create a link to busybox for each function they wish to use and BusyBox will act like whatever it was invoked as. Currently defined functions: [, [[, acpid, add-shell, addgroup, adduser, ash, awk, base64, basename, beep, blkid, blockdev, bootchartd, cat, chmod, chown, chroot, cksum, clear, cp, cut, date, dd, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsdomainname, du, dumpleases, echo, egrep, eject, expr, fbsplash, fdisk, fgconsole, fgrep, find, flock, free, fsck, fsync, ftpd, ftpget, getopt, grep, gunzip, gzip, halt, head, hexdump, hostname, hwclock, id, ifconfig, ifplugd, inetd, init, insmod, ionice, iostat, kill, killall, killall5, ln, login, losetup, ls, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makemime, mdev, mkdir, mkdosfs, mke2fs, mkfs.ext2, mkfs.vfat, mknod, mkswap, mktemp, modinfo, modprobe, more, mount, mpstat, mv, nbd-client, netstat, nice, ntpd, passwd, pgrep, pidof, ping, pivot_root, pmap, popmaildir, poweroff, powertop, ps, pwd, rdev, readahead, readlink, reboot, reformime, remove-shell, renice, rev, rm, rmdir, rmmod, route, rtcwake, scriptreplay, sed, setfont, setlogcons, sh, sha256sum, sha512sum, showkey, sleep, smemcap, swapoff, swapon, sync, sysctl, tail, tar, telnetd, test, tftp, timeout, top, touch, tr, tunctl, udhcpc, udhcpd, umount, uname, unlzma, unlzop, unxz, unzip, usleep, vi, volname, wall, which, xz, xzcat, zcat

Customer busybox build working on all xtreamer devices:


~ # busybox (http://xtreamer-web-sdk.googlecode.com/svn/trunk/binaries/busybox) BusyBox v1.18.5 (2012-01-15 18:11:10 MSK) multi-call binary. Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko and others. Licensed under GPLv2. See source distribution for full notice. Usage: busybox [function] [arguments]... or: busybox --list[-full] or: function [arguments]... BusyBox is a multi-call binary that combines many common Unix utilities into a single executable. Most people will create a link to busybox for each function they wish to use and BusyBox will act like whatever it was invoked as. Currently defined functions: [, [[, acpid, add-shell, addgroup, adduser, adjtimex, ar, arp, arping, ash, awk, basename, bash, blkid, blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown,

14 din 15

30.10.2012 15:12

Xtreamer Linux Distribution - Xtreamer

http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux...

chpasswd, chpst, chroot, chrt, cmp, cp, cpio, cryptpw, cttyhack, cut, date, dc, dd, delgroup, deluser, depmod, devfsd, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dpkg, dpkg-deb, du, dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat, fdisk, fgrep, find, findfs, flock, fold, free, freeramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid, hostname, httpd, hwclock, id, ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod, install, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kill, killall, killall5, klogd, length, less, linux32, linux64, ln, logger, login, logname, logread, losetup, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, man, md5sum, mesg, microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od, passwd, patch, pgrep, pidof, ping, pipe_progress, pivot_root, pkill, pmap, poweroff, powertop, printenv, printf, ps, pscan, pwd, raidautorun, rdate, rdev, readlink, readprofile, realpath, reboot, remove-shell, renice, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, seq, setarch, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat, strings, stty, sum, sv, svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr, traceroute, true, tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, uncompress, unexpand, uniq, unlzma, unlzop, unxz, unzip, uptime, usleep, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog, wc, wget, which, whoami, xargs, xz, xzcat, yes, zcat, zcip

very dirty busybox replacement (please test first!!! without replacement )


cd /tmp wget http://xtreamer-web-sdk.googlecode.com/svn/trunk/xmp/busybox chmod 755 ./busybox cp /bin/busybox /bin/busybox.bak ./busybox cp -a ./busybox /bin/busybox for i in $( busybox --list-full ); do /bin/busybox rm -f /$i && /bin/busybox ln -s /bin/busybox /$i ; done wget http://xtreamer-web-sdk.googlecode.com/svn/trunk/xmp/programs/base/inetd.conf -O /etc/inetd.conf chown 500:500 /etc/inetd.conf if [ -f /etc/init.d/S45telnet ]; then rm /etc/init.d/S45telnet fi

Xtreamers applications and configurations


...have a deeper look into /usr/local/... a lot of interesting things you find there!

Live Radio
Under /usr/local/Live_Radio/ we found the structure of the radios streaming list. Just edit/put there your plsx files, see tne thread The Official .PLSX Radio Stations List in the Xtreamers forum. ...this whole section needs to becontinued! Specially all the things under /usr/local are interesting... (last but not least: we should have a short look into the existing php scripts... they may answer some more questions) Retrieved from "http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux_Distribution" This page was last modified on 12 March 2012, at 18:19.

15 din 15

30.10.2012 15:12