busybox replacement

15
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. Xtreamer Linux Distribution - Xtreamer http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_Linux... 1 din 15 30.10.2012 15:12

Upload: alina-otell

Post on 28-Oct-2015

172 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Busybox Replacement

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, someinformation here may be outdated... best regards, nixda.

Contents

1 Foreword2 Security issues3 Firmware issues4 Directory structure and filesystems5 mtdblock devices6 myshortcut7 Boot process and Kernel8 Boot procedure9 Linux10 Startscrips11 Services and Deamons12 RootApp13 DvdPlayer14 ushare15 Syslog16 Samba17 Web Services18 FTP Service19 Terminal for the internal serial port20 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 hotplug25 "sleep 300" process26 Xtreamers busybox27 Xtreamers applications and configurations28 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 Realtekoffers a linux SDK for hardware vendors. It looks like this SDK is the base of the "linux kernel" used on theXtreamer device.

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

1 din 15 30.10.2012 15:12

Page 2: Busybox Replacement

Most of the software packages on similar Realtek based products may differ only in a few packages or buildshowever the latest SDK is still based on a rather old kernel (2.6.12). As this is a linux environment most ofthe packages are distibuted via the Xtreamer_Source-code releases. Poorly the details of the boot processand the core application and modules (DvdPlayer) are closed source. Some people are working on finding away 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 avery interesting discussion about DvdPlayer in the forum! Maybe some day we will have the ability to buildour 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 mostof them (in this price class) are based on Sigma or Realtek chips. Last year in 2009 Realtek announced anaward about their new HD Media chips RTL1073 and RTL1283 which also includes the same enhanced chipat 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 theRTL1283 (PVR ability), at this time there are no devices using this chipset making use of this capability. Sothe Xtreamer is "just a media player". Disappointingly, Realtek has not released detailed specifications aboutthese chips for us. Sigma takes a completely different approach and you will find a lot more information fortheir chips.

If we have a closer look at the Xtreamer and all these other similar boxes we find a very interestingplayground 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 youwill end up with a better understanding of the Linux OS and the proprietary DvdPlayer and how you canconfigure 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. Incase of the software development you see that there are many very hard working people out there and theyare often forced to find solutions without having access to useful information as Xtreamer themselves arerestricted in the details that they can release due to there contractual arrangements with Realtek. This canslow if not stop development and as we continue to work with staff we hope that our work can helpconvince them to convince Realtek to allow more access to restricted code. The main missing parts may beheader files, information about the bootloader and non-GPL code to control video and audio parts of thechip (The DvdPlayer component). You will find short notes and links about this at the chapter with thekernel below.

Some of the hesitation shown by Xtreamer can be linked to the fact that their efforts and innovation hadpreviously led to all other Realtek based media player suppliers gaining from their effort without a reciprocalarrangement.

Security issues

WARNING ** WARNING ** WARNING

I would hardly recommend not to use the Xtreamer without any firewall connected to the internet! You donot need to "hack" into the xtreamer, it is completely open for root access. Since the Xtreamer - from theview 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 ifyou ever think about plugging it into a "real network" (means: other, untrusted persons are in the samenetwork area) you need to know that your xtreamer is as open as possible. I will show you onedemonstration of how this big "security hole" (let us call this a feature)... makes it "more easy" in home use:

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

2 din 15 30.10.2012 15:12

Page 3: Busybox Replacement

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 guestand for example place our hello.php there:

<?phpsystem("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 meanthat 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 beanswered in other pages. But I think it is good to know some few things about the firmware image fileinstall.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 modifiedmeans: 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 theimages 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 otherpackages and utils - This is slightly different with the Xtreamer which uses a file with a .xtr filetype. In a xmlfile we can decide which other yaffs packages should be mounted where and how big the partitions shouldbe. The yaffs utilities allowing you to unpack and pack this yaffs images to put your data in there (f.e. addingsshd, changing the password file and so on). Like I said before: More about modding should be found andplaced 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 noterased during a firmware flash. It is a 16MB large part of the FLASH on the xtreamers NAND flash. You

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

3 din 15 30.10.2012 15:12

Page 4: Busybox Replacement

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 resiststhere.

- /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 24.0M 12.5M 11.5M 52% /tmp/0/dev/mtdblock/1 187.3M 131.1M 56.1M 70% /tmp/1/dev/mtdblock/3 12.8M 1.1M 11.6M 9% /tmp/3/dev/mtdblock/disc 256.0M 142.5M 113.5M 56% /tmp/disc

Since we do not know more details about how they are used I would prefer not to touch them (/usr/local/etcseems to be ok).

notes: plugged devices will be mounted under /tmp/usbmount/... example... xtreamer with some apps in /optand a connected usb stick...:

# df -hFilesystem 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 spaceleft 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 0none /dev devfs rw 0 0none /proc proc rw,nodiratime 0 0devpts /dev/pts devpts rw 0 0none /sys sysfs rw 0 0/dev/mtdblock/2 /usr/local/etc yaffs2 rw,noatime 0 0none /tmp ramfs rw 0 0/dev/rd/0 /mnt/rd vfat rw,nodiratime,fmask=0022,dma sk=0022,codepage=cp437,iocharset=iso8859-1 0 0/dev/scsi/host2/bus0/target0/lun0/part1 /tmp/usbmou nts/sda1 vfat rw,nodiratime,fmask= 0000,dmask=0000,codepage=cp437,iocha

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

myshortcut

Location of all favoiurites shortcuts:

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

4 din 15 30.10.2012 15:12

Page 5: Busybox Replacement

/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 scriptsunder /etc/init.d/ smells funny... rcS1 is the most interesting but nearly everythin is commented, things hasegone (script for starting inetd but no inetd there... other notes shows us something about console logins (viaserial...)...

Linux

Besides a video and an audio enginge/firmware (needinfo... see firmware images audio_firmware.install.binvideo_firmware.install.bin and configuration.xml in the firmware image file) the linux distribution bases on alinux-2.6.12.

uname:

Linux myxtreamer 2.6.12.6-VENUS #20 Fri Dec 11 18:0 4: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 scriptrcS1 starts another script for loggin (see the section about init scripts).

Another short note:

Filesystem support:

/ # cat /proc/filesystems nodev sysfsnodev rootfsnodev bdev

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

5 din 15 30.10.2012 15:12

Page 6: Busybox Replacement

nodev procnodev sockfsnodev usbfsnodev pipefsnodev futexfsnodev tmpfsnodev eventpollfsnodev devpts

ext3squashfs

nodev dvrfsnodev ramfs

vfatnodev devfsnodev nfsnodev cifsnodev jffs2

yaffsyaffs2

nodev rpc_pipefsufsd

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/realte k/11n8709/HAL/rtl8192u/r8192_usb.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/11n8709/ieee80211/ieee80211-rsl.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/11n8709/ieee80211/ieee80211_crypt-rsl.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/11n8709/ieee80211/ieee80211_crypt_ccmp-rsl.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/11n8709/ieee80211/ieee80211_crypt_tkip-rsl.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/11n8709/ieee80211/ieee80211_crypt_wep-rsl.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8187/ieee80211/ieee80211-8187.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8187/ieee80211/ieee80211_crypt.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8187/ieee80211/ieee80211_crypt_ccmp.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8187/ieee80211/ieee80211_crypt_tkip.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8187/ieee80211/ieee80211_crypt_wep.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8187/rtl8187/r8187.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8191su/HAL/rtl8192u/r8192s_usb.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8191su/ieee80211/ieee80211-rsi.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8191su/ieee80211/ieee80211_crypt-rsi.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8191su/ieee80211/ieee80211_crypt_ccmp-rsi.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/rtl8191su/ieee80211/ieee80211_crypt_tkip-rsi.ko

./2.6.12.6-VENUS/kernel/drivers/net/wireless/realte k/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.k o

./2.6.12.6-VENUS/kernel/drivers/usb/host/ohci-hcd.k o

./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, seeInstalling ipkg on Xtreamer.

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

6 din 15 30.10.2012 15:12

Page 7: Busybox Replacement

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 open ftp80/tcp open http139/tcp open netbios-ssn445/tcp open microsoft-ds8082/tcp open blackice-alerts49152/tcp open unknown

For the internal view I would suggest to first install the Installing ipkg on Xtreamer and then second theutility 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 binarycalled 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 (andclosed 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 write(1, "RootApp AVHDD version...\n", 25) = 25 727 write(1, "pli initialization...\n", 22) = 22 727 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 i s woken up by RTC alarm wh

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

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

7 din 15 30.10.2012 15:12

Page 8: Busybox Replacement

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

root 76 0.0 0.1 400 132 ? S 09:59 0:00 RootApproot 78 0.0 0.1 400 132 ? S 09:59 0:00 \_ RootApproot 81 0.0 0.1 400 132 ? S 09:59 0:00 | \_ RootApproot 80 0.9 5.6 804752 6788 ? S< 09:59 2:16 \_ DvdPlayerroot 86 0.0 5.6 804752 6788 ? S 09:59 0:00 \_ DvdPlayerroot 89 0.0 5.6 804752 6788 ? SN 09:59 0:00 \_ DvdPlayerroot 88 0.0 5.6 804752 6788 ? SN 09:59 0:00 \_ DvdPlayerroot 97 0.0 5.6 804752 6788 ? S 09:59 0:00 \_ DvdPlayerroot 102 0.0 5.6 804752 6788 ? S 09:59 0:00 \_ tty_monitorroot 107 0.0 5.6 804752 6788 ? S 09:59 0:00 \_ DvdPlayerroot 105 0.0 5.6 804752 6788 ? S 09:59 0:00 \_ IR_MONITORroot 108 0.0 5.6 804752 6788 ? S 09:59 0:00 \_ tts_monitorroot 117 0.0 5.6 804752 6788 ? S 09:59 0:00 \_ AbsAP_discThrearoot 123 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ RPC_thread_Aroot 122 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ RPC_thread_Aroot 121 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ RPC_thread_Aroot 126 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ RPC_thread_Vroot 124 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ RPC_thread_Vroot 125 0.0 5.6 804752 6788 ? S 10:00 0:01 \_ RPC_thread_Vroot 127 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ VFD_Updaterroot 128 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ USBroot 154 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ LoadMediaroot 158 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ DvdPlayerroot 159 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ DvdPlayerroot 157 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ DvdPlayerroot 172 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ HDMI_MONITORroot 171 0.0 5.6 804752 6788 ? S 10:00 0:00 \_ WEBCGI Threadroot 1421 0.0 5.6 804752 6788 ? S 13:00 0:00 \_ FlowManagerroot 1422 0.0 5.6 804752 6788 ? S 13:00 0:00 \_ NTSC Closed_Caproot 1424 0.0 5.6 804752 6788 ? S 13:00 0:00 \_ Teletextroot 1423 0.0 5.6 804752 6788 ? S 13:00 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. Withoutchange something you find it's logs at /tmp/log/messages. Note: /var/log/ is a syslink to /tmp/log/ and bewarenot 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. Thegood 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 tocheck out if they modify the config in runtime (I guess).

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

8 din 15 30.10.2012 15:12

Page 9: Busybox Replacement

/usr/local/daemon/samba/lib/smb.conf:

[global]security=shareinclude=/usr/local/etc/workgroupserver string=%h#log file=/usr/local/daemon/samba/var/log.%m#max log size=2000domain logons=Yesdns proxy=Nouse sendfile=yesguest account=root#encrypt passwords=yespassdb backend=smbpasswdsocket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDB UF=8192 SO_RCVBUF=8192read raw=yeswrite raw=yesoplocks=yesmax xmit=65535dead time=15getwd cache=yesclient NTLMv2 auth=yesveto files=/.cached/.lock/lost+found/System Volume Information/RECYCLER/get quota command = /usr/local/daemon/samba/sbin/ge t_quota

[Xtreamer]comment=Xtreamer Storagepath=/tmp/usbmounts/guest ok=yeswritable=yesforce create mode=0775force 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 errormessage "...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/somewh ere ...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 knowhow 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. Oneinteresting 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 thisfiles via http, too.

The lighttpd is:

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

9 din 15 30.10.2012 15:12

Page 10: Busybox Replacement

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 = "/tmp/temp" server.document-root = "/sbin/www" fastcgi.debug = 1 fastcgi.map-extensions = ( ".php3" => ".php" ) #server.errorlog = "/tmp/temp/error_log1 23" server.indexfiles = ( "index.php", "index. html", "index.htm", "defaul t.htm" ) mimetype.assign = ( ".pdf" => "application/pdf", ".sig" => "application/pgp-signature ", ".spl" => "application/futuresplash" , ".class" => "application/octet-stream" , ".ps" => "application/postscript", ".torrent" => "application/x-bittorrent" , ".dvi" => "application/x-dvi", ".gz" => "application/x-gzip", ".pac" => "application/x-ns-proxy-au toconfig", ".swf" => "application/x-shockwave-f lash", ".tar.gz" => "application/x-tgz", ".tgz" => "application/x-tgz", ".tar" => "application/x-tar", ".zip" => "application/zip", ".mp3" => "audio/mpeg", ".m3u" => "audio/x-mpegurl",

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

10 din 15 30.10.2012 15:12

Page 11: Busybox Replacement

".wma" => "audio/x-ms-wma", ".wax" => "audio/x-ms-wax", ".ogg" => "audio/x-wav", ".wav" => "audio/x-wav", ".gif" => "image/gif", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".png" => "image/png", ".xbm" => "image/x-xbitmap", ".xpm" => "image/x-xpixmap", ".xwd" => "image/x-xwindowdump", ".css" => "text/css", ".html" => "text/html", ".htm" => "text/html", ".js" => "text/javascript", ".asc" => "text/plain", ".c" => "text/plain", ".conf" => "text/plain", ".text" => "text/plain", ".txt" => "text/plain", ".dtd" => "text/xml", ".xml" => "text/xml", ".mpeg" => "video/mpeg", ".mpg" => "video/mpeg", ".mov" => "video/quicktime", ".qt" => "video/quicktime", ".avi" => "video/x-msvideo", ".asf" => "video/x-ms-asf", ".asx" => "video/x-ms-asf", ".wmv" => "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 = "WMI Http Server"

#accesslog.filename = "/tmp/temp/access_lo g"

url.access-deny = ( "~", ".inc" ) server.port = 80 #compress.cache-dir = "/tmp/temp/cache/" fastcgi.server = ( ".php" => ( "localhost" => ( "socket" => "/tmp /php.socket", "bin-path" => "/s bin/www/php", "max-procs" => 1, "broken-scriptfil ename" => "enable", "allow-x-send-fil e" => "enable", "bin-environment" => ( "PHP_FCG I_CHILDREN" => "1" ), ) ) )

FTP Service

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

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

11 din 15 30.10.2012 15:12

Page 12: Busybox Replacement

My configuration contained the cleartext password I have entered into the webformular (while accessing andtyping 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 theuserinformations means that this account is granted for every operations of the ftpd. The "good thing" is thatwe have no access to other files than under /tmp/usbmounts (in general).

/usr/local/etc/stupid-ftpd.conf:

mode=daemonchangeroottype=realport=21maxusers=10user=MyUsername MyCleartextPassword /tmp/us bmounts 10 Alogin-timeout=120timeout=240

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 thedevice /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/0Why you want to enter this system consoleYou 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_infoopenmyfdsignalioctlmemcpymiscountorg_passwordgetpasswordstderrfprintfsystemsleeplogin_messagewritestrlenreadrtc_qcstrcmp_DYNAMIC_LINKING__RLD_MAPlibc.so.0_gp_disp_DYNAMIC_GLOBAL_OFFSET_TABLE__ftext__etext_fdata_edata

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

12 din 15 30.10.2012 15:12

Page 13: Busybox Replacement

__bss_start_fbss___sbss_start___sbss_endEnter MvixPVREnter 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 runningas 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 ofit.

"sleep 300" process

This sleep is caused by a looping shell script for updating DDNS datas. Right now I do not know who isstarting 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 wgetare there:

BusyBox v1.1.3 (2009.12.11-09:06+0000) multi-call binary

Usage: busybox [function] [arguments]... or: [function] [arguments]...

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

13 din 15 30.10.2012 15:12

Page 14: Busybox Replacement

BusyBox is a multi-call binary that combines many c ommon Unixutilities into a single executable. Most people wi ll create alink to busybox for each function they wish to use and BusyBoxwill act like whatever it was invoked as!

Currently defined functions:[, [[, addgroup, adduser, ash, basename, busybox, c at, chmod, chown, chroot, clear, c p, cut, date, dd, delgroup,deluser, devfsd, df, dirname, dmesg, du, e2fsck, ec ho, egrep, eject, expr, false, fdi sk, fgrep, find, free, fsck,fsck.ext2, fsck.ext3, ftpget, ftpput, getopt, grep, gzip, halt, head, hexdump, hostna me, hwclock, id, ifconfig,init, insmod, ipcrm, ipcs, kill, killall, klogd, li nuxrc, ln, logger, login, losetup, ls, lsmod, lzmacat, mkdir,mke2fs, mkfs.ext2, mkfs.ext3, mkfs.extk, mknod, mks wap, mktemp, modprobe, more, mount , mv, nice, passwd, pidof,ping, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, reboot, rm, rmdir, rmmo d, route, sed, sh, sleep,sort, stty, swapoff, swapon, sync, syslogd, tail, t ar, tee, test, time, top, touch, t r, true, tune2fs, udhcpc,udhcpd, umount, uname, unlzma, unzip, uptime, uslee p, 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-cal l binary.Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenkoand 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 pe ople 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, chmo d, chown, chroot, cksum, clear, cp, cut, date, dd, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsdomainna me, du, dumpleases, echo, egrep, eject, expr, fbsplash, fdisk, fgconso le, fgrep, find, flock, free, fsck, fsync, ftpd, ftpget, getopt, gre p, gunzip, gzip, halt, head, hexdump, hostname, hwclock, id, ifconf ig, ifplugd, inetd, init, insmod, ionice, iostat, kill, killall, killa ll5, 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, rm dir, rmmod, route, rtcwake, scriptreplay, sed, setfont, setlogcons, sh, sha256sum, sha512sum, showkey, sleep, smemcap, swapoff, swapon, sy nc, 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-cal l binary.Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenkoand 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 pe ople 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, b ootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown,

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

14 din 15 30.10.2012 15:12

Page 15: Busybox Replacement

chpasswd, chpst, chroot, chrt, cmp, cp, cpio , cryptpw, cttyhack, cut, date, dc, dd, delgroup, deluser, depmod, dev fsd, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, d pkg, dpkg-deb, du, dumpleases, echo, ed, egrep, eject, env, env dir, envuidgid, ether-wake, expr, fakeidentd, false, fbset, fbsplash, fd flush, fdformat, fdisk, fgrep, find, findfs, flock, fold, free, free ramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid, hos tname, 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, k logd, length, less, linux32, linux64, ln, logger, login, logname , logread, losetup, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lz op, lzopcat, makedevs, man, md5sum, mesg, microcom, mkdir, mkdosfs, mke2 fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mksw ap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, m t, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od, passwd, patch, pgrep, pidof, ping, pipe_progress, pivot_roo t, pkill, pmap, poweroff, powertop, printenv, printf, ps, pscan, pwd, raidautorun, rdate, rdev, readlink, readprofile, realpath, reboot, rem ove-shell, renice, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, s ed, seq, setarch, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum , slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon, s tat, strings, stty, sum, sv, svlogd, swapoff, swapon, switch_root, sy nc, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, tes t, tftp, tftpd, time, timeout, top, touch, tr, traceroute, true, t ty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, uncom press, unexpand, uniq, unlzma, unlzop, unxz, unzip, uptime, usleep, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog, wc, w get, which, whoami, xargs, xz, xzcat, yes, zcat, zcip

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

cd /tmpwget http://xtreamer-web-sdk.googlecode.com/svn/tru nk/xmp/busyboxchmod 755 ./busyboxcp /bin/busybox /bin/busybox.bak./busybox cp -a ./busybox /bin/busyboxfor i in $( busybox --list-full ); do /bin/busybox rm -f /$i && /bin/busybox ln -s /b in/busybox /$i ; done

wget http://xtreamer-web-sdk.googlecode.com/svn/tru nk/xmp/programs/base/inetd.conf -O /etc/inetd.confchown 500:500 /etc/inetd.conf

if [ -f /etc/init.d/S45telnet ]; then rm /etc/init.d/S45telnetfi

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 plsxfiles, 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 morequestions)

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.

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

15 din 15 30.10.2012 15:12