From 4a143d08d7a70a1dae14846d6a7bfec8732e17ba Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 16 May 2014 10:25:11 +0000 Subject: Update morph to version containing vagrant-related fixes These include virtualbox-ssh.write updates and also a fix to the write extension for raw disks and how it constructs the state subvolumes --- tools.morph | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools.morph b/tools.morph index dcba3f80..66eac31a 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 -- cgit v1.2.1 From da7f1db8c9a66e0a295ed0dfc49afed12687fbf6 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 16 May 2014 10:27:13 +0000 Subject: Add sudo, based off 1.8.10p2 We have a baserock/morph branch which is just the 1.8.10p2 tag no need for a morphology at this time. --- tools.morph | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools.morph b/tools.morph index 66eac31a..5da65228 100644 --- a/tools.morph +++ b/tools.morph @@ -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: [] -- cgit v1.2.1 From 13912d9262e44161e4609bda4b9cecaae5db3d6e Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 16 May 2014 10:28:45 +0000 Subject: Add a tools BSP stratum and add to the chroot devel systems for x86. This means that chroots will be able to build rawdisks providing the host has a compatible btrfs module. --- bsp-x86_both-tools.morph | 18 ++++++++++++++++++ devel-system-x86_32-chroot.morph | 1 + devel-system-x86_64-chroot.morph | 1 + 3 files changed, 20 insertions(+) create mode 100644 bsp-x86_both-tools.morph 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 -- cgit v1.2.1 From ab3cd75c9b2a2362efc042813ca8600c7c3d4b8f Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 16 May 2014 10:30:39 +0000 Subject: Vagrant basebox configure script. This sets up the various little bits vagrant relies on. --- vagrant.configure | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 vagrant.configure 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" + -- cgit v1.2.1 From 4b5ffac402c73329f8ecfa4bc372100c885cd139 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 16 May 2014 10:52:02 +0000 Subject: Vagrant system with virtualbox guest additions. At this time, the VirtualBox stuff is x86_64 only because we're abusing its build system to get to what we need. --- devel-system-x86_64-vagrant.morph | 29 +++++++++++++++++++++++++ vagrant-files/home/vagrant/.ssh/authorized_keys | 1 + vagrant-files/manifest | 4 ++++ virtualbox-guest-x86_64.morph | 21 ++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 devel-system-x86_64-vagrant.morph create mode 100644 vagrant-files/home/vagrant/.ssh/authorized_keys create mode 100644 vagrant-files/manifest create mode 100644 virtualbox-guest-x86_64.morph 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/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/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 -- cgit v1.2.1