wiki:ArtemisInstall

Version 4 (modified by pespin, 7 years ago) (diff)

--

Introduction

This guide applies to the HTC Artemis (P3300), which runs WinCE

This guide will show you how to have a running SHR system, using haret bootloader and booting from SD card

Kernel comes from linwizard/wing-linux project.


Build

You will need

  • For now, a Linux installation on your PC.eg., Ubuntu.
  • A working OpenEmbedded? tree (with SHR Makefile)

Configuring stuff

From now on, we'll conside that /OE is the root path of your OE tree.

Setting machine

in /OE/conf/local.conf, add (or replace in case you arelady have some MACHINE var):

MACHINE="htcartemis"

Creating new branch

As we will be modifying some OE stuff, it's better to create a separate git branch for it. For instance, in /OE/shr-unstable/openembedded/ we'll do:

$ git branch artemis master # creates a branch for all the artemis stuff we'll add
$ git checkout artemis # switch to the desired artemis branch to start using it.

Patching

At the moment of writing this patch, htcartemis OE support is not present in upstream, you'll need to apply all the patches in this dir, in order: http://pespin.espeweb.net/patches/artemis/

and after those are applied, you need to apply this little one too: http://pespin.espeweb.net/patches/0002-xorg-xserver-common.inc-change-DISTRO_XORG_CONFIG_MA.patch

Be aware that the last patch at this moment breaks buildage of SHR distro for other machines in the branch we are using, so remember switching to master branch before building for other machines

How to apply patches? It's easy. Move to /OE/shr-unstable/openemebedded, download all the patches above and then run:

$ for p in `ls *.patch`; do git apply $p; done

Bitbaking image and kernel

just run this in /OE/shr-unstable:

. ./setup-env
bitbake shr-lite-image

This can take some time. From few hours to some days, depending on the computer you are building on.

Getting the generated image and kernel

Once it has finished without errors, you'll find them in /OE/shr-unstable/tmp/deploy/images/htcartemis/

Kernel image has usually a .bin extension. rootfs image has usually a .tar.gz extension.


Installation

You will need

  • For now, a Linux installation on your PC.eg., Ubuntu.
  • a microSD
  • haret bootloader

Formatting your MicroSD card

Put your SD card into your reader, and attach your reader to your PC.

Note: You cannot format your MicroSD card in the phone. Ensure you use a reader.

Basically you will format the card in to two partitions:

  • 1st partition: <vfat> (about 64MB of space needed) where we'll put all the necessary stuff for haret to boot linux from WinCE: haret binary, haret config file, kernel binary, initramfs.cio.gz
  • 2nd partition: <ext2/3/4> rootfs partition

Filling the vfat partition

Let's suppouse your vfat partition is mounted in /media/sd1:

You'll finish having something similar to this:

-rwxr-xr-x    1 root     root         255 Jan 31 03:12 default.txt
-rwxr-xr-x    1 root     root      157.0K Aug 26 21:00 haret-pre-0.5.2.exe
-rwxr-xr-x    1 root     root        4.0M Jan  1  2000 initramfs.cpio.gz
-rwxr-xr-x    1 root     root        1.5M Aug 26 22:34 zImage

Writing haret settings

in /media/sd1/default.txt, write:

set MTYPE 1462
set KERNEL "zImage"
set INITRD "initramfs.cpio.gz"
set CMDLINE "quiet root=/dev/mmcblk0p2 init=/sbin/init rootdelay=5 loglevel=8 console=tty0 video=omapfb:accel gsm-wizard.noreset=1 gsm-wizard.noload=1 5"
log "earlylog.txt"
bootlinux

Acquiring haret

At the time when this guide is being written, the webpage where haret project is suppoused to be hosted is down for maintenance. You can download it from here.

Put it in /media/sd1/haret-0.5.2.exe.

Acquiring initramfs

At the moment I haven't tried to generate initramfs using OpenEmbedded?. You can get one from here thought.

Put it in /media/sd1/initramfs.cpio.gz

Acquiring the kernel

Get it from your tmp/deploy/images/htcartemis/zImage-htcartemis-... once it has been built by OE.

Rename it to zImage and put it in as /media/sd1/zImage

Filling the ext partition

Extracting SHR image into root filesystem.

Let's suppouse you mounted the ext partition (2nd partion in your SD) into /media/sd2.

Simply extract the tarball to it as root (very important) For instance,if the shr-image was downloaded in /home/user/Downloads/full-htcartemis.tar.gz do:

 cd /media/sd2
 sudo tar xvzpf home/user/Downloads/full-htcartemis.tar.gz
 cd

Then unmount the SD card. Ensure that you wait for the SD card to be unmounted before removing it or the reader. Then put the SD card into your phone.

Booting the phone from WinCE

Once your WinCE OS is fully loaded, go to the file explorer and open it. Navigate to your microSD vfat partition and you'll find there the haret executable you did install there before. Just run it, and a menu with a "run" button will appear. Press it, and haret will boot the linux kernel with the rootfs on the 2nd partition.

Now, wait a very long time for SHR post-install configuration screen to come up.

You'll finally see XServer appear.


Post-install configuration

Network tweaks

I don't know why usb0 network interface is not initialize correctly, and there's nothing in /etc/resolv.conf, so we need this in /etc/init.d/htcartemis:

#! /bin/sh
case "$1" in 
start)		
	echo "Running PESPIN init script"

	ifconfig usb0 192.168.2.202 >/log-pespin-ifconfig-exec  2>&1

	echo "nameserver 209.67.222.222" > /etc/resolv.conf
	echo "nameserver 208.67.220.220" >> /etc/resolv.conf

	route add default gw 192.168.2.200 metric 8
	
	;;
esac


exit 0

Then link it to runlevel 5: ln -s /etc/init.d/htcartemis /etc/rc5.d/S89htcartemis

GUI tweaks

In /etc/profile.d/elementary.sh, set the following variables:

export ELM_SCALE=1
export ELM_FINGER_SIZE=40