My notes on the Mvix Ultio. These are not necessarily intended to be taken as a guide, just more of a way for me to document as I play with the device. Use at your own risk.

My environment

I'm using ubuntu 9.04 server for everything in this guide. It should work under centos, fedora or anything else as well.

you will need to install binutils.

sudo apt-get install binutils-multiarch

To convert the RPMs extracted form the zips, you will need alien or rpm2cpio

sudo alien mipsel-sdelinux-v6.03.01-1.i386.rpm
sudo alien toolchain_mipsel-6.03-6.i586.rpm

Dev environment

Haven't successfully setup their toolchain yet. Will work on that next.

Packages

The Ultio appears to only look for the 4 packages listed on Mvix's site.
These are archived as "ar" files which are pretty straight forward. These are delivered with the .ipk extension. Let me state this now, I have never played with any .ipk files, so some of my language may be incorrect.

Extracting Packages

to extract a package with dpkg-deb:
dpkg-deb -x 
or ar (suggested method)
ar x 

Modifying Mvix supplied packages

ar archives contain three files:

  • data.tar.gz - a tar/gzipped archive containg the structure
  • control.tar.gz - a tar/gzipped archive containg package info
  • debian-binary - a version description perhaps?
  • To modify a package (using samba_3.0.23c_mipsel.ipk) as a test.

    ar x samba_3.0.23c_mipsel.ipk
    Then extract the data.tar.gz:
    tar -zxvf data.tar.gz
    
    edit the ./tmp/script/samba file:
        vim ./tmp/script/samba
    
    and under the start() { section add something like this (a slight modification of rozz's method):
        mkdir -p /tmp/hdd/root/etc
        cp /etc/inetd.conf /tmp/hdd/root/etc
        sed -i 's/#telnet/telnet/' /tmp/hdd/root/etc/inetd.conf
        killall -9 inetd
        sleep 5
        inetd /tmp/hdd/root/etc/inetd.conf
        
    So your completed section should look like:
    
        start() {
            KIND="SMB"
            echo -n $"Starting $KIND services: "
    
    # start mod
        mkdir -p /tmp/hdd/root/etc
        cp /etc/inetd.conf /tmp/hdd/root/etc
        sed -i 's/#telnet/telnet/' /tmp/hdd/root/etc/inetd.conf
        killall -9 inetd
        sleep 5
        inetd /tmp/hdd/root/etc/inetd.conf
    # end mod
    
            nice -n 10 /tmp/package/samba/sbin/smbd -D
    

    Now recreate the samba package:

    rm data.tar.gz
    tar zcvf data.tar.gz ./tmp
    ar -q samba_3.0.23c_mipsel.ipk ./control.tar.gz ./data.tar.gz ./debian-binary
    

    Copy the modified over to a usb key, install the package through the gui, then start the service. You should now be able to telnet into the machine.

    You could also mount the device under a linux box and modify an already installed samba startup script. That is located here: /tmp/hdd/root/script/samba

    Next step is to create a ssh package once Mvix gets back to me.

    Dropbear SSH

    Ok I compiled a static version of Dropbear.
    You can download it Here.
    You will also need Dropbearkey

    How to compile it

    Install your toolchain. Setup your environment:
    PATH=/usr/local/mipsel/bin:/usr/local/mipsel/sbin:/usr/local/mipsel/lib:$PATH
    export PATH
    
    
    Configure the package:
    ./configure --disable-lastlog --host=mipsel-linux --disable-zlib --disable-wtmp
    
    Build the package:
    make PROGRAMS="dropbear dropbearkey dbclient scp" MULTI=1 STATIC=1 SCPPROGRESS=1
    
    Copy the binary over on a key, then copy it from /tmp/usbmounts/sdb1 to /tmp/hdd/root/mybin.
    Dropbear wants things symbollically linked. so just ln -s the binary to the appropriate apps:
    ln -s dropbearmulti dropbear
    ln -s dropbearmulti dbclient
    ln -s dropbearmulti scp
    
    generate the keys:
    ./dropbearkey -t rsa -f dropbear_rsa_host_key
    ./dropbearkey -t dss -f dropbear_dss_host_key
    
    to start it:
    /tmp/hdd/root/mybin/dropbear -d /tmp/hdd/root/mybin/dropbear_dss_host_key  -r /tmp/hdd/root/mybin/dropbear_rsa_host_key  -F 
    
    adding this to inetd.conf should work:
    ssh    stream  tcp     nowait  root    /usr/sbin/dropbear dropbear -i -E
    
    however, it appears to be failing on me.
    
    

    What I did

  • remounted the root partition
  • created /etc/dropbear and copied my generated keys there
  • copied the dropbead binaries in /usr/sbin/
  • remounted the root partition as readonly
  • Changed the root password
  • Started up dropbear with this command: /usr/sbin/dropbear -F -E
  • Now I'm trying to figure out why scp won't work.

    Remounting the root drive

    You can edit /etc or anything else on the root flash partition (which is read onely), by remounting:
    mount -o remount,rw
    
    I added a password to the root account and set the home directory to /tmp/hdd/root/root. This way I can use ssh to get into the machine with private keys.
    If you try changing the password with the system mounted as read only, passwd will core dump. You can also edit /etc/inetd.conf to start

    OS Info

    A fairly up to date kernel:
    /tmp/hdd/root # uname -a
    Linux Venus 2.6.12.6-VENUS #1 Wed Apr 22 10:33:31 CST 2009 mips unknown
    /tmp/hdd/root # 
    

    Filesystems and partitions

    I put a 250GB SATA-II Drive in the machine, ran the internal format command (from the gui), then mounted the device via USB on my desktop. It created three partitions:

  • Linux - Ext3. This is mounted as /tmp/hdd/root.
  • Linux - Swap
  • And a third file system. It looks like Paragon UFSD. This mounts under ntfs on my Mac. I'm not sure on this, perhaps someone can correct me.
  • Disk /dev/sdb: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00023f44
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               2       30341   243706050    7  HPFS/NTFS
    /dev/sdb2           30342       30361      160650   82  Linux swap / Solaris
    /dev/sdb3           30362       30381      160650   83  Linux
    
    I inserted this:
    mounts > /tmp/hdd/root/mybin/mounts.txt
    

    in my samba script (before I had telnet access. This is what it came back with:

    /dev/root on / type yaffs2 (ro,noatime)
    none on /dev type devfs (rw)
    none on /proc type proc (rw,nodiratime)
    devpts on /dev/pts type devpts (rw)
    none on /sys type sysfs (rw)
    /dev/mtdblock/2 on /usr/local/etc type yaffs2 (rw,noatime)
    none on /tmp type ramfs (rw)
    /dev/rd/0 on /mnt/rd type vfat (rw,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)
    /dev/scsi/host0/bus0/target0/lun0/part1 on /tmp/usbmounts/sda1 type ufsd (rw,nodiratime)
    /dev/scsi/host0/bus0/target0/lun0/part3 on /tmp/hdd/root type ext3 (rw)
    

    So we have two yaffs2 file systems. One mounted read-only (the root), and one mounted read-write(/usr/local/etc)

    Taking a look at /etc, we can see many of the files are symbolically linked over to /usr/local/etc (hence the rw):

    / # ls -la /etc/
    drwxr-xr-x    1 root     root         2048 Aug 12  2009 .
    drwxr-xr-x    1 root     root         2048 Aug 17  2009 ..
    -rw-r--r--    1 root     root          341 Apr 22  2009 fstab
    lrwxrwxrwx    1 root     root           22 Aug 17  2009 group -> ../usr/local/etc/group
    -rw-r--r--    1 root     root            6 Apr 22  2009 hostname
    -rw-r--r--    1 root     root           20 Apr 22  2009 hosts
    -rw-r--r--    1 root     root          385 Apr 22  2009 httpd.conf
    -rw-r--r--    1 root     root          461 Aug 12  2009 inetd.conf
    drwxr-xr-x    1 root     root         2048 Apr 22  2009 init.d
    lrwxrwxrwx    1 root     root           28 Aug 17  2009 ld.so.cache -> ../usr/local/etc/ld.so.cache
    lrwxrwxrwx    1 root     root           27 Aug 17  2009 ld.so.conf -> ../usr/local/etc/ld.so.conf
    lrwxrwxrwx    1 root     root           14 Aug 17  2009 mtab -> ../proc/mounts
    lrwxrwxrwx    1 root     root           23 Aug 17  2009 passwd -> ../usr/local/etc/passwd
    lrwxrwxrwx    1 root     root           24 Aug 17  2009 passwd- -> ../usr/local/etc/passwd-
    lrwxrwxrwx    1 root     root           24 Aug 17  2009 profile -> ../usr/local/etc/profile
    drwxr-xr-x    1 root     root         2048 Apr 22  2009 reexec_init
    lrwxrwxrwx    1 root     root           26 Aug 17  2009 resolv.conf -> /usr/local/etc/resolv.conf
    -rw-r--r--    1 root     root        20373 Apr 22  2009 services
    -rw-r--r--    1 root     root            7 Apr 22  2009 system_svn_version
    -rwxr-xr-x    1 root     root         1893 Apr 22  2009 udhcpc.script
    / #
    

    This is where part of the problem lies with re-enabling telnet. You will need to use Rozz's method, which involves adding some commands to the samba startup script.

    The rest of the filesystem structure is pretty straight forward:

    
    

    Memory

    Fairly straight forward. Not a ton to deal with.
    / # free
                  total         used         free       shared      buffers
      Mem:       121864       119904         1960            0         2876
     Swap:       160672         3152       157520
    Total:       282536       123056       159480
    / #
    

    Translation of the realtek doc

    the file is under GPL/Linux/system/doc/在Bootloader底下動態更改Linux設定.doc
    the name translates to: Bootloader under the dynamic changes in the Linux settings.doc
    Bootloader under the dynamic changes in the Linux settings
    
    In the bootloader under way through the set system_parameters parameters, you can dynamically change the Linux part of the set.
    To 12V/15V GPIO set as an example. Each board control 12V/5V switch GPIO pin necessarily the same. Therefore, under bootloader, you can use the following ways to set variables to tell Linux the first 34pin through the GPIO to control the 12V/5V switch:
    Realtek> set system_parameters_2 34
    
    Parameter setting mode:
    bootloader under the variable system_parameters_1, system_parameters_2, system_parameters_3, and system_parameters_4 settings if there is, Linux will be the value of the continuation of these four parameters together, as a setting.
    Example:
    In the bootloader set up under these two values:
    bootloader> set system_parameters_2 "USBDISK_PART4 12V5V_GPIO = 34"
    bootloader> set system_parameters_4 "JM_SATA"
    Linux will have a value of the string are follow-up, so read the settings are as follows:
    USBDISK_PART4 12V5V_GPIO = 34 JM_SATA
    
    In the Linux way inside to read system_parameters parameters:
    kernel level:
    system_parameters values will be stored in the platform_info-> system_parameters in. In the kernel, the function parse_token can to help and strive to achieve the desired token and its value. Please refer to linux-2.6.12/lib/parser.c.
    user level:
    system_parameters values will be stored in the / sys / realtek_boards / system_parameters file
    
    Variable list:
    Parameter Name Function / Notes
    12V5V_GPIO = 34, hion All setting control 12V/5V The GPIO pin number. In this case refers to the use of GPIO 34 to control the 12V/5V. Back hion parameter indicates that when GPIO34 output for a time, 12V/5V power is turned on; If this parameter is specified when the hioff when GPIO34 output for a time, 12V/5V power off.
    JM_SATA
    USBDISK_PART4 PVR Module PVR Module has the first four of the partition formatted as vfat 
    

    Mail me