Active Topics

 


Reply
Thread Tools
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#31
Originally Posted by BruceL View Post
daperl, I'm looking forward to the details.
[Zohan]Let's do thees theeng[/Zohan]: Phase I of daperl's brute force hack method of on-tablet n900 SDK creation.

WARNING: These notes/instructions are for Advanced Linux/Maemo Developers and crazy people only. Please, please, please don't try any of the following if you don't fit in either of these two categories. This could f*ck up your n900 and force you to reflash, especially if you don't properly remove the busybox links mentioned later.

FURTHER WARNING: This is for C and C++ builds. Because of the Python mount bindings, I don't think Python stuff works in this chroot. So, for now this is for building stuff with no Python runtime build dependencies.

And lastly, read everything before trying anything; get an understanding of the process. Good luck!

These are mostly notes, but it wouldn't be too difficult to put them in a robust shell script. And as a last disclaimer, these notes are from memory and timestamp sorting. I'm optimistic, but it's possible something fell through the cracks.

Download this post's attachments to /home/user so they're in both roots, then do the following as root:

# Install bash
# It's either in fremantle/sdk free non-free, fremantle/tools free non-free, or extras
# Fix your /etc/apt/sources.list accordingly
# For example:

echo "deb http://repository.maemo.org/ fremantle/sdk free non-free" >> /etc/apt/sources.list

apt-get update
apt-get install bash

# Fix your /etc/apt/sources.list again if you want to. If you do, then update again:

apt-get update

# Clone the system
# This takes a while, so be patient.

mount --bind / /floppy
cp -a /floppy /home/.chroot
umount /floppy

# Fix and Make some directories

rm /home/.chroot/opt
mkdir /home/.chroot/opt
mkdir -p /home/.chroot/home/user/MyDocs

# Setup the mount bindings
# Look at /home/user/chroot.sh.txt so you know what it's doing
# Do the following only once per n900 boot,
# otherwise you could have a mounting mess.
# Clean-up is on you at the moment.

. /home/user/chroot.sh.txt

# Let's chroot

chroot /home/.chroot /bin/bash --rcfile /home/user/chrootrc.txt -i

# You should now be in the chroot.
# Check and make sure

df

# what size is / ?
# It should be near 2064208 1k-blocks
# It shouldn't be near 233224 1k-blocks
# If it's not near 2064208, STOP. YOU'RE DONE FOR THE TIME BEING.

# Setup apt-get for some serious work.

echo "deb http://repository.maemo.org/ fremantle/sdk free non-free" >> /etc/apt/sources.list
echo "deb-src http://repository.maemo.org/ fremantle/sdk free non-free" >> /etc/apt/sources.list
apt-get update

# Install the packages listed in /home/user/dpkg-list.txt
# The packages are listed in the order they should be installed
# This list is based on following the rabbit hole of dependencies from the
# maemo-sdk-dev meta-package
# How you get this done is up to you.
# I did this by hand in chunks of 15 or so.
# Obviously, fix stuff when it breaks.

Ouch!

# After that most heinous process,
# install some non-busybox binaries from /home/user/other.tar.gz
# I compiled coreutils in FREMANTLE_ARMEL to get the i386 replacements*;
# I just copied the armel versions (I think).
# More of these non-busybox tools might be necessary for complex builds. Not sure.
# But before that, first remove the busybox links. Maybe try the following:

Code:
cd /
for f in `tar tzf /home/user/other.tar.gz` ; do
    rm $f
done
# Some files inside this archive aren't replacement files, so there will be nothing to remove, but rm should not fail for the busybox replacements.

# Did you successfully remove the busybox links from the previous step?
# If not, go no further until you verify that you did.

# You should be ready to install this small set of binaries and symbolic links
# I'm not sure what options the busybox tar has, but the following should work

cd /
tar xzf /home/user/other.tar.gz

# You might be done.
# Try building maemopad
# I haven't been able to get the builds working as user yet, so...

mkdir -p /home/user/src/maemopad
cd /home/user/src/maemopad
apt-get source maemopad
cd maemopad-2.6

# Remember, you're still root

dpkg-buildpackage -b -d -nc

# or maybe

dpkg-buildpackage -b -d -nc -rfakeroot

# These should be equivalent in this scenario

# What happened?

# If the build was successful, don't try installing until you leave the chroot.


*Scratchbox uses some i386 binary tools regardless of build architecture
Attached Files
File Type: txt chroot.sh.txt (478 Bytes, 172 views)
File Type: txt chrootrc.txt (185 Bytes, 155 views)
File Type: txt dpkg-list.txt (3.8 KB, 178 views)
File Type: gz other.tar.gz (305.7 KB, 178 views)
__________________
N9: Go white or go home
 

The Following 11 Users Say Thank You to daperl For This Useful Post:
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#32
Woops, I forgot the maemo-optify perl scripts. I'll have to deal with that later; time for sleep.
__________________
N9: Go white or go home
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#33
I realized after the PR1.1 update that it's a very bad idea to mount --bind /opt. I just got an 8GB card so I'm gonna rework everything on to that. After I fix the /opt stuff, Python should be usable in the chroot.

Also, I've added some other missing tools and packages that I will document after the migration.
__________________
N9: Go white or go home
 

The Following User Says Thank You to daperl For This Useful Post:
BruceL's Avatar
Posts: 305 | Thanked: 154 times | Joined on Aug 2006 @ Colorado
#34
Daperl, thanks for putting all that together. One comment: you tarred the other.tar.gz using the tar program included inside it. Therefore, we cannot untar it without already having that tar installed. Any chance you could retar it using the busybox tar?
__________________
Give me immortality or give me death!
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#35
Originally Posted by BruceL View Post
Daperl, thanks for putting all that together. One comment: you tarred the other.tar.gz using the tar program included inside it. Therefore, we cannot untar it without already having that tar installed. Any chance you could retar it using the busybox tar?
I was able to untar others.tar.gz with the n900 busybox tar. Did you try?

Code:
tar xzf others.tar.gz
I've included the non-busybox tar. You shouldn't have problems unzipping it with the following:

Code:
gunzip tar.gz
Attached Files
File Type: gz tar.gz (79.2 KB, 147 views)
__________________
N9: Go white or go home
 
Posts: 170 | Thanked: 75 times | Joined on Jun 2008 @ NYC
#36
Some cut and paste goodness for the horrible apt-get list.

Code:
binutils cpp-4.2 bash libgomp1 gcc-4.2 gcc-4.2-base libc6-dev libstdc++6-4.2-dev g++-4.2 readline-common netbase liblocale-gettext-perl libmagic1 python-support build-essential perl-modules perl-base patch g++ gcc perl make cpio autotools-dev m4 autoconf automake1.9 automake1.8 automake1.7 automake1.4 pkg-config libtool libtimedate-perl intltool-debian module-init-tools libpango1.0-common

cpp libgtk2.0-bin clinkc-av-dev libares-dev debhelper gettext gettext-base libcurl3-dev clinkc-dev conbtdialogs-dev libdbus-1-dev libdbus-glib-1-dev libosso-dev icd2-osso-ic-dev libconic0-dev

libopenobex1-dev libgwobex-dev osso-wlan-dev libbluetooth3-dev libiw-dev x11proto-core-dev libice-dev libsm-dev libcurl4-openssl-dev zlib1g-dev libxml2-dev libssl-dev libxdmcp-dev x11proto-input-dev x11proto-kb-dev xtrans-dev

libxcb-xlib0 libpthread-stubs0 libpthread-stubs0-dev libxcb1-dev libxcb-xlib0-dev x11proto-render-dev libxrender-dev x11proto-xext-dev x11proto-fixes-dev libfreetype6-dev libexpat1-dev libfontconfig1-dev fontconfig libglib2.0-dev hildon-games-wrapper-dev libatk1.0-dev libbz2-dev html2text libpixman-1-dev libxcb-render0 libxcb-render0-dev libcairo2-dev libjpeg62-dev

libepeg0-dev libpango1.0-dev libgvfscommon-dev libnotify-dev libhildonnotify-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libtotem-plparser-dev x11proto-xsp-dev libxsp-dev gtkhtml3.14-dev hildon-input-method-framework-dev libcanberra-dev libxfixes-dev

libxext-dev libxau-dev libxcursor-dev libx11-dev libtiff4-dev libgconf2-dev libglade2-dev libgmime-2.0-2-dev libhildon-im-ui-dev libosso-gnomevfs2-dev libhildon-thumbnail-dev libhildon1-dev libhildonmime-dev libhildonfm2-dev libosso-gsf-1-dev libtrackerclient0-dev libxft-dev libsdl1.2-dev libgtk2.0-dev osso-af-settings osso-gnomevfs-extra osso-gnomevfs-extra-dev libfontenc-dev x11proto-fonts-dev libxfont-dev libpopt-dev libxmu-headers x11proto-randr-dev

maemo-launcher-dev x11proto-record-dev x11proto-video-dev libxmu6 libxmu-dev libxmuu1 libxmuu-dev libdb1 libxpm4 libxpm-dev libxv-dev libxtst-dev libxrandr-dev libxi-dev libdb1-dev x11proto-damage-dev libxdamage-dev libxkbfile-dev x11proto-resource-dev libxt-dev libncursesw5 libncursesw5-dev libreadline4-dev libreadline4 libusb++-0.1-4c2 libusb-dev libusb++-dev libxaw7

libxaw7-dev x-dev xcb-proto x11proto-composite-dev libncurses5-dev libxaw-headers libxres1 x11proto-bigreqs-dev x11proto-dri2-dev x11proto-fontcache-dev x11proto-scrnsaver-dev x11proto-trap-dev x11proto-xcmisc-dev x11proto-xf86bigfont-dev x11proto-xf86dga-dev x11proto-xinerama-dev linux-kernel-headers libdrm-dev libpciaccess-dev libvolume-id-dev x11proto-gl-dev xserver-xorg-dev

check libasound2-dev libxres-dev libxcomposite-dev libcanberra-gtk-dev libexif-dev libsoup2.4-dev libgssdp-1.0-dev xutils-dev libgstreamer-plugins-base0.10-dev libgupnp-1.0-dev libgupnp-av-1.0-dev libltdl7-dev liboil0.3-dev libpulse-dev libsndfile1-dev libspeex-dev libspeexdsp-dev libwildmidi0 libwildmidi-dev pulseaudio-dev gstreamer0.10-plugins-bad-dev gstreamer0.10-plugins-camera-dev libiptcdata0-dev libgstfarsight0.10-dev libgupnp-igd-1.0-dev libgupnp-igd-doc libtelepathy-glib-dev libmcclient-dev libmissioncontrol-dev libnice-dev libnice-doc

librtcom-telepathy-glib-dev libsofia-sip-ua-dev libsofia-sip-ua-glib-dev libtelepathy-farsight-dev libhal-dev libhal-storage-dev mce-dev ohm-dev upstart-dev libgstreamer0.10-dev libgupnp-av-doc libgupnp-doc libmafw-doc libmafw-shared-doc libmafw-shared0-dev libsqlite3-dev libmafw0-dev libedataserver-dev libedata-book-dev evolution-data-server-dev libebook-dev libexempi-dev libgypsy-dev libmodest-dbus-client-dev tablet-browser-interface-dev links libpng12-dev mce po-debconf devscripts liburi-perl libatomic-ops-dev libhtml-tagset-perl libhtml-parser-perl libhtml-tree-perl fakeroot-net libxml-parser-perl intltool dpkg-dev gnome-common libhildondesktop1-dev libwww-perl cdbs
 

The Following 3 Users Say Thank You to Konceptz For This Useful Post:
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#37
Yeah, I was working on a nice clean room version of 51-1 when the repositories went down. I fixed the Python stuff and I hope to get back to this soon, but for the short term I have been diverted. Thanks for the list.
__________________
N9: Go white or go home
 
Posts: 44 | Thanked: 11 times | Joined on Oct 2009 @ UK, Manchester
#38
Do I really need all of this to compile simple command line progs?
 
Posts: 81 | Thanked: 45 times | Joined on Dec 2009
#39
For doing class room exercises it really should be enough to use the tcc compiler, see: http://bellard.org/tcc/ . Unfortunately it seems there is no package for it yet.

Also, note that most of the dependencies listed above are not for gcc per se, but dependencies for linking to all installed libraries and API's on the phone.
 
Posts: 107 | Thanked: 74 times | Joined on Jan 2010
#40
Hi, it may be interesting to put the sdk on an external microSD (like debootstrap but with maemo and sdk repositories), use chroot to develop and copy the results on the real OS.
Some hints for that?
 

The Following User Says Thank You to nicola.mfb For This Useful Post:
Reply

Tags
c compiler, c language, c programming, c++ compiler, c++ language, c++ programming, compile, compiler, development, maemo, on-device, on-device development, on-device programming, programming


 
Forum Jump


All times are GMT. The time now is 23:55.