---------------------------

This README describes how this buildroot system was set up to compile
a toolchain, kernel, filesystem for the Auger PC board (Voipac PXA270).
The configuration is set up for the 256MB RAM version.

WARNING: this is not a fun process.  If you can simply use an existing
build directory, do so.  If you can avoid using a new buildroot version, do
so.

These instructions are based on buildroot v2009.02 and a 2.6.27 kernel.

Note: make sure the glibc version on whatever system you build this on is
compatible with the other machines you want to be able to compile on.  For
example, Ubuntu 9.04 has a newer glibc than SL 5.2, so the compiler
toolchain built on the former will not run on the latter.  

June 2010: Updated with JFFS2 write verification in kernel due to FS problems.  

July 2010: Updated with latest kernel.org patch (2.6.27.48) -- was seeing permission problems randomly cropping up on JFFS2 fs.

John Kelley, July 2010
j.kelley@astro.ru.nl

---------------------------

- Make sure necessary packages are installed.  On a clean Ubuntu 8.04 
  install, I had to add:

    sudo aptitude install g++ libncurses5-dev bison flex \
      gettext patch texinfo zlib1g-dev liblzo2-dev

- Set up environment variables to point to download directory:
  
    % setenv BUILDROOT_DL_DIR ~/Documents/AERA/digi/buildroot/dl_dir

- Copy config directory over (BUILDROOT_LOCAL support is broken)

    % cd <buildroot dir>; mkdir local
    % cp -r ../local_dir/voipac_pxa270 local/

- Get configuration files from existing config directory

    % make menuconfig  <exit but don't save config>
    % make BOARD=voipac_pxa270 getconfig

- First run at make:

    % make

- Make fails with [install_headers] error.  Copy hacked install_header.sh
  file over (magical print statement fix):

    % cp local/voipac_pxa270/install_headers.sh \ 
       toolchain_build_arm/uClibc-0.9.30/extra/scripts/

- Copy hacked Makefile.in, which specifies patches are in $DL_DIR (like
  config suggests): 

    % cp local/voipac_pxa270/Makefile.in.advanced \
       target/linux

- Copy modified skeleton files:

    % cp local/voipac_pxa270/inittab target/generic/target_skeleton/etc/        
    % cp local/voipac_pxa270/issue target/generic/target_skeleton/etc/ 
    % cp local/voipac_pxa270/TZ target/generic/target_skeleton/etc/ 

- Delete the project build directory:

    % rm -rf project_build_dir/voipac_pxa270

- Restart make (this will take a long time):

    % make

- Kernel image and filesystem should be in binaries/voipac_pxa270/.  Check
  that the zImage is no larger than 1310720 bytes.

- At this point the zImage and filesystem (rootfs.arm.jffs2) are ready to
  be uploaded to the board (see "loadfs" script).

NOTE: 

- To rebuild after making configuration changes, do not use "make clean" or
  the like.  Instead, remove the target and binary directories and restart
  make: 

    % rm -rf toolchain_build_arm
    % rm -rf project_build_arm
    % rm -rf binaries
    % make

*------------------------------------------------------------------------*
* My notes on the build process (gory details).  This may be helpful
* if you need to start over with a new buildroot, kernel, etc.
*------------------------------------------------------------------------*

- Downloaded latest buildroot release
     http://buildroot.uclibc.org/downloads/buildroot-2009.02.tar.gz

- make oldconfig

- make menuconfig

- make source

- Hand copy busybox config and kernel configs over

- Download Voipac's kernel patches for appropriate kernel version and check
  config path 

- Copy Linux kernel configuration file over

- Make sure locale support is disabled in master configuration
- make uclibc-menuconfig (or make menuconfig inside uClibc directory)
    disable locales here also

- Have to have "advanced kernel config"
- Removed trailing slashes in toolchain/uClibc/uclibc.mk (see comment);
  maybe not necessary? 

- Added print statements in install_headers.sh which somehow magically
  fixed return code? 

- libcrypt, syslog, xattr support necessary in uclibc

- Add $(DL_DIR) to patch path in target/linux/Makefile.in.advanced

- Hack .config to BR2_TARGET_UBOOT=n

- Kernel binary format zImage in .config

- Hacked .config to point to 2.6.19 kernel; copied config to .; added vpac
  patch to dl/ 

- Add "limits.h" #include to 
  ./project_build_arm/voipac_pxa270/linux-2.6.19/mod/sumversion.c

- Add CONFIG_CPU_FREQ_GOV_ONDEMAND=y to kernel configuration

-*** RESTARTED WITH 2.6.27 KERNEL ***-

- Unpacked clean buildroot directory

- Copy existing .config over 

- make menuconfig and save without changing anything

- Hack .config to BR2_TARGET_UBOOT=n

- make source

- Copied kernel config and busybox configs over to home directory

- Downloaded kernel patches from voipac to dl/

- Copied uclibc menu config over to toolchain_build_arm/uClibc-0.9.30/.config

- Copied toolchain_build_arm/uClibc-0.9.30/extra/scripts/install_headers.sh
  with magical print statement fix  

- Fixed paths in uClibc config

- Add $(DL_DIR) to patch path in target/linux/Makefile.in.advanced

- Cat both voipac kernel patches together in dl/ (including 256M ram one)

- Change FREQ_TABLE patch to
 config CPU_FREQ_TABLE
-	tristate
+	def_tristate y

- Weird error in toolchain_build_arm/mtd_orig/ when building mkfs.jffs2
  Went in and made locally, worked

- Check max size of zImage.dat in binaries (must be < 1310720B)

- To rebuild, have to blow away project_build_arm and binaries

- Edited target/generic/target_skeleton/etc/inittab to start tty on serial port

- Edited target/generic/target_skeleton/etc/issue

- Files saved with "make saveconfig" in ./local/voipac_pxa270, along with
  modified scripts/files referenced above

- Edited target/generic/target_skeleton/etc/TZ to "UTC"

- Turned off PCMCIA stuff in kernel configuration -- FPGA module was
  somehow confusing pccard driver.   

---

