Home Desktop (Advanced • Customizing the HP t5325 with opening the box

Customizing the HP t5325 with opening the box

 - 

In my earlier post, we started modifying the t5325 without opening the box. This time we’ll try to achieve the same, but with the use of the serial connection. Via this way we can load and boot our own kernel, change the root device etc, thus giving more control over the device! At the end, if you have followed this post thoroughly and no errors occur during the installation, you will have the latest kernel running with Debian Squeeze, later partially upgraded to Sid for extra functionality and a complete Gnome desktop for your needs!

Downloads
Some software is provided on my downloads page, see below:
Downloads

uBoot
Since this is a Kirkwood based board, there is uBoot again, however, there is one major plus on this uBoot: HP didn’t protect it, so you can actually modify everything inside uBoot, including the bootargs etc!

Serial header
To reach the serial header, remove the screw on the back and slide the back panel off the device and slide the top case off. If you have the front of the device towards you there will be a COMAconnector in the bottom left (near the speaker). This is your serial header, this uses a 4-pin JST connector and I got a bundle of these connectors off eBay for $1, which gave me 10 of these connectors with 4 wires already connected to them.
The pinout is, with the device facing towards you: 3V3, TxD, RxD and GND. I used a CP2102 USB -> TTL converter and on connecting, it’s done as follows:
GND -> GND
RxD -> TxD
TxD -> RxD
3V3, not used, not needed with this converter (this converter is USB powered, so not needing the 3V3 for this purpose, also the HP is powered, so not needing added power)

Kernel
You can build a kernel using the kirkwood kernelconfig, there is one major point to look out for and that is the XGI display driver, since this driver is staging, this needs to be extra specified in Device Drivers -> Staging Drivers, and disable the option “Disallow staging drivers from being built”, once disabled, you’ll see all the staging (testing) drivers in the current kernel, there is your XGI display driver. Also, if you want to have sound on the t5325, enable Alsa and enable the SoC audio options for the t5325 (you’ll notice the options directly).
I’ve also shared my working kernel for the t5325 on my Downloads page, check it out, if you don’t want to compile a kernel of your own.

Storage
The internal storage is not sufficient for normal usage (I’ve prepared this as a rescue zone), so your options are using an USB flash/harddisk or NFS storage, my main focus will be the USB hard disk storage using a 80 Gb Hitachi disk, which should provide enough space for this box.

Display
The xorg XGI display driver is not available in the armel repo’s of Debian, luckily there was a dude that built the XGI driver from source, creating the armel deb package for our needs, it’s available in my Downloads section.

Overall preparations
Make sure you have the right cables and are able to connect to the HP via serial line and are able to see the uBoot output and can input text into it. Also prepare the harddisk for usage with the device, prepared rootfilesystems are available on my Downloads page. Also see my post on how to prepare your harddisk for use. When that’s done, make sure you’ve got the kernel ready for load. In my case I use tftp to load the kernel.

uBoot preparations
There are IP-addresses set in uBoot, but they are wrong in my case, I want to set these first, else I am not able to load the kernel via TFTP (reflect these with your own values):
setenv serverip 192.168.0.75
setenv gatewayip 192.168.0.1
setenv ipaddr 192.168.0.150
saveenv

Also, the default bootargs part is not set, so I’ll do that now, note that the second disk will be sdb:
setenv bootargs console=ttyS0,115200 root=/dev/sdb1 rw init=/sbin/init video=xgifb rootwait
saveenv

The rootwait flag is for the USB device to let the kernel know it has to pause until the device becomes ready. The video flag is for setting the display device.
Since I’m using TFTP to load the kernel, I want to set this at boot time using the bootcmd option:
setenv tftp_boot tftp 00800000 t5325\; bootm
saveenv

Now I’ve set the bootcommand, the actual bootcmd will be changed at the end to prevent hassle during the installation.
And, at last, we want to change the bootdelay, now on 1 second, you really need to be fast and is annoying during this part of the setup, change it to it’s maximum value, 3:
setenv bootdelay 3
saveenv

Installation 1: The preinstall and setup
Now that you have your disk prepared, have your kernel waiting for you and having uBoot configured, it’s time to start the first install round. Hook up the disk via USB and for this instance you need to set a different set of bootargs and do not need to be saved:
setenv bootargs console=ttyS0,115200 root=/dev/sdb1 rw init=/bin/bash video=xgifb rootwait
Since you’ve set the tftp_boot command, you can issue this command to load and execute the kernel:
run tftp_boot
You’ll be left with a prompt if all goes well, first we need to set the PATH variable:
export PATH=/usr/sbin:/usr/bin:/bin:/sbin:/debootstrap
Now start the second stage of Debootstrap:
cd /debootstrap
debootstrap --second-stage

Wait for it to install, should be ready in a couple of minutes. When done, edit some configuration files which are necessary, starting with fstab:
nano /etc/fstab
Add the following 2 lines and save it afterwards:
/deb/sdb1 / ext3 defaults 0 0
/dev/sdb2 none swap defaults 0 0

Now edit the inittab file and save your settings:
nano /etc/inittab
Add the following line on a empty line:
S0::respawn:/bin/bash
This will give you serial access to the box once booted in different runlevels.
Now edit the APT sources.list, for now we’ll use squeeze, but will partly upgrade to sid later on.
nano /etc/apt/sources.list
Add the following line:
deb http://ftp.nl.debian.org/debian squeeze main contrib non-free
Change the country code (NL) to the one matching yours for better connection speeds!
Now open up your interfaces file to establish a basic DHCP connection (will be managed via Gnome later on):
nano /etc/network/interfaces
Add the following lines for lo and eth0 support:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

Set the root password now:
passwd root
Enter the password you want twice.
That’s it! Now you’ve installed a basic Debian Squeeze system on your t5325, now it’s time to restart the device and let it boot the new Debian system. Since a reboot won’t work, power off the device and re-power it on. Cancel the autoboot by hitting any key within the 3 second span and move on to the next part, the actual installation!

Installation 2: Installing the desktop
If all went correct you’re now again at the uBoot prompt, now boot the kernel again, but this time we are using the preset bootargs to actually boot the new Debian system, start:
run tftp_boot
When left at the prompt again, but this time you have complete access to the Debian environment, on some systems the swapspace does not setup properly, that’s corrected this way, preparing it for swap and activating it, this is a one-time action:
mkswap /dev/sdb2 (assuming your swap partition is number 2)
swapon /dev/sdb2

Now we can actually install the desktop, for this box I’ve choosen Gnome / LXDE and XFCE4, I’ve installed all 3 of them, since space is of no issue to me and for testing the box, it’s handy to have them installed. They will be driven via GDM3 (much faster than 2).
First update your packagetree and start installing some base tools:
apt-get update
apt-get install vim vim-doc vim-scripts
(I tend to use vim alot)
Also, since this is an ARM box, sometimes you’ll have to build software from source, to install this suite do:
apt-get install build-essential
The above is not necessary for running a desktop, but can come handy when needed to recompile software which are available as source, but not as a package.
Now we start installing our desktop, I’ll install everything in one batch, but you can leave out the stuff you don’t want:
apt-get install gdm3 gnome lxde xfce4
This will take a good while to install (15 minutes on my t5325).
Now install the prepared Xorg XGI debian package, download and install it:
wget lacie.busfreaks.nl/dls/xserver-xorg-video-xgi_1.6.0-1_armel.deb
dpkg -i xserver-xorg-video-xgi_1.6.0-1_armel.deb

When it’s done, give GDM a restart, if all goes well, you’ll see a graphical login prompt, altho, you cannot login yet, move on to the next part. (if you have compiled the kernel with XGI support):
/etc/init.d/gdm3 restart

Installation 3: Installing apps
Now that your desktop is actually running like a desktop, it’s time to install some apps that should be installed on a good desktop (note that this is my opinion, you may install whatever you like).
Now that our base system is installed, we are going to switch to sid since this unstable repo offers the latest on armel software:
nano /etc/apt/sources.list
Replace the squeeze with sid , save and update, but do NOT upgrade:
apt-get update
Within sid, there is LibreOffice (the non-Oracle branded version of OpenOffice), which we want to install, since I don’t need the whole suite, but only the Writer app, I’m installing that:
apt-get install libreoffice-writer
Also, some multimedia apps are handy. There’s Rhythmbox in Gnome, but having VLC is a nice addon:
apt-get install vlc
For internet browsing we’ll use IceWeasel (rebranded Firefox):
apt-get install iceweasel
For emailing you can use Evolution within Gnome, but IceDove (rebranded Thunderbird) is handy:
apt-get install icedove
That would be about it, install all other software you would like as well. Since we upgraded to sid repo, we need to do an upgrade, not mistaken by a dist-upgrade. Note that doing a dist-upgrade will break your xserver, as it will remove the XGI driver. Doing an upgrade will upgrade the common libraries and software, but leaves out Xorg:
apt-get upgrade

Installation 4: Adding users and logging in
Now that the installation is almost complete, we get to the step where we can configure the users that are able to login, this is a simple task:
adduser username
Replacing username for the username you want to add.
Now that you’ve added user(s), try to let one login with it’s given password and see if everything works well. When all works, log out and continue, you’re almost done!

Installation 5: Setting tftp_boot default in uBoot
Now that the installation is finished on your machine, it’s time to make some changes to uBoot so it knows that it boots from TFTP (my case). Reboot your installation:
reboot
When back in uBoot make the following change and save that:
setenv bootcmd tftp_boot
saveenv

Now you’ve made the TFTP boot and start permanent in uBoot. Now give a reset and check if everything starts up without your intervention, also, this time you don’t need to interrupt the bootdelay process.
reset
When everything works without your intervention and GDM shows up you know you’ve done everything right. Halt the system:
halt
When powered off, remove all the cables and put the unit back together and install it on your desired location.

That’s it!

Addendum
As noted before, once you use sid do not issue a dist-upgrade, this will break your current Xorg configuration therefore removing the XGI driver, as it is not compatible (and never will) with the newer Xorg systems.

When using the device as a full desktop you’ll notice that the device can become pretty hot, this is not a problem, I’ve installed several ARM based systems now, all gaining the same temperature and is not as temperature sensitive as Intel or AMD.

When using my kernel (for now at least), there is no audio support, I’ve built it in, but the alsa modules in the kernel are too old. It’s on my todo list to build a better kernel for this device.

If you get a garbled screen with the default X settings, try my xorg.conf file, ready on my Downloads page. I noted the garbled screen only using a VGA monitor, DVI seems to be picking the highest resolution possible as VGA does not. The maximum resolutions are 1680×1050 (16:10) and 1600×1200 (4:3).

Since this is a very long blogpost, there may be some errors in it, if you stumble upon one, let me know to fix it!

Author:langerak

8 responses to “Customizing the HP t5325 with opening the box”

  • Nigel 08-01-2014 at 11:02 Reply 

    Hello,

    I am trying to setup an attached SATA HDD (actually, an SSD) and have figured out why nobody seems to be able to get u-boot to realise a drive is attached.

    HP never added 4 resistors on the board, they are marked C80, C81, C82, C83 – 2 are locate on the upper side of the PCB and 2 are located on the lower side of the PCB – all are near the SATA0 connector/solder pads.
    I got the required series capacitors from a broken SATA HDD and soldered them to the t5325 board.

    u-boot now sees the drive and I am now trying to follow your guide to install Debian 7 onto the newly attached SSD/HDD.

    I can get through the whole install, by booting from a Thinpro created USB stick and adding the deb t5325 uInitrd.usb and uImage.usb files but can’t finally get it to boot from the HDD (u-boot settings wrong?) it just boots from the original disk as normal (this is OK as I would like to leave the original 512MB disk alone in case I want to ‘revert to original’).

    Any ideas on how to force u-boot to boot from the SSD/HDD (sdb in my case)?

    Regards,

    Nigel.


  • Nigel 14-01-2014 at 12:06 Reply 

    It’s OK, I figured it out.
    Nobody tells you to add the ‘ ‘ in some of the u-boot setenv commands 😉

    Nigel.


    • langerak 20-02-2014 at 16:04 Reply 

      Hi, good to see you figured it out already, how is the SSD performing in your t5325? What kind of speeds are you achieving?


  • Nigel 01-03-2014 at 21:49 Reply 

    Hi,

    It is not ‘supersonic’ as the SSD is low grade (cheap!).
    The SSD is a ‘half slim SSD’ and fits inside the case (just).

    I have it running in command line only (no GUI) and it works just fine.
    It is grabbing data from my weather station and formatting/presenting it to any web browser on my home network.
    I like it as it is low power, quiet and runs cool – kind of a Raspberry Pi on steroids!

    An idea of ‘speed’

    Timing the read/write of a 100Mb test file with the command

    time sh -c “dd if=/dev/zero of=testfile bs=100k count=1k && sync”

    gives…

    1024+0 records in
    1024+0 records out
    104857600 bytes (105 MB) copied, 2.84626 s, 36.8 MB/s

    real 0m26.528s
    user 0m0.010s
    sys 0m1.130s

    Cheers,

    Nigel.


  • Corvin 23-06-2014 at 22:38 Reply 

    Hi,

    I am trying to boot my T5325 form USB (one ext2 partition with kernel located in /boot) and I cannot boot any kernel listed in your downloads. Every time I try I get: “Error: unrecognized/unsupported machine ID (r1 = 0x0000020f)”
    I am accessing u-boot console over serial connection and the commands I issue are:
    usb reset
    setenv bootargs console=ttyS0,115200 root=/dev/sdb1 rw init=/sbin/init video=xgifb rootwait
    setenv mainlineLinux yes
    setenv arcNumber 2846
    ext2load usb 0:1 0x2000000 /boot/uImage
    bootm 0x2000000

    My u-boot is the original HP u-boot.

    Any idea what am I doing wrong?


  • Corvin 24-06-2014 at 00:38 Reply 

    Hi,

    I found it! The issue was I did not do saveenv and reset, but trying to set the arcNumber every boot.
    It was your post at http://forum.nas-central.org/viewtopic.php?p=12111#p12111 which helped me understand this!

    Thank you.


Leave a Reply

Your email address will not be published. Required fields are marked*

*

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.