Menu

How to Build RC4 Log in to Edit

João Cardoso Peter Gerhard netherquark

Work in progress

Introduction

Quick Instructions for RC4 and later.

The kernel has been successfully compiled using the following distributions. Other distributions should also work, but might need some tweaks.

Release Distribution Tweak
1.0 OpenSuse 13.2 (32 bit), OpenSuse 13.2 (64 bit), OpenSuse Leap 42.1 (64 bit), OpenSuse LEAP 15 (64 bit) needs this patch -

Prerequisites

Before trying to compile the source code, make sure you have at least the following tools or libraries installed:

  • subversion
  • gcc
  • ncurses-devel
  • gcc-c++
  • flex
  • bison
  • patch
  • intltool
  • make
  • makeinfo

Build process

Checkout the development tree:

svn checkout svn://svn.code.sf.net/p/alt-f/code/tags/Release-1.0 alt-f-read-only

Then,

cd alt-f-read-only          # change to the checkout directory
. exports dns323            # defines the firmware to be built and some needed variables
make >> build-dns323.log && echo OK || echo FAIL    # make it all, logging to build-dns323.log
./mkinitramfs.sh            # create the root filesystem
./mkfw.sh                   # create the firmware files

'exports' must be sourced, not executed. It supports two arguments:

. exports [board] [build_dir]

where 'board' can be 'dns323' (for the 'dns-321/323)', 'dns325' (for the dns-320/320L/325), dns327, 'pkgs' (for all packages) or empty, and 'build_dir' specifies the build directory, which by default is the 'build' sub-directory of the current directory.
If no argument is supplied to 'exports', it will use the current configuration and print its name. You have to use '. exports' after a new login or in a new shell session, as it defines some needed environment variables, including your PATH variable.
The 'exports' script looks at local/<board> for configuration files; some are shared among different boards.</board>

Several packages are downloaded during which compiling the source code.

  • The main download sites are defined in the .config file, which is based on the <box>/<box>.config file.
  • For a specific package, the download locations are defined in the <package>.mk file located in package/<package></package></package>

Some mk*.sh scripts might ask for the root password; this is needed to mount the generated ext2 rootfs as a loop device and manipulate it. See the source.

Result

When finished, you should find:

-in $BINARIES, the kernel, "zImage", the root filesystem image, "rootfs.arm.ext2",
and the firmware files, "Alt-F-RC4-<model>.bin"
-in $ROOTFS you will find the directory structure used to create the
root filesystem image, "rootfs.arm.ext2".
-in $KERNEL the built linux kernel</model>

You might also want to read the How to Build RC3 wiki for further inside details or other make targets.


Related

Wiki: How to Create Packages