mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Tidying up the Vagrant stuff. Added support for userscripts. More docs. (#601)
This commit is contained in:
committed by
Mikhail
parent
e082bb1f4c
commit
24d0ec4824
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
### Specific to building Armbian ###
|
||||
.vagrant/
|
||||
output/
|
||||
ubuntu-*-cloudimg-console.log
|
||||
|
||||
### General annoyances ###
|
||||
.DS_Store
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
## Quick Start with Vagrant
|
||||
# Quick Start with Vagrant
|
||||
|
||||
First, you'll need to [install vargrant](https://www.vagrantup.com/downloads.html) on your host box. You'll also need to install a plug-in that will enable us to resize the primary storage device. Without it, Vagrant images are too small to build Armbian.
|
||||
## Vagrant HOST Steps
|
||||
|
||||
The following steps are preformed on the *host* that runs Vagrant.
|
||||
|
||||
### Installing Vagrant and Downloading Armbian
|
||||
|
||||
First, you'll need to [install vargrant](https://www.vagrantup.com/downloads.html) on your host box. Next, you'll need to install a plug-in that will enable us to resize the primary storage device. Without it, the default Vagrant images are too small to build Armbian.
|
||||
|
||||
vagrant plugin install vagrant-disksize
|
||||
|
||||
Now we'll need to [install git](https://git-scm.com/downloads) and check out the Armbian code. While this might seem obvious, we'll rely on it being there when we use Vagrant.
|
||||
Now we'll need to [install git](https://git-scm.com/downloads) and check out the Armbian code. While this might seem obvious, we rely on it being there when we use Vagrant to bring up our guest-build box.
|
||||
|
||||
# Check out the code.
|
||||
git clone --depth 1 https://github.com/igorpecovnik/lib.git lib
|
||||
@@ -16,24 +22,38 @@ Now we'll need to [install git](https://git-scm.com/downloads) and check out the
|
||||
# This only needs done once and a while.
|
||||
vagrant box update
|
||||
|
||||
# Finally! Let's bring the box up. This might take a minute or two.
|
||||
### Armbian Directory Structure
|
||||
|
||||
Before we bring up the box, take note of the [directory structure]( https://docs.armbian.com/Developer-Guide_Build-Process/#directory-structure) used by the Armbian build tool. When you read the lib/Vagrant file you'll see that Vagrant automatically creates a directory for *output*. This is helpful as it enables you to easily get your images once built. It also speeds-up the build process by caching files used during the build. In addition, Vagrant creates the *userscripts* directory. This is where you'd put any files used to [customize the build process](https://docs.armbian.com/Developer-Guide_User-Configurations/).
|
||||
|
||||
### Creating the Vagrant Guest Box Used to Build
|
||||
Let's bring the box up. This might take a minute or two depending on your bandwidth and hardware.
|
||||
|
||||
# We have to be in the same directory as the Vagrant file.
|
||||
cd lib
|
||||
|
||||
# And now we simply let vagrant create out box and bring it up.
|
||||
vagrant up
|
||||
|
||||
# When the box has been installed we can get access via ssh.
|
||||
# (No need for passwords, Vagrant installs the keys we'll need.)
|
||||
vagrant ssh
|
||||
|
||||
Once it's finally up and you're logged in, it works much like any of the other install (note: these commands are run on the *guest* box).
|
||||
## Vagrant GUEST Steps
|
||||
|
||||
The following steps are all run on the *guest* Vagrant created for us.
|
||||
|
||||
Once it's finally up and you're logged in, it works much like any of the other install methods (NOTE: again, these commands are run on the *guest* box).
|
||||
|
||||
# Copy the compile script out of the lib directory.
|
||||
cp lib/compile.sh .
|
||||
|
||||
# Let's get buidling!
|
||||
sudo ./compile.sh
|
||||
|
||||
There are two directories that are mapped from the host to the guest:
|
||||
## More Vagrant HOST Steps
|
||||
|
||||
* You'll find the git repo is shared, and
|
||||
* The *output* directory is also shared (makes it easy to preserve cache, downloads, and IOSs between builds). It also makes them easily accessible on your host box.
|
||||
|
||||
Wrap up your vagrant box when no longer needed (log out of the guest before running these on the host system):
|
||||
Wrap up your vagrant box when no longer needed (log out of the guest before running these on the *host* system):
|
||||
|
||||
# Shutdown, but leave the box around for more building at a later time:
|
||||
vagrant halt
|
||||
|
||||
20
Vagrantfile
vendored
20
Vagrantfile
vendored
@@ -11,21 +11,25 @@ Vagrant.configure(2) do |config|
|
||||
#
|
||||
# $ vagrant plugin install vagrant-disksize
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
# Default images are not big enough to build Armbian.
|
||||
config.disksize.size = "40GB"
|
||||
|
||||
#######################################################################
|
||||
# We could sync more folders (that *seems* like the best way to go),
|
||||
# but in many cases builds fail because hardlinks are not supported.
|
||||
# So, a more failproof approach is to just use a larger disk.
|
||||
#
|
||||
# Following the directory structure outlined here:
|
||||
# https://docs.armbian.com/Developer-Guide_Build-Process/#directory-structure
|
||||
|
||||
# So we don't have to download the code a 2nd time.
|
||||
config.vm.synced_folder ".", "/home/ubuntu/lib"
|
||||
|
||||
#######################################################################
|
||||
# We could sync more folders (that seems like the best way to go),
|
||||
# but in many cases builds fail because hardlinks are not supported.
|
||||
# So, a more failproof approach is to just use a larger disk.
|
||||
|
||||
# Share folders with the host to make it easy to get our images out.
|
||||
config.vm.synced_folder "./output", "/home/ubuntu/output", create: true
|
||||
config.vm.synced_folder "../output", "/home/ubuntu/output", create: true
|
||||
|
||||
# Bring over your customizations.
|
||||
config.vm.synced_folder "../userpatches", "/home/ubuntu/userpatches", create: true
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.name = "Armbian Builder"
|
||||
|
||||
Reference in New Issue
Block a user