msoula/cosmicbox

Questions...

Closed this issue · 2 comments

Hi,
first of all. Thank you for your work. It looks very clean and good documented. I never knew about the buildroot thing, that could had save me alot hours, because I could stick to raspbian, instead of moving over to ArchLinux.

As this decision (move to Archlinux) is done, I already created packages for LibraryBox on ArchLinux but haven't been able to finish it since them.

I have a few questions:

  1. Why did you create a complete copy of the sourcecode instead of pulling the latest stable and modify it to the way you need? IMHO The way it is now implemented causes redundant code and is harder to maintain for your.
  2. Because of which reason did you split up all the parts from /opt/piratebox do a custom configuration? What is your intention behind it? I want to understand that, maybe my current route on the project is not correct.
  3. How did you realise the different hostap versions for chipsets like the realtak ****cus one?

Thank you for your work,
best regards Matthias

Hi Matthias,

The CosmicBox project wouldn't exist without your work, so thank to you and also, thank you for your interest for the CosmicBox project.

About one year ago, Les Chats Cosmiques asked me to integrate the LibraryBox on RaspberryPi. I wrote two scripts that used the LibraryBox-core repo to install/configure or uninstall the LibraryBox on Raspbian. These scripts were quite complicated, but hey, they did the work!
But after that, I've been contacted by Les Chats Cosmiques to apply some changes (ssid, chat message, etc.) to their boxes on diverse occasion. Facing their many questions, I came to realize that, from noobs' perspectives, personalizing the librarybox to certain extents could prove quite difficult.
I was also bothered by the RaspberryPi's performance : it was too slow to boot, too many unused services started to kept using cpu and memory, there was no way to turn it off properly., etc. So I designed a new Rpi system that only cares about supporting the LibraryBox and nothing else.

Buildroot is a set of tools that automate the process of building an embedded system (kernel + filesystems). For the kernel, I used the default raspberrypi configuration (raspberry_defconfig) and I added the support for the WiFi USB antennae Wi-Pi: rt2800usb - rt53xx (other antennae are not recognized by default, see README). For the filesystem, I selected some packages such as lighttp, hostap, python, php, etc.
The embedded system that is built is divided into two partitions:

  1. the first one contains both the kernel and the standard filesystem,
  2. the second one contains the LibraryBox specific filesystem.
    The first partition is mounted into RAM, thus we prevent the system from being corrupted from power cuts. The second partition can be modified when mounted.

Now, here are my answers:

  1. You perfectly right, I don't know what I was thinking! It will be fixed :)

  2. While I was integrating the LibraryBox code into the system integration, I removed some steps from the startup process (eg. ipv6 support) because I was trying to keep things as simple as possible. At the end, my fileystem was completly different from yours.
    The other reason is that I wanted the code to be easily modified by standard linux user. That is why the configuration file (/cosmicbox/cosmicbox.conf) is very small. I hope you're not bothered with this.

Here are the main steps:
- create /cosmicbox/etc dir from /cosmicbox/etc.templated dir. Each file from the ladder may be modified;
- configure www dir (prepare chat message, grant permissions);
- wait for wlan0 to be up;
- starts daemons (hostapd, dnsmasq, droopy (if droopy enabled), lighttpd)

  1. By default, the CosmicBox only supports the following driver: rt2800usb/rt53xx. However you can add all antennae and firmware you want (cf. README#ConfigurationOfTheCosmicbox).
    Concerning the ***CUS, it is a little more complicated. While working the original CosmicBox (the one with the scripts), I've created two patches from this article (http://www.jenssegers.be/blog/43/Realtek-RTL8188-based-access-point-on-Raspberry-Pi) for last version of both hostap and wpa_supplicant packages. Those patches are not integrated into this repository yet, I've to do some
    tests before commit them.
    Maybe I should work on a branch that generate a system that supports as many drivers as possible...

I hope my explanations are clear and answer your questions :)
Regards, Mathieu Soula

Thank you for your detailed answer!

The first partition is mounted into RAM, thus we prevent 
the system from being corrupted from power cuts. 
The second partition can be modified when mounted.

Whop, very good idea.
No, I don't mind about stripping down. I only - as mentioned- think it is important to not do a static 1:1 copy, because it makes more work that use later.

I started to work on a rework of the PirateBoxScripts which are much more modular. Maybe you are interested in contributing, and I think after that work, you have an idea what is going on ;)
You can find the first part of the rework here: https://github.com/PirateBox-Dev/PirateBoxScripts_Webserver/tree/configuration_n_start_rework/piratebox/piratebox/modules.available
I'm currently discussing and searching for people who are willing to support, help and contribute with

  • coding
  • documenting
  • testing
  • refactoring
    All the stuff to a more common framework, where LibraryBox, PirateBox and other projects can make simple use of it. Want to join? visit #piratebox on freenode :)

And we still need a better support for the RPi on PirateBox as well. ;)

Also check out this repository https://github.com/LibraryBox-Dev/package-arch-librarybox-config
I started to work on a guided UI for changing the configuration.