偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.
全部博文(1748)
分类: LINUX
2009-06-25 17:16:56
Trouble running maemo's scratchbox under Ubuntu Hardy?
I’ve been having trouble running scratchbox after upgrading to hardy. I’ve finally found some workarounds for the issues that creep up.
echo 0 | sudo tee /proc/sys/vm/vdso_enabled
echo 4096 | sudo tee /proc/sys/vm/mmap_min_addr
vm.vdso_enabled = 0
vm.mmap_min_addr = 4096
sudo sysctl -p
Contents[] |
This is a step-by-step guide about how to install on Ubuntu 8.04.
The installation requires the following packages:
So, type:
sudo apt-get install autoconf autogen automake autotools-dev binutils fakeroot gcc-3.4 git-core g++ libsdl1.2-dev make sbrsh subversion
We're going to install a custom version of Qemu, so remove any existing version of Qemu by typing:
sudo apt-get --purge remove qemu
$ rm -fr $HOME/sbox2 $HOME/.scratchbox2
$ mkdir -p $HOME/sbox2 $HOME/sbox2/bin $HOME/sbox2/bin/qemu $HOME/sbox2/rootfs/armle $HOME/sbox2/src
$ cd $HOME/sbox2/src
$ git clone git://anongit.freedesktop.org/git/sbox2
$ cd sbox2
$ ./autogen.sh
$ ./configure --prefix=$HOME/sbox2/bin/scratchbox
$ make install
Edit $HOME/sbox2/bin/scratchbox/bin/sb2-build-libtool and add
--host=i386
to to the "./configure" command.
Edit $HOME/sbox2/bin/scratchbox/bin/sb2-init and remove the option
-Wno-poison-system-directories
from the SBOX_EXTRA_CROSS_COMPILER_ARGS variable.
Download Qemu:
$ cd $HOME/sbox2/src
$ svn co svn://svn.savannah.nongnu.org/qemu
Armeb support in Qemu does not work properly. To make it work a bit better, open the qemu/trunk/linux-user/syscall_defs.h file and change
abi_ulong st_blocks; /* Number 512-byte blocks allocated. */
abi_ulong __pad4; /* future possible st_blocks high bits */
to
#ifndef TARGET_WORDS_BIGENDIAN
abi_ulong st_blocks; /* Number 512-byte blocks allocated. */
abi_ulong __pad4; /* future possible st_blocks high bits */
#else
abi_ulong __pad4; /* future possible st_blocks high bits */
abi_ulong st_blocks; /* Number 512-byte blocks allocated. */
#endif
Then, install Qemu:
$ cd qemu/trunk/
$ ./configure --prefix=$HOME/sbox2/bin/qemu/
$ make
$ make install
Edit $HOME/.bashrc and append at the end of the file the following line:
export PATH=$PATH:$HOME/sbox2/bin/scratchbox/bin:$HOME/sbox2/bin/qemu/bin
Close and re-open the console.
We get the toolchain from :
$ cd $HOME/sbox2/src
$ wget
$ tar -xvjf arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -C $HOME/sbox2/bin/
$ cd $HOME/sbox2/src
$ wget
$ tar -xvzf maemo-sdk-rootstrap_4.1_armel.tgz -C $HOME/sbox2/rootfs/armle
$ cd $HOME/sbox2/rootfs/armle
$ sb2-init armle $HOME/sbox2/bin/arm-2007q3/bin/arm-none-linux-gnueabi-gcc
Since the toolchain is from CodeSourcery, we have to edit $HOME/.scratchbox2/armle/sb2.config and add the option
-Wno-poison-system-directories
to the SBOX_EXTRA_CROSS_COMPILER_ARGS variable.
$HOME/sbox2/workspace
cd $HOME/sbox2/workspace${directory} ; sb2 `echo ${command} | sed 's|${directory}|.|g'` ${args}
directory=none; sb2-config -l
sb2-config -d ${target}
|