The differences between platforms are confined to a single file, which is the platform configuration file in the sources/configs directory. The same scripts build the same packages for each platform, differing only in which configuration file they read.
Each configuration file sets some environment variables, defines one shell function, and writes two data files. The name of the configuration file is also significant.
Configuration files are read and processed by the script include.sh.
The name of the platform configuration file is used to form a "tuple" for gcc and binutils by appending "-unknown-linux" to the filename. So the first thing to do is find out what platform name gcc and binutils want for your target platform, and name your config file appropriately.
(Note: if your platform really can't use an "${ARCH}-unknown-linux" style tuple, and instead needs a tuple like "bfin-elf", you can set the variable CROSS_TARGET in the config file to override the default value and feed some other --target to gcc and binutils. You really shouldn't have to do this unless gcc doesn't yet fully support Linux on your platform. Try the default first, and fix it if necessary.)
The name of the configuration file is also used in the name of the various directories generated during the build (temp-$NAME, cross-compiler-$NAME, and mini-native-$NAME, all in the build/ directory), and as the prefix of the cross compiler binaries ($NAME-gcc and friends).
The following environment variables are usually set in a configuration file:
The shell function emulator_command() is used to generate the run-$ARCH.sh shell script in the build directory. The function should output an emulator command line to stdout (generally using "echo"). The function receives three arguments: $1 is the name of the ext2 image containing the root filesystem, $2 is the name of the kernel image, $3 is a set of platform-independent kernel command line arguments (currently "rw init=/tools/bin/sh panic=1 PATH=/tools/bin") to which emulator_command should append at least root= and console= arguments. This function is called from include.sh.
The Linux kernel needs a configuration file to build. Firmware Linux uses the "miniconfig" file format, which contains only the configuration symbols a user would have to switch on in menuconfig if they started from allnoconfig.
This file is written as a "here" document, ala:
cat > "${WORK}"/miniconfig-linux << 'EOF' [insert file contents here] EOF
To generate a miniconfig, first configure your kernel with menuconfig, then copy the resulting .config file to a temporary filename (such as "tempfile"). Then run the miniconfig.sh script in the sources/toys directory with the temporary file name as your argument and with the environment variable ARCH set to the $KARCH value in your new config file (and exported if necessary). This should produce a new file, "mini.config", which is your .config file converted to miniconfig format.
For example, to produce a miniconfig for a given platform:
make ARCH=$KARCH menuconfig mv .config tempfile ARCH=$KARCH miniconfig.sh tempfile ls -l mini.config
To expand a mini.config back into a full .config file (to build a kernel by hand, or for further editing with menuconfig), you can go:
make ARCH=$KARCH allnoconfig KCONFIG_ALLCONFIG=mini.config
Remember to supply an actual value for $KARCH.
Just like the Linux kernel, uClibc needs a .config file to build, and so the Firmware Linux configuration file supplies a miniconfig. Note that uClibc doesn't require an ARCH= value, because all its architecture information is stored in the config file. Otherwise the procedure for creating and using it is the same as for the Linux kernel, just with a different filename and contents.
Note that Firmware Linux patches uClibc to work with miniconfig files, the base uClibc 0.9.29 release doesn't support miniconfig files yet.