Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
qtmoko/doc/txt/debian_rootfs_howto.txt
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
730 lines (510 sloc)
23 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Debian rootfs | |
| ============= | |
| Step 0 - QEMU image for creating rootfs | |
| ======================================= | |
| * I used to create images straight on the device, but i dont do it anymore. | |
| * Easiest way to create tarbal and NAND images is in qemu. You can download my | |
| preinstalled qemu image from: | |
| https://sourceforge.net/projects/qtmoko/files/BuildHost/qtmoko-buildhost.tar.gz/download | |
| * Unpack the tarball, install qemu and run ./start.sh | |
| * After the system is started you can use redirected port to ssh there: | |
| ssh -p 22222 root@localhost | |
| please note that the root password is empty. | |
| * The system is very minimal, download more packages: | |
| apt-get update | |
| apt-get install multistrap cdebootstrap mtd-utils | |
| Step 1 | |
| ====== | |
| * We will be installing new image to /media/card: | |
| cd ~ | |
| cat > multistrap.conf << __END__ | |
| [General] | |
| arch=armel | |
| directory=/media/card | |
| cleanup=true | |
| noauth=false | |
| unpack=true | |
| aptsources=Grip Debian | |
| debootstrap=Grip Debian | |
| [Debian] | |
| packages=openssh-server libts-0.0-0 udhcpc iputils-ping liblcms1 libexpat1 omhacks | |
| source=http://cdn.debian.net/debian/ | |
| keyring=debian-archive-keyring | |
| suite=wheezy | |
| [Grip] | |
| packages=ifupdown net-tools procps netbase nano module-init-tools wget screen mc wpasupplicant wireless-tools iproute dosfstools fbset rsyslog psmisc iptables dash ttf-dejavu libpng12-0 libjpeg8 libxtst6 sqlite3 ntpdate libmng1 libtiff4 libvorbisfile3 libicu48 gpsd ppp rfkill libasound2 alsa-utils libcap-ng0 libcap2 libsystemd-login0 dbus libgstreamer-plugins-base0.10-0 | |
| keyring=emdebian-archive-keyring | |
| source=http://www.emdebian.org/grip | |
| suite=wheezy-grip | |
| __END__ | |
| multistrap -f multistrap.conf | |
| Step 1.2 - modified packages | |
| ============================ | |
| * wpa_supplicant has non upstream patch, bluez and gpsd-clients have useless | |
| python dependencies. See step 14 and 15 below how they are built. | |
| cd /media/card | |
| wget http://qtmoko.sourceforge.net/debian/gta02/armel/bluez_4.99-2_armel.deb | |
| wget http://qtmoko.sourceforge.net/debian/gta02/armel/gpsd-clients_3.6-4+deb7u1_armel.deb | |
| wget http://qtmoko.sourceforge.net/debian/gta02/armel/wpasupplicant_1.0-3_armel.deb | |
| wget http://ftp.de.debian.org/debian/pool/main/b/bluez/bluez-alsa_4.99-2_armel.deb | |
| mount -t proc none /media/card/proc | |
| chroot /media/card | |
| dpkg -i gpsd-clients_3.6-4+deb7u1_armel.deb | |
| dpkg -i wpasupplicant_1.0-3_armel.deb | |
| dpkg -i bluez_4.99-2_armel.deb | |
| /etc/init.d/bluetooth stop | |
| dpkg -i bluez-alsa_4.99-2_armel.deb | |
| exit | |
| umount /media/card/proc | |
| rm gpsd-clients_3.6-4+deb7u1_armel.deb | |
| rm wpasupplicant_1.0-3_armel.deb | |
| rm bluez_4.99-2_armel.deb | |
| rm bluez-alsa_4.99-2_armel.deb | |
| Step 2 | |
| ====== | |
| * Complete installation. Copy paste below in shell: | |
| mkdir /media/card/mnt/nfs | |
| mkdir /media/card/mnt/p1 | |
| mkdir /media/card/mnt/p2 | |
| mkdir /media/card/mnt/p3 | |
| mkdir /media/card/media/card | |
| echo "neo" > /media/card/etc/hostname | |
| echo "127.0.0.1 neo" >> /media/card/etc/hosts | |
| cat > /media/card/etc/network/interfaces <<__END__ | |
| auto lo | |
| iface lo inet loopback | |
| auto usb0 | |
| iface usb0 inet static | |
| address 192.168.0.202 | |
| netmask 255.255.255.0 | |
| network 192.168.0.0 | |
| gateway 192.168.0.200 | |
| up rm /etc/resolv.conf | |
| up echo nameserver 208.67.222.222 >/etc/resolv.conf | |
| __END__ | |
| cat > /media/card/etc/fstab << __END__ | |
| rootfs / auto defaults,errors=remount-ro,noatime 0 1 | |
| /dev/mmcblk0p1 /media/card auto defaults 0 0 | |
| /dev/mmcblk0p4 swap swap defaults 0 0 | |
| proc /proc proc defaults 0 0 | |
| #tmpfs /var/cache/apt tmpfs defaults,noatime 0 0 | |
| 192.168.0.200:/ /mnt/nfs nfs noauto,nolock,soft,rsize=32768,wsize=32768 0 0 | |
| __END__ | |
| cat > /media/card/etc/apt/apt.conf.d/99no-install-recommends << __END__ | |
| APT::Install-Recommends "0"; | |
| __END__ | |
| sed -i 's/\(PermitEmptyPasswords\) no/\1 yes/' /media/card/etc/ssh/sshd_config | |
| chroot /media/card /bin/sh -e <<__END_CHROOT__ | |
| echo root: root | chpasswd | |
| sed -i 's/root:.*/root:C0XOiCyzQDtsA:14973:0:99999:7:::/' /etc/shadow | |
| __END_CHROOT__ | |
| Step 3 - add more package repositories | |
| ======================================== | |
| echo "deb http://cdn.debian.net/debian wheezy contrib" >> /media/card/etc/apt/sources.list | |
| echo "deb http://cdn.debian.net/debian wheezy non-free" >> /media/card/etc/apt/sources.list | |
| echo "deb http://security.debian.org/ wheezy/updates main contrib non-free" >> /media/card/etc/apt/sources.list | |
| echo "deb http://qtmoko.sourceforge.net/debian/gta02/armel /" >> /media/card/etc/apt/sources.list | |
| echo "deb http://qtmoko.sourceforge.net/apps/all /" >> /media/card/etc/apt/sources.list | |
| echo "deb http://qtmoko.sourceforge.net/apps/armel /" >> /media/card/etc/apt/sources.list | |
| Step 4 | |
| ====== | |
| * Device drivers modules. Most of device drivers are built in kernel, but | |
| following drivers are exception. g_ether is module so that we can switch | |
| between mass storage and with ppp_generic saves space so that we fit under | |
| 2MB u-boot limit. | |
| echo g_ether > /media/card/etc/modules | |
| echo ppp_generic >> /media/card/etc/modules | |
| echo bq27x00_battery >> /media/card/etc/modules | |
| echo ohci_hcd >> /media/card/etc/modules | |
| echo ar6000 >> /media/card/etc/modules | |
| echo btusb >> /media/card/etc/modules | |
| echo bluetooth >> /media/card/etc/modules | |
| echo snd-soc-neo1973-wm8753 >> /media/card/etc/modules | |
| echo snd-soc-wm8753 >> /media/card/etc/modules | |
| echo snd-soc-dfbmcs320 >> /media/card/etc/modules | |
| echo snd_soc_s3c24xx >> /media/card/etc/modules | |
| * Edit /media/card/etc/ppp/options and replace "auth" with "noauth" | |
| nano /media/card/etc/ppp/options | |
| * Create /media/card/etc/fb.modes | |
| cat > /media/card/etc/fb.modes << __END__ | |
| mode "vga" | |
| geometry 480 640 480 1280 16 | |
| timings 40816 8 16 2 16 8 2 | |
| rgba 5/11,6/5,5/0,0/0 | |
| endmode | |
| mode "qvga" | |
| geometry 480 640 480 1280 16 | |
| timings 100000 8 16 2 16 8 2 | |
| rgba 5/11,6/5,5/0,0/0 | |
| endmode | |
| __END__ | |
| Calling "fbset qvga" and "echo qvga > /sys/class/lcd/jbt6k74-lcd/device/resolution" | |
| is needed for mplayer in 320x240 with correct colors. | |
| * Configure bluez4 for handsfreee calls, otherwise there is no sounds: | |
| nano /media/card/etc/bluetooth/audio.conf | |
| and uncomment SCORouting=PCM setting in [General]: | |
| SCORouting=PCM | |
| * Remove alsa-utils init scripts - we dont need them, we set correct alsa | |
| state ourselves when qtmoko starts up: | |
| chroot /media/card | |
| update-rc.d -f alsa-utils remove | |
| exit | |
| Step 4.5 - make it generate SSH keys on start | |
| ============================================= | |
| * SSH server keys are automatically generated during debootstrap. This can be | |
| security problem if user does not regenerate them. So we delete old keys and | |
| generate new ones during first boot. | |
| rm /media/card/etc/ssh/ssh_host_* | |
| cat > /media/card/etc/init.d/sshkeysfirstboot << __END__ | |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: sshkeysfirstboot | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Generate SSH host keys on first boot | |
| ### END INIT INFO | |
| dpkg-reconfigure openssh-server | |
| update-rc.d -f sshkeysfirstboot remove | |
| rm -f /etc/init.d/sshkeysfirstboot | |
| __END__ | |
| chmod +x /media/card/etc/init.d/sshkeysfirstboot | |
| chroot /media/card | |
| update-rc.d sshkeysfirstboot defaults | |
| exit | |
| Step 4.6 - get rid of getty in inittab | |
| ====================================== | |
| * TTY's are for logging to console which is useful only if you have USB | |
| keyboard. So tty respawning is in done in usb-host.sh script and we can | |
| comment it out from /etc/inittab: | |
| nano /media/card/etc/inittab | |
| and comment all lines with "respawn:/sbin/getty 38400 ttyX" | |
| Step 4.7 - disable logging by defaults | |
| ====================================== | |
| * We will have syslogd and klogd disabled by default. If phone works it's not | |
| needed and it saves flash memory from wearing off. It can be always enabled | |
| in settings->logging or via devtools menu or with logging_enable.sh script. | |
| chroot /media/card | |
| update-rc.d -f rsyslog remove | |
| exit | |
| Step 4.8 - fix GPRS stability | |
| ============================= | |
| * Freerunner has problem with GPRS stability. This will limit max speed on ppp | |
| insterface to 1000 bytes/s, with faster speed calypso crashes. For more info | |
| see http://docs.openmoko.org/trac/ticket/2264 | |
| cat > /media/card/etc/ppp/ip-up.d/09lindi-tc << __END__ | |
| #!/bin/sh | |
| /sbin/tc qdisc add dev ppp0 root tbf rate 7kbit latency 4500ms burst 3200 | |
| __END__ | |
| chmod +x /media/card/etc/ppp/ip-up.d/09lindi-tc | |
| Step 5 | |
| ====== | |
| * Set locale to get rid of apt-get warnings | |
| echo "LANG=C" > /media/card/etc/default/locale | |
| echo "LC_ALL=C" >> /media/card/etc/default/locale | |
| * Fix incompatible libts version | |
| cd /media/card/usr/lib | |
| ln -s libts-0.0.so.0 libts-1.0.so.0 | |
| * Remove .udev dir, that confuses udev. This dir is here after instalation and | |
| causes some error/warnings during init. Not sure what's the exact problem. | |
| cd /media/card/dev | |
| rm -rf .udev | |
| * Remove udev from startup scripts, we have devtmpfs in kernel and it's faster: | |
| chroot /media/card | |
| update-rc.d -f udev-mtab remove | |
| update-rc.d -f udev remove | |
| exit | |
| * Remove /etc/network/run and do make dir /etc/network/run | |
| Otherwise fstab mounting will fail for this directory | |
| rm /media/card/etc/network/run | |
| mkdir /media/card/etc/network/run | |
| Step 6.5 - configure gpsd | |
| ========================= | |
| * We use gpsd and it has to be configured for Freerunner: | |
| nano /media/card/etc/default/gpsd | |
| * Make sure you have these values: | |
| START_DAEMON="true" | |
| DEVICES="/dev/ttySAC1" | |
| GPSD_OPTIONS="-b" | |
| Step 7.5 - dash | |
| =============== | |
| * For faster boot (~15s) and more memory (+1MB) we use dash instead of bash. | |
| cd /media/card/bin/ | |
| rm sh | |
| ln -s dash sh | |
| Step 8 - install QtMoko | |
| ======================= | |
| * I use qemu armel host for building qtmoko package. It should be as simple as | |
| git checkout v58 | |
| dpkg-buildpackage | |
| * Note that you may need to install some dependencies before building: | |
| apt-get install libX11-dev libXext-dev libXtst-dev libasound2-dev libdbus-1-dev libts-dev libbluetooth-dev | |
| ...and checkout git submodules as it's necessary to place qt sources into qtmoko/qtopiacore/qt/: | |
| git submodule update --init | |
| * Please note that releases are made from translations branch so that we have | |
| all languages. | |
| * Now upload the package to sourceforge. In filezilla connect to sourceforge | |
| sftp and upload it to /home/project-web/qtmoko/htdocs/debian | |
| * Install it | |
| chroot /media/card/ | |
| wget http://qtmoko.sourceforge.net/debian/gta02/qtmoko-neo_58-1_armel.deb | |
| dpkg -i qtmoko-neo_58-1_armel.deb | |
| update-rc.d qtmoko-neo defaults | |
| rm qtmoko-neo_58-1_armel.deb | |
| exit | |
| killall qpe.sh # recent versions start qtmoko after install, so kill it | |
| rm -rf /media/card/home/root/* # remove all stuff created by qpe | |
| Step 8.1 - install mokofaen theme | |
| ================================= | |
| * Mokofaen is now default theme for qtmoko - but it's not part of qtmoko deb | |
| package, so that user can uninstall it to save space. So install mokofaen: | |
| cd /media/card | |
| wget http://qtmoko.sourceforge.net/apps/all/qtmoko-theme-mokofaen_3-2_all.deb | |
| chroot /media/card/ | |
| dpkg -i qtmoko-theme-mokofaen_3-2_all.deb | |
| rm qtmoko-theme-mokofaen_3-2_all.deb | |
| exit | |
| Step 8.2 - some more alarm and ringtones | |
| ======================================== | |
| mkdir -p /media/card/home/root/Documents | |
| cd /media/card/home/root/Documents | |
| wget https://github.com/radekp/qtmoko/raw/master/src/applications/clock/sounds/Alarm_Beep_01.ogg | |
| wget https://github.com/radekp/qtmoko/raw/master/src/applications/clock/sounds/Alarm_Beep_02.ogg | |
| wget https://github.com/radekp/qtmoko/raw/master/src/applications/clock/sounds/Alarm_Beep_03.ogg | |
| Step 9 - Linux kernel | |
| ===================== | |
| * Sources for qtmoko are on github: | |
| http://github.com/radekp/linux-2.6/ | |
| * Checkout branch for your qtmoko version: | |
| git checkout v2.6.39-gta02-qtmoko-v58 | |
| * Create package in buildhost: | |
| cd linux-2.6 | |
| dpkg-buildpackage | |
| * You should remove .git while building the package so that the tar with | |
| sources is not that big. The package to sourceforge. | |
| * Install kernel image: | |
| chroot /media/card | |
| wget http://qtmoko.sourceforge.net/debian/gta02/linux-image-2.6.39-qtmoko-gta02_58-1_armel.deb | |
| dpkg -i linux-image-2.6.39-qtmoko-gta02_58-1_armel.deb | |
| rm linux-image-2.6.39-qtmoko-gta02_58-1_armel.deb | |
| exit | |
| * Create boot args and symlink for qi: | |
| cd /media/card/boot | |
| echo "console=tty0 loglevel=3 rootwait" > append-GTA02 | |
| ln -s uImage.bin uImage-GTA02.bin | |
| Step 9.1 - Linux kernel cross compiling - not using anymore | |
| =========================================================== | |
| * If you want to cross compile kernel and make uboot image on PC: | |
| make CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- ARCH=arm gta02_defconfig | |
| make -j8 CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- ARCH=arm uImage | |
| make -j8 CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- ARCH=arm modules | |
| make CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- ARCH=arm modules_install INSTALL_MOD_PATH=GTA02 | |
| Step 9.2 - import QtMoko debian repository public keys | |
| ====================================================== | |
| * We use secure apt and we need keys for QtMoko repositories: | |
| cd /media/card | |
| wget https://github.com/radekp/qtmoko/raw/master/dist/qtmoko-pubring.gpg | |
| chroot /media/card | |
| apt-key add /qtmoko-pubring.gpg | |
| rm qtmoko-pubring.gpg | |
| exit | |
| Step 9.5 - remove bash history | |
| ============================== | |
| * Remove .bash_history created during install | |
| rm -f /media/card/root/.bash_history | |
| Step 9.6 - setup default DNS | |
| ============================ | |
| * So that internet works on neo, DNS used during installation is not working | |
| e.g. when installing from qemu: | |
| cat > /media/card/etc/resolv.conf <<__END__ | |
| nameserver 8.8.8.8 | |
| __END__ | |
| Step 9.9 - enable ssh access just on usb | |
| ======================================== | |
| * SSH root access can be dangerous on wifi or on GPRS, so enable it only on usb0 | |
| echo "# Enable ssh access just on usb" >> /media/card/etc/rc.local | |
| echo "ip6tables -A INPUT ! -i usb0 -p tcp --dport 22 -j REJECT --reject-with tcp-reset; iptables -A INPUT ! -i usb0 -p tcp --dport 22 -j REJECT --reject-with tcp-reset" >> /media/card/etc/rc.local | |
| * Manually edit /media/card/etc/rc.local and move "exit" 0 to the end of file: | |
| nano /media/card/etc/rc.local | |
| Step 10 - release tarball | |
| ========================= | |
| * Release tarbals are uploaded to sourceforge dir /home/frs/project/qtmoko/GTA02/ | |
| cd /media/card | |
| tar -czvf ../qtmoko-debian-gta02-v58.tar.gz . | |
| Step 11 - make ubifs images | |
| =========================== | |
| * Delete contents of boot, because for NAND it's not needed: | |
| rm -rf /media/card/boot/* | |
| * Remove doc and stuff that is not needed and makes NAND image slower: | |
| find /media/card/usr/share/locale/ -type f -exec rm -f '{}' \; | |
| find /media/card/usr/share/doc/ -type f -exec rm -f '{}' \; | |
| find /media/card/usr/share/doc-base/ -type f -exec rm -f '{}' \; | |
| find /media/card/usr/share/info/ -type f -exec rm -f '{}' \; | |
| find /media/card/usr/share/man/ -type f -exec rm -f '{}' \; | |
| rm -rf /media/card/usr/share/sounds/alsa/* | |
| rm -rf /media/card/usr/share/ssh/blacklist* | |
| * We need just 3 fonts | |
| cd /media/card/usr/share/fonts/truetype/ttf-dejavu/ | |
| mv DejaVuSansCondensed-Bold.ttf 1 | |
| mv DejaVuSansCondensed.ttf 2 | |
| mv DejaVuSansMono.ttf 3 | |
| rm *.ttf | |
| mv 1 DejaVuSansCondensed-Bold.ttf | |
| mv 2 DejaVuSansCondensed.ttf | |
| mv 3 DejaVuSansMono.ttf | |
| * Trim down midnight commander | |
| mkdir /media/card/usr/share/mc-new | |
| cp /media/card/usr/share/mc/mc.* /media/card/usr/share/mc-new | |
| mkdir /media/card/usr/share/mc-new/skins | |
| cp /media/card/usr/share/mc/skins/default.ini /media/card/usr/share/mc-new/skins | |
| rm -rf /media/card/usr/share/mc/ | |
| mv /media/card/usr/share/mc-new /media/card/usr/share/mc | |
| * Strip kernel modules a bit more (saves ~1MB) | |
| find /media/card/lib/modules/2.6.39-qtmoko-v58/ -name *.ko -exec strip -R .not -R .comment --strip-unneeded {} \; | |
| * Edit the mount for root in /media/card/etc/fstab so that it reads: | |
| rootfs / auto defaults,no_chk_data_crc,bulk_read 0 0 | |
| * Create config for ubinize and create the resulting image: | |
| cd /media | |
| cat > ubinize.cfg <<__END__ | |
| [ubifs] | |
| mode=ubi | |
| image=qtmoko-debian.ubifs | |
| vol_id=0 | |
| vol_size=230MiB | |
| vol_type=dynamic | |
| vol_name=om-gta02-rootfs | |
| vol_flags=autoresize | |
| __END__ | |
| mkfs.ubifs -r /media/card -o qtmoko-debian.ubifs -x zlib -m 2048 -e 126976 -c 2047 | |
| ubinize -o qtmoko-debian-gta02-v58.ubi -m 2048 -p 128KiB -s 2048 -O 2048 ubinize.cfg | |
| rm qtmoko-debian.ubifs | |
| Step 12 - jffs2 image (not using anymore) | |
| ========================================= | |
| * Same first 2 steps as with ubi (copy&delete /boot) | |
| * Uncomment the /var/cache/apt mount in /media/card/etc/fstab | |
| * Make jffs2 image: | |
| mkfs.jffs2 --pad=0x700000 -o qtmoko-debian.jffs2 -e 0x20000 -n -d/media/card | |
| Step 12 - qi for booting ubi image | |
| ================================== | |
| * Standard qi from openmoko git has jffs2 hardcoded as root file system. If your | |
| want to use ubi image you need patched qi. | |
| git clone git://github.com/radekp/qi.git | |
| cd qi | |
| git checkout qtmoko-v28 | |
| make CROSS_COMPILE=/opt/toolchains/arm920t-eabi/bin/arm-linux- CPU=s3c2442 | |
| Step 13 - generate Packages.gz for debian repository | |
| ==================================================== | |
| * We have debian repository at http://qtmoko.sourceforge.net/debian/ After you | |
| upload packages there (using filezilla, host is frs.sourceforge.net user is | |
| radekp,qtmoko and directory is /home/project-web/qtmoko/htdocs/debian) you | |
| have to generate Packages.gz: | |
| dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz | |
| * For secure apt you need to generate and sign Release file: | |
| apt-ftparchive release . > Release | |
| gpg -abs -o Release.gpg Release | |
| Step 14 - modified wpa_supplicant | |
| ================================== | |
| * There is a regression in wpa_supplicant affecting Freerunner. We have to | |
| install modified version with this patch reverted: | |
| diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c | |
| index 9fa356b..e44aeac 100644 | |
| --- a/src/drivers/driver_wext.c | |
| +++ b/src/drivers/driver_wext.c | |
| @@ -1007,7 +1007,7 @@ int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params) | |
| /* Not all drivers generate "scan completed" wireless event, so try to | |
| * read results after a timeout. */ | |
| - timeout = 5; | |
| + timeout = 10; | |
| if (drv->scan_complete_events) { | |
| /* | |
| * The driver seems to deliver SIOCGIWSCAN events to notify | |
| For more info check: | |
| http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679085 | |
| http://w1.fi/bugz/show_bug.cgi?id=456 | |
| http://patchwork.ozlabs.org/patch/167925/ | |
| * The modified package is now uploaded with others here: | |
| http://qtmoko.sourceforge.net/debian/gta02/armel/ | |
| Step 15 - modified bluez and gpsd-clients | |
| ======================================== | |
| * These packages in wheezy suck because they add usless python dependencies | |
| which is ~60MB | |
| * The tricks is that we rebuild them without dependencies: | |
| apt-get build-dep bluez gpsd-clients | |
| apt-get source bluez gpsd-clients | |
| * Now edit their debian/control and manually remove dependencies and rebuild | |
| packages with dpkg-buildpackage | |
| * The modified packages are now uploaded here: | |
| http://qtmoko.sourceforge.net/debian/gta02/armel/ | |
| Boot speedup | |
| ============ | |
| - replacing /bin/sh with dash, speedup 15s | |
| Ideas & TODO | |
| ============ | |
| - support for dumb batteries as described in mail | |
| "Document with answers to most popular battery-related questions is ready" | |
| http://wiki.openmoko.org/wiki/Battery_Questions_and_Answers#So.2C_how_do_i_use_.22dumb.22_batteries_with_my_freerunner.3F | |
| from Paul Ferster | |
| Creating debian cross compiling toolchain | |
| ========================================= | |
| * Install packages needed for toolchain. Use your phone and existing | |
| qtmoko-debian rootfs (ideally from chroot over NFS in /root/toolchain on | |
| your PC). (Havent found xcalibrate pkg, where is it? Is it needed?) | |
| apt-get install libasound2-dev libbluetooth-dev libdbus-1-dev libglib2.0-dev \ | |
| libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libavcodec-dev \ | |
| libswscale-dev libxsettings-client-dev libssl-dev libts-dev \ | |
| libxcomposite-dev libxcursor-dev libxdamage-dev libxfont-dev \ | |
| libxfontcache-dev libxft-dev libxinerama-dev libxi-dev \ | |
| libxmu-dev libxmuu-dev libxp-dev libxrandr-dev libxts-dev libxtst-dev \ | |
| libxxf86dga-dev libxxf86misc-dev libxxf86vm-dev zlib1g-dev \ | |
| build-essential libc6-dev libjpeg-dev libfreetype6-dev libdjvulibre-dev | |
| * Make directory for your toolchain and copy files from toolchain rootfs: | |
| mkdir -p /opt/toolchains/arm920t-eabi/arm-linux-gnueabi/lib | |
| mkdir -p /opt/toolchains/arm920t-eabi/arm-linux-gnueabi/include | |
| cp -r /root/toolchain/lib /opt/toolchains/arm920t-eabi/arm-linux-gnueabi | |
| cp -r /root/toolchain/usr/lib /opt/toolchains/arm920t-eabi/arm-linux-gnueabi | |
| cp -r /root/toolchain/usr/include /opt/toolchains/arm920t-eabi/arm-linux-gnueabi | |
| * We will use cross compiler from emdebian project. On PC add emdebian | |
| repository to your /etc/apt/sources.list | |
| deb http://www.emdebian.org/debian/ lenny main | |
| * Download needed packages | |
| apt-get update | |
| apt-get -d install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi gcc-4.3-arm-linux-gnueabi g++-4.3-arm-linux-gnueabi | |
| * Unpack toolchain packages | |
| ln -s /opt/toolchains/arm920t-eabi /opt/toolchains/arm920t-eabi/usr | |
| rm -rf /opt/toolchains/arm920t-eabi/arm-linux-gnueabi/include/c++/4.3* | |
| dpkg -x /var/cache/apt/archives/binutils-arm-linux-gnueabi_2.18.1~cvs20080103-7_i386.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/cpp-4.3-arm-linux-gnueabi_4.3.2-1.1_i386.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/gcc-4.3-arm-linux-gnueabi-base_4.3.2-1.1_i386.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/gcc-4.3-arm-linux-gnueabi_4.3.2-1.1_i386.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/g++-4.3-arm-linux-gnueabi_4.3.2-1.1_i386.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/libc6-armel-cross_2.7-18_all.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/libc6-dev-armel-cross_2.7-18_all.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/libgcc1-armel-cross_1%3a4.3.2-1.1_all.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/libstdc++6-armel-cross_4.3.2-1.1_all.deb /opt/toolchains/arm920t-eabi/ | |
| dpkg -x /var/cache/apt/archives/libstdc++6-4.3-dev-armel-cross_4.3.2-1.1_all.deb /opt/toolchains/arm920t-eabi/ | |
| * Symlinks | |
| cd /opt/toolchains/arm920t-eabi/lib/gcc/arm-linux-gnueabi/4.3.2 | |
| rm libgcc_s.so | |
| ln -s ../../../../arm-linux-gnueabi/lib/libgcc_s.so.1 libgcc_s.so | |
| * Fix problems with #include_next in stddef and others | |
| cd /opt/toolchains/arm920t-eabi/arm-linux-gnueabi/include/c++/4.3.2 | |
| find . -type f -print0 | xargs -0 sed -i 's/#include_next/#include/g' | |
| * Fix path to toolchain in package config files: | |
| cd /opt/toolchains/arm920t-eabi/arm-linux-gnueabi/lib/pkgconfig | |
| sed -i 's/\/usr/\/opt\/toolchains\/arm920t-eabi\/arm-linux-gnueabi/g' *.pc | |
| * Make paths relative in libc.so and others: | |
| cd /opt/toolchains/arm920t-eabi/arm-linux-gnueabi/lib | |
| sed -i 's/\/usr\/arm-linux-gnueabi\/lib\///g' *.so | |
| * Make the toolchain compatible with our old toolchain | |
| cd /opt/toolchains/arm920t-eabi/ | |
| ln -s arm-linux-gnueabi arm-angstrom-linux-gnueabi | |
| cd /opt/toolchains/arm920t-eabi/bin/ | |
| ln -s arm-linux-gnueabi-gcc-4.3 arm-linux-gcc | |
| ln -s arm-linux-gnueabi-g++-4.3 arm-linux-g++ | |
| ln -s arm-linux-gnueabi-ar arm-linux-ar | |
| ln -s arm-linux-gnueabi-strip arm-linux-strip | |
| ln -s arm-linux-gnueabi-ld arm-linux-ld | |
| ln -s arm-linux-gnueabi-nm arm-linux-nm | |
| ln -s arm-linux-gnueabi-objcopy arm-linux-objcopy | |
| ln -s arm-linux-gnueabi-objdump arm-linux-objdump | |