Re: [Balloon] Most recent known good for FPGA

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: balloon
Subject: Re: [Balloon] Most recent known good for FPGA
On Saturday 20 February 2010 23:53:17 Wookey wrote:
> +++ Charles Manning [2010-02-17 11:02 +1300]:
> > It seems that the FPGA balloon gets a bit less attention than the CLPD
> > version and Wookey warned me off trying the latest a few days back. I
> > tried something older but that fails to build.
> >
> > What's the most recent version of svn that:
> > * Supports FPGA.
> > * Has an FPGA binary file so there is no need to play with Xilinx tools
> > * Builds, boots and does healthy things?
>
> It's taken a while to work out the answer to this question, but I
> think I've found it.
>
> The old FPGA stuff that was actually released:
> http://balloonboard.org/files/balloon3/distro/test-v0.3/
> is old-arm, rather than eabi.
> It corresponds to svn r260
> I tried going back and rebuilding this, but it doesn't work, and only
> knows how to build old arm ABI binaries anyway.
>
> So I moved on to just before the VLIO changes. : r839 which only
> requires one patch to build: to build with a vaguely recent version of
> glibc installed you need to either add the patch below to the initrd
> quilt series (copy it into initrd/patches and add getline.patch to the
> end of the series file) or let it build until it barfs, with a
> 'getline redefined' whinge then apply the patch manually. Index:
> buildroot/build_arm/linux-2.6.20.4/scripts/unifdef.c
> ===================================================================
> --- buildroot.orig/build_arm/linux-2.6.20.4/scripts/unifdef.c
> 2010-02-20 01:18:40.000000000 +0000 +++
> buildroot/build_arm/linux-2.6.20.4/scripts/unifdef.c 2010-02-20
> 01:19:01.000000000 +0000 @@ -206,7 +206,7 @@ static void error(const
> char *); static int findsym(const char *); static void
> flushline(bool); -static Linetype getline(void); +static Linetype
> get_line(void); static Linetype ifeval(const char **); static void
> ignoreoff(void); static void ignoreon(void); @@ -512,7 +512,7 @@
>
>      for (;;) {
>          linenum++;
> -        lineval = getline();
> +        lineval = get_line();
>          trans_table[ifstate[depth]][lineval]();
>          debug("process %s -> %s depth %d",
>              linetype_name[lineval],
> @@ -526,7 +526,7 @@
>   * help from skipcomment().
>   */
>  static Linetype
> -getline(void)
> +get_line(void)
>  {
>      const char *cp;
>      int cursym;

>
>
>
> If you want to avoid the downloads for both debian and emdebian
> rootfs's then edit rootfs/Makefile and set
> SUBDIRS = emdebian (or debian) so you only get one.
>
> There is another minor blip: 'make dist' gives an error on the last
> file it was going to copy anyway - that doesn't matter, it's the cpld
> xsvf file only).
>
> Then you should be able to upload with
> cd ../distro
> utils/bbl --bootldr --fpga --installer
> To upload bootloader, fpga image and nor-kernel/initrd
>
> That should be sufficient to set you on your way whilst we get to the
> bottom of the HEAD/FPGA issue.
>
> 'It works for me' :-)
> Feel free to grumble if you find other issues.
>
> Wookey


OK... having another go....

My goals are this: Take the FPGA balloon I have here and build things to the
stage where I can run a shell and basic busybox commands and have enough
development environment where I can build and run a kernel with a changed
yaffs for yaffs testing.


I'm following the instructions on
www.balloonboard.org/balloonwiki.SoftwareBuilding. I hope that is the right
songsheet.

Having tried ToT and r 945 which failed to build completely I take it from the
above that r 839 is the magic. So let's give that a go.

$ svn update -r 839

then

$ make

which fell over in a heap because the bit that fetches yaffs2does a wget of
the tarball and untars (which passes) and then still tries to do a cvs export
which fails due to the files being in the way. Commenting out the bit of the
kernel/Makefile that does the cvs export and we're building again...


NB: This patch is not a general fix because it also comments out the yaffs
kernel patching. Just given here to show what I did. Since I already have a
yaffs2 patched into the kernel from a previous build this is just to make
some progress.

-- kernel/Makefile    (revision 839)
+++ kernel/Makefile    (working copy)
@@ -72,10 +73,13 @@
 $(RES)/yaffs-source-$(YAFFSCHECKOUT).stamp: $(RES)/unpacked-$(KERNVER).stamp
     ( cd $(RES) && rm -rf yaffs2 && \
     (( wget -N $(RELEASESITE)/sources/kernel/yaffs-$(YAFFSCHECKOUT).tar.bz2 && \
-      tar --extract --bzip2 --file yaffs-$(YAFFSCHECKOUT).tar.bz2) || \
-      echo "Checking out yaffs2 ($(YAFFSCHECKOUT)) from cvs"; 
CVSROOT=:pserver::/home/aleph1/cvs cvs 
export -f -D "$(YAFFSCHECKOUT)" yaffs2 || test $$? = 2 )) && \
-    ( cd $(RES)/yaffs2 && ./patch-ker.sh c ../linux-$(KERNVER) && \
-    cd .. && tar -cjf $(RES)/yaffs-$(YAFFSCHECKOUT).tar.bz2 yaffs2 && rm -rf 
yaffs2) && \
+      tar --extract --bzip2 --file yaffs-$(YAFFSCHECKOUT).tar.bz2) && \
+      ls yaffs2 \
+      )) && \
+#      || \
+#      echo "Checking out yaffs2 ($(YAFFSCHECKOUT)) from cvs"; 
CVSROOT=:pserver::/home/aleph1/cvs cvs 
export -f -D "$(YAFFSCHECKOUT)" yaffs2 || test $$? = 2 )) && \
+#    ( cd $(RES)/yaffs2 && ./patch-ker.sh c ../linux-$(KERNVER) && \
+##    cd .. && tar -cjf $(RES)/yaffs-$(YAFFSCHECKOUT).tar.bz2 yaffs2 && rm -rf 
yaffs2) && \
     touch $(RES)/yaffs-source-$(YAFFSCHECKOUT).stamp 




After much building, things fall over where they did last time I tried....

make[2]: Entering directory `/opt/balloon/trunk/rootfs/debian'
mkdir -p ../../../build/rootfs/debian
#make arm/armel rootfs with debootstrap
#note - there should be a way of putting in debs needed by balloon3-config 
automatically...(dash,lrzsz,)
#    fakeroot /usr/sbin/debootstrap --verbose --arch 
armel --include=udev,pcmciautils,ntpdate,dash,avahi-daemon,libdaemon0,libavahi-common3,libavahi-core4,avahi-autoipd,libnss-mdns,libdbus-1-3,dbus,lrzsz 
\
    #in order to use fakeroot we have to clean out rootfs first 
(cd ../../../build/rootfs/debian && rm -rf balloon3-rootfs) 
fakeroot /usr/sbin/debootstrap --verbose --arch 
armel --include=udev,pcmciautils,ntpdate,dash,lrzsz,wireless-tools \
        --foreign lenny ../../../build/rootfs/debian/balloon3-rootfs 
http://ftp.uk.debian.org/debian/ 
I: Retrieving Release
I: Retrieving Packages
.....
I: Extracting bsdutils...
I: Extracting mount...
I: Extracting util-linux...
I: Extracting zlib1g...
#copy balloon-config package into apt cache, ready for 2nd stage
#hack debootstrap file so that balloon3-config gets configured
cp 
balloon3-config_*_all.deb ../../../build/rootfs/debian/balloon3-rootfs/var/cache/apt/archives/
#sed -i -e 's/$/ 
balloon3-config/' ../../../build/rootfs/debian/balloon3-rootfs/debootstrap/required
#fix up rootfs enough to boot it and do 2nd-stage config 
chmod +x rootfs-config
fakeroot ./rootfs-config ../../../build/rootfs/debian/balloon3-rootfs 
balloon3-config/files
+ '[' '' = ../../../build/rootfs/debian/balloon3-rootfs ']'
+ '[' -e ../../../build/rootfs/debian/balloon3-rootfs ']'
+ ROOTFS=../../../build/rootfs/debian/balloon3-rootfs
+ '[' / = ROOTFS ']'
+ '[' '' = balloon3-config/files ']'
+ '[' -d balloon3-config/files ']'
+ CONFIG=balloon3-config/files
+ '[' -e config ']'
+ . config
./rootfs-config: line 34: .: config: file not found
make[2]: *** [../../../build/rootfs/debianstage1root.tgz] Error 1
make[2]: Leaving directory `/opt/balloon/trunk/rootfs/debian'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/opt/balloon/trunk/rootfs'
make: *** [all] Error 1


Any hints?

-- Charles