Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #23 from hypriot/add-device-init
Browse files Browse the repository at this point in the history
WIP: Add device-init
  • Loading branch information
StefanScherer committed Feb 13, 2016
2 parents 642979d + 3046b84 commit 0a0e87d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/ubuntu1404"

config.vm.network "forwarded_port", guest: 2376, host: 2376
config.vm.network "forwarded_port", guest: 2376, host: 2376, auto_correct: true
config.vm.synced_folder ".", "#{`pwd`.chomp}"

config.vm.provider "vmware_fusion" do |v|
Expand Down
1 change: 1 addition & 0 deletions builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export KERNEL_VERSION="4.1.12"
export DOCKER_ENGINE_VERSION="1.10.1-1"
export DOCKER_COMPOSE_VERSION="1.6.0-27"
export DOCKER_MACHINE_VERSION="0.4.1-72"
export DEVICE_INIT_VERSION="0.0.14"

# create build directory for assembling our image filesystem
rm -rf ${BUILD_PATH}
Expand Down
3 changes: 2 additions & 1 deletion builder/chroot-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ proc /proc proc defaults 0 0
apt-get install -y \
"docker-hypriot=${DOCKER_ENGINE_VERSION}" \
"docker-compose=${DOCKER_COMPOSE_VERSION}" \
"docker-machine=${DOCKER_MACHINE_VERSION}"
"docker-machine=${DOCKER_MACHINE_VERSION}" \
"device-init=${DEVICE_INIT_VERSION}"

# enable Docker systemd service
systemctl enable docker
Expand Down
2 changes: 2 additions & 0 deletions builder/files/boot/device-init.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# hostname for your HypriotOS device
hostname: black-pearl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'spec_helper'

describe file('/etc/hypriot-firstboot_not_to_be_run') do
it { should be_file }
end
28 changes: 28 additions & 0 deletions builder/test-integration/spec/hypriotos-image/device-init_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'spec_helper'

describe package('device-init') do
it { should be_installed }
end

describe command('dpkg -l device-init') do
its(:stdout) { should match /ii device-init/ }
its(:stdout) { should match /0.0.14/ }
its(:exit_status) { should eq 0 }
end

describe file('/boot/device-init.yaml') do
it { should be_file }
its(:content) { should match /hostname: / }
end

describe file('/usr/local/bin/device-init') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
end

# describe command('device-init --version') do
# its(:stdout) { should match /0.0.14/m }
# # its(:stderr) { should match /^$/ }
# its(:exit_status) { should eq 0 }
# end

0 comments on commit 0a0e87d

Please sign in to comment.