Talk:Scratchbox2 based cross compiling
Help needed.
I installed ubuntu-9.04 desktop version on two i386 PCs as host computers. And follow the Scratchbox2 based cross compiling instructions to build the cross compile development platform. The build process gives out error messages, which I don't know how to fix. The final build system works on the factorial sample, not the Hello world sample. The problems from both hosts are identical.
Can someone help me to resolve the issue please?
I list commands I used and relevant, failed responses here. The portions in questions have been highlighted and framed.
The ubuntu-9.04 installation CD is downloaded from http://releases.ubuntu.com/9.04/ubuntu-9.04-desktop-i386.iso
Thanks in advanced.
~$ cd ~
~$ mkdir SheevaPlug
~$ cd SheevaPlug
~$ bunzip2 arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
~$ tar xvf arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar
~$ ls
~$ arm-2009q3
~$
Append the line of "deb http://maemo-sdk.garage.maemo.org/download/host ubuntu-jaunty free" to the end of /etc/apt/sources.list
~$ sudo apt-get update
~$ sudo apt-get scratchbox2 sb2-qemu-arm
E: Invalid operation scratchbox2
~$ sudo apt-get install scratchbox2 sb2-qemu-arm
Get rootfs.tar.gz from the "Sheeva installer 1.0" directory and rename it to the Ubuntu_Jaunty.rootfs.tar.gz
~$ mkdir -p ubuntu_rootfs
~$ cd ubuntu_rootfs
~$ sudo tar -xvf ../Ubuntu_Jaunty.rootfs.tar.gz
~$ ls -al .. | grep ubuntu_rootfs
drwxr-xr-x 20 myname myname 4096 2010-04-13 11:48 ubuntu_rootfs
~$ sudo chown myname
chown: missing operand after `myname'
Try `chown --help' for more information.
~$ sudo chown -R myname *
~$ sudo chgrp -R myname *
~$ cd ..
~$ cd ubuntu_rootfs
~$ sb2-init -c sb2-qemu-arm Sheeva_ubuntu $HOME/SheevaPlug/arm-2009q3/bin/arm-none-linux-gnueabi-gcc
~$ cd ..
~$ mkdir source
~$ cd source
~$ sb2 -eR apt-get update
~$ sb2 -eR apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
cron dhcp3-client dhcp3-common dpkg file gzip language-pack-en libcurl3-gnutls libgnutls26 libkrb53 libmagic1 libnewt0.52 libpam-modules libpam-runtime libpam0g libsasl2-2 libsasl2-modules libsqlite3-0 libssl0.9.8 libvolume-id1 libxcb1 lsb-base lsb-release ntpdate openssl perl perl-base perl-modules sudo tzdata udev whiptail
32 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.2MB of archives.
After this operation, 733kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://ports.ubuntu.com jaunty-updates/main dpkg 1.14.24ubuntu1.1 [2360kB]
Get:2 http://ports.ubuntu.com jaunty-updates/main gzip 1.3.12-6ubuntu2.9.04.1 [108kB]
Get:3 http://ports.ubuntu.com jaunty-updates/main perl-modules 5.10.0-19ubuntu1.1 [3182kB]
Get:4 http://ports.ubuntu.com jaunty-updates/main perl 5.10.0-19ubuntu1.1 [4529kB]
Get:5 http://ports.ubuntu.com jaunty-updates/main perl-base 5.10.0-19ubuntu1.1 [965kB]
Get:6 http://ports.ubuntu.com jaunty-updates/main libpam-modules 1.0.1-9ubuntu1.1 [297kB]
Get:7 http://ports.ubuntu.com jaunty-updates/main language-pack-en 1:9.04+20090803.2 [214kB]
Get:8 http://ports.ubuntu.com jaunty-updates/main libpam-runtime 1.0.1-9ubuntu1.1 [96.5kB]
Get:9 http://ports.ubuntu.com jaunty-updates/main libpam0g 1.0.1-9ubuntu1.1 [111kB]
Get:10 http://ports.ubuntu.com jaunty-updates/main libvolume-id1 141-1.2 [105kB]
Get:11 http://ports.ubuntu.com jaunty-updates/main lsb-base 4.0-0ubuntu0.9.04.1 [24.4kB]
Get:12 http://ports.ubuntu.com jaunty-updates/main tzdata 2010h~repack-0ubuntu0.9.04 [686kB]
Get:13 http://ports.ubuntu.com jaunty-updates/main cron 3.0pl1-105ubuntu1.1 [81.8kB]
Get:14 http://ports.ubuntu.com jaunty-updates/main dhcp3-client 3.1.1-5ubuntu8.2 [233kB]
Get:15 http://ports.ubuntu.com jaunty-updates/main dhcp3-common 3.1.1-5ubuntu8.2 [296kB]
Get:16 http://ports.ubuntu.com jaunty-updates/main file 4.26-2ubuntu4 [44.4kB]
Get:17 http://ports.ubuntu.com jaunty-updates/main libmagic1 4.26-2ubuntu4 [372kB]
Get:18 http://ports.ubuntu.com jaunty-updates/main libgnutls26 2.4.2-6ubuntu0.1 [360kB]
Get:19 http://ports.ubuntu.com jaunty-updates/main libnewt0.52 0.52.2-11.3ubuntu3.1 [56.9kB]
Get:20 http://ports.ubuntu.com jaunty-updates/main libssl0.9.8 0.9.8g-15ubuntu3.4 [849kB]
Get:21 http://ports.ubuntu.com jaunty-updates/main libsasl2-2 2.1.22.dfsg1-23ubuntu3.1 [108kB]
Get:22 http://ports.ubuntu.com jaunty-updates/main libsasl2-modules 2.1.22.dfsg1-23ubuntu3.1 [148kB]
Get:23 http://ports.ubuntu.com jaunty-updates/main libsqlite3-0 3.6.10-1ubuntu0.2 [270kB]
Get:24 http://ports.ubuntu.com jaunty-updates/main lsb-release 4.0-0ubuntu0.9.04.1 [23.9kB]
Get:25 http://ports.ubuntu.com jaunty-updates/main udev 141-1.2 [329kB]
Get:26 http://ports.ubuntu.com jaunty-updates/main whiptail 0.52.2-11.3ubuntu3.1 [35.5kB]
Get:27 http://ports.ubuntu.com jaunty-updates/main libkrb53 1.6.dfsg.4~beta1-5ubuntu2.3 [444kB]
Get:28 http://ports.ubuntu.com jaunty-updates/main libxcb1 1.1.93-0ubuntu3.1 [41.4kB]
Get:29 http://ports.ubuntu.com jaunty-updates/main libcurl3-gnutls 7.18.2-8ubuntu4.1 [210kB]
Get:30 http://ports.ubuntu.com jaunty-updates/main ntpdate 1:4.2.4p4+dfsg-7ubuntu5.2 [64.8kB]
Get:31 http://ports.ubuntu.com jaunty-updates/main openssl 0.9.8g-15ubuntu3.4 [392kB]
Get:32 http://ports.ubuntu.com jaunty-updates/main sudo 1.6.9p17-1ubuntu3.1 [182kB]
Fetched 17.2MB in 31s (550kB/s)
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 11640 files and directories currently installed.)
Preparing to replace dpkg 1.14.24ubuntu1 (using .../dpkg_1.14.24ubuntu1.1_armel.deb) ...
Unpacking replacement dpkg ...
Setting up dpkg (1.14.24ubuntu1.1) ...
(Reading database ... 11640 files and directories currently installed.)
Preparing to replace gzip 1.3.12-6ubuntu2 (using .../gzip_1.3.12-6ubuntu2.9.04.1_armel.deb) ...
Unpacking replacement gzip ...
Setting up gzip (1.3.12-6ubuntu2.9.04.1) ...
(Reading database ... 11640 files and directories currently installed.)
Preparing to replace perl-modules 5.10.0-19ubuntu1 (using .../perl-modules_5.10.0-19ubuntu1.1_all.deb) ...
Unpacking replacement perl-modules ...
Preparing to replace perl 5.10.0-19ubuntu1 (using .../perl_5.10.0-19ubuntu1.1_armel.deb) ...
Unpacking replacement perl ...
Preparing to replace perl-base 5.10.0-19ubuntu1 (using .../perl-base_5.10.0-19ubuntu1.1_armel.deb) ...
Unpacking replacement perl-base ...
Setting up perl-base (5.10.0-19ubuntu1.1) ...
(Reading database ... 11640 files and directories currently installed.)
Preparing to replace libpam-modules 1.0.1-9ubuntu1 (using .../libpam-modules_1.0.1-9ubuntu1.1_armel.deb) ...
Unpacking replacement libpam-modules ...
Setting up libpam-modules (1.0.1-9ubuntu1.1) ...
(Reading database ... 11640 files and directories currently installed.)
Preparing to replace language-pack-en 1:9.04+20090413 (using .../language-pack-en_1%3a9.04+20090803.2_all.deb) ...
Unpacking replacement language-pack-en ...
Replacing files in old package language-pack-en-base ...
Preparing to replace libpam-runtime 1.0.1-9ubuntu1 (using .../libpam-runtime_1.0.1-9ubuntu1.1_all.deb) ...
Unpacking replacement libpam-runtime ...
Setting up libpam-runtime (1.0.1-9ubuntu1.1) ...
(Reading database ... 11649 files and directories currently installed.)
Preparing to replace libpam0g 1.0.1-9ubuntu1 (using .../libpam0g_1.0.1-9ubuntu1.1_armel.deb) ...
Unpacking replacement libpam0g ...
Setting up libpam0g (1.0.1-9ubuntu1.1) ...
(Reading database ... 11649 files and directories currently installed.)
Preparing to replace libvolume-id1 141-1 (using .../libvolume-id1_141-1.2_armel.deb) ...
Unpacking replacement libvolume-id1 ...
Setting up libvolume-id1 (141-1.2) ...
(Reading database ... 11649 files and directories currently installed.)
Preparing to replace lsb-base 3.2-20ubuntu4 (using .../lsb-base_4.0-0ubuntu0.9.04.1_all.deb) ...
Unpacking replacement lsb-base ...
Setting up lsb-base (4.0-0ubuntu0.9.04.1) ...
(Reading database ... 11649 files and directories currently installed.)
Preparing to replace tzdata 2009f-0ubuntu1 (using .../tzdata_2010h~repack-0ubuntu0.9.04_all.deb) ...
Unpacking replacement tzdata ...
Setting up tzdata (2010h~repack-0ubuntu0.9.04) ...
Current default timezone: 'Etc/UTC'
Local time is now: Tue Apr 13 19:23:02 UTC 2010.
Universal Time is now: Tue Apr 13 19:23:02 UTC 2010.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
(Reading database ... 11664 files and directories currently installed.)
Preparing to replace cron 3.0pl1-105ubuntu1 (using .../cron_3.0pl1-105ubuntu1.1_armel.deb) ...
* Stopping periodic command scheduler crond [fail]
Unpacking replacement cron ...
Preparing to replace dhcp3-client 3.1.1-5ubuntu8 (using .../dhcp3-client_3.1.1-5ubuntu8.2_armel.deb) ...
Unpacking replacement dhcp3-client ...
Preparing to replace dhcp3-common 3.1.1-5ubuntu8 (using .../dhcp3-common_3.1.1-5ubuntu8.2_armel.deb) ...
Unpacking replacement dhcp3-common ...
Preparing to replace file 4.26-2ubuntu3 (using .../file_4.26-2ubuntu4_armel.deb) ...
Unpacking replacement file ... Preparing to replace libmagic1 4.26-2ubuntu3 (using .../libmagic1_4.26-2ubuntu4_armel.deb) ...
Unpacking replacement libmagic1 ...
Preparing to replace libgnutls26 2.4.2-6 (using .../libgnutls26_2.4.2-6ubuntu0.1_armel.deb) ...
Unpacking replacement libgnutls26 ...
Preparing to replace libnewt0.52 0.52.2-11.3ubuntu3 (using .../libnewt0.52_0.52.2-11.3ubuntu3.1_armel.deb) ...
Unpacking replacement libnewt0.52 ...
Preparing to replace libssl0.9.8 0.9.8g-15ubuntu3 (using .../libssl0.9.8_0.9.8g-15ubuntu3.4_armel.deb) ...
Unpacking replacement libssl0.9.8 ...
Preparing to replace libsasl2-2 2.1.22.dfsg1-23ubuntu3 (using .../libsasl2-2_2.1.22.dfsg1-23ubuntu3.1_armel.deb) ...
Unpacking replacement libsasl2-2 ...
Preparing to replace libsasl2-modules 2.1.22.dfsg1-23ubuntu3 (using .../libsasl2-modules_2.1.22.dfsg1-23ubuntu3.1_armel.deb) ...
Unpacking replacement libsasl2-modules ...
Preparing to replace libsqlite3-0 3.6.10-1 (using .../libsqlite3-0_3.6.10-1ubuntu0.2_armel.deb) ...
Unpacking replacement libsqlite3-0 ...
Preparing to replace lsb-release 3.2-20ubuntu4 (using .../lsb-release_4.0-0ubuntu0.9.04.1_all.deb) ...
Unpacking replacement lsb-release ...
Preparing to replace udev 141-1 (using .../udev_141-1.2_armel.deb) ...
Adding `local diversion of /sbin/udevadm to /sbin/udevadm.upgrade'
Unpacking replacement udev ...
Preparing to replace whiptail 0.52.2-11.3ubuntu3 (using .../whiptail_0.52.2-11.3ubuntu3.1_armel.deb) ...
Unpacking replacement whiptail ...
Preparing to replace libkrb53 1.6.dfsg.4~beta1-5ubuntu2 (using .../libkrb53_1.6.dfsg.4~beta1-5ubuntu2.3_armel.deb) ...
Unpacking replacement libkrb53 ...
Preparing to replace libxcb1 1.1.93-0ubuntu3 (using .../libxcb1_1.1.93-0ubuntu3.1_armel.deb) ...
Unpacking replacement libxcb1 ...
Preparing to replace libcurl3-gnutls 7.18.2-8ubuntu4 (using .../libcurl3-gnutls_7.18.2-8ubuntu4.1_armel.deb) ...
Unpacking replacement libcurl3-gnutls ...
Preparing to replace ntpdate 1:4.2.4p4+dfsg-7ubuntu5 (using .../ntpdate_1%3a4.2.4p4+dfsg-7ubuntu5.2_armel.deb) ...
Unpacking replacement ntpdate ...
Preparing to replace openssl 0.9.8g-15ubuntu3 (using .../openssl_0.9.8g-15ubuntu3.4_armel.deb) ...
Unpacking replacement openssl ...
Preparing to replace sudo 1.6.9p17-1ubuntu3 (using .../sudo_1.6.9p17-1ubuntu3.1_armel.deb) ...
Unpacking replacement sudo ...
Setting up language-pack-en (1:9.04+20090803.2) ...
Setting up cron (3.0pl1-105ubuntu1.1) ...
- Starting periodic command scheduler crond [ OK ]
Setting up dhcp3-common (3.1.1-5ubuntu8.2) ...
Setting up dhcp3-client (3.1.1-5ubuntu8.2) ...
Setting up libmagic1 (4.26-2ubuntu4) ...
Setting up file (4.26-2ubuntu4) ...
Setting up libgnutls26 (2.4.2-6ubuntu0.1) ...
Setting up libnewt0.52 (0.52.2-11.3ubuntu3.1) ...
Setting up libssl0.9.8 (0.9.8g-15ubuntu3.4) ...
Setting up libsqlite3-0 (3.6.10-1ubuntu0.2) ...
Setting up lsb-release (4.0-0ubuntu0.9.04.1) ...
Setting up udev (141-1.2) ...
- Stopping kernel event manager... [ OK ]
- Starting kernel event manager...
error initializing netlink socket [fail]
invoke-rc.d: initscript udev, action "restart" failed.
dpkg: error processing udev (--configure):
subprocess post-installation script returned error exit status 3
Setting up whiptail (0.52.2-11.3ubuntu3.1) ...
Setting up libkrb53 (1.6.dfsg.4~beta1-5ubuntu2.3) ...
Setting up libxcb1 (1.1.93-0ubuntu3.1) ...
Setting up libcurl3-gnutls (7.18.2-8ubuntu4.1) ...
Setting up ntpdate (1:4.2.4p4+dfsg-7ubuntu5.2) ...
Setting up openssl (0.9.8g-15ubuntu3.4) ...
Setting up sudo (1.6.9p17-1ubuntu3.1) ...
Setting up perl-modules (5.10.0-19ubuntu1.1) ...
Setting up libsasl2-modules (2.1.22.dfsg1-23ubuntu3.1) ...
Setting up libsasl2-2 (2.1.22.dfsg1-23ubuntu3.1) ...
Setting up perl (5.10.0-19ubuntu1.1) ...
Errors were encountered while processing: udev E: Sub-process /usr/bin/dpkg returned an error code (1)
~$ sb2 gcc factorial.c -o factorial
~$ file factorial
factorial: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
~$ ./factorial
bash: ./factorial: cannot execute binary file
~$ sb2 ./factorial
factorial(0) = 1
factorial(1) = 1
factorial(2) = 2
factorial(3) = 6
factorial(4) = 24
factorial(5) = 120
factorial(6) = 720
factorial(7) = 5040
factorial(8) = 40320
factorial(9) = 362880
~$
~$ sb2 g++ -c -o test.o test_ace.cpp
/bin/bash: g++: command not found
~$ sb2 gcc -c -o test.o test_ace.cpp
test_ace.cpp:1: fatal error: ace/Log_Msg.h: No such file or directory
compilation terminated.
~$ sb2 -eR apt-get install libace-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libace-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it:
mpc-ace
E: Package libace-dev has no installation candidate
~$
~$ sb2 -eR apt-get install mpc-ace
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
make
Suggested packages:
make-doc libace-dev pkg-config
The following NEW packages will be installed:
make mpc-ace
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 477kB of archives.
After this operation, 3453kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://ports.ubuntu.com jaunty/main make 3.81-5 [156kB]
Get:2 http://ports.ubuntu.com jaunty/universe mpc-ace 5.6.3-5 [320kB]
Fetched 477kB in 2s (231kB/s)
Selecting previously deselected package make.
(Reading database ... 11665 files and directories currently installed.)
Unpacking make (from .../archives/make_3.81-5_armel.deb) ...
Selecting previously deselected package mpc-ace.
Unpacking mpc-ace (from .../mpc-ace_5.6.3-5_all.deb) ...
Setting up udev (141-1.2) ...
- Stopping kernel event manager... [ OK ]
- Starting kernel event manager...
error initializing netlink socket [fail]
invoke-rc.d: initscript udev, action "restart" failed.
dpkg: error processing udev (--configure):
subprocess post-installation script returned error exit status 3
Setting up make (3.81-5) ...
Setting up mpc-ace (5.6.3-5) ...
Errors were encountered while processing:
udev
E: Sub-process /usr/bin/dpkg returned an error code (1)
~$
~$
~$ sb2 g++ -c -o test.o test_ace.cpp
/bin/bash: g++: command not found
~$ sb2 gcc -c -o test.o test_ace.cpp
test_ace.cpp:1: fatal error: ace/Log_Msg.h: No such file or directory
compilation terminated.