User:Jebba/Mer

(Installing Fremantle Packages)
(Installing Fremantle Packages)
Line 350: Line 350:
  apt-get install foo
  apt-get install foo
   
   
-
  # This will get you a working battery applet. Perhaps try rebooting after
+
  # This will get you a battery applet. It appears in the notification
-
  # installing it, and don't install other stuff which may pooch it
+
# area, but I'm not sure if it is working or not. Perhaps try rebooting
 +
  # after installing it, and don't install other stuff which may pooch it
  apt-get install hald-addon-bme bme-rx-51 status-area-applet-battery
  apt-get install hald-addon-bme bme-rx-51 status-area-applet-battery
   
   

Revision as of 05:48, 1 January 2010

Contents

N900 Install

Note, this is still in a *very* rough state. Currently, you can't recharge the battery while using Mer, nor even draw power when plugged in, so developing on it means you have to reboot just to recharge your battery. No phone calls are possible yet. Grabbing binaries of the proprietary crock from Nokia requires rebuilding packages and jumping through hoops. On the positive side, it boots. :)

You can do this without erasing your main install, FYI...


Mer Image

The latest release as of this post is 0.17testing4.

# you need an ext3 formated MicroSD card.
mount -o noatime /dev/mmcblk1p1 /media/mmc1/

# go hence
cd /media/mmc1/

wget http://stskeeps.subnetmask.net/mer/0.17testing4/mer-armel-generic-image-v0.17testing4.tar.gz

# Untar it verbosely to see the majick.
# Note this will create dirs like ./usr and ./lib etc, so you don't want stuff pre-existing in those dirs.
tar zxvf mer-armel-generic-image-v0.17testing4.tar.gz

# sync and live free!
sync

bootmenu

You need to have getbootstate version 1.0.35+0m5 or greater for this to work.

dpkg -l getbootstate

(As a side note, getbootstate is closed software. Please vote for this bug and/or clamour for it to be released as free software.)

# Grab this package:
wget http://www.daimi.au.dk/~cvm/bootmenu_1.6_armel.deb

# Be root
sudo gainroot

# Install bootmenu
dpkg -i bootmenu_1.6_armel.deb

Then tappy tap tap the bootmenu install icon and answer yes.

Now you need to set up Mer in the menu for bootmenu. See also: Mer bootmenu docs.

I put everything on the first and only partition on an ext3 formatted "external" MicroSD card (the one that's right next to the camera).

# edit/create this file to create a boot menu item for Mer:
vim /etc/bootmenu.d/mer.ext.item

# Make it look justa lika thisa:

ITEM_NAME="Mer (external SD, partition 1)"
ITEM_ID="mer"
ITEM_DEVICE="${EXT_CARD}p1"
ITEM_MODULES="mbcache jbd ext3"
ITEM_FSTYPE="ext3"
ITEM_FSOPTIONS="noatime,ro"


(Note: why jbd module needed?)

Then shutoff the phone and reboot with KEYBOARD SLID OUT, so you get the bootmenu.

Disable watchdog

You have to disable the watchdog with the flasher tool or the system will just shut down on bootup:

./flasher-3.5 --set-rd-flags=no-omap-wd

./flasher-3.5 --set-rd-flags=no-ext-wd

./flasher-3.5 --enable-rd-mode

0.17testing4 fixes for N900

# root does all
sudo gainroot

# mount up the MicroSD
mount -o noatime /dev/mmcblk1p1 /media/mmc1/

# go hence
cd /media/mmc1

Missing dir needed at boot

# create a missing directory
mkdir mnt/initfs


Need modules from kernel

# copy over modules from main OS:
cp -a /lib/modules/*  /media/mmc1/lib/modules/


Fix touchscreen

I STILL DON'T HAVE THIS WORKING.

auto-startx

To get the touchscreen working you have to edit this file: /media/mmc1/etc/init.d/auto-startx. Patch it ala:

--- etc/init.d/auto-startx.orig	2009-10-20 12:39:30.000000000 -0300
+++ etc/init.d/auto-startx	2009-12-31 13:46:06.000000000 -0300
@@ -8,6 +8,7 @@
 start)
 	if [ ! -f /etc/default/autologin ] ; then
 		if [ -x /usr/sbin/first-boot-wizard.sh ] ; then
+			TSLIB_TSDEVICE=/dev/input/event3 TSLIB_CONFFILE=/etc/ts.conf ts_calibrate
 			/usr/bin/xinit /usr/sbin/first-boot-wizard.sh 2>&1 > /var/log/first-boot-wizard.log
 		else
 			echo -n "No user specified for auto login. Creating..."


Note to self: I have a copy of this in /home/user/MyDocs/Mer, so when copying back over be sure to chmod because VFAT loses perms gah:

chmod +x /media/mmc1/etc/init.d/auto-startx

remove synaptics driver

sudo gainroot

chroot /media/mmc1 /bin/bash

dpkg --remove \
xserver-xorg-input-synaptics \
xserver-xorg-input-all

Add xserver-xorg-input-tslib

sudo gainroot

apt-get update

apt-get install xserver-xorg-input-tslib

upgrade

Note sure if it's needed, but:

chroot /media/mmc1 /bin/bash
apt-get update
apt-get upgrade

This got me new updates:

hildon-input-method libclutter-0.8-0 libetpan13 libhildon-im-ui3

The first one sounds helpful.

Set root password

Might as well set one in the chroot. I had X not come up once, but couldn't log in.

sudo gainroot
chroot /media/mmc1 /bin/bash
passwd

Misc

When you are booted up into Fremantle, it wouldn't hurt to fsck your MicroSD too....

umount /dev/mmcblk1p1 && fsck.ext3 -vvv /dev/mmcblk1p1

Automated install

Ok, here's dodgy scripts to automatically do lots of the above. I set these up because in the process of doing this I corrupted the filesystem on the MicroSD card enough times that I kept having to do this. If you don't understand what these scripts are doing, don't run them. Ah, and I use sudo lots, so you probably want do add this to /etc/sudoers:

user ALL = NOPASSWD: ALL


freemoe-mer-install

#!/bin/sh

echo "this is going to format your microsd, take care!"

read ok
read ok
exit 0 # you get this, ya?
echo
 
echo "umount /dev/mmcblk1p1"
sudo umount /dev/mmcblk1p1

echo "mkfs.ext3 -j -m1 /dev/mmcblk1p1"
sudo mkfs.ext3 -j -m1 /dev/mmcblk1p1

echo "fsck -vvv /dev/mmcblk1p1"
sudo fsck -vvv /dev/mmcblk1p1

echo "mount -o noatime /dev/mmcblk1p1 /media/mmc1/"
sudo mount -o noatime /dev/mmcblk1p1 /media/mmc1/

echo "cd /media/mmc1/"
cd /media/mmc1/

echo "tar zxf /home/user/MyDocs/Mer/mer-armel-generic-image-v0.17testing4.tar.gz"
sudo tar zxf /home/user/MyDocs/Mer/mer-armel-generic-image-v0.17testing4.tar.gz

echo "mkdir mnt/initfs"
sudo mkdir mnt/initfs

echo "cp -a /lib/modules/*  /media/mmc1/lib/modules/"
sudo cp -a /lib/modules/*  /media/mmc1/lib/modules/

echo "WARNING WARNING WARNING!!!!"
echo "Copying over NON-FREE FIRMWARE"
echo "PAY PENANCE!!!!"
echo "cp -a /lib/firmare/*  /media/mmc1/lib/firmware/"
sudo cp -a /lib/firmware/*  /media/mmc1/lib/firmware/

echo "patch -p0 < /home/user/MyDocs/Mer/auto-startx-n900.patch"
sudo patch -p0 < /home/user/MyDocs/Mer/auto-startx-n900.patch

# not needed
echo "chmod +x etc/init.d/auto-startx"
sudo chmod +x etc/init.d/auto-startx

echo "cp -p /home/user/MyDocs/Mer/mer-setup-in-chroot ./"
sudo cp -p /home/user/MyDocs/Mer/mer-setup-in-chroot ./

echo "chmod +x mer-setup-in-chroot"
sudo chmod +x mer-setup-in-chroot

echo "add . to root's PATH to help with debugging"
echo "cp -p /home/user/MyDocs/Mer/root-bashrc /media/mmc1/root/.bashrc"
sudo cp -p /home/user/MyDocs/Mer/root-bashrc /media/mmc1/root/.bashrc

echo "copy over some scripts to help with debug"
echo "cp -p /home/user/MyDocs/Mer/root/* /media/mmc1/root/"
sudo cp -p /home/user/MyDocs/Mer/root/* /media/mmc1/root/

echo "WARNING: this leaves /root with less-than-optimal perms"
echo "sudo chmod -R +x /media/mmc1/root/"
sudo chmod -R +x /media/mmc1/root/

echo
echo "now run ./mer-setup-in-chroot after you enter the chroot"
echo

echo "chroot /media/mmc1 /bin/bash"
sudo chroot /media/mmc1 /bin/bash



mer-setup-in-chroot

#!/bin/sh

# run this chrooted

echo "apt-get update"
apt-get update

echo "apt-get upgrade"
apt-get upgrade

echo "apt-get remove xserver-xorg-input-synaptics xserver-xorg-input-all"
apt-get remove xserver-xorg-input-synaptics xserver-xorg-input-all

echo "apt-get install xserver-xorg-input-tslib"
apt-get install xserver-xorg-input-tslib


auto-startx-n900.patch

--- etc/init.d/auto-startx.orig	2009-10-20 12:39:30.000000000 -0300
+++ etc/init.d/auto-startx	2009-12-31 13:46:06.000000000 -0300
@@ -8,6 +8,7 @@
 start)
 	if [ ! -f /etc/default/autologin ] ; then
 		if [ -x /usr/sbin/first-boot-wizard.sh ] ; then
+			TSLIB_TSDEVICE=/dev/input/event3 TSLIB_CONFFILE=/etc/ts.conf ts_calibrate
 			/usr/bin/xinit /usr/sbin/first-boot-wizard.sh 2>&1 > /var/log/first-boot-wizard.log
 		else
 			echo -n "No user specified for auto login. Creating..."

Installing Fremantle Packages

Mer is missing some key parts, such as charging from battery and making phone calls. The first is killer, the second is a major drawback... Nokia decided to keep these parts proprietary which makes Mer on the N900 pretty pointless actually. Gar.

So I thought I would try to install (most begrudgingly) their proprietary Fremantle battery and cell phone applications under Mer. I was able to get the battery applet and some of the hal stuff going, but I don't think it was actually *doing* andything. I then installed the cell phone application, which pretty much screwed up the install.

So, in sum, the following doesn't work, but is a possible starting point for getting battery charging working under Mer.

I didn't have access to the original .debs, so I decided to just reconstruct them from the ones already installed under fremantle. It's a bit out there, but this is how I did it:

# boot into Mer

# We'll use dpkg-repack to rebuild the .debs
apt-get install dpkg-repack

# set up nice working space:
mkdir -p /mnt/fremantle

# umount the read/write of the NAND since we crash all the time and run out of battery
umount /mnt/initfs

# Remount it read-only some place nicer
mount -o ro -t ubifs ubi0:rootfs /mnt/fremantle/

# And put /home and the infamous /opt there too
mount -o ro /dev/mmcblk1p2 /mnt/fremantle/home/

# ...and MyDocs under that
mount -o ro /dev/mmcblk1p1 /mnt/fremantle/home/user/MyDocs/

# Set up stupid symlink for the /opt mess
cd /home
ln -s /mnt/fremantle/home/opt .

# create a nice place to put the .debs we'll create
mkdir /root/REPACKS 

# go hence
cd /root/REPACKS

# take a look all those fremantle applications
dpkg -l --root=/mnt/fremantle/

# Repack some random single package
dpkg-repack --root=/mnt/fremantle/ burgerspace

# rebuild the local repo
cd /root/REPACKS
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

# Add this to /etc/apt/sources.list and perhaps comment out all the others
deb file:///root/REPACKS ./

# update from our new local repo
apt-get update

# and see that it works
apt-cache search burgerspace

# if that works, you can do them one at a time, or repack all of the 
# fremantle debs with this:
for i in `dpkg -l --root=/mnt/fremantle/ |grep ii | cut -f 3 -d " "` ;
do echo $i
	dpkg-repack --root=/mnt/fremantle/ $i
done

# Then re-run the archiverthinger
cd /root/REPACKS
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

# update
apt-get update

# now install whatever
apt-get install foo

# This will get you a battery applet. It appears in the notification
# area, but I'm not sure if it is working or not. Perhaps try rebooting
# after installing it, and don't install other stuff which may pooch it
apt-get install hald-addon-bme bme-rx-51 status-area-applet-battery

# After I installed this, I had a mess
apt-get install rtcom-call-ui

Oh, and I guess I should also point out, that all of this needs to be done because nokia is doing something funky with apt-transport-https. I tried rebuilding theirs and using it under Mer, but it barfed on libraries. I tried using the Ubuntu one but that didn't work with the Nokia repos, even after copying over /etc/apt/auth.

Another way to do this would perhaps be to apt-get mirror the repos, if possible or a --download-only type approach. I didn't have apt-transport-https working so I just did this. Time for bed.

Build Packages

Packages are built using OpenSUSE's Build Service

  • Sign up for account on OBS: jebbajeb