diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2014-05-16 17:02:55 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2014-05-16 17:02:55 +0100 |
commit | f6ab09cc15e6c3c0a5c06ca81a29c5f8d4284305 (patch) | |
tree | 31bb0e956aa0eabdc29befba517d52a4e4b2a870 | |
parent | 96ba897f39d486ba45a19d890692c30284a360eb (diff) | |
parent | 4b5ffac402c73329f8ecfa4bc372100c885cd139 (diff) | |
download | definitions-f6ab09cc15e6c3c0a5c06ca81a29c5f8d4284305.tar.gz |
Merge branch 'baserock/danielsilverstone/vagrant-support'
-rw-r--r-- | bsp-x86_both-tools.morph | 18 | ||||
-rw-r--r-- | devel-system-x86_32-chroot.morph | 1 | ||||
-rw-r--r-- | devel-system-x86_64-chroot.morph | 1 | ||||
-rw-r--r-- | devel-system-x86_64-vagrant.morph | 29 | ||||
-rw-r--r-- | tools.morph | 7 | ||||
-rw-r--r-- | vagrant-files/home/vagrant/.ssh/authorized_keys | 1 | ||||
-rw-r--r-- | vagrant-files/manifest | 4 | ||||
-rw-r--r-- | vagrant.configure | 55 | ||||
-rw-r--r-- | virtualbox-guest-x86_64.morph | 21 |
9 files changed, 136 insertions, 1 deletions
diff --git a/bsp-x86_both-tools.morph b/bsp-x86_both-tools.morph new file mode 100644 index 00000000..a8630823 --- /dev/null +++ b/bsp-x86_both-tools.morph @@ -0,0 +1,18 @@ +name: bsp-x86_64-tools +kind: stratum +description: The set of platform specific components required for configuring a bootable + x86 based system. +build-depends: +- morph: core +chunks: +- name: nasm + repo: upstream:nasm + ref: 78bdad3d14fb875d5f2062957e326ba2a9e4ccb0 + unpetrify-ref: baserock/morph + build-depends: [] +- name: syslinux + repo: upstream:syslinux + ref: 8821237240c5374d83298b2da5ad88fa1e3c1ef7 + unpetrify-ref: baserock/morph + build-depends: + - nasm diff --git a/devel-system-x86_32-chroot.morph b/devel-system-x86_32-chroot.morph index e5cc2043..baca2904 100644 --- a/devel-system-x86_32-chroot.morph +++ b/devel-system-x86_32-chroot.morph @@ -15,3 +15,4 @@ strata: - morph: foundation - morph: tools - morph: openstack-clients +- morph: bsp-x86_both-tools diff --git a/devel-system-x86_64-chroot.morph b/devel-system-x86_64-chroot.morph index 04ab534c..50c757ea 100644 --- a/devel-system-x86_64-chroot.morph +++ b/devel-system-x86_64-chroot.morph @@ -15,3 +15,4 @@ strata: - morph: foundation - morph: tools - morph: openstack-clients +- morph: bsp-x86_both-tools diff --git a/devel-system-x86_64-vagrant.morph b/devel-system-x86_64-vagrant.morph new file mode 100644 index 00000000..a346ad2d --- /dev/null +++ b/devel-system-x86_64-vagrant.morph @@ -0,0 +1,29 @@ +arch: x86_64 +configuration-extensions: +- set-hostname +- add-config-files +- simple-network +- nfsboot +- install-files +- vagrant +description: A system that is able to build other systems based on the 64-bit x86 + architecture. This adds the virtualbox guest additions and vagrant configuration too +kind: system +name: devel-system-x86_64-vagrant +strata: +- morph: build-essential +- morph: core +- morph: foundation +- morph: genivi-foundation +- morph: bsp-x86_64-generic +- morph: connectivity +- morph: audio-bluetooth +- morph: x-common +- morph: x-x86_64-generic +- morph: multimedia +- morph: genivi +- morph: genivi-x-x86_64-generic +- morph: tools +- morph: virtualization +- morph: openstack-clients +- morph: virtualbox-guest-x86_64 diff --git a/tools.morph b/tools.morph index dcba3f80..5da65228 100644 --- a/tools.morph +++ b/tools.morph @@ -92,7 +92,7 @@ chunks: - six - name: morph repo: baserock:baserock/morph - ref: 06b61dd0344d8e3bf1039dffc964e1e58556e75d + ref: 72e66be042b9fc0457311708445d794a944487ca unpetrify-ref: master build-depends: - cliapp @@ -149,3 +149,8 @@ chunks: ref: c92f284c3cf76d471eb27a271de3a51cb45ed058 unpetrify-ref: baserock/morph build-depends: [] +- name: sudo + repo: upstream:sudo + ref: a4769dc7999b53260325fb89945bef85714fb338 + unpetrify-ref: baserock/morph + build-depends: [] diff --git a/vagrant-files/home/vagrant/.ssh/authorized_keys b/vagrant-files/home/vagrant/.ssh/authorized_keys new file mode 100644 index 00000000..18a9c00f --- /dev/null +++ b/vagrant-files/home/vagrant/.ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key diff --git a/vagrant-files/manifest b/vagrant-files/manifest new file mode 100644 index 00000000..67168341 --- /dev/null +++ b/vagrant-files/manifest @@ -0,0 +1,4 @@ +0040755 0 0 /home +0040755 1000 0000 /home/vagrant +0040700 1000 1000 /home/vagrant/.ssh +0100600 1000 1000 /home/vagrant/.ssh/authorized_keys diff --git a/vagrant.configure b/vagrant.configure new file mode 100644 index 00000000..abc3ea0c --- /dev/null +++ b/vagrant.configure @@ -0,0 +1,55 @@ +#!/bin/sh +# Copyright (C) 2014 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License.5 +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +set -e + +ROOT="$1" + +if test "x$VAGRANT" = "x"; then + exit 0 +fi + +for needed in etc/ssh/sshd_config etc/sudoers; do + if ! test -e "$ROOT/$needed"; then + echo >&2 "Unable to find $needed" + echo >&2 "Cannot continue configuring as Vagrant basebox" + exit 1 + fi +done + +# SSH daemon needs to be configured to not use DNS... +sed -i -e's/^(.*[Uu]][Ss][Ee][Dd][Nn][Ss].*)$/#\1/' "$ROOT/etc/ssh/sshd_config" +echo "UseDNS no" >> "$ROOT/etc/ssh/sshd_config" + +# We need to add a vagrant user with "vagrant" as the password We're doing this +# manually because chrooting in to run adduser is not really allowed for +# deployment time since we wouldn't be able to run the adduser necessarily. In +# practice for now we'd be able to because we can't deploy raw disks +# cross-platform and expect extlinux to install but we won't, for good +# practice and to hilight this deficiency. +echo 'vagrant:x:1000:1000:Vagrant User:/home/vagrant:/bin/bash' >> "$ROOT/etc/passwd" +echo 'vagrant:/6PTOoWylhw3w:16198:0:99999:7:::' >> "$ROOT/etc/shadow" +echo 'vagrant:x:1000:' >> "$ROOT/etc/group" +mkdir -p "$ROOT/home/vagrant" +chown -R 1000:1000 "$ROOT/home/vagrant" + +# Next, the vagrant user is meant to have sudo access +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> "$ROOT/etc/sudoers" + +# And ensure that we get sbin in our path +echo 'PATH="$PATH:/sbin:/usr/sbin"' >> "$ROOT/etc/profile" +echo 'export PATH' >> "$ROOT/etc/profile" + diff --git a/virtualbox-guest-x86_64.morph b/virtualbox-guest-x86_64.morph new file mode 100644 index 00000000..4babc6da --- /dev/null +++ b/virtualbox-guest-x86_64.morph @@ -0,0 +1,21 @@ +name: virtualbox-guest-x86_64 +kind: stratum +description: | + VirtualBox Guest Additions for x86_64 +build-depends: +- morph: tools +- morph: bsp-x86_64-generic +- morph: x-common +- morph: x-x86_64-generic +chunks: +- name: yasm + repo: upstream:yasm + ref: fefefe262eb29081f0bcb4d48f2d476ce5730562 + unpetrify-ref: baserock/morph + build-depends: [] +- name: vboxguest + repo: upstream:VirtualBox + ref: 617aeb5a3c13f4a46423e8c2fb560449403ad56d + unpetrify-ref: baserock/morph + build-depends: + - yasm |