Export to GitHub

popcorn-bld - Readme.wiki


Introduction

This project provides build scripts, software and scripts for use on a Popcorn Hour C-200 media player.

The player runs a crippled version of Linux for MIPS. Crippled means that Syabas Technology who made the product released their changes to the Linux kernel, but made the binary release which is flashed on the device lack PTY support in the kernel. This means that the C-200 is the most likely the last product from Syabas Technology that I am going to buy.

What this is not

This project does not provide an initial shell for the Popcorn Hour C-200. This is already provided by http://www.lundman.net/wiki/index.php/NetworkedMediaTank.

It provides modules which add PTY support to the kernel used by the C-200 and a ssh server. Please see for further information.

Firmware Version

Tested with C-200 firmware 02-03-100821-21-POP-408-000.

Not tested with firmware 02-03-101006-21-POP-408-000.

Howto

SVN checkout

```

mkdir -p ~/remote-svn/ && \

svn checkout http://popcorn-bld.googlecode.com/svn/trunk/ popcorn-bld-read-only

```

Compiler

```

cd ~/remote-svn/tool && tar -xjf *.tar.bz2

``` Add ~/remote-svn/popcorn-bld/tool/mips-4.3/bin to your PATH. Notice that the cross compiler is for x86 host.

Provided Software

Kernel

The kernel version 2.6.22.19 with different patches provided by Syabas Technology. Additionally a configuration and changes to a few files are provided so that built kernel modules can work with the binary kernel flashed in a Popcorn hour C-200 box.

PTY Modules

Two modules which add the missing PTY support to the kernel are provided in impl/kernel-pty. Load them using insmod before attempting to start a ssh server.

Also, it should be possible to mount the devpts pseudo filesystem now.

mount devpts /dev/pts -t devpts

Libraries

| Name | Description | |:---------|:----------------| | boost | C++ library. Used by libtorrent and btg. | |e2fsprogs | Ext2 Filesystem Utilities. | |expat | XML parser. | |glib | GLib provides the core application building blocks for libraries and applications written in C. | |gnutls | TLS implementation. | |gpgme | GnuPG Made Easy - makes access to GnuPG easier for applications. | |libassuan | IPC library for GnuPG related projects. | |libcurl | Reliable and portable library which provides you with an easy interface to a range of common Internet protocols. | |libgcrypt | General purpose cryptographic library based on the code from GnuPG. | |libgpg-error | Libgpg-error is a small library with error codes and descriptions shared by most GnuPG applications. | |libtorrent | Libtorrent is a feature complete C++ bittorrent implementation focusing on efficiency and scalability. | |LVM2 | LVM2 refers to a new userspace toolset that provide logical volume management facilities on linux.| |ncurses | Ncurses is software for controlling writing to the console screen under Unix, Linux and other operating systems. | |openssl | A toolkit implementing SSL v2/v3 and TLS protocols with full-strength cryptography world-wide. | |popt | Popt is a C library for parsing command line parameters. | |readline | The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. | |zlib | A massively spiffy yet delicately unobtrusive compression library. |

Applications

| Name | Description | |:---------|:----------------| | btg | BTG is a bittorrent server/client application. | | cryptosetup | LUKS Cryptosetup. | | dropbear | SSH server. | | fuse | Filesystem in Userspace.| | gdb | Debugger. | | openssh | SSH client only. | | screen | Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. | | sshfs-fuse | Mount using ssh protocol.| | util-linux-ng | Linux utilities - provides losetup which can mount encrypted volumes. |

Scripts

The following scripts are meant as examples only.

| Name | Description | |:---------|:----------------| |bashrc |Bash configuration.| |create_crypto.sh|Create encrypted filesystem.| |insmod_crypto.sh|Load required module.| |mount_crypto.sh|Mount encrypted filesystem.| |mount_sshfs.sh|Mount directories from another pc using sshfs.| |setup_dropbear.sh|Start dropbear ssh server.| |setup_ssh_agent.sh|Replace current shell with one which uses an ssh agent.| |start_dropbear.sh|Start dropbear ssh server.| |umount_sshfs.sh|Unmount sshfs mount points.|

Build all software and kernel modules

```

cd ~/remote-svn/popcorn-bld/impl && make install

``` The above command will attempt to build all configured applications, libraries and kernel modules and install them into ~/remote-svn/popcorn-bld/impl/popcorn-inst.

Install built software into C-200

Copy using ftp ~/remote-svn/popcorn-bld/impl/popcorn-inst to /opt/sybhttpd/localhost.drives/SATA_DISK on the popcorn box. This location is the mount point of the 3.5" SATA disk the popcorn box can use for storage.

Configure software and scripts

Login using a shell. Start bash, source /opt/sybhttpd/localhost.drives/SATA_DISK/popcorn-inst/script/bin/bashrc. This sets up your PATH and LD_LIBRARY_PATH.

After running the above script it will be possible to run the build applications such as the ssh daemon, sshfs or btg.

Adding new software

You need to add an application named Foo which depends on libBar.

LibBar

  • Create directory ~/remote-svn/popcorn-bld/impl/libs/libbar
  • Add a makefile named ~/remote-svn/popcorn-bld/impl/libs/libbar/Makefile which builds the library. Copy expat/Makefile and change NAME and VERSION. Copy libBar-x.y.z.tar.gz to ~/remote-svn/popcorn-bld/impl/libs/libbar/source. Change the configure target of the makefile to reflect the options needed to configure the library.

Foo

  • Create directory ~/remote-svn/popcorn-bld/impl/applications/foo.
  • Add a makefile named ~/remote-svn/popcorn-bld/impl/applications/foo/Makefile which builds the application. Copy opkg/Makefile and change NAME, VERSION and append libs/libfoo to DEPENDS. Copy foo-x.y.z.tar.gz to ~/remote-svn/popcorn-bld/impl/applications/foo/source. Change the configure target of the makefile to reflect the options needed to configure the application.

Finally

  • Change ~/remote-svn/popcorn-bld/impl/libs/Makefile. Append libbar to LIBS.
  • Change ~/remote-svn/popcorn-bld/impl/applications/Makefile. Append foo to APPLICATIONS.