Hi people,
I 've just received my Movie Cube R700 a couple of days ago and since then it has played about 2 minutes of movie.
Why? Because I 'm more interested in getting this thing to run any Linux application I want. I 'm not a programmer, let alone an embedded developer, but I 'm quite good at getting things to run as long as the tools exist.
Goals:
-Modify the partitioning so it has 1 big volume for data in a native Linux filesystem => share via samba
-Install alternative distribution, preferably Gentoo because of its flexible nature of keeping up-to-date
-Attach new USB hardware like USB ethernet adapter
-Run the appliance as a firewall with iptables => replace my old-laptop-as-a-firewall
-Run an rsync daemon to keep my home computers backed up.
-Figure out how to tweak the graphical environment
-Run a vpn daemon
What I've accomplished so far:
-First thing to do was to repartition the box, because the default partitioning sucks. Luckily this was quite easy.
What you have to do is to flash it again with the latest firmware. This completely wipes out the disk and repartitions everything. But included with this firmware is the file part.txt, which is some sort of answer file when it comes down to partitioning your disk at install time. Here 's a dump of the file with my comments and how it goes:
udf:res # res must stand for "rest of the disk", used for recording
ext3:512 # size in mb of / , where your firmware actually gets installed to
ext3(2):150 # size of partition where DvdPlayer and RootApp reside
swap:256 # 256mb swap
udf2:12288 # partition for time-shift recording
fat32:30% # volume1, a fat partition shared via samba (read/write)
ntfs:30% # volume2, an ntfs partition shared via samba (read-only)
volume1:MULTIMEDIA1
volume2:MULTIMEDIA2
option:install
I changed the values like this in my case
udf:res
ext3:10480
ext3(2):150
swap:256
udf2:12288
fat32:49% # This and the next make 97% together. On my 750Gb disk this makes that about 10G is available for recording
ntfs:48% # This and the previous one I delete afterwards. Haven 't tried, but you could try and put this to 0% and former to 97%
volume1:MULTIMEDIA1
volume2:MULTIMEDIA2
option:install
So my root will now be 10Gb, enough to put complete distros on it. I unmount and delete the volumes fat32 and ntfs afterwards to make one big ext3 volume by hand.
Next, I flashed my movie cube
Went back in with telnet and saw that it had worked
First thing I did was remount root in rw, kill the smbd, then umount drives, then fdisk:
'mount -o remount,rw /'
'killall smbd'
'umount /usr/local/etc/dvdplayer/hdd/volumes/HDD1'
'umount /usr/local/etc/dvdplayer/hdd/volumes/HDD2'
'vi /etc/init.d/rcS1'
comment and add these lines:
# if [ -e ${HD_DEV_FILE}7 ]; then
# mkdir -p /usr/local/etc/hdd/volumes/HDD1
# mount -t vfat -o shortname=winnt -o umask=000 -o utf8 ${HD_DEV_F
# if [ $? -ne 0 ]; then
# mount -t ntfs -o ro -o umask=000 -o nls=utf8 ${HD_DEV_FI
# if [ $? -ne 0 ]; then
# mount -t ext3 ${HD_DEV_FILE}7 /usr/local/etc/hdd
# fi
# fi
# else
# rm -rf /usr/local/etc/hdd/volumes/HDD1
# fi
# New mount command, by Harakiri: just mount it, kernel will detect ext3
mount /dev/hda7 /usr/local/etc/hdd/volumes/HDD1
vi /usr/lib/smb.conf
comment out sharing of the second volume
name the other share to whatever you like
'fdisk /dev/hda'
In fdisk, delete partition 8 and 7, remember the original offset of partition 7
New partition 7, original offset an use rest of the disk
Write partition and reboot
Telnet to machine again,
'mount -o remount,rw /'
'mkfs.ext3 /dev/hda7'
This will take a while.
Rebooting again will now make a 633Gb free space share on a 750Gb Movie Cube, read/write from the network. Now we 're talking.
Oh yes, you need to chmod 777 the complete volume to make it read/write for everyone.
'chmod -R 777 /usr/local/etc/dvdplayer/hdd/volumes/HDD1'
You can of course tweak access rights here with several users and groups in the smb.conf etc. This is only the quick and dirty method.
What I was more interested in now was to get a Gentoo running on it.
The kernel for this machine is closed source, so no chance of modifying the original busybox running on it too much.
It 's really sad Mele doesn 't release any sources (yet) or at least the kernel, which for sure is patched to support the graphical hardware in it. A quick look at /proc/kallsyms showed me a lot of words like VENUS, which is not generic kernel stuff. Also the kernel is already quite old: 2.6.12 must date from about 2004. This would prove to be a burden in the following events.
So, getting Gentoo on it in a chrooted environment.
I found a Gentoo port for Little Endian MIPS machines from the old Cobalt Qubes, a little application server from a few years ago.
You can find the website here:
http://dev.gentoo.org/~redhatter/mips/
Download the following tarball with a normal PC and save it to your network share:
http://dev.gentoo.org/~redhatter/mips/cobalt/stages/stage3-mipsel4-2008.0.tar.bz2
You will need to unpack with another Linux machine or have a utility like 7-zip on your Windows PC because the busybox doesn't provide bzip2. Tar is provided though, so you can just deflate the archive with 7-zip and afterwards untar on the machine itself. Beware, this will become a 1.4Gb tarball!
Once bunzipped, enter in a telnet session
'mkdir /gentoo'
'cd /gentoo'
'tar xf /usr/local/etc/dvdplayer/hdd/volumes/HDD1/stage3-mipsel4-2008.0.tar'
Once untarred, you can chroot to it, but first mount your /proc to it
'mount -t proc proc /gentoo/proc'
'chroot /gentoo bash'
Now you 're in a nice Gentoo environment.
Sadly, I immediately ran into the following problems: basic commands like mv don't work: they exit with the error "Unknown error 4294967207"
One way to work around this more or less is to go out of chroot, rename these commands and symbolic link new commands to the Gentoo built-in busybox (yes, there one in /gentoo/bin)
'exit'
'cd /gentoo/bin'
'mv mv mv.old'
'ln -s busybox mv'
You will find several basic commands that won 't work, you can all rename them and link new ones to busybox.
The problem with this workaround is that busybox commands lack features from the full blown originals.
This would be a problem with 'emerge', the tool that downloads, compiles, installs and updates your packages
Emerge uses several tools, of which tar and find are one of them. Unfortunately, it uses flags not supported by busybox, so emerge exits.
What is possible then?
Well, I was able to get a sshd running ('/etc/init.d/sshd start', but first relink "rm" to busybox)
Compiling with "make" also works nicely. I 'm even able to recompile tar but it would still give me the same unknown error
That 's all I tried running from it but I think most supplied tools and servers will work. This stage3 tarball is in fact a completely equipped Gentoo
Later I also tried mixing in Debian for mipsel packages, with varying success: some tools work better, but some others still exit with the same error.
I found a post (http://archive.netbsd.se/?ml=debian-mips&a=2008-01&t=6203096) where they state that it 's kernel related: newer kernels as of 2.6.20 don 't have this problem anymore. It 's probably a combination of a newer gcc compiler against a very old kernel like the one in the Movie Cube.
This is how far I 've gotten. Any suggestions are always welcome. I will post more as soon as I made any more progress.
Harakiri