Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

bismark build

woodrow edited this page · 1 revision

bismark-build: the BISmark build manager

The goal of Contractor is to manage the OpenWrt build environment in order to make the OpenWrt build process fully described and repeatable. This includes managing packages "installed" in the OpenWrt buildroot and assocaited external dependencies. We will know we have succeeded in our goal when anyone can simply clone the bismark-build repository, pull down the disparate sources at specified revisions, and make an OpenWrt image and pacage repository equivalent to the image and repository shipped with any BISmark release.

Requirements

The following requirements motivate our design of Contractor:

  • Contractor must maintain a reference to the revision of OpenWrt tree that is used in each build
  • Contractor must maintain the following, for a number of deployment targets and other versions of the OpenWrt build environment:
    • .config
    • files/
    • feeds.conf
    • a list of pacakges installed into the OpenWrt buildroot
  • Contractor must maintain references to the repositories and revision specifiers (commit, branch, or tag) for each of the repositories to be symlinked to by the OpenWrt feeds system
  • Contractor must (by default) ensure that the build directory is "consistent" before executing a build, allowing code to be committed, or switching branches (checkout). This consistency requirement can be relaxed by enabling a testing/debug mode that produces images with a different name (and packages in a different repository name) to underscore that this build is not reproducable.

Consistency

We will define consistency as follows:

Pre-commit consistency

  • The set of packages specified in the pacakge list is equal to the set of packages installed at /packages/feeds (this could be resolved by presenting a choice to the user: update package list and commit, revert /packages/feeds to package list, or abort commit)

Pre-build/pre-checkout consistency

  • All pre-commit consistency requirements
  • The working trees of the repositories symlinked to feeds are clean and contain no untracked files (aside from those ignored by .gitignore)
  • The working tree of the openwrt repository is clean and contains no untracked files (aside from those ignored by .gitignore)

Files

The following is a sketch of the proposed filesystem hierarchy for a bismark-build:

Pre-init (i.e. sitting on github.com)

bismark-build
|- .git/
|- openwrt-config/   (this stuff will be literally symlinked into openwrt/)
|  |- wndr3700       (use openwrt naming scheme for these)
|  |  |- .config
|  |  |- /files
|  |  |- feeds.conf
|  |- buffalo
|     |- .config
|     |- /files
|     |- feeds.conf
|- contractor -> scripts/contractor
|- contractor.conf
|- scripts/
|  |- .contractor.defconfig
   |- contractor

Post-init (i.e. sitting on your disk and ready to build)

bismark-build
|- .git/
|- .contractor
|- openwrt/              (untracked)
|  |- .git/
|  |- .config    -> ../openwrt-config/wndr3700/.config
|  |- files      -> ../openwrt-config/wndr3700/files
|  |- feeds.conf -> ../openwrt-config/wndr3700/feeds.conf
|- openwrt-config/   (this stuff will be literally symlinked into openwrt/)
|  |- wndr3700       (use openwrt naming scheme for these)
|  |  |- .config
|  |  |- /files
|  |  |- feeds.conf
|  |- buffalo
|     |- .config
|     |- /files
|     |- feeds.conf
|- contractor -> scripts/contractor
|- contractor.conf
|- scripts/
|  |- .contractor.defconfig
|  |- contractor
|- feeds_repos           (untracked)
   |- bismark-packages
   |  |- .git/
   |- luci
   |  |- .git/
   |- openwrt-packages
   |  |- .git/
   |- openflow
   |  |- .git/

contractor.conf

This file will contain:

  • the openwrt git repository URL and revision
  • a list of feeds repository URLs and revisions
  • a list of installed packages

Commands/Features

(Should contractor only handle openwrt/ and feeds/, and leave the user to deal with git in bismark-build? Also how does contractor keep track of private vs. public branches?)

./contractor init

  • install git hooks
  • ask user for initial target (based on contents of openwrt-config) and create .contractor file with current target
  • if git repositories don't exist, clone them and check them out to the appropriate revisions (git protocol read-only repos)
  • make openwrt/packages/feeds consistent with packages listed in contractor.conf (i.e. install packages listed in contractor.conf)

(remaining commands fail if git repositories don't exist -- sync requried)

./contractor sync

  • check for consistency
  • do git pulls on openwrt and feed repositories (should be no merging)
  • checkout repositories with specified revsision/tag/branch
  • ./contractor target to refresh symlinks

./contractor target <platform_name>

  • check for consistency
  • remove symlinks installed (noted in .contractor file)
  • add symlinks in /openwrt-config/<platform_name>

    check for consistency; adjust symlinks; create metadata

./contractor status

check consistency

./contractor build <openwrt_build_target>

check consistency; adjust symlinks; create metadata; start build

Git hooks

bismark-build/pre-commit

check consistency

bismark-build/post-checkout

./contractor sync

Something went wrong with that request. Please try again.