Maemo SDK+ installation on Debian (AMD64)

m (Building the chrooted platform)
(forgot to add "-eR" to the build-dep step, sorry)
 
(15 intermediate revisions not shown)
Line 1: Line 1:
-
{{Out of date}}
 
-
 
-
 
The Maemo SDK+ package includes scratchbox 2 and Qt, but it will only install on 32-bit platforms.  If you're running Debian with a 64-bit kernel, Maemo SDK+ can be installed into a chrooted 32-bit environment that sits on top of your 64-bit platform.  This guide takes you through all the steps to the point of compilation and running the test.
The Maemo SDK+ package includes scratchbox 2 and Qt, but it will only install on 32-bit platforms.  If you're running Debian with a 64-bit kernel, Maemo SDK+ can be installed into a chrooted 32-bit environment that sits on top of your 64-bit platform.  This guide takes you through all the steps to the point of compilation and running the test.
Line 7: Line 4:
All steps in this section are executed as root, directly on the host.
All steps in this section are executed as root, directly on the host.
 +
Using lenny (old, from the archives):
  # aptitude install debootstrap
  # aptitude install debootstrap
-
  # debootstrap --arch i386 lenny /srv/lenny-ia32 http://ftp.debian.org/debian/
+
  # debootstrap --arch i386 lenny /srv/lenny-ia32 <nowiki>http://archive.debian.org/debian/</nowiki>
-
  # echo "deb http://maemo-sdk.garage.maemo.org/download/host debian-lenny free" >> /srv/lenny-ia32/etc/apt/sources.list
+
  # echo "deb <nowiki>http://maemo-sdk.garage.maemo.org/download/host debian-lenny</nowiki> free" >> /srv/lenny-ia32/etc/apt/sources.list
  # aptitude install schroot
  # aptitude install schroot
-
   
+
 
-
  xxx # cat >> /etc/schroot/schroot.conf <<EOF
+
Or using sqeeze (current stable):
-
  xxx [lenny]
+
  # aptitude install debootstrap
-
  xxx description=Debian lenny
+
  # debootstrap --arch i386 squeeze <nowiki>/srv/lenny-ia32 http://ftp.debian.org/debian/</nowiki>
-
  xxx type=directory
+
# echo "deb <nowiki>http://maemo-sdk.garage.maemo.org/download/host debian-squeeze</nowiki> free" >> /srv/lenny-ia32/etc/apt/sources.list
-
  xxx '''location'''=/srv/lenny-ia32
+
# aptitude install schroot
-
  xxx priority=3
+
You may want to adjust the /srv/lenny-ia32 directory, but then you'd have to adjust it in the rest of the instructions as well (together with any other lenny references if you like).
-
  xxx users='''''<YOUR_USERNAME_HERE!!>''''' (A comma-separated list of users on the host which are allowed access to the chroot)
+
 
-
  xxx groups='''''<YOUR_USER_GROUPNAME_HERE!!>''''' (A comma-separated list of groups on the host which are allowed access to the chroot. probably "users")
+
<s># cat >> /etc/schroot/schroot.conf <<EOF
-
  xxx root-groups=root
+
  [lenny]
-
  xxx aliases=stable,default
+
  description=Debian lenny
-
  xxx EOF
+
  type=directory
 +
  '''location'''=/srv/lenny-ia32
 +
  priority=3
 +
  users='''''<YOUR_USERNAME_HERE!!>''''' (A comma-separated list of users on the host which are allowed access to the chroot)
 +
  groups='''''<YOUR_USER_GROUPNAME_HERE!!>''''' (A comma-separated list of groups on the host which are allowed access to the chroot. probably "users")
 +
  root-groups=root
 +
  aliases=stable,default
 +
  EOF</s>
   
   
  # eval $(sed -rne '/^(FIRST|LAST)_.ID/p' /etc/adduser.conf)
  # eval $(sed -rne '/^(FIRST|LAST)_.ID/p' /etc/adduser.conf)
Line 36: Line 41:
  root-groups=root
  root-groups=root
  aliases=stable,default" >> /etc/schroot/schroot.conf
  aliases=stable,default" >> /etc/schroot/schroot.conf
 +
# echo "export PS1='(lenny)\w \\$ '" >> /srv/lenny-ia32/root/.bashrc
===Installing Maemo SDK+===
===Installing Maemo SDK+===
-
As root on the host:
+
While still logged in as root on the host:
  # schroot -c lenny
  # schroot -c lenny
 +
(lenny)~ #
or
or
  # chroot /srv/lenny-ia32/ /bin/bash
  # chroot /srv/lenny-ia32/ /bin/bash
 +
(lenny)/ #
 +
You are now logged in as root in the chrooted environment as  ''root''.
You are now logged in as root in the chrooted environment as  ''root''.
-
  # aptitude update
+
  (lenny)~ # aptitude update
-
  # aptitude install maemo-sdk
+
  (lenny)~ # aptitude install maemo-sdk
-
  # maemo-sdk install tools lenny-2009-1
+
  (lenny)~ $ maemo-sdk reload catalogue
 +
(lenny)~ # maemo-sdk list available tools
 +
etch
 +
etch-2008
 +
lenny-2009-1
 +
 
 +
Install tools:
 +
(lenny)~ # maemo-sdk --mirror <nowiki>http://archive.debian.org/debian/ install tools lenny-2009-1</nowiki>
 +
 
 +
(lenny)~ # maemo-sdk list available toolchains
 +
arm-2005q3
 +
arm-2007q3
 +
i386-2007q3
 +
 
 +
Install toolchain:
 +
(lenny)~ # maemo-sdk install toolchain arm-2007q3
 +
 
As the SDK needs to use sudo to gain root access later, we need to configure sudo:
As the SDK needs to use sudo to gain root access later, we need to configure sudo:
-
  # visudo
+
  (lenny)~ # visudo
You will be in an editor session now. Modify the file so that it looks like this (remove the comment sign in front of the last lign):
You will be in an editor session now. Modify the file so that it looks like this (remove the comment sign in front of the last lign):
  Defaults env_reset
  Defaults env_reset
Line 53: Line 78:
  %sudo ALL=NOPASSWD: ALL
  %sudo ALL=NOPASSWD: ALL
-
As user on the host:
+
Now, log out of the schroot section, log out of the root account, and as a normal user on the host, log in to the chroot:
 +
(lenny)~ # logout
 +
# logout
  $ schroot -c lenny
  $ schroot -c lenny
-
You are now logged in as root in the chrooted environment as a ''user''.
+
(lenny)~ $
 +
You are now logged in <s>as root in</s> to the chrooted environment as a ''normal (non-root) user''.
Now, choose a rootstrap to install:
Now, choose a rootstrap to install:
-
  $ maemo-sdk list available rootstraps
+
  (lenny)~ $ maemo-sdk list available rootstraps
You get a list of rootstraps
You get a list of rootstraps
-
  $ diablo4.1.2_armel
+
  diablo4.1.2_armel
-
  $ diablo4.1.2_i386
+
  diablo4.1.2_i386
-
  $ diablo4.1.1_armel
+
  diablo4.1.1_armel
-
  $ diablo4.1.1_i386
+
  diablo4.1.1_i386
-
  $ diablo4.1_armel
+
  diablo4.1_armel
-
  $ diablo4.1_i386
+
  diablo4.1_i386
-
  $ fremantle5.0minimal_armel
+
  fremantle5.0minimal_armel
-
  $ fremantle5.0minimal_i386
+
  fremantle5.0minimal_i386
-
  $ fremantle5.0beta1_armel
+
  fremantle5.0beta1_armel
-
  $ fremantle5.0beta1_i386
+
  fremantle5.0beta1_i386
-
  $ scirocco2.2_armel
+
  scirocco2.2_armel
-
  $ scirocco2.2_i386
+
  scirocco2.2_i386
-
  $ mistral2.0_armel
+
  mistral2.0_armel
Now, install your desired rootstrap. For example
Now, install your desired rootstrap. For example
-
  $ maemo-sdk install rootstrap '''''fremantle5.0beta1_armel'''''
+
  (lenny)~ $ maemo-sdk install rootstrap '''''diablo4.1.2_armel'''''
-
  $ sb2 -eR apt-get update
+
  (lenny)~ $ sb2 -eR apt-get update
-
  $ sb2 -eR apt-get install maemo-sdk-runtime maemo-sdk-dev maemo-sdk-dbg
+
  (lenny)~ $ sb2 -eR apt-get install maemo-sdk-runtime maemo-sdk-dev maemo-sdk-debug
===Preparing host for target GUI===
===Preparing host for target GUI===
As root on the host:
As root on the host:
-
  $ aptitude install xserver-xephyr
+
  # aptitude install xserver-xephyr
===Building Maemopad to test the build environment===
===Building Maemopad to test the build environment===
-
As user on the host:
+
As a normal (non-root) user on the host:
  $ schroot -c lenny
  $ schroot -c lenny
-
You are now logged in as root in the chrooted environment as a ''user''.
+
You are now logged in <s>as root in</s> to the chrooted environment as a ''normal (non-root) user''.
-
  $ mkdir -p ~/src/mytest
+
  (lenny)~ $ mkdir -p ~/src/mytest
-
  $ cd ~/src/mytest
+
  (lenny)~ $ cd ~/src/mytest
-
  $ sb2 -eR apt-get update
+
  (lenny)~/src/mytest $ sb2 -eR apt-get update
-
  $ sb2 apt-get source maemopad
+
  (lenny)~/src/mytest $ sb2 apt-get -eR build-dep maemopad
-
  $ cd maemopad-2.4
+
(lenny)~/src/mytest $ sb2 apt-get source maemopad
-
  $ export SBOX_REDIRECT_FORCE=/usr/bin/perl
+
  (lenny)~/src/mytest $ cd maemopad-2.6
-
  $ sb2 dpkg-buildpackage -rfakeroot -d -b
+
  (lenny)~/src/mytest/maemopad-2.6 $ export SBOX_REDIRECT_FORCE=/usr/bin/perl
 +
  (lenny)~/src/mytest/maemopad-2.6 $ sb2 dpkg-buildpackage -rfakeroot -d -b
===Running Maemopad===
===Running Maemopad===
As ''user'' on the host:
As ''user'' on the host:
-
  $ Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -kb
+
  $ Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac &
  $ schroot -c lenny
  $ schroot -c lenny
-
You are now logged in as root in the chrooted environment as a ''user''.
+
You are now logged in <s>as root in</s> to the chrooted environment as a ''normal (non-root) user''.
-
  $ export DISPLAY=:2
+
  (lenny)~ $ export DISPLAY=:2
-
  $ sb2 -eR dpkg -i maemopad_2.4_armel.deb
+
  (lenny)~ $ cd ~/src/mytest/
-
  $ maemo-sdk start gui
+
(lenny)~/src/mytest $ sb2 -eR dpkg -i maemopad_2.6-3+0m5_armel.deb
-
Notice that Maemopad appears in the x11 window.
+
  (lenny)~/src/mytest $ maemo-sdk start gui
-
  $ maemo-sdk stop gui
+
<s>Notice that Maemopad appears in the x11 window.</s><br />
 +
Now you can launch MaemoPad from the Extras menu in the Xephyr window.
 +
  (lenny)~/src/mytest $ maemo-sdk stop gui
===Installing Qt===
===Installing Qt===
As ''root'' in the chrooted environment:
As ''root'' in the chrooted environment:
-
  $ aptitude install qt4-dev-tools
+
  (lenny)~ # aptitude install qt4-dev-tools
===Known Issues===
===Known Issues===
Line 117: Line 148:
  * af-sb-init.sh
  * af-sb-init.sh
They don't seem to be important.. just a cosmetic matter.
They don't seem to be important.. just a cosmetic matter.
 +
 +
I have ~/.maemo-sdk/rootstraps/armel/diablo4.1.2_armel/usr/bin/run-standalone.sh and ~/.maemo-sdk/rootstraps/armel/diablo4.1.2_armel/usr/bin/af-sb-init.sh
 +
I'm not sure where I got them --[[User:swajime|SwaJime]] 22:50, 5 August 2010 (UTC)
===Guides used as a source for this document===
===Guides used as a source for this document===
Line 127: Line 161:
* http://maemo-sdk.garage.maemo.org/install-debian.html
* http://maemo-sdk.garage.maemo.org/install-debian.html
 +
This page has been brought up to date.--[[User:swajime|SwaJime]] 23:03, 5 August 2010 (UTC)
[[Category:Development]]
[[Category:Development]]

Latest revision as of 17:53, 4 March 2013

The Maemo SDK+ package includes scratchbox 2 and Qt, but it will only install on 32-bit platforms. If you're running Debian with a 64-bit kernel, Maemo SDK+ can be installed into a chrooted 32-bit environment that sits on top of your 64-bit platform. This guide takes you through all the steps to the point of compilation and running the test.

Contents

[edit] Building the chrooted platform

All steps in this section are executed as root, directly on the host.

Using lenny (old, from the archives):

# aptitude install debootstrap
# debootstrap --arch i386 lenny /srv/lenny-ia32 http://archive.debian.org/debian/
# echo "deb http://maemo-sdk.garage.maemo.org/download/host debian-lenny free" >> /srv/lenny-ia32/etc/apt/sources.list
# aptitude install schroot

Or using sqeeze (current stable):

# aptitude install debootstrap
# debootstrap --arch i386 squeeze /srv/lenny-ia32 http://ftp.debian.org/debian/
# echo "deb http://maemo-sdk.garage.maemo.org/download/host debian-squeeze free" >> /srv/lenny-ia32/etc/apt/sources.list
# aptitude install schroot

You may want to adjust the /srv/lenny-ia32 directory, but then you'd have to adjust it in the rest of the instructions as well (together with any other lenny references if you like).

# cat >> /etc/schroot/schroot.conf <<EOF
[lenny]
description=Debian lenny
type=directory
location=/srv/lenny-ia32
priority=3
users=<YOUR_USERNAME_HERE!!> (A comma-separated list of users on the host which are allowed access to the chroot)
groups=<YOUR_USER_GROUPNAME_HERE!!> (A comma-separated list of groups on the host which are allowed access to the chroot. probably "users")
root-groups=root
aliases=stable,default
EOF

# eval $(sed -rne '/^(FIRST|LAST)_.ID/p' /etc/adduser.conf)
# USER_LIST=$(sed -e 's/ /,/' <<< $(awk -F: $FIRST_UID'<=$3 && $3<='$LAST_UID' {print $1}' /etc/passwd))
# GROUP_LIST=$(sed -e 's/ /,/' <<< $(awk -F: $FIRST_GID'<=$3 && $3<='$LAST_GID' {print $1}' /etc/passwd))
# echo -e "[lenny]
description=Debian lenny
type=directory
directory=/srv/lenny-ia32
priority=3
users=$USER_LIST
groups=$GROUP_LIST
root-groups=root
aliases=stable,default" >> /etc/schroot/schroot.conf
# echo "export PS1='(lenny)\w \\$ '" >> /srv/lenny-ia32/root/.bashrc

[edit] Installing Maemo SDK+

While still logged in as root on the host:

# schroot -c lenny
(lenny)~ #

or

# chroot /srv/lenny-ia32/ /bin/bash
(lenny)/ #

You are now logged in as root in the chrooted environment as root.

(lenny)~ # aptitude update
(lenny)~ # aptitude install maemo-sdk
(lenny)~ $ maemo-sdk reload catalogue
(lenny)~ # maemo-sdk list available tools
etch
etch-2008
lenny-2009-1

Install tools:

(lenny)~ # maemo-sdk --mirror http://archive.debian.org/debian/ install tools lenny-2009-1
(lenny)~ # maemo-sdk list available toolchains
arm-2005q3
arm-2007q3
i386-2007q3

Install toolchain:

(lenny)~ # maemo-sdk install toolchain arm-2007q3

As the SDK needs to use sudo to gain root access later, we need to configure sudo:

(lenny)~ # visudo

You will be in an editor session now. Modify the file so that it looks like this (remove the comment sign in front of the last lign):

Defaults	env_reset
root	ALL=(ALL) ALL
%sudo ALL=NOPASSWD: ALL

Now, log out of the schroot section, log out of the root account, and as a normal user on the host, log in to the chroot:

(lenny)~ # logout
# logout
$ schroot -c lenny
(lenny)~ $

You are now logged in as root in to the chrooted environment as a normal (non-root) user.

Now, choose a rootstrap to install:

(lenny)~ $ maemo-sdk list available rootstraps

You get a list of rootstraps

diablo4.1.2_armel
diablo4.1.2_i386
diablo4.1.1_armel
diablo4.1.1_i386
diablo4.1_armel
diablo4.1_i386
fremantle5.0minimal_armel
fremantle5.0minimal_i386
fremantle5.0beta1_armel
fremantle5.0beta1_i386
scirocco2.2_armel
scirocco2.2_i386
mistral2.0_armel

Now, install your desired rootstrap. For example

(lenny)~ $ maemo-sdk install rootstrap diablo4.1.2_armel
(lenny)~ $ sb2 -eR apt-get update
(lenny)~ $ sb2 -eR apt-get install maemo-sdk-runtime maemo-sdk-dev maemo-sdk-debug

[edit] Preparing host for target GUI

As root on the host:

# aptitude install xserver-xephyr

[edit] Building Maemopad to test the build environment

As a normal (non-root) user on the host:

$ schroot -c lenny

You are now logged in as root in to the chrooted environment as a normal (non-root) user.

(lenny)~ $ mkdir -p ~/src/mytest
(lenny)~ $ cd ~/src/mytest
(lenny)~/src/mytest $ sb2 -eR apt-get update
(lenny)~/src/mytest $ sb2 apt-get -eR build-dep maemopad
(lenny)~/src/mytest $ sb2 apt-get source maemopad
(lenny)~/src/mytest $ cd maemopad-2.6
(lenny)~/src/mytest/maemopad-2.6 $ export SBOX_REDIRECT_FORCE=/usr/bin/perl
(lenny)~/src/mytest/maemopad-2.6 $ sb2 dpkg-buildpackage -rfakeroot -d -b

[edit] Running Maemopad

As user on the host:

$ Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac &
$ schroot -c lenny

You are now logged in as root in to the chrooted environment as a normal (non-root) user.

(lenny)~ $ export DISPLAY=:2
(lenny)~ $ cd ~/src/mytest/
(lenny)~/src/mytest $ sb2 -eR dpkg -i maemopad_2.6-3+0m5_armel.deb
(lenny)~/src/mytest $ maemo-sdk start gui

Notice that Maemopad appears in the x11 window.
Now you can launch MaemoPad from the Extras menu in the Xephyr window.

(lenny)~/src/mytest $ maemo-sdk stop gui

[edit] Installing Qt

As root in the chrooted environment:

(lenny)~ # aptitude install qt4-dev-tools

[edit] Known Issues

The procedures above work quite well, other than the fact that the following scripts are missing from the chrooted environment:

* run-standalone.sh
* af-sb-init.sh

They don't seem to be important.. just a cosmetic matter.

I have ~/.maemo-sdk/rootstraps/armel/diablo4.1.2_armel/usr/bin/run-standalone.sh and ~/.maemo-sdk/rootstraps/armel/diablo4.1.2_armel/usr/bin/af-sb-init.sh I'm not sure where I got them --SwaJime 22:50, 5 August 2010 (UTC)

[edit] Guides used as a source for this document

Parts of the following sites were used to compose this guide. These sites should be visited to get more detail on the process.

This page has been brought up to date.--SwaJime 23:03, 5 August 2010 (UTC)