brbox is a wrapper tools/script around buildroot to help in creating bare-metal bootable Linux images for different single-board-computers. It provides the foundational features of an embedded Linux system, serving as a base for extending and integrating various applications.
Update!!: A more recent, cleaner and well maintained version of brbox image creation is available here
- Failsafe In-System Programmability: Allows network-based Linux system updates using backup and main rootfs copies(A/B).
- Zeroconf Announcement: Makes it easy to detect the IP of headless embedded Linux systems running brbox.
- System Monitoring: Displays parameters such as IP, MAC address, RAM size, and CPU load via the web interface.
- Create and prepare a build directory:
sudo mkdir -p /mnt/buildramdisk sudo chown user:user /mnt/buildramdisk # Replace 'user' with your username
- Install required dependencies:
sudo apt-get update sudo apt-get install subversion git ckermit build-essential gcc-multilib libncurses5-dev expect
- Configure temporary RAM disk(optional - but this step helps not to stress your hdd due to large amount of buid data):
Add the following line(change the size as per your hw config):
sudo vi /etc/fstab
tmpfs /mnt/buildramdisk tmpfs defaults,gid=100,size=6G 0 0
- Prepare directories:
mkdir -p /home/user/dl mkdir -p /home/user/sandbox cd /home/user/sandbox
- Clone the repository(with softlink, retain dl folder to avoid repeated downloads):
git clone https://github.com/hackboxguy/brbox.git cd brbox mkdir -p ~/dl ln -s ~/dl dl
- Prepare and build the system(e.g for pc-x86-64-efi):
./prepare-buildroot.sh ./build-image.sh -o /mnt/buildramdisk -v 01.00 -s mypw -b pc-x86-64-efi
-o
: Output folder-v
: Build version number-s
: Your sudo password-s
: board type
The first build may take 1–2 hours. Once complete, the following files will be generated:
- bootable-usb-disk.img: Use this image for creating a bootable USB drive.
- uBrBoxRoot.uimg: Upgrade package for in-system updates(OTA).
- Use the
dd
command to write the image to a USB drive:Replacesudo dd if=/mnt/buildramdisk/01.00/images/bootable-usb-disk.img of=/dev/sdX bs=1M
/dev/sdX
with the correct device node. - Configure your BIOS to boot from the USB drive and disable EFI boot.
- Insert the USB drive and power up your system. Log in using the
root
account.
- Copy the upgrade package to the device:
scp /mnt/buildramdisk/01.00/images/uBrBoxRoot.uimg root@<brbox-ip>:/tmp/
- Log in via SSH:
ssh root@<brbox-ip>
- Perform the upgrade:
brdskmgr -v # Check current version update -u /tmp/uBrBoxRoot.uimg reboot
- Verify the upgrade:
ssh root@<brbox-ip> brdskmgr -v # Confirm the updated version
- Create and build the image:
cd ~/ git clone https://github.com/hackboxguy/brbox.git cd brbox mkdir -p ~/dl/;ln -s ~/dl dl ./prepare-buildroot.sh time ./build-image.sh -o /mnt/buildramdisk -v 00.01 -s my_sudo_pw -b raspi1
- Create a bootable SD card:
Replace
sudo sh -c "pv -tpreb /mnt/buildramdisk/00.01/images/bootable-usb-disk.img | dd bs=128k of=/dev/sdX conv=fdatasync"
/dev/sdX
with the correct device node. - Boot your Raspberry Pi with the SD card and log in as
root
with the passwordbrb0x
.