Theme Package - 14pt Fonts

April 28, 2006 on 10:04 am | In maemo, nokia770 | 1 Comment

Following up on a post last week, I took the 4 standard themes and modified the default font to 14pts (instead of 16.75) and packaged them. When installed, they are at /var/lib/install/usr/share/themes.

Since the maemo theme manager only looks at /usr/share/themes for themes, I had to write a setup script located in /var/lib/install/usr/opt. It creates symbolic links, so that removing the package really removes them.

Install

  1. Install the theme package
  2. Open xterm, enter ’sudo gainroot’
  3. enter ’su -’
  4. enter ‘cd /var/lib/install/usr/opt’
  5. enter ‘./setup-themes-14pt.sh’
  6. the themes should now be visible under the personalization applet.

the package is at

First note - If you are going to remove this theme package, run the setup script with the ‘restore’ parameter. I am not sure how the 770 would react with empty theme links. It should be fine, but it has not been validated (yet).

Second note - If you uninstall these themes while one of them is the active theme, it would probably brick your 770 (requiring a firmware flash). I have verified that if you trash the active theme (for any reason), it will probably get stuck in a continuous boot cycle. (you been warned)
ubergEEk

PS - Like everything else on this blog, use at your own risk. Just because it worked for me, does not mean I assume responsibility for anything you do.

Metapackage : osso-xterm

April 27, 2006 on 12:32 pm | In maemo, nokia770, packaging | 3 Comments

First - A metapackage is a aggregated package that contains the contents of several other packages.

Metapackages are useful if you find yourself re-installing the same packages, in the same manner often. One that screams out to be packaged for me is a osso-xterm metapackage. The quandary with all metapackages is to be both complete as possible within a given context, and yet contain nothing extra. And of course have the widest possible appeal. I selected:

  • osso-xterm
  • tiny-vim
  • slocate
  • openSSH
  • usbnet.sh

In addition, i split my fixup scripts into three pieces, and rewrote them with full restore functions.

Firstly - If you are planning on installing this metapackage, remove any of the packages identified above. My package will overwrite them and (pkg management) confusion will result if you try to remove them afterwards.

The three scripts are:

  • setup-meta-xterm-2006.04.27.sh - creates symbolic links, configures vim, openssh and allows for a complete restore (if needed).
  • automount-mmc.sh - patches the OS for automounting of a second rs-mmc partition. also includes a full restore.
  • filemgr-fixup.sh - maps the root filesystem and /MMC into the filemanager. also includes a full restore.

After an install, these scripts are located in /var/lib/install/usr/opt.

Installation

  1. remove any packages this metapackage may overwrite
  2. install the xterm-metapackage
  3. open xterm
  4. enter ’sudo gainroot’
  5. enter ’su -’
  6. (optional) passwd setup - if you haven’t set it up already
    1. enter ‘passwd -l root’
    2. enter ‘passwd root’ (and set the root password)
    3. enter ‘passwd user’ (and set the user password)
  7. enter ‘cd /var/lib/install/usr/opt’
  8. enter ‘./setup-meta-xterm-2006-04-27.sh’ this will take a few minutes
  9. (optional) enter ‘automount-mmc.sh’ to automount a 2nd rs-mmc partition.
  10. (optional) enter ‘filemgr-fixup.sh’ to provide file manager access to your root filesystem.

I have tested the script for both installation and restoral several times on my 770, but that is not a validation that they will run correctly in all scenarios.

The package is at

ubergEEk

PS - Like everything else on this blog, use at your own risk. Just because it worked for me, does not mean I assume responsibility for anything you do.

Fixups part 1.1

April 26, 2006 on 10:33 am | In Uncategorized | No Comments

well i found a few bugs in the script, and have updated it. there are more changes to come. For now, i would ask that users refrain from using the fixup script until i have a clean version.

uber-gEEk

Personalizing Startup Images / BlueSun Hack

April 21, 2006 on 1:51 pm | In maemo, nokia770 | 3 Comments

After the first couple thousand times you reboot your 770 and look at the bland blue Nokia logo and the pair of pedophilic hands, you are thinking it is time for now startup images. It is a simple enough hack, and here are the rules.

  1. The images must be PNG format, no larger than 800×480, and up to 24bit color depth.

There are three images displayed at startup. These are:

  1. The first Nokia Image - Have not been able to change that. I have not dug far enough to find out where it is. I suspect it is being called as part of the kernel splash routine.
  2. The second Nokia Image - /usr/share/icons/hicolor/scalable/hildon/qgn_indi_startup_nokia_logo.png. This image has the dimensions of 415×68.
  3. The hands image - /usr/share/icons/hicolor/scalable/hildon/qgn_indi_nokia_hands.png. This image is 800×480.

I grabbed a couple of thematic images from the web

bluesun logo

and the second one

serenity logo

I backup the current images, and copied / renamed the new images to the appropriate directory (to replace the two original image files). The bluesun logo replaced the Nokia logo and the Serenity logo replaced the hands.
After a restart, i now have a more unique set of 770 startup images.

NOTE - I tried padding the bluesun logo out to 800×480 in order to cover the green debug text, but got a completely blank screen with that. So 780×480 works and 800×480 does not (For the Nokia Logo image only). Not sure why. One pixel smaller than max may be sufficient to function, but i am out of time for this today.

ubergEEk

PS - Like everything else on this blog, use at your own risk. Just because it worked for me, does not mean I assume responsibility for anything you do.

Scaling / Changing the System Fonts

April 21, 2006 on 10:19 am | In maemo, nokia770 | No Comments

I would like to add yet one more thing to the list of things that should be user configurable (on the 770), but is not. The selection of System Fonts and System Font sizes. The 770 display has one of the highest pixel densities available, yet the system font is 16.75 points. For everything. Yes, I may be getting old and my eyes arent as sharp as they used to be, but I would like the option of tweaking the system font to fit how i see. Not some demographic profile. I would also like to be able to do in a few easy steps without having to write my own theme.

At some point, i may write a script for this (or maybe somebody else will). Until then i have the following process.
NOTE - Before you start editing your favorite theme, make sure it is NOT the current and active theme.

  1. Open a xterm window and enter ’sudo gainroot’
  2. Enter ’su -’
  3. Enter ‘cd /usr/share/themes’
  4. Select your current favorite theme. The directory names are not exactly right, and you may have to examine ‘index.theme’ in each directory to determine the theme name (clue in line 3 of the file).
  5. When you have selected your favorite theme, enter the matchbox directory within that theme.
  6. enter ‘cp theme.xml theme.xml.baseline’ to make a backup.
  7. Edit theme.xml, and find ‘ font id=”osso-TitleFont” def=”Nokia Sans-16.75:30px” ‘ at about line 13.
  8. Change the def entry to something like ‘def=”Nokia Sans-14″ />”‘. The fonts are TTF fonts and scalable, and I am not sure what the px entry does, but it worked fine without it.
  9. Save and exit the file. Enter ‘cd ../gtk-2.0′
  10. Enter ‘cp gtkrc gtkrc.baseline’ to make a backup.
  11. Enter ‘rm gtkrc.cache’ to delete the current cached resources.
  12. Edit gtkrc.
  13. Find a font definition section from lines 253 to 294.
  14. Change all of the 16.75 fonts to 14. I left the rest alone.
  15. Save and exit the file.
  16. Reselect this modified theme from the home tab, and all of your system fonts should be noticably smaller but still readable (for most of us).

Of course, you can adjust as necessary to any miniscule or monstrous font of your choosing.

ubergEEk

PS - Like everything else on this blog, use at your own risk. Just because it worked for me, does not mean I assume responsibility for anything you do.

Maemo Shell Environment Fixups

April 20, 2006 on 2:28 pm | In maemo, nokia770 | 2 Comments

I am Linux geek and by definition that makes me a shell geek also. My (formerly) greatest frustration was entering long strings of commands through the pickboard interface on the 770 everytime i had to reflash it. Of course i wouldn’t have to reflash it so often if i wasn’t breaking the root filesystem so often. But i do.

As a result i developed a fairly consistent set of procedures for reinstallation with a supporting script. The overall impact to the root filesystem is minimal (nothing like the ravenwolf script - however i did borrow a few lines of script from it). Here it is:

Activating Debug / Root Mode (every install)

In order to place the 770 in root mode, you have to use the Linux Flasher.

  1. Boot to linux, download the linux flasher from http://maemo.org/downloads/d3.php.
  2. Connect the 770 to the USB cable (to the PC).
  3. Enter ‘chmod +x flasher’ to make sure it is executable.
  4. Enter ‘./flasher –enable-rd-mode –reboot
  5. Place the 770 in ‘brick mode’ by (a) powering it down (b) hold the home button down, (c) press the power button until the USB symbol appears at the upper right corner of the display. This mode places the internal flash memory on the USB interface so it can be updated from the PC.
  6. The 770 will reboot when it is completed.

Repartioning External Flash (as necessary)

In order to extend the root file system and create a swapspace on the external flash card, we need to repartition the card. The first partition must be the VFAT partition. Maemo treats this partiton as special, in that it maps into the file manager directly and will map to the USB interface when the connected to a PC (but only if it is VFAT). Any other Linux partition can be persistantly mounted by the 770. By creating symbolic links from this partition back to the root file system, we can offload the internal memory.

  1. Boot your PC to Linux. Login as root.
  2. Connect the 770 to the USB.
  3. enter ‘mkdir /mnt/770′ to create a mount point.
  4. enter ‘fdisk /dev/sda’ to repartition the card. Delete the current vfat partition, create a new (smaller) vfat partition1 and a linux partition for the balance of the card. Write the partition table and exit.
  5. enter ‘mkfs.vfat /dev/sda1 to create the vfat filesystem.
  6. enter ‘mkfs.ext2 /dev/sda2 to create the ext2 filesystem. ext3 is not appropriate for a flash file system.
  7. enter ‘mount /dev/sda2 /mnt/770′ to mount the ext2 partition.
  8. enter ‘dd if=/dev/zero of=/mnt/770/swapfile bs=1024 count=24576′ to create a swapfile.
  9. enter ‘mkswap /mnt/770/swapfile’ to format it as a swapfile
  10. enter ‘umount /mnt/770′ to unmount the partition.
  11. unplug the 770 from the computer and reboot the 770.

Installations Part 1 (every install)

Before we can do anything interesting with our Nokia 770 we need to have the following mimimal applications installed. These include:

These tools will allow you to open a terminal and edit. After installation follow these steps to configure and verify operation.

Updating Passwords

There are two users defined on the maemo image. These would be ‘user’ with no password , and ‘root’ with a password of ‘rootme’. Update the passwords as follows:

  1. Open xterm.
  2. enter ’sudo gainroot’ to change user to root.
  3. enter ’su -’
  4. enter ‘passwd -l root’ to lock the root account.
  5. enter ‘passwd root’ to change the root password
  6. enter ‘passwd user’ to change the user password

Installing Apps Part 1

In this section we will install the baseline applications for the nokia 770. These include:

Running the Filesystem Fixups

Copy the following script into a file and execute from the root of the filesystem. It creates a number of symbolic links so that all of the binaries are now in the path, the lib paths are updated and a few files in the ‘wrong place’ are linked to the more appropriate location. The most invasive fixup is to automount /dev/mmcblk0p2 (as ext2 filesystem) at /MMC, if it exists.

Each fixup tests to determine if it has already been ‘fixed’, and only applies the fixup if necessary, so it can be run multiple times without impact.

#!/bin/sh
 MMC_Mount=/MMC
MMC_Device=/dev/mmcblk0p2
#
#       test if user is root / exit if not
#
if [ `id -u` != 0 ]; then
        echo $0: only root can do that && exit
fi
#
#       MMC automount code
#
if [ ! -e $MMC_Mount -a -b MMC_Device ]; then
        echo "creating $MMC_Mount mountpoint and automounting $MMC_Device"
        cd /
        echo $0: save | tee -a $MMC.log
        cp -p /etc/fstab /etc/fstab.baseline
        echo /dev/mmcblk0p2 $MMC ext2 defaults,noatime 0 0 >>/etc/fstab
        cp -p /etc/init.d/minircS /etc/init.d/minircS.baseline
        sed -ir 's|(/sbin/udevstart)$|1;mount /dev/mmcblk0p2|' /etc/init.d/minircS
        cp -p /etc/init.d/minireboot /etc/init.d/minireboot.baseline
        sed -ir 's|(/media/mmc1)|/dev/mmcblk0p1 /dev/mmcblk0p2|' /etc/init.d/minireboot
        cp -p /etc/init.d/minishutdown /etc/init.d/minishutdown.baseline
        sed -ir 's|(/media/mmc1)|/dev/mmcblk0p1 /dev/mmcblk0p2|' /etc/init.d/minishutdown
        mkdir -p $MMC && mount /dev/mmcblk0p2
else
        echo "either $MMC_Mount already exists or $MMC_Device does not exist - bypassing automount scripts"
fi
#
#       linking the install directories into the path
#
if [ ! -d /usr/local ]; then
        echo "/usr/local does not appear to exist - creating"
        mkdir /usr/local
else
        echo "/usr/local appears to exist"
fi
#
if [ ! -h /usr/local/bin ]; then
        echo "/usr/local/bin symbolic link does not appear to exist - creating"
        ln -s /var/lib/install/usr/bin /usr/local/bin
else
        echo "/usr/local/bin symbolic link appears to exist"
fi
#
if [ ! -h /usr/local/sbin ]; then
        echo "/usr/local/sbin symbolic link does not appear to exist - creating"
        ln -s /var/lib/install/usr/sbin /usr/local/sbin
else
        echo "/usr/local/sbin symbolic link appears to exist"
fi
#
if [ ! -h /usr/local/lib ]; then
        echo "/usr/local/lib symbolic link does not appear to exist - creating"
        ln -s /var/lib/install/usr/lib /usr/local/lib
        echo "refreshing lib cache"
        ldconfig
else
        echo "/usr/local/lib symbolic link appears to exist"
fi
#
#       Linking the MMC and / directories into the File Manager
#
if [ ! -h /home/user/MyDocs/Root ]; then
        echo "/home/user/MyDocs/Root symbolic link does not appear to exist - creating"
        ln -s / /home/user/MyDocs/Root
else
        echo "/home/user/MyDocs/Root symbolic link appears to exist"
fi
#
if [ ! -h /home/user/MyDocs/MMC ]; then
        echo "/home/user/MyDocs/MMC symbolic link does not appear to exist - creating"
        ln -s /MMC /home/user/MyDocs/MMC
else
        echo "/home/user/MyDocs/MMC symbolic link appears to exist"
fi
#
#       Fixing up slocate
#
if [ ! -d /var/lib/slocate ]; then
        echo "/var/lib/slocate does not appear to exist - creating"
        mkdir /var/lib/slocate
        groupadd slocate
        usermod -G slocate user
else
        echo "/var/lib/slocate appears to exist"
fi
#
#       Fixing up dpkg
#
if [ ! -h /var/lib/dpkg ]; then
        echo "/var/lib/dpkg symbolic link does not appear to exist - creating"
        ln -s /var/lib/install/var/lib/dpkg /var/lib/dpkg
else
        echo "/var/lib/dpkg symbolic link appears to exist"
fi
#
#       Fixing up OpenSSH application links
#
if [ ! -h /var/lib/install/usr/bin/scp ]; then
        echo "/var/lib/install/usr/bin/scp symbolic link does not appear to exist - creating"
        ln -s /var/lib/install/bin/scp /var/lib/install/usr/bin/scp
else
        echo "/var/lib/install/usr/bin/scp symbolic link appears to exist"
fi
#
if [ ! -h /var/lib/install/usr/bin/ssh ]; then
        echo "/var/lib/install/usr/bin/ssh symbolic link does not appear to exist - creating"
        ln -s /var/lib/install/bin/ssh /var/lib/install/usr/bin/ssh
else
        echo "/var/lib/install/usr/bin/ssh symbolic link appears to exist"
fi
#
if [ ! -h /var/lib/install/usr/bin/skey ]; then
        echo "/var/lib/install/usr/bin/skey symbolic link does not appear to exist - creating"
        ln -s /var/lib/install/bin/skey /var/lib/install/usr/bin/skey
else
        echo "/var/lib/install/usr/bin/skey symbolic link appears to exist"
fi
#
if [ ! -h /var/lib/install/usr/sbin/sshd ]; then
        echo "/var/lib/install/usr/sbin/sshd symbolic link does not appear to exist - creating"
        ln -s /var/lib/install/sbin/sshd /var/lib/install/usr/sbin/sshd
else
        echo "/var/lib/install/usr/sbin/sshd symbolic link appears to exist"
fi

Configure the ssh server

  1. Open xterm.
  2. enter ’sudo gainroot’ to change user to root.
  3. enter ’su -’
  4. enter ‘cd /var/lib/install/sbin’
  5. enter ’sh ./setup.sh’
  6. reboot the 770. open a network connection on the 770, and ssh to the 770 from a PC.
  7. complete any command line configuration from the ssh session.

Configuration Part 2

  1. Open an xterm session
  2. enter ’sudo gainroot’ to change user to root
  3. enter ’su -’ to get the full environment
  4. FYI - most applications install everything under /var/lib/install/usr/, and that is not in the path. So we create a symbolic link into a section of the path this is appropriate.
  5. enter ’slocate -u’ to update the locate database. (takes a long time)
  6. enter ‘cd ~’
  7. enter ‘vim .vimrc’
  8. within vim insert ’set nocompatible’, and then save and exit.

We now have installed a xterm, vim and mapped the directories so these applications are directly invokable.

Of course the fixup script is available at maemo.feelslikeburning.com

ubergEEk

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^