Mer/Documentation/SmartQ Installation for the Windows user
Contents |
Introduction
This page is aimed at people who want to get set up with Mer, but don't necessarily want go around re-flashing firmware and lose the in-built Operating System on the SmartQ.
There are other how-tos on this site for the more experienced user, so this page is aimed at users who may know some stuff about Linux and/or windows, but have never done any embedded-linux stuff and/or really mucked about with memory block devices and so on.
Disclaimer: This may not be the easiest way, but I've used it a couple of times to get Mer set up and booting from the SD card. It really helps to know a bit of linux, or at least know a little about DOS, disks and partitions. Also, having a VMWare linux machine really helps to dig you out of a hole in case you muck up your SD card. :-)
OK, that's the start over, time to get setting up....
What's going to happen?
We're going to set up a 'virtual machine', which will allow us to do all this safely away from Windows. The way the smartq boots is this:-
- If a particular button is pressed, when the machine is switched on, then the SmartQ will choose to boot from the SD card. It does so by looking at the end of the card (at a particular location) for a 'bootloader'. this bootloader is a small program which hunts for a valid Linux installation on the card, and then starts booting that. So, we have to get this little chain of programs set up just right.
Shopping List
* A SmartQ 5 / 7 * 1 PC running Windows with * A vague knowledge of Linux or DOS and file systems. ** at least 1Gig RAM, ** 5 Gigs of Disk Space ** An SD card reader. ** An SD / SDHC Card with at least 6 gigs of RAM * About an hour to an hour and a half.
Getting Started
Windows
Firstly, get the PC switched on. Ah, I see you've already done that. Good thinking. Use "My Computer" to locate a drive with 5 or more gigs of space on it. Keep a note of that drive. If you can, create a folder on the root of that drive called something like "Virtual Machines".
VMWare
Right, step 2, download VMWare from [VMWare.com]. It's free, but you need to put in some name / country information. You'll have to reboot your PC a few times, but you should be used to that as a Windows owner ;-)
Ubuntu
Now, download a ready-to-go Ubuntu "Virtual Appliance". This is a fancy word for a honking-big file which is a snapshot of a Linux PC. Once VMWare is installed, there should be a link on the first window which says 'Download' or 'Get'.
- Click it, and search for an "Ubuntu 9.04 Desktop with VMWare Tools". You'll get a few hits. One will be by "Chrysaor". That's what I use, and it's fine.
- Alternatively, and more easily, go to [Chrysaor's Place] and grab one from here directly. Unzip it once it's downloaded. Inside the zip file will be an info.txt with the login credentials.
- Download it somewhere on your PC with lots of space, preferrably the location you found earlier, in a subfolder called ´Virtual Machines´ and not your desktop. Once it's downloaded it'll create 5 to 10 more files in the same place, so it ´is´ best to stick it in a subdirectory.
- Once it's downloaded, go back to VMWare and click 'Open', then surf over to the 'vmx' file you just downloaded, and sit back and enjoy the ubuntu loading screen.
´´´ŃOTE´´´ We are NOT going to harm windows. VMWare contains the Linux in a safe harness and does not change or break windows in any way.
- Once you're into Ubuntu, click on the "Devices v" button at the top, and look for your SD/SDHC card reader. Mine says "Alcor Micro Mass Storage Device". Select it, and click "Connect". Then do it again and select "Show icon in status bar". This'll make it easier to see what's happening.
Using VMWare/Ubuntu to configure the SD card
Installing Mer on the SD Card
Click the Applications>Accessories>Terminal menu inside ubuntu and open up a command prompt. Insert the SD card into your PC's SD reader, and check the little drive icon on the VMWare status bar.. it should flicker in time with the LED on your card reader...
OK, so firstly, we need to get the stuff you're going to install on the SD card. So, click the little Firefox logo at the top of the screen to get a browser, and grab the following three things:
Downloading everything
- Go to [The releases page] and grab the current stable release for your device. You want the ROOTFS version of the file, NOT the Firmware version. This will go onto the SD card to make Mer.
- Go to [ZenVoid's Blog] and grab the install-smartq-qi.sh and qi-smartq-20090612.bin files. These will make the SD card bootable.
- [Optional] If you're using 0.15testing5, you're also going to need the Marvell Wifi Drivers, so head to [Marvell.com] to get the driver.
All of this should have downloaded to your 'home' folder, or to your desktop. So, at this point we need to go to a prompt and get Mer installed.
So, click Applications>Accessories>Terminal. This will dump you at a command prompt. some useful commands are ls -l cd and sudo. You'll be seeing a lot of these.
Setting up the SD Card
So, firstly, the SD card will have been automounted, probably. Linux assigns a 'device name' to all its disks, and until you're familiar with the system, sometimes it takes a moment to locate a new drive... A quick way to find out the device name (if the drive was auto-mounted), is to run df to see the free space on all mounted disks. One disk should be mounted under /media/disk. Take a note of the disk's name, it should be /dev/sdb1 or /dev/sdc1. the important part is the "sdb" or "sdc". From now on, I'll assume it's /dev/sdb1. If you didn't see one, then you may need to ensure you've added the right drive to VMWare in the steps above.
- type sudo umount /dev/sdb1 . This will unmount the sd card ready for formatting
- type sudo fdisk /dev/sdb. this will open the disk for partitioning.
- in fdisk, type p to print the partition list, there should be one 'sdb1' of type 'FAT32'. This is the current card contents.
- Press d and hit return. This will delete the partiion. If you are asked for a partition number, enter '1'. If there are more than one partition, repeat until running p shows no partitions left.
- Press n and hit return to create a new partition.
- Press p and hit return to crate a primary partition
- Press 1 and hit return to create it as partition one.
- Press return to choose block 1 to start the partition
- Do some mental maths and work out the end block by dividing the size of the disk by the total number of blocks. So if fdisk says your 16Gig card has '1900' blocks, then that's ~8Megs per block, so it's safe to end the partition at the last-block-but-one. (Remember we're leaving at least 1 Mb for the bootloader) (If you want to add a swap partition, then choose a lower number, then repeat the partition-creation step, always remembering to leave at least 1Mb spare at the end of the card (high number).
- Press a and return to make a partition active, and choose partition 1.
- If you created a swap partition, press t and choose partition 2, and make it type 82, Linux Swap.
- Press w and hit return to write the partition table (saving your work).
- Press q and hit return to exit.
Right, that's the SD card partitioned up nicely. Time to format the partition and put Mer on there. It's likely that Ubuntu in it's ever-friendly way will attempt to re-mount the partition again. So, run sudo umount /dev/sdb1.
- Type sudo mkfs.ext3 /dev/sdb1 to format the partition ready for Mer. this will take a while, depending on the size / speed of your card.
Install the bootloader
OK, now it's time to install the Bootloader which will allow you to boot to Mer.
- Type cd and press return to go to your home folder
- Type ls -l to list all your files. If you don't see your downloaded files, they'll be on your desktop, so type cd Desktop (capitalisation is important). Type ls -l again to see your files. If you still can't see them, go into Mozilla and work out where your files ended up.
- Type sudo chmod a+rx install-smartq-qi.sh - This will make the installer script 'runnable'.
- Type sudo ./install-smartq-qi.sh /dev/sdb qi-smartq-20090612.bin - This will install the boot loader onto the SD card for you.
Install Mer
Ok, now it's time to install mer on the SD card. So we need to 'mount' the card, and move some files about. The easiest way to do this is unplug the sd card, and re-plug it, and let Ubuntu automount it. If you'd prefer to do it manually, here are some commands:-
- Type sudo mkdir /media/disk
- Type sudo mount /dev/sdb1 /media/disk
Once it's mounted, all you have to do is untar the rootfs... so assuming you have a SmartQ7, you downloaded the file mer-armel-smartq7-rootfs-v0.16testing5.tar.gz, or something similar, you should now type:-
- Type ls -l and press return and ensure you are in the same folder as the Mer file. If not, type cd (return) ls -l (return), and if it's not there, type cd Desktop (return), ls -l (return). At some point, you should find it. If not, re-download it in Mozilla, and choose to save it to the desktop.
- Type sudo mv *.tar.gz /media/disk . this will move the entire mer installation to the disk (so we can untar it easily).
- Type cd /media/disk and press return. We will now be 'on' the disk
- Type sudo untar xvf *.gz and press return. This will now untar the entire 'rootfs' to the card. (Install Mer).
After a few moments, the scrolling text will finish. We're almost there!!!
Getting the bootloader to 'see' Mer
We're almost home and dry. Just a little housekeeping to do. The bootloader is pretty smart, but it needs the 'kernel file' to have a special name so that it can find it on boot.
- Type cd /media/disk/boot
- Type ls -l and note that there's a file called 'zImage' somthing. That's the kernel file. I'll assume it's 'zImage-smartq-200932'
- Type sudo cp zImage-smartq-200932 linux-SMDK6410.bin
Getting the wifi working
- I am still trying to get this working myself... will complete when I know how.
Booting Into Mer
Bye bye PC, hello SmartQ
Unmount the card (right-click on the icon on the desktop and select unmount, or type the following. Ensure that you've closed all open windows which show the card's contents (Ubuntu may open a file browser if you chose to automount the card).
- cd (return)
- sudo umount /dev/sdb1
Pull the card out of your PC, and insert it into the Q5 / Q7 (upside down!). It will need to be pushed in quite far until it clicks home. Then, hold down the right-hand-most button on the top of the device, and plug in the power supply. The LED should flash red, and perhaps green for a brief instant.. After a moment, the screen should go white. You can let go of the button and enjoy Mer in all its glory.
Currently, to switch off a Q5/7, you have to press the 'reset' button on the bottom. S'why we formatted the disk with ext3, and not ext2 ;-)
Where to from here?
Using VMWare
Well, in the words of Ben Kenobi, youve taken your first step into a wiser world. You have a nice fresh Linux install to play with.
VMWare is very fault tolerant, so when you want to put Linux away, just close the window. When you want to resume, just open VMWare again, and Linux will auto-resume from where you left off.
It is very quick and quite safe. If the Linux gets completely broken, just delete the virtual machine, re-download it, and start again, without having to muck about with installation CDs.
Recreating the card
Well, now that you've had a play with installing Mer, you should be able to set the card up for other installations, like WinCE, etc. So, keep the VMWare console around.
Reading the card
Don't unplug the card when the SmartQ is switched on, it'll cause you pain. However, if you want to install stuff onto the card from the PC, you'll need your VMWare (or ext2fs tools for windows), to mount the card and copy files on/off.
Downloading applications
Mer is maturing all the time, and new Applications are being developed for it. Check the app manager from time to time to see if there's new apps on the internet.
Developing for Mer
The Mer team uses the "OBS" suite from OpenSuse, a remote-build-farm. You get a username / 'garage ID', download the OBS toolkit inside your Ubuntu Virtual machine, and start coding. the only difference is that you ask the OpenSuse build farm to build your app for you. Once it's built you can install it on a simulated MID (called Scratchbox), or you can install it on the MID itself.
thanks
Thanks to lbt, zenvoid, meizirkki for helping me understand what's going on, and of course the whole Mer team for this awesome product, which may just save a good MID from oblivion :). I hope this page proves useful, and allows more people to set up and play with Mer.
nww02