-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related to #9, "Add local config override file" Distro configs sorted out into associative arrays, and `distro_configure_repos` function sorted into separate 'repo' configs. Now distros and repos params can be overridden in a local config file. A poor example is included. This also paves the way to a solution for #3. Package overrides not done. Also, architecture handling mess refactored into separate file
- Loading branch information
Showing
20 changed files
with
342 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
arch_default() { | ||
# The default architecture is the first in the $DISTRO_ARCHES list | ||
local DISTRO=$1 | ||
echo ${DISTRO_ARCHES[$DISTRO]} | awk '{print $1}' | ||
} | ||
|
||
arch_host() { | ||
# The host arch is given with the '-a' option | ||
local DISTRO=$1 | ||
local ARCH=$2 | ||
|
||
if test $ARCH = 'default'; then | ||
ARCH=$(arch_default) | ||
fi | ||
echo $ARCH | ||
} | ||
|
||
arch_build() { | ||
# The build arch for a package is the host arch if the package | ||
# cannot be cross-built. Otherwise, if the host arch is a | ||
# 'personality' of the machine arch (e.g. amd64->i386), use the | ||
# host arch. Otherwise, use the machine arch. | ||
local DISTRO=$1 | ||
local ARCH=$2 | ||
local HOST_ARCH=$(arch_host $DISTRO $ARCH) | ||
|
||
if $NATIVE_BUILD_ONLY || \ | ||
! distro_base_repo $DISTRO $HOST_ARCH >/dev/null; then | ||
echo $HOST_ARCH | ||
return | ||
fi | ||
|
||
# By default, the build arch is the machine arch... | ||
local BUILD_ARCH=$(arch_machine) | ||
|
||
# ...But check for 'personality' compatibility | ||
if test $BUILD_ARCH = amd64 -a $HOST_ARCH = i386; then | ||
BUILD_ARCH=i386 | ||
fi | ||
|
||
echo $BUILD_ARCH | ||
} | ||
|
||
arch_machine() { | ||
# The machine arch is the Docker host's arch | ||
dpkg-architecture -qDEB_BUILD_ARCH | ||
} | ||
|
||
arch_is_foreign() { | ||
local DISTRO=$1 | ||
local ARCH=$2 | ||
local RES | ||
test $(arch_host $DISTRO $ARCH) = $(arch_build $DISTRO $ARCH) && \ | ||
RES=0 || RES=1 | ||
return $RES | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,9 @@ | ||
# RT kernel packages | ||
PACKAGES="xenomai rtai linux linux-tools linux-latest" | ||
DISTRO_PACKAGES[jessie]="xenomai rtai linux linux-tools linux-latest" | ||
# ZeroMQ packages | ||
PACKAGES+=" czmq" | ||
DISTRO_PACKAGES[jessie]+=" czmq" | ||
# Zultron Debian package repo | ||
PACKAGES+=" dovetail-automata-keyring" | ||
|
||
# Jessie arches | ||
ARCHES="amd64 i386 armhf" | ||
|
||
# Jessie distro mirror and keys | ||
DISTRO_MIRROR=http://http.debian.net/debian | ||
|
||
distro_configure_repos() { | ||
# Cross-build tools | ||
repo_configure_emdebian | ||
|
||
# Dovetail Automata; enable to pull deps not built locally | ||
#repo_configure_dovetail_automata # include for partial builds | ||
|
||
# RCN's ARM repo | ||
# repo_configure_rcn | ||
} | ||
DISTRO_PACKAGES[jessie]+=" dovetail-automata-keyring" | ||
|
||
# Repos to configure for jessie | ||
DISTRO_REPOS[jessie]="debian emdebian" |
Oops, something went wrong.