Skip to content

Commit

Permalink
More flexible kernel finding in hw-sama's collect-compiled.
Browse files Browse the repository at this point in the history
  • Loading branch information
rektide committed Mar 10, 2015
1 parent f4cea18 commit 7a899f8
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 68 deletions.
9 changes: 3 additions & 6 deletions examples-private/etcd.inventory
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ discovery_factoryt=https://discovery.etcd.io/new?
cluster_active_size=3

[etcd_srv]
10.0.0.1
10.0.0.1 port=4002
10.0.0.1 port=4003
10.0.0.2
10.0.0.3

127.0.0.1
127.0.0.1 port=4002
127.0.0.1 port=4003
36 changes: 33 additions & 3 deletions examples-private/pdebuild-cross.vars
Original file line number Diff line number Diff line change
@@ -1,20 +1,50 @@
---
ARCH: armel
ARCH: armhf
noauth: true
MULTISTRAP_REPOS:
- name: debian
source: http://debian.gtisc.gatech.edu/debian/
suite: jessie
source: http://http.debian.net/debian/
suite: unstable
keyring: debian-keyring
pkg_sets:
- BASE
- "BASE_{{ARCH}}"
- AUDIO
- AVAHI
- BT
#- CEPH
- DOCKER
- JACK
- MEDIA
- POSTGRES
- RYGEL
- WORKSTATION
#- AVAHI_X
#- WORKSTATION_X
#- WORKSTATION_KDE_BASE
#- WORKSTATION_KDE
#- WORKSTATION_MATE
- DEVEL
- DEBDEV
#- AUDIO_X
#- BT_X
#- RYGEL_X
#- JACK_PLUGINS
#- JACK_X
#- MEDIA_X
- XPRA
pkgs:
- pwgen
- screen
- mumble-server
- usbip
#- linux-image-3.16
components:
- main
- contrib
- non-free
- name: archive
source: http://archive.voodoowarez.com/debian/
suite: archive
pkgs:
- linux-image-3.19
18 changes: 9 additions & 9 deletions examples-private/reprepro.vars
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
REPOS:
- host: apt.yoyodyne.net
name: overthrust
label: yoyodyne apt
REPREPROS:
- host: archive.eldergods.com
name: archive
label: archive
description: yoyodyne's package archive
architectures:
- armel
- i386
- x32
- amd64
components: main
keyid: 6E6E6E6E
overrides:
- pkg: blah
key: foo
value: bar
#keyid: 6E6E6E6E
#overrides:
#- pkg: blah
# key: foo
# value: bar
NGINX: nginx-main
NGINX_ETC: "/srv/{{NGINX}}/etc"
6 changes: 0 additions & 6 deletions examples-private/sama5d3-xplained.vars

This file was deleted.

9 changes: 4 additions & 5 deletions files/build-deb-kernel.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e

Expand All @@ -7,12 +7,11 @@ set -e
[ -z "$LINUX_DEFCONFIG" ] && export DEFCONFIG="{{item.defconfig|default(LINUX_DEFCONFIG)|default(VAR+'/kernel-defconfig')}}"
[ -z "$LINUX_DIR" ] && export LINUX_DIR="{{item.repo_dir|default(LINUX_DIR)|default(SRCS_DIR+'/linux')}}"
[ -z "$LINUX_PARAM_EXTRA" ] && export LINUX_PARAM_EXTRA="{{item.kernel_param|default(LINUX_PARAM_EXTRA)|default('')}}"
[ -z "$LINUX_TARGET" ] && export KERNEL_TARGET="{{item.target|default(LINUX_TARGET)|default('deb-pkg')}}"
[ -z "$LINUX_TARGET" ] && export LINUX_TARGET="{{item.target|default(LINUX_TARGET)|default('deb-pkg')}}"
[ -z "$ARCH" ] && export ARCH="{{item.arch|default(ARCH)}}"
[ -z "$CROSS_COMPILE" ] && export CROSS_COMPILE="{{item.cc|default(CROSS_COMPILE)}}"
[ -z "$KBUILD_DEBARCH" ] && export KBUILD_DEBARCH="{{item.debarch|default(KBUILD_DEBARCH)}}"
[ -z "$LOCALVERSION" ] && export LOCALVERSION="{{ '-'+item.localversion|default(LOCALVERSION)|default('')}}"
[ -z "$KDEB_PKGVERSION" ] && export KDEB_PKGVERSION="{{ item.pkgversion|default(KDEB_PKGVERSION)|default('1.0${LOCALVERSION}')}}"
[ -z "$KDEB_PKGVERSION" ] && export KDEB_PKGVERSION="{{ item.pkgversion|default(KDEB_PKGVERSION)|default('1.0')}}"

# "inspired by" and distilled from https://github.com/RobertCNelson/armv7_devel/blob/v3.15.x-sama5-armv7/build_deb.sh
# http://www.spinics.net/lists/linux-kbuild/msg09276.html also shows hope of dtbs_install someday helping
Expand All @@ -27,7 +26,7 @@ cd "${LINUX_DIR}"
[ ! -f .config ] && cp "${LINUX_DEFCONFIG}" .config && echo "default config copied"

# make
time fakeroot make ${LINUX_PARAM_EXTRA} ${LINUX_TARGET}
time make ARCH=$ARCH $LINUX_PARAM_EXTRA $LINUX_TARGET

# extra
{{item.after_kernel|default(LINUX_AFTER)|default("")}}
Expand Down
4 changes: 1 addition & 3 deletions files/etcd/initial-cluster.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{% for i in range(groups.etcd_srv|len) -%}
{{ ENV.etcd_name }}{{i}}=http://{{ groups.etcd_srv[i] -}}:{{ hostvars[groups.etcd_srv[i]].port
{%- endfor -%}
ppp{{ inventory_hostname }}ooo
36 changes: 28 additions & 8 deletions files/hw-sama5d3/collect-compiled.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,41 @@
[ -z "$OUTPUT_DIR" ] && OUTPUT_DIR="{{OUTPUT_DIR}}"
[ -z "$BOARD" ] && BOARD="{{BOARD}}"
[ -z "$UBOOT_DIR" ] && UBOOT_DIR="{{UBOOT_DIR|default(SRCS_DIR+'/repo/uboot')}}"

cp $LINUX_DIR/arch/arm/boot/dts/$BOARD.dtb debian/tmp/boot/vmlinuz* "$OUTPUT_DIR/"
cp $UBOOT_DIR/{spl/u-boot-spl.bin,u-boot.img} "$OUTPUT_DIR/"
cp $AT91BOOT_DIR/sama*bin "$OUTPUT_DIR/"

[ -z "$LINUX_DIR" ] && LINUX_DIR="{{LINUX_DIR}}"
[ -z "$DEBS_DIR" ] && DEBS_DIR="$(readlink -f $LINUX_DIR)/.."
[ -z "$KBUILD_DEBARCH" ] && KBUILD_DEBARCH="{{debarch}}"
[ -z "$REPREPRO_DISTRO" ] && REPREPRO_DISTRO="{{REPREPRO_DISTRO}}"
[ -z "$AT91BOOT_DIR" ] && AT91BOOT_DIR="{{AT91BOOT_DIR}}"
[ -z "$UBOOT_DIR" ] && UBOOT_DIR="{{UBOOT_DIR}}"

cd $OUTPUT_DIR


# uboot
UBOOT_BINS=( "spl/u-boot-spl.bin" "u-boot.img" "u-boot.bin" )
for UBOOT_BIN in ${UBOOT_BINS[@]}
do
[ -f "$UBOOT_DIR/$UBOOT_BIN" ] && cp "$UBOOT_DIR/$UBOOT_BIN" .
done


# at91boot
[ -n "$(shopt -s nullglob; ls $AT91BOOT_DIR/binaries/sama*bin)" ] && cp $AT91BOOT_DIR/binaries/sama*bin .

DEBS_DIR="$(readlink -f $LINUX_DIR)/.."

# kernel
DEBS=( "linux-image" "linux-headers" "linux-firmware-image" "linux-libc-dev" )
for DEB in ${DEBS[@]}
do
FILE=${DEBS_DIR}/$( (cd ${DEBS_DIR}; ls -t $DEB*{{debarch}}*deb | head -n1) )
FILE=${DEBS_DIR}/$( (cd ${DEBS_DIR}; ls -t $DEB*${KBUILD_DEBARCH}*deb | head -n1) )
[ -e "$FILE" ] && ln -sf "$FILE" "$OUTPUT_DIR/"
reprepro includedeb ${REPREPRO_DISTRO} ${FILE}

[ -z "REPREPRO_BYPASS" ] && reprepro includedeb ${REPREPRO_DISTRO} ${FILE}
done

LATEST_DEB=$( (cd $DEBS_DIR ; ls -t linux-image*${KBUILD_DEBARCH}*deb | head -n1 ) )
VMLINUZ_DEB=$( dpkg -c $DEBS_DIR/$LATEST_DEB | grep 'boot/vmlinuz' | awk '{print $6}' )
dpkg --fsys-tarfile $DEBS_DIR/$LATEST_DEB | tar x --wildcards --strip-components=2 -f - "./boot/vmlinuz*"
ln -sf $LATEST_DEB vmlinuz-latest

cp $LINUX_DIR/arch/arm/boot/dts/$BOARD.dtb .
2 changes: 1 addition & 1 deletion files/hw-sama5d3/install-sd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

[ -z "$2" ] && export VAR="{{VAR}}"
[ -z "$3" ] && export IMAGE="${VAR}/pdebuild-cross.tgz"
[ -z "$3" ] && export IMAGE="{{IMAGE|default('${VAR}/pdebuild-cross.tgz')}}"
[ -z "$BINS_DIR" ] && export BINS_DIR="{{BINS_DIR}}"

if [ -z "$1" ]
Expand Down
25 changes: 15 additions & 10 deletions hw-sama5d3.xplained.pb
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,28 @@
PKGS:
- device-tree-compiler

localversion: ''
revision: 1.0
localversion: ''
cc: "{{CROSS_COMPILE}}"
debarch: "{{KBUILD_DEBARCH}}"

ARCH: "arm"
BOARD: at91-sama5d3_xplained
CROSS_COMPILE: "arm-linux-gnueabihf-"
CONCURRENCY_LEVEL: '$(nproc)'
OUTPUT_DIR: "{{VAR}}"
LINUX_DIR: "{{REPO_DIR}}/linux"
LINUX_DEFCONFIG: "{{VAR}}/kernel-defconfig"
LINUX_PARAM_EXTRA: ""
LINUX_TARGET: deb-pkg
LINUX_REVISION: "{{revision}}{{ '-' + localversion if localversion|default(False) else '' }}"
KBUILD_DEBARCH: "armhf"
KDEB_PKGVERSION: "{{revision}}{{ '-' + localversion if localversion|default(False) else '' }}"
REPREPRO_DISTRO: main
IMAGE: "{{VAR}}/pdebuild-cross.tgz"

ENV:
ENV_VARS:
- var
- bins_dir
- image
- arch
- cross_compile
- concurrency_level
Expand All @@ -51,7 +55,10 @@
- linux_target
- linux_revision
- kbuild_debarch
- kdeb_pkgversion
- reprepro_distro
- uboot_dir
- at91boot_dir

#BINS_RUN_BYPASS: True # install but do not run
# using mainline uboot is good enough; not seeing any advantage to at91boot
Expand All @@ -61,27 +68,25 @@
- part1-install-sd.sh
- part2-install-sd.sh
- collect-compiled.sh
- build-dtb.sh
- src: build-at91boot.sh
dest: build-at91boot-sd.sh
repo_dir: "{{REPO_DIR}}/at91boot"
target: sama5d3_xplainedsd_uboot_defconfig
- src: build-at91boot.sh
dest: build-at91boot-nand.sh
repo_dir: "{{REPO_DIR}}/at91boot"
target: sama5d3_xplainednf_uboot_defconfig
- src: ../build-uboot.sh
dest: build-uboot-sd.sh
repo_dir: "{{REPO_DIR}}/u-boot"
target: sama5d3_xplained_mmc_config
flavor: -sd
- src: ../build-uboot.sh
dest: build-uboot-nand.sh
repo_dir: "{{REPO_DIR}}/u-boot"
target: sama5d3_xplained_nandflash_config
flavor: -nand
- src: ../build-deb-kernel.sh
dest: build-deb-kernel.sh
repo_dir: "{{REPO_DIR}}/linux"
#config_target: "sama5_defconfig"
after_kernel: 'cp arch/arm/boot/dts/at91-sama5d3_xplained.dtb debian/tmp/boot/vmlinuz* "${OUTPUT_DIR}/"'
after_kernel: 'cp arch/arm/boot/dts/at91-sama5d3_xplained.dtb debian/tmp/boot/vmlinuz* "$OUTPUT_DIR/"; (linux_dir=$(pwd); ln -sf $(basename $(ls $linux_dir/debian/tmp/boot/vmlinuz*)) vmlinuz-latest)'

tasks:
- include: tasks/compfuzor.includes type=opt
Expand Down
15 changes: 4 additions & 11 deletions openstack-master.pb
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
---
- hosts: all
sudo: True
gather_facts: False
tags:
- packages
- root
vars_files:
- vars/common.vars
- vars/pkgs.vars
sudo: True
tasks:
- apt: pkg=${item} state=${APT_INSTALL}
with_items: ${OPENSTACK_MASTER}
only_if: not ${APT_BYPASS}
- set_facts:
INSTANCE: main
- include: tasks/multifuzor/persist.tasks
- include: openstack-keystone.pb
1 change: 1 addition & 0 deletions tasks/compfuzor.includes
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- debug: "msg=Compfuzor: FILESYSTEM"
- include: compfuzor/fs_base.tasks
when: DIR|default(False) or DIRS|default(False) or FILES|default(False) and not DIR_BYPASS|default(False)
- include: compfuzor/fs_repo.tasks
- include: compfuzor/fs_env.tasks
when: has_env.stdout|int != 0 or ENV|default(False) and not ENV_BYPASS|default(False)
- include: compfuzor/fs_hierarchy_multi.tasks
Expand Down
1 change: 1 addition & 0 deletions tasks/compfuzor/bins.tasks
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- name: "Create `BINS_DIR`"
file: path="{{BINS_DIR}}" state=directory mode=771
when: not not BINS
- debug: msg="{{BINS}}"
- name: "Copy `BINS` into place`"
template: src="files/{{ TYPE|default(NAME) }}/{{item.src|default(item.name) if item is mapping else item }}" dest="{{BINS_DIR}}/{{item.dest|default(item.name) if item is mapping else item}}" mode={{item.mode|default(0755)}}
with_items: BINS
Expand Down
2 changes: 1 addition & 1 deletion tasks/compfuzor/fs_env.tasks
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
when: PREFIX_DIR|default(False) and (ENV|default(False) or has_env.stdout|int != 0)
- name: link env.`TYPE` into PREFIX_DIR if not defined
file: src="{{DIR}}/env" dest="{{PREFIX_DIR}}/env.{{TYPE|default(NAME)}}" state=link
when: PREFIX_DIR|default(False) and (ENV|default(False) or has_env.stdout|int != 0 and has_type_env.stdout|int != 0)
when: PREFIX_DIR|default(False) and (ENV|default(False) or has_env.stdout|int != 1 and has_type_env.stdout|int != 0)
2 changes: 1 addition & 1 deletion vars/common.vars
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SPECS_DIR: "{{SRCS_DIR}}/spec"
WWW_LINKS_D: /etc/lighttpd2/links.d
NGINX: /etc/nginx
# package installation config
APT_INSTALL: installed
APT_INSTALL: latest
APT_BYPASS: False
APT_DEFAULT_COMPONENT: main
APT_DEFAULT_DISTRIBUTION: jessie
Expand Down
8 changes: 4 additions & 4 deletions vars/pkgs.vars
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ BASE:
- firmware-ralink
- firmware-realtek
- firmware-ti-connectivity
- gawk
- gnupg
- grep
- gzip
Expand Down Expand Up @@ -199,7 +200,7 @@ BASE:
- mount
- nftables
- xdg-user-dirs
- accountservices
- accountsservice
- iw
WORKSTATION:
- dnsutils
Expand Down Expand Up @@ -289,9 +290,8 @@ WORKSTATION_X:
- fonts-mplus
- fonts-inconsolata
- fonts-liberation
- ttf-anonyous-pro
- ttf-anonymous-pro
- lightdm
- accountservices
WORKSTATION_KDE_BASE:
- kde-baseapps
- konqueror-nsplugins
Expand Down Expand Up @@ -516,7 +516,7 @@ AUDIO:
- pulseaudio-module-lirc
- pulseaudio-module-raop
- pulseaudio-module-zeroconf
#- vorbis-tools
- vorbis-tools
#- earcandy
AUDIO_X:
- alsa-tools-gui
Expand Down

0 comments on commit 7a899f8

Please sign in to comment.