Difference between revisions of "BeagleBoardDebian"
(added building native kernel deb's) |
m (language tweak) |
||
Line 93: | Line 93: | ||
=Native Built Debian Kernel= | =Native Built Debian Kernel= | ||
− | Note, this process will take some time to complete a kernel build (5-6 hours on my 2.5Ghz amd64 Debian PC). | + | Note, this process will take some time to complete a kernel build (5-6 hours on my 2.5Ghz amd64 Debian PC). Test and verify your kernel's .config and uImage's thru the standard kernel cross compile method first. Don't forget to have the frame buffer enabled so your kernel's console will show up on the hdmi/lcd screen. (The deb's I built listed at the bottom of this wiki are missing this feature.) |
==qemubuilder== | ==qemubuilder== |
Revision as of 13:42, 17 August 2008
This page is about running a (ARM) Debian distribution at BeagleBoard. BeagleBoard will boot the (ARM) Debian distribution from SD card. To prepare the SD card and install (ARM) Debian on it, QEMU on host PC will be used, following Aurélien Jarno's excellent Debian on an emulated ARM machine howto.
Contents
QEMU
Install QEMU on your host PC. This assumes that your host PC is running Debian as well. If not, install QEMU the way your host PC distribution uses.
apt-get install qemu
Format SD Card
You need a SD card 1GB or greater.
Currently (Aug 15, 2008) ext2load doesn't seem to work in the current u-boot beagle board git repo. For the moment follow the LinuxBootDisk guide to setup a 50-100MB FAT partition on your SD Card to use u-boot's fatload.
For reference, this is a 2GB sd card after installing Debian:
Disk /dev/sde: 2032 MB, 2032664576 bytes 255 heads, 63 sectors/track, 247 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x000ab123 Device Boot Start End Blocks Id System /dev/sde1 1 6 48163+ 6 FAT16 /dev/sde2 * 7 228 1783215 83 Linux /dev/sde3 229 247 152617+ 5 Extended /dev/sde5 229 247 152586 82 Linux swap / Solaris
Preparation
To stay organized create working directory.
wget http://people.debian.org/~aurel32/arm-versatile/vmlinuz-2.6.18-6-versatile wget http://people.debian.org/~aurel32/arm-versatile/initrd.img-2.6.18-6-versatile wget http://ftp.de.debian.org/debian/dists/etch/main/installer-arm/current/images/rpc/netboot/initrd.gz
Install Debian
To install (ARM) Debian inside QEMU:
sudo qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.18-6-versatile -initrd initrd.gz -hda /dev/sde -append "root=/dev/ram"
Note: sudo access is required to access /dev/sde directly.
Debian-Installer will complain that it can't find kernel modules, answer [yes] to continue the install. We will be providing our own kernel.
Running Debian
sudo qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.18-6-versatile -initrd initrd.img-2.6.18-6-versatile -hda /dev/sde -append "root=/dev/sda2"
Note: Time will be incorrect.
login as root, change password apt-get install ntpdate ntpdate pool.ntp.org reboot.. relogin change password...
Stop QEMU and remount SD card to copy uImage to FAT partition:
cd /media/disk-1/ wget http://beagleboard.googlecode.com/files/uImage_OTG
Beagleboard
Insert SD Card and power up beagleBoard.
Boot
Using a serial program, stop u-boot and add these commands:
setenv bootcmd 'mmcinit; fatload mmc 0:1 0x80300000 uImage_OTG; bootm 0x80300000' setenv bootargs 'console=ttyS2,115200n8 noinitrd root=/dev/mmcblk0p2 rootfstype=ext3 rw rootwait nohz=off' boot
To force the Beagleboard to always boot the sd card image:
setenv bootcmd 'mmcinit; fatload mmc 0:1 0x80300000 uImage_OTG; bootm 0x80300000' setenv bootargs 'console=ttyS2,115200n8 noinitrd root=/dev/mmcblk0p2 rootfstype=ext3 rw rootwait nohz=off' saveenv boot
Debian on Beagleboard
Debian on BeagleBoard uses the following configuration:
- Console log = Serial Terminal
- User Console = HDMI port + usb (keyboard,etc)
Current Issues
- Swap disabled: change /dev/hda5 -> /dev/mmcblk0p5 in /etc/fstab (artifact of qemu install to /dev/hdaX)
- RTC seems to be not enabled: use ntpdate when ethernet works, or issue date MMDDHHMMSSYYYY
Native Built Debian Kernel
Note, this process will take some time to complete a kernel build (5-6 hours on my 2.5Ghz amd64 Debian PC). Test and verify your kernel's .config and uImage's thru the standard kernel cross compile method first. Don't forget to have the frame buffer enabled so your kernel's console will show up on the hdmi/lcd screen. (The deb's I built listed at the bottom of this wiki are missing this feature.)
qemubuilder
Install qemubuilder on your host PC. (For me, i've only had success with Debian Etch, Ubuntu 8.04 will fail during qemubuilder's 2nd stage.)
apt-get install qemubuilder
Create config file: (for reference)
KERNEL_IMAGE=/home/voodoo/arm/image/vmlinuz-2.6.18-6-versatile INITRD=/home/voodoo/arm/image/initrd.img-2.6.18-6-versatile MIRRORSITE=http://ftp.us.debian.org/debian ARCH=arm BASEPATH=/var/cache/pbuilder/base-arm.qemu MEMORY_MEGS=256
Create qemubuilder image.
qemubuilder --create --distribution etch --configfile arch.config
Login into qemubuilder image.
qemubuilder --login --distribution etch --configfile arch.config
Reference: to update qemubuilder's image.
qemubuilder --update --distribution etch --configfile arch.config
Install Dependencies
apt-get install git-core kernel-package fakeroot build-essential curl libncurses-dev
u-boot
Download sources and checkout test branch.
git clone git://www.sakoman.net/git/u-boot-omap3.git u-boot_beagle cd u-boot_beagle/ git checkout -b beagle test
Using nano/preferred editor, modify u-boot's Makefile, to use native gcc.
CROSS_COMPILE = arm-none-linux-gnueabi- -> CROSS_COMPILE =
Build u-boot
make distclean make omap3530beagle_config make
Note: this should eventually error out. The goal isn't to build a native u-boot but just the u-boot's 'mkimage' such that a u-boot compatible uImage can be build later.
Add /tools/ to $PATH
PATH=/home/debian/u-boot_beagle/tools:"${PATH}"
Linux Kernel
Download Linux Sources, and switch to preferred branch
git clone git://source.mvista.com/git/linux-omap-2.6.git git checkout -b beagle v2.6.26-omap1
Using nano/preferred editor, modify kernel's Makefile, to use native gcc.
CROSS_COMPILE := arm-none-linux-gnueabi- -> CROSS_COMPILE :=
Build Linux Kernel
cd linux-omap-2.6/ make distclean make omap3_beagle_defconfig make menuconfig
Create Debian linux-image* & linux-headers* Package
make-kpkg clean CONCURRENCY_LEVEL=1 fakeroot make-kpkg --initrd kernel_image kernel_headers
Note: these are listed one directory up (cd ..)
U-boot Image
make uImage
Transfer via ftp/etc uImage, linux-image*, & linux-headers* outside the qemubuilder machine. (qemubuilder doesn't save any contents.) Using QEMU method listed above remount the sd card and install the linux-image* & linux-header* deb files. Then remount the sd's fat file partition and add the new uImage for u-boot.