FDS-TEAM
Linux, Windows, Programming and more...
Linux on the hx4700: Debian Image
01 Dec 2012 22:26 CET  - 6 comment(s)

In my previous series of blog entries I described how to manually create a Debian Installation for your hx4700 and how you should configure it, to get an optimal result. I believe that some people might be interested in this, but fear to do everything on their own or just don’t have the time to do so. Due to some requests I created an (almost) ready to use image. It’s mostly the result you would get by going through all the chapters from 0 to 4, with some little enhancements. Please keep in mind that I may not have enough time to provide all new findings as updates to the image and that you may need to follow some steps from the tutorial to get the best experience.

# 1. General information about the image

If you didn’t take a look at the last chapters, I will give you a short summary about the image in a Q&A style.

Is this just a normal debian installation?

No, this image is based on a debootstraped debian wheezy installation which uses only lightweight packages (whenever it’s possible). I manually selected most of the installed packages and created an own desktop enviroment instead of just using a common one. The limited hardware (64 MB RAM, slow disk access) is not powerfull enough to use a standard desktop enviroments like LXDE or XFCE.

What are the advantages compared to Windows?

You can run any open source linux software on it (if the hardware is not too limited for it) and you will still get updates for your system. There are also some hardware enhancements, because the hardware is capable to provide more features than windows supports natively. The main enhancements are a high screen resolution (480×640 pixel), support for SDHC cards (SD cards >4 GB) and the possibility to use modern wifi encryption standards (WPA 1/2 and even WPA (2) Enterprise).

What are the disadvantages compared to Windows?

Debian is not optimized for touchscreens and you sometimes need some tricks to access all functions (like the emulation of a right click), but this is not a big problem. More problematic is the fact that Windows CE/Mobile software was optimized for small screen sizes, but debian software was written for desktop PCs. Some programs will take a long time to load, are very slow or simply don't fit on the screen.

Why should I use your Image and not one of the others?

Well, the main difference is that the other projects are created from source which is heavily patched to get the optimal experience on the hx4700. This is good for the user experience, but has many disadvantages if you want to use software, which is not supplied in the prepared image. You need to compile other programs on your own and they may require some patching as the available libraries are sometimes different than the ones used on desktop distributions. The other disadvantage is that you won't get any updates if their development freezes, which happens quite often. When using my image you can still use the normal debian package system to keep your software up-to-date and I doubt that debian will stop existing in some months .

Can you show me some screenshots?

Take a look at chapter 0.

Which hardware functions are supported?

There is a nice overview in chapter 0.

What applications are preinstalled?

The image has only a small set of programs installed, so you can decide on your own, how you are using your remaining disk space. The installed programs are:

• Dillo (configured as default browser)
• netsurf (another browser)
• Xfe, Xfwrite, Xfview, Xfpack (Filemanager, Texteditor/viewer, tool to create/extract archive files)
• Alsamixergui (a tool to configure the channels of the audio device)
• urxvt (configured as default terminal)
• some smaller utilities like htop, xcalc, …

This should give you the possibility to do the most important things without installing additional software.

Which kernel version does the image use?

I used the most recent version available, when creating the image, which was kernel 3.7-rc7. You can download the kernel config file here.

# 2. Installation

• MD5:    54ccb2b0f9625a70f35ccda9d9810d4d
Size:   2,0 MB
Kernel zImage
• MD5:    0eac75ea04a9d7cd2dc079329297b69a
SHA256: 19251884297818382e2e59f79cfdce4610b082b1d884e6afbd5d1667aacee14b
Size:   153.41 MB
image with clean apt-cache
SHA256: f8567a09a56917c728be0165a877f36d4e85dbf91f5f7eb731f3e9544babee01
Size:   327.47 MB
image with full apt-cache

## 2.2. Installation of the bootloader

Install the SDG bootloader using this tutorial in chapter 1. You can download the necessary kernel here.

If you want to keep your windows installation, you can try to use the haret bootloader. Find a copy of haret and follow an (untested!) comment of mine below this article.

## 2.3. Format your SD/CF Card

My image is too big for the internal storage and must be installed to a SD/CF card. Before we can do this, we need to format the card. Follow this tutorial to find out how. Don’t forget to setup a swap partition as the memory of the device is too small to run Debian without swap.

## 2.4. Copy image to SD/CF card

sudo tar -C MOUNTPOINT -xvpJf IMAGENAME


Replace MOUNTPOINT with the mountpoint of the system partition on your SD/CF card and IMAGENAME with either image.tar.xz or image-clean.tar.xz.

## 2.5. Correct Mountpoints

I configured the image for using a SD card, but you just need to do change two files to use it on a CF card. My image expects the swap partition to be the second partition of a SD card. To use the second partition of a CF card, open /etc/fstab and change it to:

rootfs               /                    auto       defaults              1  1
/dev/sda2            none                 swap       sw                    0  0


You should also change /etc/udev/rules.d/automount.rules, if you are using a CF card as root file system, to automatically mount SD cards:

ACTION=="add",KERNEL=="mmcblk0*", RUN+="/usr/sbin/automount.sh %k"
ACTION=="remove", KERNEL=="mmcblk0*", RUN+="/usr/sbin/autounmount.sh %k"


## 2.6. Wifi firmware

For legal reasons I can not include the wifi firmware in the image. To use wifi, you need to download RADIO0d.BIN, RADIO11.BIN and WLANGEN.BIN from the SDG website and copy the files (as root) to /lib/firmware on your card.

## 2.7. First Boot

Now you are ready to boot the system for the first time (put the SD/CF card in the device and reset it). After the SDG Bootloader screen, you should see the kernel messages scroll down.

If you are using a SD card and getting the error “Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)“, then you may need to increase the rootdelay option in your bootloader. The SD card is accessed asynchronously: The kernel sends a command to read the partition table and does not wait for the answer. If the answers takes too long, the kernel will tell you that it can’t find the root filesystem. The respond time may differ, so it just might work if you reset the device.

The first boot might take a bit longer as normal, because the prepared image has never been booted and may create some new files on the first boot. When you start the image for the first time (and only for the first time), a quick&dirty written installer will guide you through the necessary steps to enable all functions.

My self created setup script

This may take some minutes, but otherwise you are missing some fundamental stuff (like an ssh server). Most of the setup routines, can be used by tapping on the required field, but some programs require you to use the on-screen-keyboard (it will appear 2-3 seconds later). To alter the time/date, tap on the field you want to change and use the up and down keys on the keyboard to manipulate the values.

There is a bug when activating wifi for the first time, which prevents it from working, so take a look at the known bug list at the end of the page. After completing all steps, you can start using programs or connect to your pda via ssh. If you want to use the usb wired connection as ethernet device, you may need to change the settings of the network manager (it expects a dhcp server running on the remote usb host). Please don’t forget to change all passwords!

# 3. Speicific details about the image

 root: ipaq user: hx4700

You should definitely change them before connecting to an insecure network. The dropbear (ssh-server) private keyfiles were removed from the image and will be generated during the installer process.

Some libraries, which are necessary to use all preinstalled software, were not included in the image, because they may be covered by patents and illegal to distribute in some countries. At the moment this is only problematic for DeadBeef (audio player). The installer will install the necessary libraries for you. If you prefer to do it manually, use:

apt-get install libfaad2 libavcodec53 libavutil51 libavformat53 libmad0


to install them.

## 3.3. Manually running the installer again

If you want to run the installer again just execute:

sudo /usr/local/sbin/hx_setup.sh


If you want to run the installer on the next boot just delete (as root) the file /etc/hx4700_setup.
The installer allows the configuration of important system functions and creates a hole in the security concept of debian, so you may want to prevent a normal user to start the installer by removing it from the sudoers file /etc/sudoers.

## 3.4. Enable sound

The sound is muted after the installation. You must start the alsamixergui and tap on the speakers above “Mono 2 Enable”, “Left Out”, “Right Out” to enable the internal speakers and headphones (only one is active at a time). You should also raise the master volume level, because the sound is only noticeable (at least with the internal speakers) if the master volume is above ~65%. You can click on the padlock above the text, to control both channels (left & right) at the same time.

## 3.5. Known bugs and problems

Wifi does not work on the first activation

If you activate wifi for the first time, the network manager does not find any wifi hotspots. You can simply solve this problem by re-enabling the wifi device by executing twice: Menu -> hx4700 -> Toggle Wifi.

Screen rotation does not work always

I don’t have any workaround yet. The long time solution should be to patch randr support into the framebuffer driver instead of restarting the xserver.

Screen turns white in standby mode

Obviously there is a bug since kernel 3.6, which turns the screen white instead of turning it off after some time. We should take a look at the changes from kernel 3.5 to kernel 3.6 to find the regression.

Sleep mode doesn’t work yet

If you try to put the device into sleep mode (as root: echo “mem” > /sys/power/state) the kernel is unable to recover the filesystem if you are using a SD card. The kernel is not able to wake up the SD card and will fail with a kernel panic. The backlight of the screen didn’t turn on either (I am not sure, but i thought this worked with kernel 3.6), so it may be hard to see the errors (you only see them if you are not running a xserver). I cannot test it myself with a CF card, because I dont have one, which would be big enough for the image.

Known hardware problems
• The wifi driver is not completely stable yet. The image contains a patched version of wpasupplicant (see my previous blog entries), but this doesn’t guarantee that everything works always.
• Bluetooth doesn’t work. I found a solution for this problem after creating the Image, sou may need to manually follow the steps in chapter 3 to get bluetooth working.
• Fast Infrared (FIR) might not work as I couldn’t test it. This may only affect the speed, normal IrDA works.
• Video hardware acceleration not supported yet
• There is no way to control the brightness of the backlight
Multiuser setup

The image is not intended to be used as a multiuser setup, because there is no way to choose a user during the boot process. You would also need to change the sudoers file by replacing the allowed user with a user group. Additionally the bash scripts should be checked again to ensure, that they cannot be used to get root rights.

# 4. Additional Information & Questions

If you want to get more information about this image, take a look at the project info page, which contains links to the hx4700 related articles. The chapters 0 - 4 will describe the parts of the system much more precisely than this summary. If you have any questions, tips or just want to share your experience with this image, feel free to write a comment.

09 Dec 2012 21:50 CET

Ooops. Just checked. I used my own compiled kernel, but with ext4 root partition…

09 Dec 2012 21:21 CET

Yeah. I used compiled kernel… ( kernel 3.7-rc7 )

03 Dec 2012 01:13 CET

Just a hint for the other users: ext2 is compiled as module and not bootable with my provided kernel. Corvin used his own kernel or made a typo.

03 Dec 2012 00:43 CET

Hello,

I succesfully boot the image from haret on SD card (small fat16 partition for boot + ext2 partition for filesystem). Works like a charm!
Thank you for all the effort!

02 Dec 2012 16:04 CET

Hi,

I am aware of this, but I thought I’ll keep them, because some packets were replaced by altered version of mine and so you still have the original versions on the device. I also understand that people with slow internet connections would appreciate a version with an empty apt cache, so I will upload a second version later.

Michael