Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
vagrant_ansible_inventory_default
freetzsrc/*
*~
.vagrant
config
images
1 change: 0 additions & 1 deletion .vagrant/machines/default/virtualbox/action_provision

This file was deleted.

1 change: 0 additions & 1 deletion .vagrant/machines/default/virtualbox/action_set_name

This file was deleted.

1 change: 0 additions & 1 deletion .vagrant/machines/default/virtualbox/id

This file was deleted.

93 changes: 86 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,93 @@
freetz-vagrant
==============

a Vagrant development environment for freetz
Set up a build environment for [Freetz](http://freetz.org/), a firmware-extension (modification) for
the AVM Fritz!Box, using [Vagrant](http://www.vagrantup.com/) and
[Ansible](http://www.ansible.com/).

Usage
==============

1. Clone repo
2. cd freetz-vagrant
3. vagrant up
4. vagrant ssh
5. cd /freetz/src
6. make menuconfig
Install necessary software
--

1. Install VirtualBox from http://www.vagrantup.com/
2. Install Vagrant from http://www.vagrantup.com/
3. Install Ansible from http://www.ansible.com/

Note: you can use Vagrant with other desktop virtualization software, see
the Vagrant documentation for detail.

Bring up the virtual machine
--

1. Clone this repo
2. Edit Vagrantfile to adjust the Subversion URL (stable or trunk)
3. If you have a Freetz `.config`, place it in the top-level directory
(alongside the `Vagrantfile`) as `config`.
4. Provision the VM with `vagrant up`. Depending on the speed of your
internet connection, this will take between 5 and 30 minutes, and will
download about 500 MB for the image, and about 150 MB for the necessary
packages.
5. Enter the VM with `vagrant ssh`
6. Run the Freetz build

```bash
cd freetz
make menuconfig
make
```

Running `make` will download all necessary tools, the selected original AVM
firmware that will be modified, the package sources, etc., and
build the packages. Depending on the speed of your internet connection and
your computer, this will take about 30 minutes and download about 100 MB.

If everything works, the `make` command should output something like:

```
STEP 3: PACK
checking for left over Subversion directories
integrate freetz info file into image
packing var.tar
creating filesystem image
SquashFS block size: 64 kB (65536 bytes)
merging kernel image
kernel image size: 13.4 MB, max 15.4 MB, free 2.0 MB (2104832 bytes)
Aproximately maximal time for the answering machine: 14 min, 41 sec (881 sec)
packing images/7240_06.05-freetz-devel-13365.de_20150818-143843.image
image file size: 14.4 MB
done.

FINISHED

real 9m31.012s
user 7m53.560s
sys 1m2.584s
```


Saving the image and configuration
--

The final firmware image is available in the `images` directory (in
`~/freetz/images` inside the VM, and `./images` on the host).

The Freetz configuration file `.config` is stored in the top level
directory as `config`. When you ssh into the VM, a symlink is automatically
created at `~/freetz/.config`. Running `menuconfig` will replace this
symlink with the new configuration file. When you log out, that file will
automatically be copied back.


Cleaning up
--

After the image has been built, you can destroy the VM:

```bash
vagrant destroy
```

This will remove the VM including it's virtual hard disk, and all downloaded
files.
27 changes: 13 additions & 14 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
Vagrant.configure("2") do |config|
config.vm.box = "debian7.2"
config.vm.box_url = "https://dl.dropboxusercontent.com/u/197673519/debian-7.2.0.box"
config.vm.box = "opscode-debian-8.1"
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-8.1_chef-provisionerless.box"
config.vm.hostname = "freetz"

config.vm.network :private_network, ip: "192.168.57.111"
config.vm.provider :virtualbox do |v|
v.memory = 512
v.cpus = 2
v.customize ["modifyvm", :id, "--name", "freetz"]
end

config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 512]
v.customize ["modifyvm", :id, "--name", "freetz-vm"]
end

config.vm.synced_folder "./freetzsrc", "/freetz"

config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/provision.yml"
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/provision.yml"
#ansible.extra_vars = { freetz_svn_url: 'http://svn.freetz.org/branches/freetz-stable-2.0' }
ansible.extra_vars = { freetz_svn_url: 'http://svn.freetz.org/trunk' }
end

end
2 changes: 1 addition & 1 deletion ansible/tasks/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
apt: update_cache=yes cache_valid_time=3600
tags: apt

- name: upgrade a server
- name: upgrade packages to current version
apt: upgrade=full
6 changes: 6 additions & 0 deletions ansible/tasks/apt.yml~
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: update apt cache
apt: update_cache=yes cache_valid_time=3600
tags: apt

- name: upgrade app packages to current version
apt: upgrade=full
12 changes: 11 additions & 1 deletion ansible/tasks/freetz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
---
- name: clone freetz repo
subversion: repo=http://svn.freetz.org/trunk dest=/freetz/src
subversion: repo={{ freetz_svn_url }} dest=freetz
sudo: no
- name: link images directory to shared vagrant directory
file: src=/vagrant/images dest=freetz/images state=link
sudo: no
- name: On login, symlink /vagrant/config to ~/freetz/config if it does not exist
lineinfile: dest=.profile state=present insertafter=EOF line='if [ ! -L ~/freetz/.config ]; then mv ~/freetz/.config ~/freetz/.config.old; ln -s /vagrant/config ~/freetz/.config; fi'
sudo: no
- name: On logout, copy ~/freetz/config to /vagrant/config if it is newer
lineinfile: dest=.bash_logout state=present insertafter=EOF line='if [ ! -L ~/freetz/.config ]; then cp -u ~/freetz/.config /vagrant/config; fi'
sudo: no
81 changes: 42 additions & 39 deletions ansible/tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,52 +19,55 @@
- name: General | Install required packages.
action: apt pkg={{ item }} state=latest
with_items:
- python-pycurl
- python-apt
- python-pip
- python-software-properties
- git-core
- ack-grep
- ngrep
- iotop
- htop
- di
- zsh
- vim
- tmux
- wget
- openssh-server
- ack-grep
- unzip
- imagemagick
- mktemp
- patchutils
- libusb-dev
- xz-utils
- perl
- build-essential
- autoconf
- automake
- libtool
- libncurses5-dev
- lib32ncurses5-dev
- libc6-dev-i386
- gcc-multilib
- zlib1g-dev
- flex
- bison
- patch
- texinfo
- tofrodos
- build-essential
- bzip2
- di
- fastjar
- flex
- gawk
- gcc-multilib
- gettext
- git-core
- htop
- imagemagick
- iotop
- jam
- pkg-config
- fastjar
- realpath
- lib32ncurses5-dev
- libacl1-dev
- libc6-dev-i386
- libcap-dev
- libncurses5-dev
- libreadline6-dev
- libstring-crc32-perl
- gawk
- libtool
- libtool-bin
- libusb-dev
- mktemp
- ngrep
- openssh-server
- patch
- patchutils
- perl
- pkg-config
- python
- python-apt
- python-pip
- python-pycurl
- python-software-properties
- realpath
- ruby
- subversion
- bzip2
- libacl1-dev
- libcap-dev
- texinfo
- tmux
- tofrodos
- unzip
- vim
- wget
- xz-utils
- zlib1g-dev
- zsh
Empty file added images/.gitkeep
Empty file.