Thursday, February 02, 2012
Setting up ARM chroot on Ubuntu Oneiric (11.10) for cross build
I recently ordered a Pandaboard ES so that I could learn a few things on ARM development. A caveat on ARM development, if you are going to compile anything on the device it takes significant time. When I am new to a platform, to gain experience, I build a bootable Linux kernel and install it. This lets me get a hang of recovering to a known working kernel if something screws up during a kernel upgrade. I started out building the kernel directly on the device but was bitten by a known bug which results in segfaults/sigbuses when running the Pandaboard using the entire 1GB of RAM it has. The workaround is to change the boot parameters so that only 768MB of 1GB of RAM is used. Considering the fact that it takes significant time to build things on the device, I thought why not use my old Pentium M laptop as cross compile build box. The first thing for that is to install a working ARM cross chroot environment. I contacted my good friend Google as ever. I found a lot of useful resources as usual. I thought I would document the approach that I used which worked for me.
I used EmDebian CrossDebootstrap wiki entry [1] as the starting point. I installed Ubuntu's Oneiric ARM port in the chroot and the steps are as follows:
With the chroot base system now setup one can use schroot/dchroot to chroot into the base system and install any other packages like a regular chroot. If you want to debootstrap to install a chroot to build packages one needs to just pass the --variant=buildd option to debootstrap in step 3.
[1] http://wiki.debian.org/EmDebian/CrossDebootstrap
I used EmDebian CrossDebootstrap wiki entry [1] as the starting point. I installed Ubuntu's Oneiric ARM port in the chroot and the steps are as follows:
- First and foremost is to install some of the required packages
# apt-get install binfmt-support debootstrap qemu qemu-user-static
- Create an empty directory where the chroot will be installed
# mkdir -p /chroot/oneiric_armel
- Now we bootstrap the chroot
# debootstrap --arch=armel --foreign oneiric /chroot/oneiric_armel http://ports.ubuntu.com/
This will take time depending on your network connection and drive speed, get yourself a sandwich or catch up on some email. - Since we passed the --foreign option to debootstrap the .deb files have been downloaded and unpacked, we are yet to configure the system and finalize the chroot installation. Before we can do anything we need to copy over the qemu binary into the chroot so that we can run ARM executables on the host system using emulation.
# cp /usr/bin/qemu-arm-static /chroot/oneiric_armel/usr/bin/
Now we are ready to configure and finalize the base system. - To configure the base system, first we need to chroot into and then execute the second stage of debootstrap.
# chroot /chroot/oneiric_armel/
/debootstrap/debootstrap --second-stage
exit - Now we have configured and working base system, we need to create a valid apt source list. The contents of /chroot/oneiric_armel/etc/apt/sources.list should resemble something like this.
deb http://ports.ubuntu.com/ oneiric main restricted universe multiverse
deb-src http://ports.ubuntu.com/ oneiric main restricted universe multiverse
With the chroot base system now setup one can use schroot/dchroot to chroot into the base system and install any other packages like a regular chroot. If you want to debootstrap to install a chroot to build packages one needs to just pass the --variant=buildd option to debootstrap in step 3.
[1] http://wiki.debian.org/EmDebian/CrossDebootstrap
Labels: arm, chroot, oneiric, pandaboard, ubuntu
Sunday, February 05, 2006
Plantronics Voyager™ 510 Bluetooth® Headset on Linux
I own a Plantronics Voyager™ 510 Bluetooth® Headset and I have been wanting to get it working on Linux for a quite sometime. I finally had some free time which utilizeded to get my headset working on Linux. The Bluetooth-alsa project provides support for Bluetooth headsets in Linux.
Requirements:
Check out the btsco from CVS using the following commands
Requirements:
- Alsa support compiled either into the kernel or separately using the alsa-driver package.
- Make sure that you have snd_usb_audio module compiled.
- Bluetooth support has been compiled in the kernel.
- Under the "Bluetooth subsystem support" make sure that you have chosen following:
- "L2CAP protocol support"
- "SCO links support" "RFCOMM protocol support", make sure you have selected "RFCOMM TTY support".
- "BNEP protocol support", make sure you have selected "Multicast filter support" and "Protocol filter support".
- "HIDP protocol support"
- Under the "Bluetooth device drivers" make sure you have chosen following:
- "HCI USB driver", make sure you have selected "SCO (voice) support"
- "HCI UART support", make sure you have selected "UART (H4) protocol support", "BCSP protocol support", and "Transmit CRC with every BCSP packet"
- Select the appropriateae Bluetooth device driver for your Bluetooth adapter.
- Under the "Bluetooth subsystem support" make sure that you have chosen following:
- The bluez-libs and bluez-utils package have been installed and configured.
Check out the btsco from CVS using the following commands
cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/bluetooth-alsa loginCompile the userland application
cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/bluetooth-alsa co btsco
./bootstrapCompile the kernel module
./configure
make install
make maintainer-clean
cd kernelNow lets configure our headset so that we can test if our headset works.
make
make install
depmod -e
make clean
- Insert the snd_bt_sco module with the command "modprobe snd_bt_sco", run "dmesg" to make sure that the module is loaded.
- Put the headset in pairing mode and then run "hcitool scan".
- Run the following command "btsco2
", where is the address from the scan.
Thursday, November 10, 2005
Linux-on-Laptops contribution
I decided to write up the experiences that I had installing Gentoo Linux on my Dell Inspiron 9300. I decided that I should submit it to Linux-on-Laptop, which I did. With the update to Linux-on-Laptops on 11th November, 2005, my article on how to install Gentoo Linux on Dell Inspiron 9300 has been included. If anyone has any questions or suggestions please feel free to contact me. You can also find my experience on how to install the driver required to use the Creative WebCam Live! on Linux. I hope to soon get my Bluetooth device working with my Plantronics Voyager™ 510 Bluetooth® Headset. Keep checking my blog for updates on its progress.
Saturday, October 15, 2005
Gentoo Linux on Dell Inspiron 9300
I recently became the owner of a Dell Inspiron 9300. This was a replacement laptop for my old Dell Inspiron 8600. Inspiron 9300 is a great desktop replacement laptop with a huge 17 inch display. Its slightly on the heavier side, that is something you have to make do with for the 17 inch display. I am running a dual boot of Windows XP and Gentoo Linux on this laptop. In this post I will try to cover the installation of Gentoo on this laptop.
Basic Installation
I use gcc-3.4 as my compiler as it supports Architecture specific optimisation for the Pentium M processors. To install from stage1 using gcc-3.4 you need to add the following lines to your /etc/portage/package.keywords
Additional features for Gentoo Linux
The DVD drive by default runs without DMA. By editing the kernel headers you can enable DMA. Edit the file/include/Linux/libata.h, change the line
Unresolved issues
E-mail: bharathblog at gmail dot com
Last updated: Sunday, February 22, 2006
| Hardware component | Status | Comments |
|---|---|---|
| Pentium M Processor 750, 1.86GHz | Works | |
| 17 WUXGA TFT Display | Works | |
| 128MB ATI Mobility Radeon X300 | Works | Requires ATI Linux drivers. |
| 1024MB 533MHz DDR2 SDRAM (2x512) | Works | |
| 60GB (5,400 RPM) Hard Drive | Works | |
| NEC ND-6650 8X DVD+/-RW Drive | Works | DMA requires libata support. |
| Broadcom Corporation BCM4401-B0 100Base | Works | |
| Intel ProWireless 2200 802.11b/g Mini PCI Wireless | Works | Requires Intel ipw2200 drivers. |
| Internal Intel AC'97 56k Modem Controller | Don't know | Haven't tried. |
| Dell Wireless 350 Bluetooth 2.0 | Works | Tested with Plantronics bluetooth headset. |
| Intel AC'97 Audio Controller | Works | |
| PCMCIA Cardbus: Ricoh Co Ltd RL5c476 II | Seems to work | Haven't tested, dont own any hardware. |
| FireWire (IEEE 1394): Ricoh Co Ltd R5C552 | Seems to work | Haven't tested, dont own any hardware. |
| SD Card Reader: Ricoh Co Ltd R5C822 | Not supported |
Basic Installation
- I installed my system from stage1 using the 2005.1 Universal CD.
- For installation documentations use the Gentoo installation handbook.
- The hard drive is a regular IDE drive but accessed as a scsi device using the libata ata_piix sata driver.
- For ATI driver emerge ati-drivers, followed by opengl-update ati.
I use gcc-3.4 as my compiler as it supports Architecture specific optimisation for the Pentium M processors. To install from stage1 using gcc-3.4 you need to add the following lines to your /etc/portage/package.keywords
sys-devel/gcc ~x86Then run the bootstrap.sh script. Once gcc-3.4 has been installed edit your make.conf to change the arch type as pentium-m from whatever you were using earlier.
sys-libs/libstdc++-v3 ~x86
source /etc/profileYou need to re-source /etc/profile so that you use the gcc-3.4 as the default compiler. Re-emerge glibc and gcc-3.4. Unmerge gcc-3.3 and then proceed from stage2 to stage3.
Additional features for Gentoo Linux
The DVD drive by default runs without DMA. By editing the kernel headers you can enable DMA. Edit the file
#undef ATA_ENABLE_ATAPIto
#define ATA_ENABLE_ATAPIEnable scsi cdrom support if you hadn't enabled it earlier. Recompile your kernel and reboot, you need to pass ide1=noprobe to the kernel. The DVD drive will now appear as a scsi device /dev/sr0 and not as a IDE device /dev/hdc. hdparm doesn't work with scsi devices without the libata passthru patch from Jeff Garzik.
Unresolved issues
- Internal Modem
- Firewire
- SD card reader, doest not work as it is not supported.
- Cardbus/PCMCIA
- lscpi
- Kernel .config
- xorg.conf
- make.conf
- kernel-2.6 (list of modules that I load on boot. I use a modular kernel hence a lot of modules are loaded.)
E-mail: bharathblog at gmail dot com
Last updated: Sunday, February 22, 2006
Friday, August 12, 2005
Creative WebCam Live! on Linux
I recently bought a Creative WebCam Live!, its a really nice camera for the price that you pay. Only drawback with this camera is that is USB 1.0 camera and not USB 2.0. Guess you can't get everything you want when you have price barrier. This camera works great on windows. I am avid Linux user. Whenever I buy hardware the most important thing that I look for is Linux support. When I was buying the web cam I wasn't paying much attention to this. After I got it I realised that possibly I should have bought something like the Logitech QuickCam which has a decent Linux support. Today as of now I have my webcam working in Linux. The distribution of Linux I am using is Gentoo. I am currently running the 2.6.10 kernel.
The kernel module that you need to compile is the spca5xx module. I am currently using the latest build which is spca5xx-20050701 which you can download from
http://mxhaard.free.fr/spca50x/Download/spca5xx-20050701.tar.gz
How do you know if your device is supported or not. There is a list of devices supported, which can be found here. Search for your webcam using the pair vendor id and product id. Obviously if you don't know what the pair is, you want to find out how. How do you find out would be the next question. You can find it using either some tool or viewing /proc/bus/usb/devices.
The tool I uses is the usbutils which has the command lsusb, similar to lspci, to list all usb devices connected to the system. You can find the vendor id and product id from it. If you don't have usbutils installed and don't want to take the pains of doing so (trust me its worth taking the pains). Open /proc/bus/usb/devices using your favourite editor. Find the device in the list, once you locate your device you will see a line like this:
P: Vendor=xxxx ProdID=xxxx Rev=xx.xx
You have your vendor id and product id from this.
I assume that you already have USB support compiled into the kernel or as a module. Make sure that you have Video For Linux compiled either into the kernel or as a module. You can find Video For Linux under "Device Drivers -> Multimedia devices". Once you have compiled all the necessary modules run modules-update. Then you just need to modprobe spca5xx kernel module. If you had compiled Video For Linux as a module then videodev should automatically be inserted, if not you need to modprobe videodev kernel module. You can check to see if your device for the webcam has been created, it should be /dev/video0 (video"zero"). You can create a symlink /dev/video for it as some application use the device /dev/video to open your camera source. All you need to do now is run your favourite application to capture the video from /dev/video0.
The kernel module that you need to compile is the spca5xx module. I am currently using the latest build which is spca5xx-20050701 which you can download from
http://mxhaard.free.fr/spca50x/Download/spca5xx-20050701.tar.gz
How do you know if your device is supported or not. There is a list of devices supported, which can be found here. Search for your webcam using the pair vendor id and product id. Obviously if you don't know what the pair is, you want to find out how. How do you find out would be the next question. You can find it using either some tool or viewing /proc/bus/usb/devices.
The tool I uses is the usbutils which has the command lsusb, similar to lspci, to list all usb devices connected to the system. You can find the vendor id and product id from it. If you don't have usbutils installed and don't want to take the pains of doing so (trust me its worth taking the pains). Open /proc/bus/usb/devices using your favourite editor. Find the device in the list, once you locate your device you will see a line like this:
P: Vendor=xxxx ProdID=xxxx Rev=xx.xx
You have your vendor id and product id from this.
I assume that you already have USB support compiled into the kernel or as a module. Make sure that you have Video For Linux compiled either into the kernel or as a module. You can find Video For Linux under "Device Drivers -> Multimedia devices". Once you have compiled all the necessary modules run modules-update. Then you just need to modprobe spca5xx kernel module. If you had compiled Video For Linux as a module then videodev should automatically be inserted, if not you need to modprobe videodev kernel module. You can check to see if your device for the webcam has been created, it should be /dev/video0 (video"zero"). You can create a symlink /dev/video for it as some application use the device /dev/video to open your camera source. All you need to do now is run your favourite application to capture the video from /dev/video0.
