Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Add initial Linux pkgsrc bootstrap logic.

  • Loading branch information...
commit 10fb52e4a83ecb2392c8e0ba4e389395dee05824 1 parent 912490a
Atalanta Systems Engineering authored
5 pkgsrc/
@@ -33,12 +33,17 @@ Provides a package provider called pkgsrc which will install & remove pkgsrc pac
+At present the second phase of the boostrap is somewhat primitive, in that it downloads the dependencies required to run `pkgin`, installs them, and then installs `pkgin`. Because at this stage in the bootstrap we don't have an intelligent enough binary package manager, we need to specify the versions exactly. As these will vary depending on the release of pkgsrc and patch level of the individual repository, we provide the capability to specify these as attributes.
* `node['pkgsrc']['package_server']` - HTTP or FTP path for remote server where pkgsrc binaries reside.
* `node['pkgsrc']['bootstrap_tarball']['url']` - URL of the pkgsrc bootstrap tarball.
* `node['pkgsrc']['bootstrap_tarball']['checksum']` - MD5 checksum of the bootstrap tarball.
+* `node['pkgsrc']['pkgin']['dependencies']` - Hash of pkgin dependencies and version numbers
+* `node['pkgsrc']['pkgin']['version']` - Version of pkgin to install
The Atalanta Systems Linux pkgsrc repository is freely available, and is specified as a sane default. The pkgsrc bootstrap tarball is also available from the same repo, and its URL and checksum are included as sane defaults.
3  pkgsrc/attributes/default.rb
@@ -1,3 +1,6 @@
default['pkgsrc']['package_server'] = ''
default['pkgsrc']['bootstrap_tarball']['url'] = ''
default['pkgsrc']['bootstrap_tarball']['checksum'] = 'f3216fb24eaab37bccdadad44be518b9'
+default['pkgsrc']['pkgin']['dependencies'] = {'xz' => '5.0.3', 'bzip2' => '1.0.6', 'zlib' => '1.2.3', 'libarchive' => '2.8.4nb1'}
+default['pkgsrc']['pkgin']['version'] = ''
27 pkgsrc/recipes/linux-client.rb
@@ -1 +1,26 @@
+remote_file "/tmp/pkgsrc-bootstrap.tar" do
+ source node['pkgsrc']['bootstrap_tarball']['url']
+ action :create_if_missing
+execute "tar xvf /tmp/pkgsrc-bootstrap.tar" do
+ cwd "/"
+ creates "/usr/pkg/sbin/pkg_add"
+repo = node['pkgsrc']['package_server']
+dependencies = node['pkgsrc']['pkgin']['dependencies'].map { |d| d.join('-') }
+pkgin_version = node['pkgsrc']['pkgin']['version']
+dependencies.each do |dep|
+ execute "Install dependency #{dep}" do
+ target = ::File.join(repo, dep)
+ command "/usr/pkg/sbin/pkg_add #{target}"
+ not_if '/usr/pkg/sbin/pkg_info -e #{dep}'
+ end
+execute "Install pkgin version #{pkgin_version}" do
+ command = "/usr/pkg/sbin/pkg_add pkgin-#{pkgin_version}"
+ not_if '/usr/pkg/sbin/pkg_info -e pkgin'

0 comments on commit 10fb52e

Please sign in to comment.
Something went wrong with that request. Please try again.