Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9412476
  • 博文数量: 1748
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 20070
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1748)

文章存档

2024年(24)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: 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.

  • For the Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion ‘(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso’ failed! problem, it’s necessary to disable “vdso”:
    echo 0 | sudo tee /proc/sys/vm/vdso_enabled

  • For problems when building packages (mmap: permission denied when building), it’s necessary to reduce the mmap minimum address:
    echo 4096 | sudo tee /proc/sys/vm/mmap_min_addr



Update: (Thanks to ):

...to make these changes permanent across reboots, one can add these settings to /etc/sysctl.conf:

vm.vdso_enabled = 0
vm.mmap_min_addr = 4096


Then run
sudo sysctl -p


Sbox2 Ubuntu Tutorial

Contents

[]

[]

INSTALLATION OF SBOX2 ON UBUNTU 8.04

This is a step-by-step guide about how to install on Ubuntu 8.04.


[]

1. Packages

The installation requires the following packages:

  • autoconf
  • autogen
  • automake
  • autotools-dev
  • binutils
  • fakeroot
  • gcc-3.4 (needed by Qemu)
  • git-core
  • g++
  • libsdl1.2-dev (needed by Qemu)
  • make
  • sbrsh
  • subversion (needed for Qemu)

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


[]

2. Directories

$ rm -fr $HOME/sbox2 $HOME/.scratchbox2

$ mkdir -p $HOME/sbox2 $HOME/sbox2/bin $HOME/sbox2/bin/qemu $HOME/sbox2/rootfs/armle $HOME/sbox2/src


[]

3. Scratchbox installation

$ 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.


[]

4. Qemu

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
[]

5. PATH variable

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.

[]

6. Target armle


[]

6.1 Toolchain

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/
[]

6.2 Rootfs

$ cd $HOME/sbox2/src

$ wget

$ tar -xvzf maemo-sdk-rootstrap_4.1_armel.tgz -C $HOME/sbox2/rootfs/armle


[]

6.3 Configuration

$ cd $HOME/sbox2/rootfs/armle

$ sb2-init armle $HOME/sbox2/bin/arm-2007q3/bin/arm-none-linux-gnueabi-gcc


[]

6.4 Remove warnings

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.


[]

7. List of commands

  • sb2 to enter sbox2
  • sb2 to execute a command in sbox2
  • sb2 -t to switch target
  • sb2-config -l to have the list of targets
  • sb2-config -d to set default target


[]

8. Configuration of Laika Plugin for Eclipse

  • Sandbox directory:
$HOME/sbox2/workspace
  • Invoking Scratchbox commands:
cd $HOME/sbox2/workspace${directory} ; sb2 `echo ${command}  | sed 's|${directory}|.|g'` ${args}
  • Listing build targets:
directory=none; sb2-config -l
  • The syntax for choosing a build target:
sb2-config -d ${target}
文件:应用Scratchbox构建基于CF卡的嵌入式linux系统.doc.rar
大小:14KB
下载:下载
阅读(2846) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~