Aug 04 2009

Installing STLinux2.3 in Ubuntu 9.04

The installation of STLinux in a Debian-based distribution doesn’t seem to be straight-forward because STLinux uses RPM as package manager whereas Ubuntu uses Debian’s DPKG. These package managers are completely different and incompatible, but you can have both installed on the same host and therefore STLinux installed on Ubuntu.

For installing SLinux2.3 you’ll have to install the RPM package manager.
DPKG is already installed in your host and you’ll use it for installing the RPM package manager.

Install the RPM package manager and the python-rpm package because the installation procedure uses Python.

$ apt-get install rpm python-rpm

Populate the RPM database since it’s empty using the package stlinux23-host-STLinux_deps-0.1-4.i386.rpm

$ rpm -ivh stlinux23-host-STLinux_deps-0.1-4.i386.rpm

The STLinux installation procedure uses Python 2.5, but Ubuntu 9.04 uses Python2.6 that introduces the new reserved keyword ‘with’. Unfortunately, the install script uses ‘with’ as variable, not as reserved keyword, so it gives the following error when executing it:

  File "/opt/STM/STLinux-2.3/host/usr/lib/python2.3/site-packages/yum/__init__.py", line 399 
    self.repos.populateSack(with='filelists')
                               ^   
SyntaxError: invalid syntax

In order to avoid this problem, you can temporary set the symbolic link /usr/bin/python to /usr/bin/python2.5:

$ cd /usr/bin
$ mv /usr/bin/python /usr/bin/python_orig
$ ln -s python2.5 python

Older Ubuntu versions: Older versions of Ubuntu that use python2.5 won’t have this problem, but could have a problem with bash that is required by the installation procedure, too. If this is the case, you can install it and create a symbolic link in an analog way.

Now everything is ready for installing STLinux2.3.
Assuming that you already downloaded and mounted an ISO image of STLinux, change to the directory where the image is mounted and run the install script:

$ ./install all-sh4-glibc
or
$ ./install all-sh4_uclibc

After installation you probably want to upgrade to the latest packages available from ST. You can run stmyum update several times until it responds that there are no more packages marked for upgrade.

$ /opt/STM/STLinux-2.3/host/bin/stmyum update

At this point you can set the /usr/bin/python symbolic link to it’s original value

$ cd /usr/bin
$ rm /usr/bin/python
$ mv python_old python

As a final and optional step, you can add the cross-toolchain to your path and add it to your .bashrc script:

$ export PATH=$PATH:/opt/STM/STLinux-2.3/devkit/sh4/bin

References:
Installation and Getting Started
Installing STLinux on Ubuntu

15 Comments

  • By kikiri, 5 August 2009 @ 17:39

    ubuntu 9.04 64bit????

  • By paguilar, 5 August 2009 @ 23:10

    Hi,
    I tested that procedure in a 32 bit T7100 Intel Core2 Duo.
    I don’t think it will work with a 64 bit processor.
    Eg. The cross-toolchain was generated by ST for a 32 bit processor.

    Regards.

  • By kikiri, 6 August 2009 @ 21:12

    ubuntu9.04 on STLinux ok.

    enigma2 error:

    buffer.cpp: In member function ‘int eIOBuffer::peek(void*, int) const’:
    buffer.cpp:64: error: ‘memcpy’ was not declared in this scope
    buffer.cpp: In member function ‘void eIOBuffer::write(const void*, int)’:
    buffer.cpp:110: error: ‘memcpy’ was not declared in this scope
    make[2]: *** [buffer.o] Error 1
    make[2]: Leaving directory `/usr/local/src/enigma2/lib/base’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/usr/local/src/enigma2/lib’
    make: *** [all-recursive] Error 1

  • By Luca72, 2 March 2010 @ 21:00

    I get this error on kubuntu 9.10:
    rpm -ivh stlinux23-host-STLinux_deps-0.1-4.i386.rpm
    rpm: please use alien to install rpm packages on Debian, if you are really sure use –force-debian switch. See README.Debian for more details.

  • By paguilar, 4 March 2010 @ 22:45

    Hi,
    ‘alien’ allows you install rpms in .deb-based machines because it convert the rpm to deb. You need to install it first and then keep going with the rpm as if you were in an .rpm-based machine.
    Regards.

  • By domino, 22 June 2010 @ 06:31

    Hi,

    Have installed the stlinux23-host-STLinux_deps-0.1-4.i386.rpm. on my Debian Lenny 32 bits machine.

    Still get the problem: “Error: Missing Dependency: libuuid.so.1 is needed by package stlinux23-host-mtd-utils”.

    Any ideas?

    regards.

  • By paguilar, 20 July 2010 @ 23:00

    Hi,
    This would mean that you need to install stlinux23-host-mtd-utils before stlinux23-host-STLinux_deps-0.1-4.i386.rpm. However, I’ve had this problem before, are you using the install script or are you doing it manually?

    Btw, sorry for the late reply, I’ve been quite busy lately, but hopefully I’ll write more posts during the following weeks.

  • By rexct, 28 February 2011 @ 11:55

    “$ ln -s python2.6 python” must be “$ ln -s python2.5 python”.

  • By paguilar, 28 February 2011 @ 12:52

    @rexct: Thanks! Fixed.

  • By Chrisgg, 2 November 2011 @ 18:35

    I’m trying to setup a QBoxHD compiling environment on a PC running Ubuntu. I followed all your steps, but I get this:

    “soluna@ubuntu:/mnt/st$ sudo ./install all-sh4_uclibc

    ************************************************************************
    * Looks like you are trying to install on a Ubuntu system *
    * *
    * This is not officially supported, but can be made to work *
    * *
    * Look at the following links and carry out the steps listed there *
    * and then rerun this script with the –debian flag *
    * *
    http://stlinux.com/install/ubuntu *
    * *
    ************************************************************************
    soluna@ubuntu:/mnt/st$ sudo ./install all-sh4_uclibc –debian
    *************************************************
    * Installing STLINUX 2.4
    *************************************************

    Trying to find out if you are inside STMicroelectronics
    Please wait for up to 10 seconds…..
    ping: unknown host linux.bri.st.com
    You are not inside ST, using http://www.stlinux.com

    ***************************************************************
    * There is a distribution available in the local directory *
    * This will be used for install. You can issue an *
    * stmyum update command to update your system later on *
    ***************************************************************

    Looking for a GPG key file
    Found a GPG key file in local directory
    rpmkeys: –force-debian: unknown option
    Failed to import GPG key into RPM , giving up”

    I followed all the steps here as well, but it made no difference: http://stlinux.com/install/ubuntu
    The iso I downloaded is STLinux 2.4 and I have Ubuntu 11.10 32 bit.

  • By paguilar, 6 November 2011 @ 16:37

    Hi,
    The QBoxHD was developed with STLinux2.3, but I don’t think that using STLinux2.4 would be a problem since the only thing that it’s used from STLinux is the toolchain. The problem you have regards the install script inside STLinux2.4. I think you can solve it if you comment int he install script the code that checks if the signing keys are installed (lines [07-312) and manually you execute:

    cd /mnt/st
    rpm --import STLinux/gpg_key

    and then run install again.
    I hope this helps.
    Regards.

  • By fodil, 22 January 2012 @ 22:18

    Hi,

    I tested every thing to install stlinux on virtual box of Oracle and I did’nt succeed….!
    Local ant net install with the old install scrpt and the new one on Fedora11 and Fedora 16, Opensuse, Ubuntu 9.04 and 11.04 and many other things…..for almost 2 weeks!

    Please can you make us a virtual box image of any distribution with stlinux ready to use on it!!!!!

    Many thanks.

  • By paguilar, 23 January 2012 @ 01:37

    Hi,
    I’ve been quite busy lately, so I cannot guarantee that I can do it fast, but I’ll try to have some time for it.
    Regards

  • By fodil, 23 January 2012 @ 09:26

    Hi,

    Thank you very much for your reply,

    For two times, I tried to install stlinux by network on fedora11 during all the night and in the morning…I have this:
    (656/659): stlinux23-sh4-ypbind-1.20.4-10.sh4.rpm | 52 kB 00:01
    (657/659): stlinux23-sh4-zlib-1.2.3-8.sh4.rpm | 72 kB 00:01
    (658/659): stlinux23-sh4-zlib-bin-1.2.3-8.sh4.rpm | 96 kB 00:02
    (659/659): stlinux23-sh4-zlib-dev-1.2.3-8.sh4.rpm | 92 kB 00:03

    Error Downloading Packages:
    stlinux23-host-u-boot-source-sh4-1.3.1_stm23_0057-57.noarch: failure: host/stlinux23-host-u-boot-source-sh4-1.3.1_stm23_0057-57.noarch.rpm from STLinux_Distribution_Updates: (256, ‘No more mirrors to try.’)
    stlinux23-host-stworkbench-4.0.1.3-30.noarch: failure: stworkbench/stlinux23-host-stworkbench-4.0.1.3-30.noarch.rpm from STLinux_Distribution_Updates: (256, ‘No more mirrors to try.’)

    error: package stlinux23-install-all-sh4-glibc is not installed

    I’m not happy at all!

    Thanks.

  • By fodil, 23 January 2012 @ 09:33

    Hi,

    by the way, Is there a way to change the install script to do only the install not the downloading….because I have almost all the packages downloaded in tmp directory!

    Thanks.

Other Links to this Post

RSS feed for comments on this post. TrackBack URI

Leave a comment

WordPress Themes