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