vagrant-vbguest-redhat-kernel-update 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: da466fa5890abfd0184055d46420f3ff74c7746c
4
+ data.tar.gz: 3447fcd8955ddb565200f62cd02d58e06877a2bc
5
+ SHA512:
6
+ metadata.gz: 8ead4588f3e560f0b8e576fdcf6d18b68769e49043c25588a845209145726d67312cc67b9ce2ab8ade07870a65d3953051cd16cc8b3a425b627c57ba88ff95fd
7
+ data.tar.gz: 6e9186e1aa7235494cc4963d0d8398990056387d687ff6549ddc223d40fd023116064c4ad626a12b1cf990bc6de4f44be6e3a4132b2bcbd26a810bc35d30c340
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.vagrant
11
+ /Vagrantfile
12
+ /*.iso
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at robert@dotless.de. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development do
4
+ # gem "vagrant", git: "https://github.com/hashicorp/vagrant.git", tag: "v1.8.6"
5
+ gem "vagrant", path: '/Users/asharpe/work/code/git/github/asharpe/vagrant'
6
+ end
7
+
8
+ group :plugins do
9
+ gem "vagrant-proxyconf"
10
+ # gem "vagrant-vbguest"
11
+ gem "vagrant-vbguest", path: '/Users/asharpe/work/code/git/github/asharpe/vagrant-vbguest'
12
+
13
+ # see https://gist.github.com/torras/3cc2159105fbfb7d7f5d63967ab045c8
14
+ gemspec
15
+ # gem "vagrant-vbguest-redhat-kernel-update", path: '.'
16
+ end
17
+
18
+ # Specify your gem's dependencies in vagrant-vbguest-kernel-update.gemspec
19
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Robert Schulze <robert@dotless.de>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # VagrantVbguestRedHatKernelUpdate
2
+
3
+ This is an experimental VagrantVbguest Installer which attempts to update the kernel to the latest available version before installing the guest additions
4
+
5
+
6
+ ## Installation
7
+
8
+ This plugin requires the vagrant plugin [vagrant-vbguest](https://github.com/dotless-de/vagrant-vbguest/)
9
+
10
+ ```bash
11
+ vagrant plugin install 'vagrant-vbguest-redhat-kernel-update'
12
+ ```
13
+
14
+
15
+ ## Contributing
16
+
17
+ I don't have a lot of time for this project so you may wish to fork and move on. I will happily accept pull requests if they match the existing work and don't break existing functionality.
18
+
19
+
20
+ ## License
21
+
22
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
23
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,16 @@
1
+ begin
2
+ require "vagrant-vbguest"
3
+ rescue LoadError
4
+ raise "This Vagrant plugin requires the vagrant-vbguest plugin."
5
+ end
6
+
7
+ require "vagrant-vbguest-redhat-kernel-update/version"
8
+ require "vagrant-vbguest-redhat-kernel-update/installer"
9
+
10
+ module VagrantVbguestRedHatkernelUpdate
11
+ class Plugin < Vagrant.plugin("2")
12
+
13
+ name "vagrant-vbguest-redhat-kernel-update"
14
+ description "Extends vagrant-vbguest to update the kernel before installation (hopefully allowing dependency packages to be available in the repository)."
15
+ end
16
+ end
@@ -0,0 +1,62 @@
1
+ module VagrantVbguestRedHatKernelUpdate
2
+ class Installer < ::VagrantVbguest::Installers::RedHat
3
+ include VagrantVbguest::Helpers::Rebootable
4
+
5
+ # Install missing deps and yield up to regular linux installation
6
+ def install(opts=nil, &block)
7
+ # kernel-headers will be installed here if a glibc update comes through
8
+ communicate.sudo(install_dependencies_cmd, opts, &block)
9
+ check_and_upgrade_kernel!(opts, &block)
10
+ super
11
+
12
+ # really old versions of the guest additions (4.2.6) fail to
13
+ # remove the vboxguest module from the running kernel, which
14
+ # makes the loading of the newer vboxsf module fail.
15
+ # The newer init scripts seem to do it just fine, so we'll just
16
+ # use them to get this working
17
+ restart_additions(opts, &block)
18
+ end
19
+
20
+ protected
21
+
22
+ def restart_additions(opts=nil, &block)
23
+ communicate.sudo("/etc/init.d/vboxadd restart", opts, &block)
24
+ end
25
+
26
+ # TODO submit MR to have this in upstream
27
+ def dependency_list
28
+ packages = [
29
+ 'gcc',
30
+ 'binutils',
31
+ 'make',
32
+ 'perl',
33
+ 'bzip2'
34
+ ]
35
+ end
36
+
37
+ def dependencies
38
+ dependency_list.join(' ')
39
+ end
40
+
41
+ def check_and_upgrade_kernel!(opts=nil, &block)
42
+ check_opts = {:error_check => false}.merge(opts || {})
43
+ exit_status = communicate.sudo("yum check-update kernel", check_opts, &block)
44
+
45
+ if exit_status == 100 then
46
+ upgrade_kernel(opts, &block)
47
+ else
48
+ communicate.sudo("yum -y install kernel-{devel,headers}")
49
+ end
50
+ end
51
+
52
+ def upgrade_kernel(opts=nil, &block)
53
+ @env.ui.warn("Attempting to upgrade the kernel")
54
+ communicate.sudo("yum -y upgrade kernel{,-devel,-headers}", opts, &block)
55
+ @env.ui.warn("Restarting to activate upgraded kernel")
56
+ reboot!(@vm, {:auto_reboot => true})
57
+ end
58
+
59
+
60
+ end
61
+ end
62
+ VagrantVbguest::Installer.register(VagrantVbguestRedHatKernelUpdate::Installer, 6)
@@ -0,0 +1,3 @@
1
+ module VagrantVbguestRedHatKernelUpdate
2
+ VERSION = "0.2.1"
3
+ end
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-vbguest-redhat-kernel-update/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-vbguest-redhat-kernel-update"
8
+ spec.version = VagrantVbguestRedHatKernelUpdate::VERSION
9
+ spec.authors = ["Andrew Sharpe"]
10
+ spec.email = ["andrew.sharpe.79@gmail.com"]
11
+
12
+ spec.summary = %q{Extends vagrant-vbguest to update the kernel to the latest before installation.}
13
+ spec.description = <<-DESC
14
+ This is an experimental extension to vagrant-vbguest.
15
+ DESC
16
+ spec.homepage = "https://github.com/asharpe/vagrant-vbguest-redhat-kernel-update"
17
+ spec.license = "MIT"
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
+ f.match(%r{^(test|spec|features)/})
21
+ end
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.add_dependency "vagrant-vbguest", "~> 0.12"
27
+
28
+ spec.add_development_dependency "bundler", "~> 1.14"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-vbguest-redhat-kernel-update
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Sharpe
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-12-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: vagrant-vbguest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '0.12'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.14'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.14'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: |2
56
+ This is an experimental extension to vagrant-vbguest.
57
+ email:
58
+ - andrew.sharpe.79@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - CODE_OF_CONDUCT.md
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/setup
70
+ - lib/vagrant-vbguest-redhat-kernel-update.rb
71
+ - lib/vagrant-vbguest-redhat-kernel-update/installer.rb
72
+ - lib/vagrant-vbguest-redhat-kernel-update/version.rb
73
+ - vagrant-vbguest-redhat-kernel-update.gemspec
74
+ homepage: https://github.com/asharpe/vagrant-vbguest-redhat-kernel-update
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.0.14
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Extends vagrant-vbguest to update the kernel to the latest before installation.
98
+ test_files: []