[Freifunk] Upgrade Virtual Freifunk Router on VMWare ESXi 6.5

As I mentioned earlier, I use a virtual Freifunk Router as part of my mobile Infrastructure / Server. With this little VM, I can actually run a big-area Freifunk Network with lots of users without having to invest in new TP-Link accesspoints: I am running the VM, outputing the Freifunk LAN to a designated VLAN and use old spare Accesspoints as dumb "Media-Converters" (LAN to WIFI ;)).

But, as I only use this appliance every now and then for different kind of conventions and conferences, I need to upgrade that Appliance manually, to get it straight to the latest version without waiting or reinstalling (and droping the VPN key...).

Actually, that is quite simple in VMWare: Just go to the terminal of said VM and get started. Well. Ok, stop! Before you're doing that, just remember: You're on a VM. You got no excuse at all for not making a backup - so just shutdown your VM, make a snapshot, then turn it back on - and get started. Better safe than sorry ;)!

First, we're going to install wget with SSL support

opkg update
opkg install wget

Then we need to find the latest version of our Freifunk Firmware - as sysupgrade package. I used the gluon-fftr-0.8.4-x86-vmware.vmdk to install the VM, so I need an x86-generic-sysupgrade.img.gz :). I found that thing here: https://github.com/freifunktrier/firmware_store/tree/master/firmware/stable/sysupgrade . However, please bear in mind to use the image from YOUR Freifunk Provider ;). Try to download the image and get to the "RAW FILE" link on Github and use it to download the file to your VM:

cd /tmp
wget -O sysupgrade.img.gz  https://github.com/freifunktrier/firmware_store/blob/master/firmware/stable/sysupgrade/gluon-fftr-0.8.6+jenk_tackin-x86-generic-sysupgrade.img.gz?raw=true

After that, apply the upgrade and reboot:

sysupgrade -v /tmp/sysupgrade.img.gz
reboot

And thats it :)!

Thanks a lot again to Freifunk Trier for supporting my project :).

[RaspPi] How To Compile OpenWRT Trunk with latest Raspberry Pi Kernel 3.10 for the RPi on Ubuntu 12.04

EDIT: This post is from 30.09.2013 and should be the "how to" to this post. However, I never released it for a now unknown reason. Because of the interest in this topic, I still will publish it today so that it can stand as some kind of documentation of what I did back then. However, I might not work anymore.

This is the latest Guide.

What are we doing here?
Building OpenWRT Trunk with the offical RPi 3.10 (next) Kernel.

Packages:
You can use some packages of the offical OpenWRT 12.09 Attitude Adjustment repo.
However, most kernel modules and stuff has to be built but yourself, as I
got no repo. Sorry!

Dependencies needed

sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip

Prepare Enviroment (Trunk)

cd ~
mkdir rpi_openwrt
cd rpi_openwrt
git clone git://git.openwrt.org/openwrt.git
cd openwrt
mkdir dl

Install Packages

./scripts/feeds update -a
./scripts/feeds install -a

Check Enviroment

make defconfig
make prereq

Download Kernel and Prepare:

cd /tmp

wget https://github.com/raspberrypi/linux/archive/rpi-3.10.y.tar.gz

tar xfvz rpi-3.10.y.tar.gz
mv linux-rpi-3.10.y linux-3.10.13
tar -cJvf linux-3.10.13.tar.xz linux-3.10.13/
mv linux-3.10.13.tar.xz ~/rpi_openwrt/openwrt/dl/

Prepare Target

cd ~/rpi_openwrt/openwrt/target/linux/brcm2708/

Remove the RPi Kernel specific patches

we don't need them because we use the ORIGINAL kernel

- and not some retailored standard kernel!

mv patches-3.10 patches-3.10.bkp
mkdir patches-3.10

check wheter the makefile does try to catch the right kernel version

vi Makefile

change LINUX_VERSION to LINUX_VERSION:=3.10.13

Prepare Generic Patches

cd ../generic/patches-3.10

Normally it should be ok to just remove some of the patches like this.

if make target/linux/{clean,prepare} V=99 does fail in patching stage

you would need to remove another patch here

but for the time beeing, lets kill these files which are known to

wreck it:

rm 063-arm-fix-fiq-vivt.patch
rm 880-gateworks_system_controller.patch

#Make
cd ~/rpi_openwrt/openwrt/
make menuconfig # Choose BCM2708 Chipset, Raspberry Pi Board, Exit and Save
make target/linux/{clean,prepare} V=99 # does extract kernel and patch it
make kernel_oldconfig # builds some tools
make kernel_menuconfig # configures kernel
make menuconfig # to change RPi Patterns, i.e.:

Packages rep:

Image configuration -> Version configuration options -> Release Repo to:

http://downloads.openwrt.org/attitude_adjustment/12.09/%T/generic/packages

Main Partition Size from 48 to 64:

Target Options -> Root File System Size, change from 48 to 64 MB or more

Exit and Save

make V=99 -j 3

Files are in ~/rpi_openwrt/openwrt/bin/brcm2708
( i.e. openwrt-brcm2708-sdcard-vfat-ext4.img )
New build:
make kernel_menuconfig
make menuconfig
make V=99 -j 3

[Docker] OpenWRT Images for x86, x64, Raspberry Pi and Raspberry Pi 2

As some of you know, I am trying to learn to use Docker.
I love the simplicity of this tool and the fact that a lot of my Appliances could be built and mainted more efficiently with the use of it.
So I thought "Well, I should at least try to create some useful Images for the Docker Registry / Hub" - and so I came up with the Github Repo of x-drum which I could not help - but fork ;). So, x-drum showed an easy way to build x86 Images for 14.07 and 15.05 OpenWRT.
And I thought "well, lets extend that". So now, we also got 12.09 OpenWRT x86, as well as trunk x86... and while I was doing some research, I slapped the x64 Versions for trunk and 15.05 on as well :).

But wait - somethings missing - yeah: We need some Raspberry Pi Stuff ;):
The guys over at Hypriot did an really awesome job with creating Hypriot OS - basically an bootable Image for RPi1/2 to use a recent Version of Docker :). But - truth been told - they already created some special RPi (ARM) Images on the Docker Hub - but... it would be nice to get some more base images to play with...

So I basically used Hypriot OS on a RPi 1 to create the OpenWRT 12.09, 14.07, 15.05 and Trunk Docker Images - and on a RPi 2 to create OpenWRT 15.05 and Trunk Docker Images.
The RPi 1 Images are also usable on a RPi 2 - so I recommend to use them. RPi 2 Images are only usable on a RPi 2 :).

Everything can be grabbed from my Github Repo: https://github.com/nmaas87/docker-openwrt or directly on Docker Hub.
The x86/x64 Images can be found on https://hub.docker.com/r/nmaas87/docker-openwrt/, while the RPi 1 and RPi 2 Images are here: https://hub.docker.com/r/nmaas87/rpi-openwrt/.

Have fun :)!

[RaspPi] OpenWRT Trunk with latest Raspberry Pi 3.10.32+ #648 Kernel – as Image download

As a lot of people asked for the OpenWRT / Raspberry Pi Images, I decided to make a new version which replaces the old one from this post ([RaspPi] OpenWRT Trunk with latest Raspberry Pi 3.10.18+ #585 Kernel – as Image download).

That said, the rules haven't changed:
- It is the trunk version of OpenWRT, injected with the latest Raspberry Pi Kernel
- opkg list does contain the current stable package list for the OpenWRT RPi port of the latest stable release and will work out of the box (opkg update, opkg install..) Most packages like apache should work out of the box – but kernel moduls could/will probably fail. I won’t build an package mirror and won’t build packages because of limitied time. Sorry!
- Other than the normal behavior, the RPi does use DHCP to get its IP Adress. To connect for the first time, use nmap to find your RPi in your network. (Then connect via telnet, set an password with passwd and you’re good to use SSH finally!)
- The main partition size has been changed from 48 MB to 64 MB – giving you additional space

You can just download and use the (7zip-ed) image here: rpi_openwrt_2.7z [ 6.1 MB ]

I WON'T BUILD PACKAGES!
This is for the fact that I neither got enough time, nor CPU power at hand.
Sorry :(!

[RaspPi] OpenWRT Trunk with latest Raspberry Pi 3.10.18+ #585 Kernel - as Image download

THIS POST IS OUTDATED! A NEW IMAGE HAS BEEN POSTED! PLEASE USE THE SEARCH FUNCTION TO FIND THE LATEST VERSION!

As I found out that the old tutorials weren't helpful and either the OpenWRT Trunk OR the Raspberry Pi Kernel broke the build process (you can still build it successfully, but you won't be able to use the RPi after boot!) - I sat down and found an new way. This time I don't let the kernel build by the OpenWRT enviroment, but insert an healthy and prebuilt one by the RPi Team ;)!

You can just download and use the (7zip-ed) image here: rpi_openwrt.7z [ 6.1 MB ]

There are several changes to the normal version:
- opkg list does contain the current stable package list for the OpenWRT RPi port of the latest stable release and will work out of the box (opkg update, opkg install..) Most packages like apache should work out of the box - but kernel moduls could/will probably fail. I won't build an package mirror and won't build packages because of limitied time. Sorry!
- Other than the normal behavior, the RPi does use DHCP to get its IP Adress. To connect for the first time, use nmap to find your RPi in your network. (Then connect via telnet, set an password with passwd and you're good to use SSH finally!)
- The main partition size has been changed from 48 MB to 64 MB - giving you additional space

All the best,

Nico

[RaspPi] How To Compile OpenWRT Trunk with latest Raspberry Pi Kernel 3.6 for the RPi on Ubuntu 12.04

What are we doing here?

As far as I understand the problem, there are two worlds:
Raspberry Pi Foundation on the one hand, the OpenWRT Team on the other one.
OpenWRT does try to patch "Default Kernels" until they work out with the intended Plattform, which does work in most cases very well.
The problem is, RPi is an new target for the latest OpenWRT Release - and does work - but it does not get much love of the devs:
No trunk compiles or nightlys of the Image or the packages - i.e.
And - the "so patched Kernel" does not represent the state of the art of the RPi Kernel Development at all:
I got many errors of the "first days of Pi", like the loved "SDcard error" which corrupted the whole filesystem and such.

User arsiskk of the raspberrypi-openwrt project had the same problem.
The rpi-openwrt project tried to deliever the first OpenWRT Experience to the RPi Users - competing with OpenWRT - and succeeded.
But the problem somehow remained: The old kernel was lingering there and the Team seemed to have given up the project after RPi
became an official target (https://code.google.com/p/raspberrypi-openwrt/).
So arsiskk developed a procedure to compile the raspberrypi-openwrt Code with the latest RPi Kernel - which worked awesome.
But as the project seems to be quite dead now - I tried to convert his idea and use it on the offical OpenWRT Trunk Sourcetree.
And that worked.

So long story short, what are we doing here?
We grab the trunk OpenWRT official source code, load the offical RPi Kernel into it, delete a bunch of files
which would only be needed to supply an standard kernel with a bit of RPi support and compile it.
In the end we will have the latest OpenWRT trunk with the latest RPi Kernel.
The only problem: You would sometimes need to rebuild packages which do not work with the official, but old (3.6.11, compared to OpenWRTs 3.10.4) Kernel.
And - you can't update the OpenWRT trunk that easily.
It is basically an "build and throw away" system.
But it works!
# Dependencies needed
sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip

# Prepare Enviroment (Trunk)
cd ~
mkdir rpi_openwrt
cd rpi_openwrt
git clone git://git.openwrt.org/openwrt.git
cd openwrt
mkdir dl
# Install Packages
./scripts/feeds update -a
./scripts/feeds install -a

# Check Enviroment
make defconfig
make prereq

# Download Kernel and Prepare:
cd /tmp
wget https://github.com/raspberrypi/linux/archive/rpi-3.6.y.tar.gz
tar xfvz rpi-3.6.y.tar.gz
mv linux-rpi-3.6.y linux-3.6.11
tar cvf - linux-3.6.11/ | lzma > linux-3.6.11.tar.xz
mv linux-3.6.11.tar.xz ~/rpi_openwrt/openwrt/dl/

# Prepare Target
cd ~/rpi_openwrt/openwrt/target/linux/brcm2708/
vi Makefile
change LINUX_VERSION to LINUX_VERSION:=3.6.11
mkdir patches-3.6
cp config-3.10 config-3.6
cd ../generic/
cd patches-3.6
#if not exists, dl latest official openwrt, copy files from openwrt/target/linux/generic/patches-3.6 to here
# Normally it should be ok to just remove some of the patches like this:
rm *-mips*
rm *-phy*
rm a*
rm 880-gateworks_system_controller.patch
#But in case there are still errors on the make target/linux/{clean,prepare} V=99 Stage,
#remove all files except these, keep these files: (openwrt specific patches)
200-fix_localversion.patch 621-sched_act_connmark.patch
201-extra_optimization.patch 630-packet_socket_type.patch
202-reduce_module_size.patch 640-bridge_no_eap_forward.patch
210-darwin_scripts_include.patch 641-bridge_always_accept_eap.patch
211-stddef_include.patch 642-bridge_port_isolate.patch
212-byteshift_portability.patch 643-bridge_remove_ipv6_dependency.patch
220-module_exports.patch 644-bridge_optimize_netfilter_hooks.patch
230-openwrt_lzma_options.patch 650-pppoe_header_pad.patch
250-netfilter_depends.patch 651-wireless_mesh_header.patch
251-sound_kconfig.patch 652-atm_header_changes.patch
252-mv_cesa_depends.patch 653-disable_netlink_trim.patch
253-ssb_b43_default_on.patch 655-increase_skb_pad.patch
254-textsearch_kconfig_hacks.patch 900-slab_maxsize.patch
255-lib80211_kconfig_hacks.patch 910-kobject_uevent.patch
256-crypto_add_kconfig_prompts.patch 911-kobject_add_broadcast_uevent.patch
257-wireless_ext_kconfig_hack.patch 920-unable_to_open_console.patch
258-netfilter_netlink_kconfig_hack.patch 921-use_preinit_as_init.patch
260-move_bcm963xx_tag.patch 930-crashlog.patch
600-netfilter_layer7_2.22.patch 940-ocf_kbuild_integration.patch
601-netfilter_layer7_pktmatch.patch 941-ocf_20120127.patch
602-netfilter_layer7_match.patch 950-vm_exports.patch
603-netfilter_layer7_2.6.36_fix.patch 960-decompress_unlzo_fix.patch
604-netfilter_cisco_794x_iphone.patch 970-remove-unsane-filenames-from-deps_initramfs-list.patch
610-netfilter_match_bypass_default_checks.patch 980-arm_openwrt_machtypes.patch
611-netfilter_match_bypass_default_table.patch 992-mpcore_wdt_fix_watchdog_counter_loading.patch
612-netfilter_match_reduce_memory_access.patch 993-mpcore_wdt_fix_wdioc_setoptions_handling.patch
613-netfilter_optional_tcp_window_check.patch 994-mpcore_wdt_fix_timer_mode_setup.patch
620-sched_esfq.patch

#Make
cd ~/rpi_openwrt/openwrt/
make menuconfig # Choose BCM2708 Chipset, Raspberry Pi Board, Exit and Save
make target/linux/{clean,prepare} V=99 # does extract kernel and patch it
make kernel_oldconfig # builds some tools
make kernel_menuconfig # configures kernel
make menuconfig # to change RPi Patterns, i.e.:
# Packages rep:
# Image configuration -> Version configuration options -> Release Repo to:
# http://downloads.openwrt.org/attitude_adjustment/12.09/%T/generic/packages
# Main Partition Size from 48 to 64:
# Target Options -> Root File System Size, change from 48 to 64 MB or more
# Exit and Save
make V=99 -j 3

Files are in ~/rpi_openwrt/openwrt/bin/brcm2708
( i.e. openwrt-brcm2708-sdcard-vfat-ext4.img )
New build:
make kernel_menuconfig
make menuconfig
make V=99 -j 3

Inspiration and Help:
http://wiki.openwrt.org/doc/howto/build
https://code.google.com/p/raspberrypi-openwrt/issues/detail?id=11

OpenWRT

OpenWRT is one of my most "beloved" operating systems ever. I am using it since 2006, already. It is very small (>= 4 MB), light weight and therefore an excellent choice for embedded computing or very small appliances. I have used it on several occasions ("prototype") in my blog, but never actually gave a heads up in terms of "What is it?" - So, let’s get rid of that:

OpenWRT is a debian linux derivate especially made for routers. OpenWRT does derive from the famous Linksys WRT series, which were based on Linux. One of the founders found out about that and got Linksys (by pointing out about the caveats of the used Linux GPL License) to the point of releasing the source code (except the wifi drivers). From the point on, OpenWRT was founded and the project began to write an own "router linux". On the course of that adventure, several forks of OpenWRT were founded (i.e. FreeWRT) - but in the end, OpenWRT remained "THE" third hand firmware for your router. Nowadays OpenWRT does support a load of routers out of the box, with famous titles like the Linksys WRT Series or even hardware like the Seagate Dockstar (which was an sort of NAS Appliance for Seagate Hard drives).

But the project did not stop on providing an firmware: With ipkg and later opkg, they also did offer packages to configure your own router experience. By using an simple build system, nearly everyone is able to configure his personal firmware and setup the things he likes. While in the beginning, only router related stuff (like wifi tools or pppoe dialers and such) was available, also big programs like recent mysql, web or file servers are found in the packet manager.

Using this little, flexible OS in cooperation with the GPIO ports of an router, software defined Inputs and Outputs, you can use your router to switch on lights, close your garage door or sound an alarm as soon as some sensors tell your router to do so. Especially with the appearance of the Raspberry Pi and its GPIOs, fast CPU, big RAM and storage, this could be the OS of your choice.

So the next time you think about throwing away your old router, check www.openwrt.org and see whether you can make it do some cool stuff.

You will be surprised.

[OpenWRT] Build your own image on Ubuntu 10.03

I'm a huge geek when it comes down to OpenWRT.
I love the style of small little router boards with not much power consumption and still big impact and power.
I have been registred on OpenWRT Forums since 2006, and thats also the time I'm already working on it and doing (weird) stuff with it.
And actually I just plainly love that small debian derived linux.

And thats why most of you would be wondering why I never downloaded the build enviroment and build an image myself.
Actually, I have to face the same question. Because, In fact, its very easy to build an image from source to your own like.

I was thinking about writing an long big blog entry about this topic, but actually, its awesomly well documented within the OpenWRT Wiki, so I just give you the link and encourage you on building your own images: http://wiki.openwrt.org/doc/howto/build

But for all who want it short for Ubuntu 10.03, here are my notes:

install req:
apt-get install build-essential asciidoc autoconf binutils bison bzip2 \
flex gawk gettext libncurses5-dev libz-dev patch unzip zlib1g-dev subversion

download stable:
mkdir OpenWrt/
cd OpenWrt/
svn co svn://svn.openwrt.org/openwrt/branches/backfire

download and install feeds:
Before downloading feeds (additional predefined package build recipies for OpenWrt) you
can check which sources you want to include. Just edit feeds.conf.default in your base directory.
Then start the download with
./scripts/feeds update -a
install with
./scripts/feeds install -a

Building Process

1. Updating sources via Subversion
## Here, backfire is the directory name of the current release branch you're tracking
cd OpenWrt/backfire/
svn up

2. Updating package feeds
./scripts/feeds update -a
./scripts/feeds install -a

3. Creating a default configuration (if necessary)
make defconfig

4. Configuring the image(s) to build
make menuconfig

5. Building the image
make

copy images:
cd bin/
ls */

cleaning up
make clean

cleaing everything, erasing build images:
make distclean

If you need own files compiled into the image, put them to: OpenWrt/backfire/files

How to disable failsafe:

Edit "package/base-files/files/lib/preinit/30_failsafe_wait"
- FAILSAFE=
- pi_failsafe_net_message=true
- preinit_net_echo "Please press button now to enter failsafe"
- pi_failsafe_net_message=false
- fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE
+ FAILSAFE=false
+ #pi_failsafe_net_message=true
+ #preinit_net_echo "Please press button now to enter failsafe"
+ #pi_failsafe_net_message=false
+ #fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE