Talk:BeagleBoardDebian

From eLinux.org
Revision as of 15:28, 12 January 2009 by RobertCNelson (talk | contribs)
Jump to: navigation, search

There are a couple of problems with the instructions:

  1. The section on building the system under QEMU does not specify that all the tasks must be conducted UNDER QEMU, nor does it spell out what set up is needed for QEMU.
  2. The section on building a custom kernel doesn't work if building on the target - it insists upon using the cross-compiler, which does not exist.
  3. The kernel image pulled from GIT is NOT the source used to build the kernel binary images, as it does not have the resolution selection code in it.
  4. The configuration for the kernel image should be linked to from the WIKI, so that we have an exact image of what needs to be built.

David Hagood 19:18, 12 January 2009 (UTC)

Hi David,

(PS, hopefully you don't view this as too 'long', but since I first wrote this in mid august, I've been trying to get some feedback..)

Thanks for you feedback, the "Debian" and "Mojo" topics (in the end they are the same) really need someone with fresh eye's to go over the install procedures. I have a couple ideas of where to go with this wiki, but would like other people's opinion.

1. QEMU <- I'd like to delete this whole section.  (all subsections of '3')

History: When I first started writing this wiki, the only method of install was using debian's 'debootstrap' tool and QEMU. (this creates one nasty 'almost finished' system.) Since that time the wiki has transitioned from "QEMU + debootstrap" -> "QEMU + debian-installer" -> "Native + debian-installer." The "QEMU + deboostrap" has since been long deleted, and the "QEMU + debian-installer" is only useful if you don't have a compatible usb-network device. (In the case of "Mojo", and the current "hasty" revision, the debian-installer is waiting for an upstream mmc patch to do a native install. In theory Mojo's Icy should already have this patch... just isn't built yet..)

2. CROSS_COMPILE= 

I can't remember what package forced me to do this, (make-kpkg, the kernel sources, etc...). Too actually use a "native" arm "GCC" on an 'armel/arm' system when building an 'arm/armel' kernel, you must pass "CROSS_COMIPLE= " (space in there), otherwise the build system would append, arm-linux-*, armel-linux-*, etc.

3. The kernel image pulled from GIT...

Yes and No, All "Debian" and "Mojo" kernels are based off that git tree along with patches from Koen's excellent kernel work. The "Linux Kernel" topic on the wiki is just a short example, but for clarification here's my current build script:

1. Link between "Debian" and "Mojo" build version and Koen's Angstrom Kernel's http://www.rcn-ee.com/deb/kernel/changes.txt (Note, all 'gitweb' links are broken since switching to 'cgit', so this 'version' i'm using as an example might not be uploaded yet. (it's building))

kernel-image/headers (2.6.27 oer12-1.0)

  * OE r12 Release, 2.6.27 + Patches
  - http://cgit.openembedded.net/cgit.cgi?url=openembedded/commit/&id=59251a6dc6e2a75fd5306ae47f5db68c62b965eb
  - fix usb RX TX bug

 -- Robert Nelson <robertcnelson+deb<at>gmail<dot>com> Mon Jan 12 08:41:38 CST 2009

From: http://cgit.openembedded.net/cgit.cgi?url=openembedded/commit/&id=59251a6dc6e2a75fd5306ae47f5db68c62b965eb

We see we are using git: 2a3408be17f287fdb5809c9b6c68e7ad96d25b74 of 2.6.27

So from: git://git2.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git

COMMIT=2a3408b
KERNEL=v2.6.27-2a3408b

cd ~/git_repo/linux-omap-2.6/
git pull
git checkout ${COMMIT}
git checkout -b ${KERNEL}
git archive --format=tar --prefix=${KERNEL}/ ${KERNEL} | gzip > ../${KERNEL}.tar.gz
git checkout master
git branch ${KERNEL} -D
cd ..

Next we apply all the 'patches', (from here again: http://cgit.openembedded.net/cgit.cgi?url=openembedded/commit/&id=59251a6dc6e2a75fd5306ae47f5db68c62b965eb (linux-omap_2.6.27.bb)) I'm not going to break this down line by line since there are many, but my build system relies on a single 'diff'.

This kernel, patch, and defconfig is stored on my home server (be nice to my slow cable modem) about a foot from a dedicated beagle builder here: http://rcn-ee.homeip.net:81/dl/omap/beagle/

The beagle builder is basically a beagleboard with a 80Gb USB harddrive with every debian chroot I've ever used.. (from Mojo's first frisky release to a test icy, to ubuntu's jaunty, to debian lenny and sid..)

This is the current, build script as of January 12, 2009, it works thru many odd 'bugs', with using chroot's, usb transfer issues (should be now fixed with 2.6.27-oer12), dns network failures (when the cable modem locks) and power failures...

#!/bin/sh
cd /mnt/debian/
echo "date"
date
schroot -c ${DIST} -u voodoo -- ls
schroot -c ${DIST} -u voodoo -- rm linux-image${FINAL_KER}.deb
schroot -c ${DIST} -u voodoo -- rm linux-headers${FINAL_KER}.deb
schroot -c ${DIST} -u voodoo -- rm ${KERNEL}-${OER_R}.diff
schroot -c ${DIST} -u voodoo -- rm defconfig
schroot -c ${DIST} -u voodoo -- rm -rfd ${KERNEL}
schroot -c ${DIST} -u voodoo -- rm ${KERNEL}.tar.gz
schroot -c ${DIST} -u voodoo -- sudo aptitude update
schroot -c ${DIST} -u voodoo -- sudo aptitude -y safe-upgrade
schroot -c ${DIST} -u voodoo -- sudo aptitude -y dist-upgrade
schroot -c ${DIST} -u voodoo -- sudo aptitude autoclean
schroot -c ${DIST} -u voodoo -- sudo aptitude -y install gcc wget kernel-package fakeroot build-essential bash apt-utils bzip2
schroot -c ${DIST} -u voodoo -- gcc -v
schroot -c ${DIST} -u voodoo -- wget --directory-prefix=/mnt/debian/ http://192.168.1.95:81/dl/omap/beagle/${KERNEL}.tar.gz
schroot -c ${DIST} -u voodoo -- wget --directory-prefix=/mnt/debian/ http://192.168.1.95:81/dl/omap/beagle/${KERNEL}-${OER_R}/${KERNEL}-${OER_R}.diff
rm ${KERNEL}-${OER_R}/${KERNEL}-${OER_R}.diff
wget --directory-prefix=/mnt/debian/ http://192.168.1.95:81/dl/omap/beagle/${KERNEL}-${OER_R}/${KERNEL}-${OER_R}.diff
schroot -c ${DIST} -u voodoo -- wget --directory-prefix=/mnt/debian/ http://192.168.1.95:81/dl/omap/beagle/${KERNEL}-${OER_R}/defconfig
schroot -c ${DIST} -u voodoo -- tar -xf /mnt/debian/${KERNEL}.tar.gz -C /mnt/debian
mkdir -p /mnt/debian/${KERNEL}
cd /mnt/debian/${KERNEL}
schroot -c ${DIST} -u voodoo -- patch -p1 < /mnt/debian/${KERNEL}-${OER_R}.diff
schroot -c ${DIST} -u voodoo -- make CROSS_COMPILE= distclean
schroot -c ${DIST} -u voodoo -- cp /mnt/debian/defconfig .config
cd /
schroot -c ${DIST} -u voodoo -- sudo patch -N -p1 < /mnt/debian/firmware-dir-fix.diff
schroot -c ${DIST} -u voodoo -- sudo patch -N -p1 < /mnt/debian/maintainer.diff
cd /mnt/debian/${KERNEL}
schroot -c ${DIST} -u voodoo -- make-kpkg --cross_compile - clean
time schroot -c ${DIST} -u voodoo -- fakeroot make-kpkg --append-to-version=-${OER_R} --revision=${BUILDREV}${DISTRO} --cross_compile - kernel_image kernel_headers
cd ..
schroot -c ${DIST} -u voodoo -- ls

cp /mnt/drive/chroot/${DIST}/mnt/debian/linux-image${FINAL_KER}.deb /mnt/debian/
curl --ftp-create-dirs -T linux-image${FINAL_KER}.deb -u ${BACKFTPUSER} ftp://192.168.1.95/deb/kernel/beagle/${DISTRO}/${KERNEL}-${OER_R}/
curl --ftp-create-dirs -T linux-image${FINAL_KER}.deb -u ${FTPUSER} ftp://www.rcn-ee.com/deb/kernel/beagle/${DISTRO}/${KERNEL}-${OER_R}/
schroot -c ${DIST} -u voodoo -- rm linux-image${FINAL_KER}.deb
rm linux-image${FINAL_KER}.deb

cp /mnt/drive/chroot/${DIST}/mnt/debian/linux-headers${FINAL_KER}.deb /mnt/debian/
curl --ftp-create-dirs -T linux-headers${FINAL_KER}.deb -u ${BACKFTPUSER} ftp://192.168.1.95/deb/kernel/beagle/${DISTRO}/${KERNEL}-${OER_R}/
curl --ftp-create-dirs -T linux-headers${FINAL_KER}.deb -u ${FTPUSER} ftp://www.rcn-ee.com/deb/kernel/beagle/${DISTRO}/${KERNEL}-${OER_R}/
schroot -c ${DIST} -u voodoo -- rm linux-headers${FINAL_KER}.deb
rm linux-headers${FINAL_KER}.deb

cp /mnt/drive/chroot/${DIST}/mnt/debian/${KERNEL}-${OER_R}.diff /mnt/debian/
curl --ftp-create-dirs -T ${KERNEL}-${OER_R}.diff -u ${BACKFTPUSER} ftp://192.168.1.95/deb/kernel/beagle/${DISTRO}/${KERNEL}-${OER_R}/
curl --ftp-create-dirs -T ${KERNEL}-${OER_R}.diff -u ${FTPUSER} ftp://www.rcn-ee.com/deb/kernel/beagle/${DISTRO}/${KERNEL}-${OER_R}/
schroot -c ${DIST} -u voodoo -- rm ${KERNEL}-${OER_R}.diff
rm ${KERNEL}-${OER_R}.diff

cp /mnt/drive/chroot/${DIST}/mnt/debian/defconfig /mnt/debian/
curl --ftp-create-dirs -T defconfig -u ${BACKFTPUSER} ftp://192.168.1.95/deb/kernel/beagle/${DISTRO}/${KERNEL}-${OER_R}/
curl --ftp-create-dirs -T defconfig -u ${FTPUSER} ftp://www.rcn-ee.com/deb/kernel/beagle/${DISTRO}/${KERNEL}-${OER_R}/
schroot -c ${DIST} -u voodoo -- rm defconfig
rm defconfig

schroot -c ${DIST} -u voodoo -- rm -rfd ${KERNEL}
schroot -c ${DIST} -u voodoo -- rm ${KERNEL}.tar.gz
rm ${KERNEL}.tar.gz
rm -rfd  ${KERNEL}
echo "date"
date

Which is 'WAY' to over complicated for this wiki....


4. The configuration for the kernel image...

Right now the only link is: http://www.rcn-ee.com/deb/kernel/changes.txt I haven't really moved beyond that, since my cable modem upload is so slow, (there goes hosting from rcn-ee.homeip.net) and it would take too long to upload to rcn-ee.com --RobertCNelson 22:28, 12 January 2009 (UTC)