Development Environment

The AstLinux Development Environment (ADE) is maintained in a repository on GitHub using subversion (SVN) or GIT.

AstLinux is cross-compiled, generating target images for x86_64 CPU architectures, using a custom maintained version of Buildroot.

Linux Build System

Building AstLinux requires using some version of Debian/Ubuntu or RHEL/CentOS Linux. It is recommended using a version of these distros in a Virtual Machine (VM). A 64-bit, x86_64 build system is required.

Using a Virtual Machine is suggested, typical recommended configuration:

  • 64 GB Storage
  • 2 GB RAM
  • 1-2 CPU Cores

Linux Build Systems known to work (must be x86_64):

  • CentOS 7
  • Debian 9
  • Debian 10 - (recommended)
  • Ubuntu 14.04
  • Ubuntu 16.04

Tip → Use a somewhat older LTS (Long Term Support) Linux distro in a VM, that will be the most compatible with our version of Buildroot.

Tip → Use a “Minimal Install” of your Linux distro, dedicated to building AstLinux.

Tip → To run Debian 10 in a LXC container on Proxmox 6, you need to enable “Nesting” under “Options/Features”, otherwise you'll end up getting “Permission denied” errors when starting several services (e.g. apache2, ntp). Creating a Flash Image does not work in a LXC container!

Prerequisites

To build Astlinux you first need to install some additional packages, depending on your Linux distribution:

Package lists

Getting Started

These instructions will show you how to build AstLinux from the “trunk” branch.

After you have installed the prerequisite packages (per above), switch to your $HOME directory on your machine as a regular user (non-root):

cd ~

Create the “astlinux” directory for the AstLinux source:

mkdir astlinux

Important → You should not be root, login as a non-admin user.

Checking out the Source

Now we will grab AstLinux via SVN:

svn co https://github.com/astlinux-project/astlinux.git/trunk astlinux/trunk

(“trunk” is the latest development branch)

Explanation:

svn - name of subversion binary should not be root.

co - short for “checkout”, grab source from url:

svn:… - URL of AstLinux SVN repository, an argument to co to specify the location of checkout

astlinux/trunk - store the previous URL in a local directory on this machine in the “astlinux” directory

You should see a bunch of files scroll down your machine. Depending on the speed of your connection, this could take a few minutes or a few hours (hopefully just a few minutes - we want to start building)!

Once the checkout process has completed, cd into astlinux/trunk to look around:

cd astlinux/trunk

First Build

The AstLinux Development Environment is based on the excellent Buildroot build system. The cross-compile toolchain is created with the excellent Crosstool-NG.

Next we will copy the default AstLinux config file and look for any new configure options.

Copy the default AstLinux config file (example with Asterisk 13):

cp x86_64-configs/astlinux-ast13.config .config

Check for new configure options:

make oldconfig

If you get “make: command not found” or a similar error you will need to install some development tools before you can continue. See Package lists for more information.

Next, create the cross-compile toolchain. Carefully follow these Crosstool-NG Instructions. Should you skip this step, ./scripts/build will generate an error with the same instructions.

If this is your first time building AstLinux we suggest that you don't make any changes to the default AstLinux configuration. This will make it easier to troubleshoot any problems you might have. Now it's time to start the build:

./scripts/build genx86_64

The script ./scripts/build is a wrapper that checks for certain tools and sets up the environment prior to issuing make. If you run make manually, you will not generate a complete build.

The option “genx86_64” is the board type, other board types are: genx86_64-serial and genx86_64-vm. If this option is omitted, the previous board type built will be used. The “genx86_64” board uses a VGA/video console, while the “genx86_64-serial” board uses a 115200 baud serial console.

Info → List of board types

The ADE will take an hour or two to build, depending on the speed of your system and internet connection.

Custom Build

After building the complete system the first time, you can modify the package selections by issuing the following command prior to ./scripts/build.

make menuconfig 

To start a fresh, clean build, remove the “output” directory and start a new build:

rm -rf output
./scripts/build

All board types use the same x86_64 toolchain, so after ./scripts/build genx86_64 completes you can issue ./scripts/build genx86_64-serial and it will take less than a minute to create the new build for that board type.

Of special note, there are two kernel configurations supported.

For 64-bit SMP kernel builds: (boards with x86_64 multi-core processors)

project/astlinux/genx86_64/linux-smp.config

For 64-bit VM kernel builds: (optimized for x86_64 virtual machines containing VM drivers)

project/astlinux/genx86_64/linux-smp-vm.config

Use make menuconfig to specify which kernel configuration to use. Changing the kernel configuration requires a fresh, clean build.

Create a Flash Image

Create an ISO Installer

Create a Private Repository

Switching Images between i586 and x86_64

Switching Images between genx86_64 and genx86_64-vm

Tips and Tricks