UPDATE: The latest builds and instructions are now at the 32-bit Arm Chef Infra and Cinc Client Builds for Linux landing page.
I blogged previously about building Chef 14 on the BeagleBone Black and I wanted to revise the instructions to cover both ARMv6l and ARMv7l builds with the BeagleBone Black and Raspberry Pi Zero respectively.
The Chef client is packaged with Omnibus, which builds the application and all of its runtime dependencies with the Omnibus-Toolchain. Omnibus is built with Ruby, so the instructions need to start with building Ruby. These instructions follow the Installing Debian 9 on a BeagleBone Black and the Installing Raspbian 9 on a Raspberry Pi Zero, so the Debian machines are ready for use.
There are several preparatory steps that need to be done before we get started.
root user update to ensure the latest packages are installed and install the prerequisites for building Ruby and Omnibus-Toolchain.
apt-get update apt-get upgrade apt-get install -y autoconf fakeroot git libreadline-dev libssl-dev zlib1g-dev
omnibus user for performing the builds.
Create and set permissions on the directories used for the upcoming builds.
mkdir /home/omnibus mkdir /var/cache/omnibus mkdir /opt/omnibus-toolchain mkdir /opt/chef chown omnibus:omnibus /home/omnibus chown omnibus:omnibus /var/cache/omnibus chown omnibus:omnibus /opt/omnibus-toolchain chown omnibus:omnibus /opt/chef
sudo su - omnibus bash
We don’t need documentation for our gems.
echo 'gem: --no-document' >> ~/.gemrc
rbenv and add it to our
git clone https://github.com/rbenv/rbenv.git ~/.rbenv cd ~/.rbenv && src/configure && make -C src export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
ruby-build plugin to make it easier to manage different Ruby versions.
mkdir plugins git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build rbenv install 2.6.0 rbenv global 2.6.0 eval "$(rbenv init -)"
Now that Ruby is installed, let’s build and install the Omnibus-Toolchain as the
cd git clone https://github.com/chef/omnibus-toolchain.git cd omnibus-toolchain bundle install --without development bundle exec omnibus build omnibus-toolchain -l internal
Once this build has completed, as the
root user remove the working directory and install the new omnibus-toolchain package.
rm -rf /opt/omnibus-toolchain dpkg -i ~omnibus/omnibus-toolchain/pkg/omnibus-toolchain*deb
There is a bug in the version of
tar provided by Omnibus, so let’s use Debian’s built-in version.
omnibus-toolchain installed, we can reset our
PATH and build Chef as the
cd export PATH="/opt/omnibus-toolchain/bin:$PATH" wget https://github.com/chef/chef/archive/v14.10.9.tar.gz tar -xzf v14.10.9.tar.gz cd chef-14.10.9/omnibus/ bundle install --without development bundle exec omnibus build chef -l internal
This usually takes several hours on these limited 32-bit ARM machines.
Installing Chef 14.10
Once the builds have completed, as the
root user we can delete the working build directory.
rm -rf /opt/chef
Now Chef 14.10.9 can be installed.
dpkg -i /home/omnibus/chef-14.10.9/omnibus/pkg/chef_14.10.9*arm*.deb