Installing Ubuntu 7.10 on a Samsung Q1U

One of the main reasons I chose the Samsung Q1U over other similar UMPCs is that it is the test device for the Ubuntu Mobile and Embedded project. However I have decided that UME is too limited in functionality for what I want a UMPC for, so I have decided to set it up dual-booting a full Ubuntu 7.10 distro alongside XP Tablet. And since no one set of instructions online worked perfectly with this exact combination of hardware and OS, I have documented the process here for others to try.

Important note for Vista users: Microsoft has completely changed its bootloading mechanism in its new OS, so if your Samsung runs Vista you'll need to look up some suitable tutorials on the web for help with the dual-booting aspects of the process before proceeding any further.

Ingredients

In addition to the Q1U itself, you will need:

  • a desktop or laptop computer with a CD burner, and a blank CD
  • a wired internet connection
  • a USB keyboard/mouse combo (e.g. the Samsung model designed for the Q1 series)
  • a USB thumb drive (1GB or larger)
  • a copy of Ubuntu 7.10

The computer can be Windows, Intel Mac or Linux (I used my MacBook). The wired internet connection is needed in order to download software onto the Q1U whilst installing Ubuntu, i.e. before the WiFi connection is configured. A keyboard is also essential, since the four-way arrow buttons on the Q1U do not work under Ubuntu.

You can get a CD of Ubuntu free from their website (http://www.ubuntu.com), or you can download the iso file and burn it to CD yourself. Note: although there are several "flavours" of Ubuntu with different desktop GUIs, some of them are not terribly stable so you are best sticking with plain vanilla Ubuntu, which uses the Gnome desktop.

You can of course use an external CD drive and install Ubuntu directly from that, but I'm assuming you don't have such a thing to hand.

Making Space for Linux

First thing you need to do is to partition your Q1U's hard drive to make room for Ubuntu. Make sure you back up any important information stored in the Windows partition before proceeding!

There are plenty of commercial programs which will allow you to do this, e.g. Partition Magic, or you could try SystemRescueCD, a free Linux-based utility which can be run from a USB stick and includes GParted (Gnome Partition Editor). I have written a short tutorial on using SystemRescueCD and GParted with the Q1U, but posted it separately to avoid cluttering up this article with optional instructions.

The Q1U already has two partitions: a small one that houses Samsung's Windows recovery software, and a large one for Windows itself, so we need to create a third partition for Linux. You probably want to allow at least 20GB for Windows, especially if you have Vista installed. Given the modest size of hard drives in these machines, a 50/50 split of the large partition should be fine. I like to create an empty partition with the disk utility, and let the Linux installer handle the job of splitting it up and formatting the space.

Ubuntu on USB

Unfortunately no one set of instructions that I found online produced a working installation for the Q1U, so I have amalgamated them: sources are given at the end of the article. This process should create a persistent USB installation that can be used as a complete "take it anywhere" Linux system, but I had no luck getting the persistent version to boot on the Q1U, so I have omitted that configuration step.

  1. Insert the CD and USB stick into your computer (if you're using a Debian Linux box, you can omit the CD and step 2, obviously)
  2. Reboot your computer into Ubuntu from the Live CD
  3. Open a terminal window and type sudo su
  4. Type fdisk -l to list available drives/partitions. Note which device is your flash drive (example: /dev/sda) Throughout these instructions, replace x with your flash drive letter. For example, if your flash drive is sdb, replace x with b.
  5. Type umount /dev/sdx1
  6. Type fdisk /dev/sdx
  7. Type umount /dev/sdx1 to ensure the 1st partition is unmounted
    • type p to show the existing partition and d to delete it
    • type p again to show any remaining partitions (if partitions exist, repeat the previous step)
    • type n to make a new partition
    • type p for primary partition
    • type 1 to make this the first partition
    • hit enter to use the default 1st cylinder
    • type +750M to set the partition size
    • type a to make this partition active
    • type 1 to select partition 1
    • type t to change the partition filesystem
    • type 6 to select the fat16 file system
    • type n to make another new partition
    • type p for primary partition
    • type 2 to make this the second partition
    • hit enter to use the default cylinder
    • hit enter again to use the default last cylinder
    • type w to write the new partition table
  8. Type mkfs.vfat -F 16 -n ubuntu710 /dev/sdx1 to format the first partition
  9. Type umount /dev/sdx2 just to ensure the 2nd partition is unmounted
  10. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
  11. Remove and re-insert your USB stick
  12. Back at the terminal, type apt-get update
  13. Type apt-get install syslinux mtools
  14. Type syslinux -f /dev/sdx1
  15. Type cd /cdrom
  16. Type cp -rf casper disctree dists install pics pool preseed .disk /media/ubuntu710
  17. Type cp isolinux/* md5sum.txt README.diskdefines ubuntu.ico /media/ubuntu710
  18. Type cp casper/vmlinuz casper/initrd.gz install/mt86plus /media/ubuntu710
  19. Type cd /media/ubuntu710
  20. Type mv isolinux.cfg syslinux.cfg
  21. Edit syslinux.cfg in your favourite text editor, as follows:
    • Search and replace /casper/ with nothing
    • Search and replace /cdrom/ with nothing
    • Search and replace /install/ with nothing
  22. Exit the live CD, remove the USB stick from your computer and you're done!

Booting Ubuntu

Now you are ready to install Linux. Note that you are advised to have the Q1U plugged into a wired internet connection at this point; whilst not essential, it saves a bit of work later on. I also strongly recommend that you run the Q1U on mains power rather than battery during installation, to avoid mishaps.

First, change the BIOS so that the Q1U will boot from USB. Plug in your USB keyboard and restart the Q1U, pressing F2 during the first 2-3 seconds of bootup to get into the BIOS menu. Go to the Boot menu and move the hard drive to below the USB options in the list, to ensure that the USB stick will be seen first.

Turn on the Q1U with the USB stick in place, and it should start booting into Linux and display a little menu screen. If you are given several options, choose 'Start Ubuntu in live mode', or press 'Enter' if Live is the only option given. Ubuntu will start loading, which may take a while!

You may get an error message 'user gdm does not exist'. A warning screen will then come up; press 'Enter' to close it. When a command prompt appears, type startx. XWindows should start up and take you into the Gnome desktop.

If you like, you can play around with the live version for a while, to aquaint yourself with Ubuntu. If, like me, you're impatient to proceed, skip ahead to the installation instructions!

Installing Ubuntu

Before you begin installing from the live version, do the following to ensure you will be able to see the dialog boxes on the Q1U's widescreen. Right-click on each "taskbar" of the Gnome interface, and select 'Properties' from the pop-up menu. Check the 'Auto-hide' box then click on 'Close'. You should now have a bit more screen real estate to play in.

To start the installation process, double-click on the "Install" icon on the Gnome desktop. Go through the first few screens to choose your language, time zone, keyboard layout, etc. Assuming you're using an external Qwerty keyboard, I suggest accepting the default keyboard layout, which seems to work OK with the Q1U's built-in keyboard as well as external ones.

When you reach the screen that asks "How do you want to partition the disk?", make sure you select "Manual", to avoid deleting Windows! In the next screen, the list will include the hard drive (sda) and the USB stick (sdb); the hard drive list should have two NTFS partitions listed and one 'empty'. Highlight the 'empty' line and click the 'New partition' button.

At the minimum, you will need a root partition and a swap partition. I also like to create a modest-sized FAT32 partition on dual-booting machines. It provides a useful shared storage area that can be seen by both operating systems and used to back up essential documents if you need to re-install either OS. Feel free to omit it from your setup if you prefer.

Set up each partition you need in the popup dialog box; they will not be created until the end of the installation process. I suggest the following:

SizeFilesystemMount point
5GBFAT32/mnt/share
1GB (same as RAM)swap 
remaining spaceext3/

I created them as logical partitions, as it seemed the safest option.

When you are finished, click 'Forward' to continue with the installation. The rest of the installation is pretty intuitive, and needs no special instructions.

Eventually you will reach the 'Ready to Install' screen, with a summary of your choices. Ignore the 'Advanced' button lurking in the corner! (The only install option it contains is to install Grub in a different location, which is not advised unless you really know what you're doing.) If you're happy with all the settings, click 'Install' then go and make a coffee, as the process will take a while. If you don't have a wired internet connection, the install process may complain about not being able to check for security updates, but it can be completed without them.

When it finishes, you can remove the USB stick and restart Ubuntu. It should boot back to a Grub screen that lets you choose the OS you want to boot into. Normal Ubuntu should be the top choice so you can just hit 'Enter' to continue. Ubuntu should start up and take you to a login screen, so you're ready to enjoy your new OS.

Well, not quite. Whilst sound and graphics work nicely straight out of the box, most of the other hardware does not. I will therefore spend the rest of this tutorial covering touchscreen and WiFi setup, as without those the Q1U is rather limited in its usability.

Accessibility tweaks

Because you are trying to use a desktop OS on a small screen, there are some minor changes to the GUI that will make the Q1U a lot more usable.

  1. Go to System->Preferences->Appearance->Fonts. The default font size is 10 points; try increasing them all to 12. Not only will all the text be more readable, but the buttons on window titlebars increase in size to match the font size, making them easier targets to hit. Now that's something you can't easily do on Windows! Obviously you can play around with these values until they suit you, but don't make them too small or the controls will be difficult to click on.
  2. You might also want to move and/or resize the panels (Gnome equivalents of Windows taskbars) to make better use of the widescreen. For example, you could move the bottom panel to the left side of the screen, so that there is more room for taller dialog boxes, and changed the Preferences setting on the Workspaces icons so that they are in one column rather than one row. Alternatively you can set one or both panels to Auto-hide, as we did during installation.

System tidy-up

The standard Ubuntu install naturally assumes we used a CD, so we need to make sure it doesn't try to look for a CD drive in future when making updates. Open a terminal (from Applications->Accessories) and type:

sudo vi /etc/fstab

N.B. I am accustomed to using vi, but in all the following examples you can substitute any command-line text editor such as gedit or pico

Look for a line something like:

/dev/sdb1 /media/cdrom0 udf,iso9660 user,noauto, exec 0 0

This is the install stick - comment this line out by putting a # at the beginning, or it will prevent you from using other USB sticks with the Q1U! You should also comment out /dev/sda1 (the recovery partition) as it will remove a useless icon from your Ubuntu desktop when you reboot.

Also look for the line where your root partition is mounted, i.e. /, and add the switch noatime to the options list, e.g.

UUID=69128de7-7af5-4cb2-9036-0f4926579876 / ext3 defaults,errors=remount-ro,noatime 0

This will prevent Ubuntu's rather over-enthusiastic power management from damaging your hard drive!

Save and close the file, then type

sudo vi /etc/apt/sources.list

At the top of the file you should see a line:

deb cdrom:[Ubuntu 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted

Again, comment this line out with a #.

Note that if you did the initial installation without an internet connection, the URL sources will all be commented out. If so, uncomment them now. N.B. Read the file carefully andd make sure you only uncomment the lines that were commented out by the installer - there are other source lines that are supposed to be commented out unless you choose to allow them.

Restart Ubuntu to make sure everything is OK - now is a good time to change the boot menu back to the way it was.

Touchscreen setup

The instructions I found online were spread over severalforum posts, so I have put together my own list that works with the Q1U and Ubuntu 7.10.

First you need to download the driver from http://stz-softwaretechnik.com/~ke/touchscreen/evtouch.html#download (the latest version at the time of writing was 0.8.7). Open a terminal, go to the directory where you downloaded the driver package and type

tar -xzf evtouch-0.8.7.tar.gz

sudo cp evtouch-0.8.7/evtouch_drv.so /usr/lib/xorg/modules/input/

screenshot

Next, download the calibration program from http://www.nextabyte.com/support/touchscreen/calibrator

Before you run it, you'll need to make a note of which device number is currently assigned to the touchscreen. In a terminal, type:

cat /proc/bus/input/devices

and scroll up until you find the section that includes the line Name="Touchkit Touch". A few lines is a line beginning 'Handlers'; make a note of the number after 'event'.

Close the file, go to the directory where you downloaded the calibrator and type:

sudo ./calibrator /dev/input/deviceX

substituting the number from the previous step for X. After a couple of seconds the Ubuntu desktop will be replaced by a calibrator screen. Tap on the targets as instructed. When you have finished, the program will output a set of coordinates in the terminal window. Write these down.

Now you need to configure the touchscreen. In a terminal, type

sudo vi /etc/X11/xorg.conf

and add these lines to the file, substituting the coordinates from your calibrator output:

Section "InputDevice"
  Identifier  "eGalax Touchscreen"
  Driver  "evtouch"
  Option  "Device"  "/dev/input/touchscreen"
  Option  "DeviceName"  "touchscreen"
  Option  "MinX"    "128"
  Option  "MinY"    "3847"
  Option  "MaxX"    "3915"
  Option  "MaxY"    "192"
  Option  "SwapY"   "1"
  Option  "ReportingMode" "Raw"
  Option  "SendCoreEvents"
EndSection

Then scroll down to the bottom of the file and edit it so it looks like this:

Section "ServerLayout"
  Identifier  "Default Layout"
  Screen    "Default Screen "
  InputDevice "Generic Keyboard"
  InputDevice "Configured Mouse"
  InputDevice "eGalax Touchscreen" "SendCoreEvents"
EndSection

Save and exit the file. Back to the terminal, type:

sudo vi /etc/udev/rules.d/10-local.rules

(if the file doesn't exist, you will need to create it) and add the line:

SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="Touchkit Touch", SYMLINK+="input/touchscreen"

Save and exit the file. Finally, type

sudo vi /etc/modprobe.d/blacklist

and add this at the end of the file:

# fix for Q1U Touchscreen
blacklist usbtouchscreen

Save and exit once more. Restart the Q1U and your touchscreen should be working.

Suspend/hibernate

Like many other laptop users, I have found that the acpi tools in Gutsy simply don't work. I have managed to get some degree of suspension/hibernation working, though it seems to be a bit buggy!

I did this by installing uswsusp:

sudo apt-get install uswsusp

During installation I got an error message saying the program was unable to recognise my swap space - maybe it wasn't big enough? Anyway, the following steps fixed it:

  1. Type cat /etc/fstab and make a note of the device number for your swap space (mine is /dev/sda6)
  2. Type sudo vi /etc/uswsusp.conf and replace the UUID of your swap space with the full device address (e.g. /dev/sda6)
  3. Save the file, then type sudo dpkg-reconfigure uswsusp. You should now be led through a series of configuration screens. I selected the default settings, as they looked sensible.
  4. Type cd /usr/lib/hal/scripts/linux/ and make backups of the following files: hal-system-power-suspend-linux and hal-system-power-hibernate-linux
  5. Open the 'suspend' file in your usual text editor (using sudo) and replace the contents with:
    #!/bin/sh
    /sbin/s2both
    
  6. Open the 'hibernate' file in your usual text editor (using sudo) and replace the contents with:
    #!/bin/sh
    /sbin/s2disk
    

On my system the 'Hibernate' button disappeared after I installed uswsusp, and though the first 's2both' output command-line messages, after that use of the 'Suspend' button produced strange patterns on-screen (though the system seemed to suspend pretty well).

You should now have a working tablet UMPC.

Acknowledgements

I could not have completed this installation without the help of everyone who has posted useful instructions on the web:

and various other contributions from the ubuntu forums. Thanks, guys!


Opera web browser - download
Made with Cascading Style Sheets