Skip to content

Editing Project Setup Hints v5

alienatedsec edited this page Aug 20, 2023 · 4 revisions

It is still to be updated !!! - many areas didn't go as planned, so please be patient before following the below steps.

Information to collaborate on the project when creating the firmware.

Needed packages to build this project

Ubuntu 18.04 LTS 64Bit / Debian 9 (my current setup)

Local Build

sudo apt install build-essential autoconf p7zip p7zip-full p7zip-rar libxml2-utils yui-compressor mtd-utils upx-ucl pkg-config python3 python3-pip valgrind

Details about usage

  • upx => Ultimate Packer for eXecutables
  • yui-compressor => is CSS and JavaScript minifier
  • xmllint => libxml2-utils Formarting XML/HTML
  • autoconf => automatic configure script builder
  • p7zip p7zip-full p7zip-rar => Zip, 7z, Rar Compress
  • mtd-utils => Memory Technology Device Utilities
  • pkg-config => Get standard api metadata of software
  • python => Needed for meson and ninja
  • valgrind => Needed for jq-1.6 submodule (SD Hack branch)

Load the specific version of meson over Python3 PIP

pip3 install 'meson=0.51.1' 
pip3 install 'ninja=1.9.0'

  • meson => Build System
  • ninja => Small build system with a focus on speed

If meson is not usable on the console, attach this to your bashrc, because the installed app can't be found. Make this sure for the root user because the root is used for the build.

export PATH="~/.local/bin/:$PATH"

Helpful

Check the yui-compressor link to the right java version.

Install this version whenever possible https://github.com/roleoroleo/yi-hack-MStar/files/5989101/yui-compressor_2.4.8-2_all.deb.gz

The java wrapper on the yui-compressor bin can be strange on the path-building; remove it when not needed. If this is not corrected, the CSS and js are missing on the camera frontend.

Hi Camera SDK & Drivers Dependencies

sudo apt install gcc-arm-linux-gnueabi libbsd-dev lib32z1 lib32stdc++6-6-dbg u-boot-tools zlib1g-dev libncurses5-dev libncursesw5-dev uuid-dev flex bison byacc make m4 openssl zlib libcrypto

Install Tutorials for Hi SDK Setup

On 64Bit OS, only the additional 32 Libs are not needed.

Download Hi3518E SDK V1.0.4.0 direct here

China Helpful Steps

English Helpful Steps

Setup

Hints for creating home and root files for the specific cameras.

Clone the project to your dev environment - it will include all submodules.

git clone https://github.com/alienatedsec/yi-hack-v5.git --recursive

Add stock firmware that is needed and place them on folder stock_firmware

  • yi_cloud_dome_1080p -> home_y19 and rootfs_y19

  • yi_dome -> home_v201 and rootfs_v201

  • yi_dome_1080p -> home_h20 and rootfs_h20

  • yi_home -> home_y18 and rootfs_y18

  • yi_home_1080p -> home_y20 and rootfs_y20

  • yi_outdoor -> home_h30 and rootfs_h30

Extract all stock firmware and mount them and copy the content

sudo ./scripts/init_sysroot.all.sh

Extract specific stock firmware

sudo ./scripts/init_sysroot.sh yi_cloud_dome_1080p

Ensure each extracted firmware's folders are linked to the sysroot folder, and home and rootfs subfolders are filled with content.

Compile firmwares

./scripts/compile.sh

Make sure there is no compile or dependency error.

Package all firmwares

sudo ./scripts/pack_fw.all.sh

Package specific firmware

sudo ./scripts/pack_fw.sh yi_cloud_dome_1080p

Now on the out folder at the root level, you can find the packaged firmwares

  • yi_cloud_dome_1080p -> home_y19 and rootfs_y19

  • yi_dome -> home_v201 and rootfs_v201

  • yi_dome_1080p -> home_h20 and rootfs_h20

  • yi_home -> home_y18 and rootfs_y18

  • yi_home_1080p -> home_y20 and rootfs_y20

  • yi_outdoor -> home_h30 and rootfs_h30

Flash camera

  • You must use a micro sd card, place the images on the card, and put them on the camera.

  • This hack has a camera (baseline) and SD hack versions

  • This hack requires baseline 0.3.8 on the camera to flash any SD hack later versions.

  • After 30sec of yellow flashing, the new firmware is placed.

  • You need to have an SD card with the yi-hack-v5 folder at all times in order to use the hack

  • More about this hack version can be found at #267 and #279

In order to flash the baseload correctly, please ensure the following:

  • (1) you have a compatible Yi camera
  • (2) you are using an SD card of max 16GB or less
  • (3) your SD card is formatted to FAT32
  • (4) the file names for baseline 0.3.8 stored on SD root are exactly "rootfs_xxx" and "home_xxx" - Additionally, the yi-hack-v5 needs to be in the same location
  • (5) sometimes, if you use a Windows computer, it tends to rename downloaded files to, e.g. "rootfs_xxx (2)" etc. Make sure your files on the SD card are named exactly "rootfs_xxx" and "home_xxx"
  • (6) Insert the SD card, power cycle the camera and ensure that you don't interrupt the process.
  • (7) On the boot-up, the camera should be yellow blinking
  • (8) Firmware baseload should be in place now
  • (9) Load the latest version using WebUI afterwards