Editing Maemo 5 Final SDK 安装指南
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
=介绍= | =介绍= | ||
- | + | ||
- | + | ||
本文是[[Documentation/Maemo 5 Final SDK Installation]]的简体中文翻译。 | 本文是[[Documentation/Maemo 5 Final SDK Installation]]的简体中文翻译。 | ||
- | 以下文档介绍了如何安装Maemo 5 Final SDK。Maemo | + | 以下文档介绍了如何安装Maemo 5 Final SDK。Maemo SDK,使用安装了Maemo特有的开发文件的Scratchbox,做为交叉编译环境。 |
在开始安装以前,先来看一下最小的系统需求。官方支持基于Debian的x86-32 Linux发行版,主要是Debian和Ubuntu。但在其他Linux发行版上安装Maemo SDK也是可以做到的。 | 在开始安装以前,先来看一下最小的系统需求。官方支持基于Debian的x86-32 Linux发行版,主要是Debian和Ubuntu。但在其他Linux发行版上安装Maemo SDK也是可以做到的。 | ||
Line 51: | Line 50: | ||
图形界面安装程序提供了标准安装和自定义安装两种选择。标准安装使用默认设置,而自定义安装提供了更多的选择。需要注意的是,如果存在 FREMANTLE_X86和FREMANTLE_ARMEL的编译目标,标准安装将会覆盖这两个目标,不过Scratchbox的home目录将会被保留。如果你不想覆盖这两个编译目标,请使用自定义安装。 | 图形界面安装程序提供了标准安装和自定义安装两种选择。标准安装使用默认设置,而自定义安装提供了更多的选择。需要注意的是,如果存在 FREMANTLE_X86和FREMANTLE_ARMEL的编译目标,标准安装将会覆盖这两个目标,不过Scratchbox的home目录将会被保留。如果你不想覆盖这两个编译目标,请使用自定义安装。 | ||
- | + | 安装程序是一个Qt程序,需要Qt的python绑定的支持。如果你的系统没有安装这些软件包,安装程序可以安装他们。 | |
如果有需要,安装程序可以使用http代理。如果你的网络连接没有正常工作,安装程序将请求你手工设置代理。 | 如果有需要,安装程序可以使用http代理。如果你的网络连接没有正常工作,安装程序将请求你手工设置代理。 | ||
- | 安装程序在Ubuntu Karmic和Debian Lenny上经受了测试,32位和64位版本都可以正常使用。安装程序需要下载Maemo | + | 安装程序在Ubuntu Karmic和Debian Lenny上经受了测试,32位和64位版本都可以正常使用。安装程序需要下载Maemo SDK,因此你需要一个可用的Internet连接。 |
'''开始安装''' | '''开始安装''' | ||
Line 90: | Line 89: | ||
- | ''' | + | '''限制:''' |
* 因为安装程序需要进行软件包安装,你应该在安装前,先退出其他的包管理程序。 | * 因为安装程序需要进行软件包安装,你应该在安装前,先退出其他的包管理程序。 | ||
Line 96: | Line 95: | ||
* 另外,安装程序需要pyQt的支持,老版本的Ubuntu和Debian可能没有提供pyQt。 | * 另外,安装程序需要pyQt的支持,老版本的Ubuntu和Debian可能没有提供pyQt。 | ||
* 在64位系统上,安装程序将显示需要做哪些设置,但不会自动进行配置,你需要手工配置它们。 | * 在64位系统上,安装程序将显示需要做哪些设置,但不会自动进行配置,你需要手工配置它们。 | ||
- | * | + | * 安装程序会DISPLAY环境变量设置为":2",如果你想使用其他值, 请手工更改。 |
=在基于Debian的x86-32 linux发行版上安装Maemo 5 SDK= | =在基于Debian的x86-32 linux发行版上安装Maemo 5 SDK= | ||
Line 110: | Line 109: | ||
4. 安装脚本将会在“sbox”用户组中添加指定的用户。要使改设置在当前终端进程中生效,你需要执行以下命令。 | 4. 安装脚本将会在“sbox”用户组中添加指定的用户。要使改设置在当前终端进程中生效,你需要执行以下命令。 | ||
- | + | 注意:如果你已经登录进了Scratchbox环境,这个命令将改变当前的用户组ID。如果你不想改变,只要从Scratchbox环境中注销再重新登录即可。 | |
$ newgrp sbox | $ newgrp sbox | ||
- | + | 这时,你已经获得了一个可用的Scratchbox环境。 | |
- | + | 5. 继续进行Maemo SDK的安装。这个脚本需要在Scratchbox环境外,以安装时指定的用户权限运行。首先,为脚本用户添加可执行权限。 | |
$ sudo chmod +x ./maemo-sdk-install_5.0.sh | $ sudo chmod +x ./maemo-sdk-install_5.0.sh | ||
Line 123: | Line 122: | ||
如果你将Scratchbox安装到了/scratchbox以外的目录,你需要用“-s PATH”选项来指定你的Scratchbox目录。你可以使用“--help”选项获得更多的命令行选项信息。 | 如果你将Scratchbox安装到了/scratchbox以外的目录,你需要用“-s PATH”选项来指定你的Scratchbox目录。你可以使用“--help”选项获得更多的命令行选项信息。 | ||
- | + | 6. 脚本成功执行完成后,你就可以登录Scratchbox环境了。 | |
$ /scratchbox/login | $ /scratchbox/login | ||
- | + | 如果你无法登录,请看一下Scratchbox的限制。 | |
- | + | 7. 你需要接受Nokia的最终用户许可协议,才能够获取Nokia提供的二进制软件包。安装这些软件包后,你将会获得Maemo SDK的完整功能。 | |
- | + | 7.1. 通过[http://tablets-dev.nokia.com/eula/index.php 这个页面],接受最终用户许可协议。 | |
- | + | 7.2. 将接受最终用户许可协议后获得的软件源地址,分别添加到x86和armel两个编译目标环境的/etc/apt/source.list文件中。然后在两个目标的环境下,执行以下命令。 | |
[sbox-FREMANTLE_X86: ~] > sb-conf select FREMANTLE_ARMEL | [sbox-FREMANTLE_X86: ~] > sb-conf select FREMANTLE_ARMEL | ||
- | [sbox-FREMANTLE_ARMEL: ~] > nano /etc/apt/sources.list # | + | [sbox-FREMANTLE_ARMEL: ~] > nano /etc/apt/sources.list # add deb line |
[sbox-FREMANTLE_ARMEL: ~] > apt-get update | [sbox-FREMANTLE_ARMEL: ~] > apt-get update | ||
[sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install nokia-binaries nokia-apps | [sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install nokia-binaries nokia-apps | ||
[sbox-FREMANTLE_ARMEL: ~] > sb-conf select FREMANTLE_X86 | [sbox-FREMANTLE_ARMEL: ~] > sb-conf select FREMANTLE_X86 | ||
- | [sbox-FREMANTLE_X86: ~] > nano /etc/apt/sources.list # | + | [sbox-FREMANTLE_X86: ~] > nano /etc/apt/sources.list # add deb line |
[sbox-FREMANTLE_X86: ~] > apt-get update | [sbox-FREMANTLE_X86: ~] > apt-get update | ||
[sbox-FREMANTLE_X86: ~] > fakeroot apt-get install nokia-binaries nokia-apps | [sbox-FREMANTLE_X86: ~] > fakeroot apt-get install nokia-binaries nokia-apps | ||
Line 218: | Line 217: | ||
=自Maemo 5 Beta 2 SDK升级= | =自Maemo 5 Beta 2 SDK升级= | ||
- | + | 很不幸地,从Beta 2平滑地升级到Final SDK是不可能的。因此我们建议你重新安装Final SDK。在你操作以前,请先看一下下列指引。 | |
一些随Final SDK附带的Nokia应用程序使用了固定的路径,来指定用户的home目录。为了使这些程序能够正常工作,你需要创建一个目录,路径与Nokia指定的路径相同。 | 一些随Final SDK附带的Nokia应用程序使用了固定的路径,来指定用户的home目录。为了使这些程序能够正常工作,你需要创建一个目录,路径与Nokia指定的路径相同。 | ||
Line 244: | Line 243: | ||
为了解决这个问题,我们需要手工检查/target/<target_name>/opt是否被链接了,如果是,那么删除这个链接,并且重新创建相应的目录。 | 为了解决这个问题,我们需要手工检查/target/<target_name>/opt是否被链接了,如果是,那么删除这个链接,并且重新创建相应的目录。 | ||
- | = | + | =施工中= |
+ | [edit] Upgrading from Maemo 4.x/Diablo SDK | ||
- | + | Due to the fact that there are API breaks in Fremantle, we cannot upgrade Diablo SDK to Fremantle. We can however have Fremantle Scratchbox targets co-exist with Diablo targets. | |
- | + | For this, we need to first upgrade the Scratchbox installation on our host machine. | |
- | * | + | * Download the Maemo5 scratchbox installer. |
- | + | * Set executable permissions and run it as follows: | |
- | + | $ chmod a+x ./maemo-scratchbox-install_5.0.sh | |
+ | $ sudo ./maemo-scratchbox-install_5.0.sh -U -u <EXISTING_USER> -s /scratchbox | ||
- | + | Once the Scratchbox installation is done, run the Maemo 5 Final SDK installer. | |
- | + | =施工中= | |
+ | [edit] Manual Installation | ||
- | + | On x86-32 Debian based systems: | |
- | * | + | * You can add the following line into your host machine's /etc/apt/sources.list file. |
- | + | ||
- | + | ||
- | + | ||
- | + | deb http://scratchbox.org/debian/ maemo5-sdk main | |
- | + | ||
- | |||
- | |||
- | |||
- | + | * Install the needed Scratchbox packages with root permission | |
- | + | $ sudo apt-get update | |
+ | $ sudo apt-get install scratchbox-core scratchbox-libs scratchbox-devkit-qemu scratchbox-devkit-debian scratchbox-devkit-doctools scratchbox-devkit-perl scratchbox-toolchain-host-gcc scratchbox-toolchain-cs2007q3-glibc2.5-arm7 scratchbox-toolchain-cs2007q3-glibc2.5-i486 scratchbox-devkit-svn scratchbox-devkit-git scratchbox-devkit-apt-https | ||
- | |||
- | + | On x86-64 Debian based systems: | |
- | + | * Download the Scratchbox packages from here. | |
+ | * Force the installation of the x86-32 packages with root permission as follows: | ||
- | + | $ sudo dpkg -i --force-architecture scratchbox-core scratchbox-libs scratchbox-devkit-qemu scratchbox-devkit-debian scratchbox-devkit-doctools scratchbox-devkit-perl scratchbox-toolchain-host-gcc scratchbox-toolchain-cs2007q3-glibc2.5-arm7 scratchbox-toolchain-cs2007q3-glibc2.5-i486 scratchbox-devkit-svn scratchbox-devkit-git scratchbox-devkit-apt-https | |
- | |||
- | + | The Scratchbox packages will be unpacked to /scratchbox directory and the installation procedure will ask you some questions about the group and user accounts. Default group to Scratchbox is 'sbox'. | |
- | + | ||
- | + | * Users who will be using Scratchbox should be added using the following command with root permission: | |
- | + | $ sudo /scratchbox/sbin/sbox_adduser USER yes | |
- | |||
- | + | It will automatically include the user to the Scratchbox group, create user directories under /scratchbox/users and mount several directories (/dev, /proc, /tmp) under the user directory. | |
- | + | * Some of the Nokia applications shipped with the final SDK use a hard coded path for user home directory which presents a problem since the default username on the device differs from the username on the developer’s machine. To make these applications work, it is required to create a home directory that matches the hard coded value. This needs to be done outside scratchbox using root privileges. | |
- | + | ||
- | + | $ sudo ln -s /scratchbox/users/<username>/home/<username> /scratchbox/users/<username>/home/user | |
- | |||
- | * | + | * For the group membership to be effective in the current terminal session, run the following command: |
- | + | $ newgrp sbox | |
- | + | ||
- | + | Note: This command will change the existing group ID during the current login session to 'sbox'. If you do not want to change, simply logout and log back in for the group membership to be effective. | |
- | |||
- | * | + | * Log-in to Scratchbox. |
- | + | $ /scratchbox/login | |
- | + | ||
- | + | ||
- | |||
- | * | + | * Configure the scratchbox x86 and armel targets as follows: |
- | + | [sbox->:~]>sb-conf st FREMANTLE_X86 -c cs2007q3-glibc2.5-i486 -d perl:debian-etch:doctools:svn:git -t none | |
+ | [sbox->:~]>sb-conf st FREMANTLE_ARMEL -c cs2007q3-glibc2.5-arm7 -d qemu:perl:debian-etch:doctools:svn:git -t qemu-arm-sb | ||
- | |||
- | |||
+ | * Download the minimal rootstraps. | ||
- | : | + | [sbox->:~]> wget http://repository.maemo.org/stable/5.0/armel/maemo-sdk-rootstrap_5.0_armel.tgz http://repository.maemo.org/stable/5.0/i386/maemo-sdk-rootstrap_5.0_i386.tgz |
- | : | + | |
- | + | ||
- | |||
- | |||
- | * | + | * Switch to x86 target, install the devkits, etc and fakeroot into the target, install the minimal rootstrap and finally the Maemo development files. |
- | + | [sbox->:~]> sb-conf se FREMANTLE_X86 | |
- | + | [sbox-FREMANTLE_X86: ~] > sb-conf rs maemo-sdk-rootstrap_5.0_i386.tgz | |
- | * | + | * Some users seem to have problems downloading all files with apt http pipelining enabled. If you want to make sure or you get download errors like "104 connection reset by peer" at the fakeroot steps below, then disable http pipelining with the next command: |
- | + | [sbox-FREMANTLE_X86: ~] > echo 'Acquire::http::Pipeline-Depth "0";' >> /etc/apt/apt.conf.d/00maemo | |
- | * | + | * either way, continue here: |
- | + | [sbox-FREMANTLE_X86: ~] > sb-conf in -edFL | |
- | + | [sbox-FREMANTLE_X86: ~] > apt-get update | |
- | + | [sbox-FREMANTLE_X86: ~] > fakeroot apt-get install maemo-sdk-debug | |
- | |||
- | + | The meta-package 'maemo-sdk-debug' installs all needed open source runtime, development and debug pakcages into the target. Use maemo-sdk-runtime if you want only runtime packages to be installed or user maemo-sdk-dev if you want only the runtime + development packages to be installed. | |
- | + | ||
- | * | + | * Accept the EULA from here to obtain the URL to access the Nokia binaries repository. |
- | + | * Add the URL thus obtained to the Scratchbox target's /etc/apt/sources.list and do the following: | |
- | + | ||
+ | [sbox-FREMANTLE_X86: ~] >apt-get update | ||
+ | [sbox-FREMANTLE_X86: ~] >fakeroot apt-get install nokia-binaries nokia-apps | ||
- | |||
- | + | * In order to facilitate installing applications under /opt on the device, a symlink /opt has been created pointing to /home/opt. The SDK inherits this feature. Under Scratchbox, /opt points to /target/links/opt which in turn points to /targets/<target_name>/opt. Installing the rootstraps makes this point to /home/opt, which is not what we want, since we need /opt to be target specific. In order to resolve this situation, | |
- | + | [sbox-FREMANTLE_X86: ~] >rm /targets/FREMANTLE_X86/opt | |
+ | [sbox-FREMANTLE_X86: ~] >mkdir /targets/FREMANTLE_X86/opt | ||
- | |||
- | |||
- | + | * Execute similar steps on the armel target too to set it up: | |
- | + | [sbox-FREMANTLE_X86: ~]> sb-conf se FREMANTLE_ARMEL | |
- | + | [sbox-FREMANTLE_ARMEL: ~] > sb-conf rs maemo-sdk-rootstrap_5.0_armel.tgz | |
- | + | * again,the next command disables http pipelining, if you like: | |
- | + | [sbox-FREMANTLE_X86: ~] > echo 'Acquire::http::Pipeline-Depth "0";' >> /etc/apt/apt.conf.d/00maemo | |
- | + | ||
- | + | * pipelining disabled or not, here we go again... | |
- | + | [sbox-FREMANTLE_ARMEL: ~] > sb-conf in -edFL | |
+ | [sbox-FREMANTLE_ARMEL: ~] > apt-get update | ||
+ | [sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install maemo-sdk-debug | ||
- | |||
- | + | * Add the same URL obtained above to access the Nokia binaries repository under /etc/apt/sources.list file of the Scratchbox armel target. | |
- | + | [sbox-FREMANTLE_ARMEL: ~] >apt-get update | |
+ | [sbox-FREMANTLE_ARMEL: ~] >fakeroot apt-get install nokia-binaries nokia-apps | ||
- | |||
- | |||
- | |||
+ | * Create the /opt directory. | ||
- | + | [sbox-FREMANTLE_ARMEL: ~] >rm /targets/FREMANTLE_ARMEL/opt | |
+ | [sbox-FREMANTLE_ARMEL: ~] >mkdir /targets/FREMANTLE_ARMEL/opt | ||
- | |||
- | + | With this, you must now have both the targets setup and ready to use. | |
- | + | Start the UI framework. | |
- | + | [edit] Un-installation | |
- | + | ||
- | + | Make sure that you have no process running inside Scratchbox. Uninstalling Scratchbox will remove everything that is installed and saved inside Scratchbox. Please take a backup of your files from Scratchbox user home directory if needed. | |
+ | |||
+ | On Debian based systems, do the following with root permissions: | ||
+ | $ sudo apt-get remove scratchbox-* --purge | ||
+ | $ sudo rm -rf /scratchbox | ||
+ | |||
+ | |||
+ | On non-Debian based systems, you need to stop scratchbox as follows before removing it. | ||
+ | $ sudo /scratchbox/sbin/sbox_ctl stop | ||
+ | $ sudo rm -rf /scratchbox | ||
+ | |||
+ | |||
+ | [edit] Limitations of Scratchbox | ||
+ | |||
+ | The following limitations have been noted in the usage of Scratchbox: | ||
+ | [edit] VDSO support | ||
+ | |||
+ | Scratchbox does not work when VDSO32 support is enabled in the host's kernel. We're working on making it possible, but at the moment there are some workarounds, which are presented here. | ||
+ | |||
+ | If your host has VDSO32 turned on you will get an error like this when trying to login to Scratchbox. | ||
+ | No directory, logging in with HOME=/ | ||
+ | Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion `(void *) | ||
+ | ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed! | ||
+ | |||
+ | |||
+ | [edit] x86-64 kernel | ||
+ | |||
+ | x86-64 Linux kernels starting from version 2.6.25 enable VDSO32 by default. To temporarily disable VDSO32 execute | ||
+ | sysctl abi.vsyscall32=0 | ||
+ | |||
+ | [[Category:Internationalization]] | ||
- | + | On Linux kernel 2.6.24 <= you can disable VDSO32 by executing | |
+ | sysctl vm.vdso_enabled=0 | ||
- | + | or | |
+ | sysctl kernel.vdso=0 | ||
- | + | The current setting of VDSO32 can be verified by using sysctl. Only values 0 and 2 are compatible with Scratchbox. In our examples we use 0 (disable). 2 enables compat mode. | |
- | + | ||
- | + | ||
- | + | You can set all of these permanently by adding the following lines to /etc/sysctl.conf | |
+ | vm.vdso_enabled = 0 | ||
+ | abi.vsyscall32 = 0 | ||
+ | kernel.vdso = 0 | ||
- | + | Save the file and run the command: | |
+ | $ sudo sysctl -p | ||
- | + | Please note the correct line depends on your Linux kernel version. When you execute sysctl -p you may get a warning about unknown keys. You can safely ignore those warnings as long as one of the 3 settings works. | |
- | + | WARNING : You should try setting these values by echoing them to the given locations before adding them to sysctl.conf to see if they cause any problems. For example, in some Ubuntu Gutsy installations, it has been observed that changing the VDSO settings will hang the system and thus making permanent changes in sysctl.conf may, in these cases, make your system unbootable. | |
- | |||
- | + | [edit] Known Issues in the SDK | |
- | + | * A list of issues and their solutions is http://wiki.maemo.org/Q%26A_-_SDK_and_Scratchbox | |
- | * | + | * Unnecessary warnings and debugging messages are printed out when the hildon application framework is started. |
- | * | + | * Armel target does not bring up the UI framework |
- | * | + | * It has been noted that Xephyr dies with the application framework at times. The crash in question might even be Xephyr related since the application framework behaves differently with different versions/builds of Xephyr. The case seems to be worst on Xephyr that comes with Ubuntu Jaunty, there Xephyr will die when running any application that contains an input field and clicking on that field with a mouse to invoke the input method. On Fedora Code 10 the Xephyr does not mind the mouse clicks but dies when shutting down the application framework. On the other hand Xephyr on Ubuntu Intrepid or even the Intrepid version recompiled for Jaunty does not experience crashing in these situations. |
- | + | A patch is already available for the Xephyr on Ubuntu Jaunty and can be found at http://bugs.freedesktop.org/show_bug.cgi?id=21591. Binaries packages for xserver-xephyr package and its dependencies (libgpg-error0 and libcrypt11) can be download from Ubuntu Jaunty repositories. | |
- | + | ||
- | * | + | * The performance of clutter can be improved by enabling hardware acceleration if not enabled already. In some cases, it would require installing restricted/proprietary drivers (Eg: on host machines with ATI or NVidia graphics card). Refer to Maemo5 clutter performance for more details. |
- | * | + | * Running Xephyr with -kb option disables entry of “@” symbol. However, removing -kb option disables cursor keys. |
- | * | + | * Colours invert sometimes in some applications. (Browser and Photo's for example) |
Learn more about Contributing to the wiki.