Talk:Build Process

From BCCD 3.0

(Difference between revisions)
Jump to: navigation, search
 
Line 193: Line 193:
dhcp-range=10.0.0.100,10.0.0.200,12h
dhcp-range=10.0.0.100,10.0.0.200,12h
</pre></li>
</pre></li>
 +
<li>Initialize vagrant environment: <code>vagrant init debian/stretch64</code></li>
 +
<li>Start: <code>VAGRANT_HOME=/var/tmp vagrant up --provider=lxc</code></li>
</ol>
</ol>

Latest revision as of 00:47, 13 May 2022

Contents

General commentary

Re-working using custom scripts

BCCD is a Debian distribution with some customizations:

Proposal

  1. Write a build driver that produces a stock Debian live ISO w/ custom kernel for aufs
  2. Package up the contents of SVN as one or more deb packages
  3. Install deb packages as part of build

Jenkins integration

The following Jenkins projects will be used:

fpm 
Build the .deb package with fpm
iso 
Build the ISO image after fpm, using debootstrap

Makefile

Jenkins can call Makefile targets:

target/bccd.noarch.deb 
Builds the .deb package, triggers ISO build
target/bccd.amd64.iso 
Builds the ISO image in a temporary directory
debootstrap 
Bootstraps a chroot'd Debian system, removes directory if it fails

Ownership/permissions tracking

Assign the following SVN attributes to files:

bccd:username 
User name for file after packaging
bccd:groupname 
Group name for file after packaging
bccd:permmode 
Permissions mode for file after packaging

The process that builds the deb package will produce a YAML dictionary of dictionaries, keyed on file name. Each key will then point to a second dictionary, with entries for the above attributes.

A post-install script can set the permissions and ownership for each file based on the array.

File conflicts b/w packages

BCCD will install files that conflict with other packages. While it does its best to avoid the situation via include files or .d directoriews, some packages do not support this (i.e. /etc/dhcp/dhclient.conf).

The legacy build process simply overwrites files, but our goal here is to package all files. To that goal, look into using diversions:

In testing, the --local causes conflicts even if the file is renamed. Running just with --rename solves the problem.

A for loop in the before-install script will have a list of conflicting files and generate a list of files to divert, which can then be used by the after-install script to remove the diversions.

Out-of-date configurations

These are configurations that can be removed:

bccd-sshd 
This used to be used to generate host SSH keys. Presumably at some point this didn't happen automatically, but it does now

deb scripts

Scripts executed by the deb package should be placed in bin/deb and referenced in the Makefile via fpm.

Pinning packages to BCCD repo

The /etc/apt/preferences.d/100_bccd file will set a high (900) priority for all packages that can be found in the BCCD apt repo (keying on Origin in Reprepro).

See https://wiki.debian.org/AptPreferences for more details.

Packaging notes

Probably not anything useful for us, kept for posterity

Links:

Questions:

dch

Used to maintain the debian/changelog file.

dh_make

debuild

dpkg-buildpackage

lintian

live-build

lb config

lb build

lb build will start the build process.

Logging

Vagrant/LXC + Jenkins

The goal is to isolate the build host from the build process. See https://wiki.debian.org/VagrantLXC

  1. Install vagrant and vagrant-lxc packages
  2. Setup /etc/default/lxc-net and then restart lxc-net service:
    USE_LXC_BRIDGE="true"
    LXC_BRIDGE="lxcbr0"
    LXC_ADDR="10.0.3.1"
    LXC_NETMASK="255.255.255.0"
    LXC_NETWORK="10.0.3.0/24"
    LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
    LXC_DHCP_MAX="253"
    LXC_DHCP_CONFILE=""
    LXC_DOMAIN=""
    
  3. Setup /etc/lxc/default.conf:
    lxc.network.type = veth
    lxc.network.flags = up
    lxc.network.link = lxc-bridge-nat
    
  4. Setup /etc/dnsmasq and then restart dnsmasq service:
    interface=lxc-bridge-nat
    dhcp-range=10.0.0.100,10.0.0.200,12h
    
  5. Initialize vagrant environment: vagrant init debian/stretch64
  6. Start: VAGRANT_HOME=/var/tmp vagrant up --provider=lxc
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox