mirror of https://github.com/OpenIPC/wiki.git
parent
ab498b1475
commit
c490d6b8d9
|
@ -11,88 +11,67 @@
|
|||
|
||||
## Introduction
|
||||
|
||||
This document serves as a comprehensive guide for developers looking to contribute to the OpenIPC firmware, including how to build from sources, understand the project's structure, modify, and add new packages, as well as instructions for installing the firmware on devices.
|
||||
This document serves as a comprehensive guide for developers looking to contribute to the OpenIPC firmware, including how to build from sources, understand the project's structure, modify, and add new packages, as well as instructions for installing the firmware on devices. If you are simply looking for a pre-built binary, for one of the listed supported devices, then please goto here instead. *** need to update with actual link ****
|
||||
|
||||
We are currently developing a high-quality source code repository. Your patience is appreciated as we strive to deliver a fully polished and ready-to-use project.
|
||||
We are continuously working towards creating a high-quality source code repository. Your patience is appreciated as we strive to deliver a fully polished and ready-to-use project and welcome your thoughts and feedback through the OpenIPC telegram channel **make that a hyperlink *** https://t.me/openipc/117235.
|
||||
|
||||
## Building from Sources
|
||||
|
||||
Before you start building your own firmware, it's essential to make a few changes to your system and understand the general process.
|
||||
|
||||
### Clone OpenIPC Firmware Git Repository
|
||||
First step is to make a local copy of the OpenIPC firmware source code in your preferred location. We are using 'mylocalOpenIPC/src' in the script below but you can change this to whatever location you prefer e.g. ~/myprojects/myOpenIPC
|
||||
|
||||
```cd
|
||||
mkdir -p local/src
|
||||
cd local/src
|
||||
mkdir -p mylocalOpenIPC/src
|
||||
cd mylocalOpenIPC/src
|
||||
git clone https://github.com/OpenIPC/firmware.git openipc-firmware
|
||||
cd openipc-firmware
|
||||
```
|
||||
We now have a clone of the firmware repository source code.
|
||||
|
||||
### Install Required Packages
|
||||
To ensure your system has the required dependencies for a succesful build you can either use the pre-built **make deps** command which is in the root of the openipc-firmware directory you have just created or enter the commands manually in a terminal window.
|
||||
|
||||
To run the make script (recommended way as this will be maintained within the source code git repository itself) do this
|
||||
```bash
|
||||
sudo make deps
|
||||
```
|
||||
|
||||
For Debian/Ubuntu, an example of installing the necessary packages and downloading our repository:
|
||||
|
||||
or to manually enter the commands yourself do the following:
|
||||
```sudo apt-get update -y
|
||||
sudo apt-get install -y automake autotools-dev bc build-essential curl fzf git libtool rsync unzip
|
||||
git clone --depth=1 https://github.com/OpenIPC/firmware.git
|
||||
cd firmware
|
||||
```
|
||||
|
||||
Alternatively, you can use the following command in the root of your OpenIPC firmware directory to install dependencies:
|
||||
|
||||
```bash
|
||||
sudo make deps
|
||||
```
|
||||
|
||||
### Quick Build from Sources
|
||||
|
||||
To build the desired version of the firmware for your processor, run the following command in the root of the project. The files will be available in the directory "output/images".
|
||||
|
||||
```bash
|
||||
./building.sh hi3518ev300_ultimate
|
||||
```
|
||||
|
||||
Examples of rebuilding the Linux kernel, root filesystems, and individual packages in our project:
|
||||
|
||||
```BOARD=hi3518ev300_ultimate make br-linux-{dirclean,rebuild}
|
||||
BOARD=hi3518ev300_ultimate make br-rootfs-{squashfs,tar}
|
||||
BOARD=hi3518ev300_ultimate make br-vtund-openipc-{dirclean,rebuild}
|
||||
sudo apt-get install -y automake autotools-dev bc build-essential cpio \
|
||||
curl file fzf git libncurses-dev libtool lzop make rsync unzip wget libssl-dev
|
||||
```
|
||||
|
||||
### Create a Permanent Storage for Downloaded Bundles
|
||||
Buildroot https://buildroot.org/ is the Linux distribution used for OpenIPC. It is used in many embedded systems as it has a very small footprint and can easily be customized to include or exclude specific functionality (see this article on what is included in the OpenIPC build). dev-buildrootpackages.md
|
||||
|
||||
By default, Buildroot stores all downloaded files in `dl/` directory inside
|
||||
buildroot file tree.
|
||||
|
||||
OpenIPC building script creates a fresh buildroot file tree before every
|
||||
compilation, meaning either deletes all downloaded packages or copies them back
|
||||
and forth prior and after creating a fresh setup.
|
||||
|
||||
You can set your own storage directory outside of the buildroot tree. Add the
|
||||
following piece of code to `.profile` file in your home directory:
|
||||
By default every time you build the firmware the OpenIPC build script creates a fresh buildroot source file tree which results in unnecessary downloads or copying of files. To avoid this you can create a permanent location and set the BR2_DL_DIR environment variable to tell the build script of the fixed location.
|
||||
|
||||
Add the following piece of code to the `.profile` file in your home directory using your favourite text editor e.g. nano ~/.profile
|
||||
```bash
|
||||
#Buildroot directory for OpenIPC build
|
||||
BR2_DL_DIR="${HOME}/buildroot_dl"
|
||||
[ ! -d "$BR2_DL_DIR" ] && mkdir -p $BR2_DL_DIR
|
||||
export BR2_DL_DIR
|
||||
```
|
||||
|
||||
Then, source the changes.
|
||||
Then, source the changes to make them effective immediately.
|
||||
|
||||
```bash
|
||||
source ~/.profile
|
||||
```
|
||||
|
||||
### Build the firmware.
|
||||
If you have followed the above steps then you are now ready to build the firmware for your specific camera model.
|
||||
|
||||
Building of a binary firmware for your IP camera is fairly easy. Just clone
|
||||
source code from the repository and run:
|
||||
The Makefile located within the firmware directory contains the build script for each supported camera model.
|
||||
|
||||
You just need to ensure you are in the firmware directory e.g. ~/mylocalOpenIPC/src/openipc-firmware and run make.
|
||||
|
||||
```bash
|
||||
cd ~/mylocalOpenIPC/src/openipc-firmware
|
||||
make
|
||||
```
|
||||
|
||||
|
@ -108,12 +87,12 @@ with 16MB+ ROM, **FPV**, a release crafted specifically for use in drones,
|
|||
or **Mini**, a fully liberated version of the firmware with an alternative
|
||||
open-source streamer.
|
||||
|
||||
Select desired target and hit enter. Building ensues.
|
||||
Select the desired target and hit enter. Building will start. (If you get an error 'tar: This does not look like a tar archive' see the Note at the bottom of this section)
|
||||
|
||||
Process of building firmware binary takes from 15-20 minutes to several hours
|
||||
The process of building the firmware binary takes from 15-20 minutes to several hours
|
||||
depending on your computer performance and selected target. If you want to
|
||||
speed up the process, make sure you use a computer with SSD rather than HDD as
|
||||
the process of compiling involves a lot of reading and writing. Faster CPU is
|
||||
speed up the process, make sure you use a computer with a SSD rather than a HDD as
|
||||
the process of compiling involves a lot of reading and writing. A faster CPU is
|
||||
also beneficial, and one cannot have too much RAM, either. You could even rent
|
||||
an online virtual server for a handful of cents to compile your firmware with
|
||||
the power of cloud computing.
|
||||
|
@ -122,11 +101,11 @@ The very first run is the longest as the script will download every source
|
|||
bundle required for successful compilation. Consequent runs will take a little
|
||||
less time.
|
||||
|
||||
After the compilation is done, you'll find the final binary kernel and `rootfs`
|
||||
image in `output/images/` directory.
|
||||
After the compilation is done, you'll find the final binary kernel 'uImage' and `rootfs`
|
||||
image in the `output/images/` directory.
|
||||
|
||||
```
|
||||
paul@r610:~/src/openipc-firmware$ ls -l output/images/
|
||||
paul@r610:~/local/src/openipc-firmware$ ls -l output/images/
|
||||
total 35628
|
||||
-rw-r--r-- 1 paul paul 4816896 Nov 22 06:06 rootfs.squashfs.t10
|
||||
-rw-r--r-- 1 paul paul 14520320 Nov 22 06:06 rootfs.t10.cpio
|
||||
|
@ -134,6 +113,22 @@ total 35628
|
|||
-rw-r--r-- 1 paul paul 1597586 Nov 22 06:02 uImage.t10
|
||||
```
|
||||
|
||||
**Note:**If you are using Ubuntu you may come across an issue when using wget in the make scripts which causes the build to fail and is reported to the console with the message 'tar: This does not look like a tar archive
|
||||
'. This is because the wget command used in the script is failing to authenticate properly and so the result is an empty file.
|
||||
|
||||
The workaround for this is to ensure the Makefile in the firmware directory is updated with the addition of '--ca-directory=/etc/ssl/certs' so the prepare section will now read
|
||||
```
|
||||
prepare:
|
||||
@if test ! -e $(TARGET)/buildroot-$(BR_VER); then \
|
||||
wget -c -q **--ca-directory=/etc/ssl/certs** $(BR_LINK)/$(BR_VER).tar.gz -O $(BR_FILE); \
|
||||
mkdir -p $(TARGET); tar -xf $(BR_FILE) -C $(TARGET); fi
|
||||
```
|
||||
and the general/external.mk file is also updated to include:
|
||||
```
|
||||
export WGET := wget --ca-directory=/etc/ssl/certs --show-progress --passive-ftp -nd -t5 -T10
|
||||
```
|
||||
|
||||
|
||||
## Installing the Firmware
|
||||
|
||||
After you build your custom firmware, you need to install it on the camera.
|
||||
|
|
Loading…
Reference in New Issue