brbox is a bare-metal linux system built with buildroot. brbox provides the basic features for an embedded-linux system which can then be used as a foundation for extending different application on top. Some of the basic features provided by brbox are as follows
- Failsafe in-system programmability of the linux system via network(it uses a concept of backup and main rootfs copies)
- Includes a basic web-interface for upgrading brbox linux image.
- Includes zeroconf announcement on the network(easy to detect ip of headless-embedded-linux boxes running brbox).
- Monitoring of system parameters like ip,mac,ram-size,cpu-load etc via web-interface
###How to prepare fresh ubuntu 14.04 for brbox
sudo mkdir -p /mnt/buildramdisk
sudo chown user:user /mnt/buildramdisk(replace user with correct username)
sudo apt-get update
sudo apt-get install subversion git ckermit build-essential gcc-multilib libncurses5-dev expect
sudo vi /etc/fstab(add last line as "tmpfs /mnt/buildramdisk tmpfs defaults,gid=100,size=6G 0 0"
###How to start brbox from fresh?
mkdir -p /home/user/dl(this will ensure that your downloads are intact even if you delete whole brbox sandbox)
mkdir -p /home/user/sandbox
svn co http://github.com/hackboxguy/brbox(if asked, enter your git username and password)
ln -s /home/user/dl dl(as stated in step-1, this softlink ensure that your downloads are intact)
./build-image.sh -o /mnt/buildramdisk -v 01.00 -s mypw(-o is the output folder -v is the version number of the build, -s is your sudo passwd)
For the first time, this will take about 1 to 2 hours (because packages are to be downloaded fresh to dl - download directory) after ./build-image.sh is complete, you will see following files under /mnt/buildramdisk/01.00/output/images
- /mnt/buildramdisk/01.00/images/bootable-usb-disk.img (this is the image to be copied to usb-flash-memory using dd)
- /mnt/buildramdisk/01.00/images/uBrBoxRoot.uimg (this is the in-system upgrade package - linux can be updated without removing usb-flash)
###what to do once the image is built by build-image.sh script?
sudo dd if=/mnt/buildramdisk/00.01/images/bootable-usb-disk.img of=/dev/sdX bs=1M(use this step for creating bootable usb-flash-drive, replace /dev/sdX with correct device-node)
- Ensure that your motherboard's bios has set to boot from usb-flash-drive, and its EFI-boot is disabled
- Insert the usb-flash-drive and power your motherboard, wait for login prompt, and use root to login
###how to upgrade brbox via network without physically removing the usb-flash-drive?
scp /mnt/buildramdisk/00.01/images/uBrBoxRoot.uimg root@ip-of-brbox:/tmp/
ssh root@ip-of-brbox (use root to login)
brdskmgr -v(shows the version of current brbox)
update -u /tmp/uBrBoxRoot.uimg
reboot(this will reboot the system with newly programmed brbox)
ssh root@ip-of-brbox (use root to login)
brdskmgr -v(verify if the version is as per the latest updated brbox)
###Simplified steps to create BrBox based bootable sdcard for RaspberryPi-1
cd /home/user/sandbox/;svn co https://github.com/hackboxguy/brbox;cd brbox/trunk;ln -s /home/user/dl dl;./prepare-buildroot.sh;time ./build-image.sh -o /mnt/buildramdisk -v 00.01 -s my_sudo_pw -b raspi1
sudo sh -c "pv -tpreb /mnt/buildramdisk/00.01/images/bootable-usb-disk.img | dd bs=128k of=/dev/sdX conv=fdatasync"
- Insert the sdcard and boot Raspi and login using root/brb0x
###How to compile code for Raspberry-1 on x86 native host machine?
cd /home/user/sandbox/;git clone svn co https://github.com/hackboxguy/downloads
cp /home/user/sandbox/downloads/toolchain/brbox-raspi1-disptst.tar.xz /opt(ensure that your user has write permission to /opt)
cd /opt/;tar -xvf brbox-raspi1-disptst.tar.xz
ln -s brbox-raspi1-disptst/ brbox-raspi1-arm
cd /home/user/sandbox/;svn co https://github.com/hackboxguy/brbox
cmake -H. -BOutput -DCMAKE_INSTALL_PREFIX=/home/usr/tmp/brbox-install -DCMAKE_TOOLCHAIN_FILE=/home/user/sandbox/brbox/trunk/sources/cmake/brbox-raspi1-arm.cmake
cmake --build Output -- install -j4(use correct -j option based on number of cpu's for faster compilation time).
/home/usr/tmp/brbox-install(here you will see all compiled binaries for raspi-1, copy this folder to your raspberry-pi using scp)