Giter VIP home page Giter VIP logo

hiburn's Introduction

hiburn

HiBurn


Deploy automation tool for HiSilicon`s ip camera modules

Part of OpenHisiIpCam project

๐Ÿ“ Table of Contents

๐Ÿ‘“ About

To deploy custom firmware (Kernel & RootFS images) onto a HiSilicon camera you usually need to do a number of actions: reset the camera's power, "catch" U-Boot console, configure network, launch TFTP server etc. It becomes especially irritating when you do it over and over again. The tool is intended to automate this routine. All you need is to launch hiburn, reset camera's power and press Enter. We believe it may save your time and nerves =)

๐Ÿ’ฟ Installation

The tool is written on python3 and needs (obviously) python3 as well, as a few packages from PyPI.

Assuming you are on some deb base GNU/Linux (like Debian or Ubuntu), you can satisfy deps following way:

foo@bar:~$ sudo apt-get install python3 python3-serial python3-pip
foo@bar:~$ sudo pip3 install tftpy

๐Ÿ”จ Usage

The actual description of capabilities and options you may get via ./hiburn_app.py --help:

foo@bar:~/hiburn$ ./hiburn_app.py --help
usage: hiburn_app.py [-h] [--verbose] (--serial V | --serial-over-telnet V)
                     [--no-fetch] [--reset-cmd RESET_CMD]
                     [--net-device_ip V] [--net-host_ip_mask V]
                     [--mem-start_addr V] [--mem-alignment V]
                     [--mem-linux_size V] [--mem-uboot_size V]
                     [--linux_console V]
                     {printenv,ping,download,upload,boot} ...

optional arguments:
  -h, --help                Show this help message and exit
  --verbose, -v             Print debug output
  --serial V                Serial port 'port[:baudrate[:DPS]]'
  --serial-over-telnet V    Serial-over-telnet endpoint '[host:]port'
  --no-fetch, -n            Assume U-Boot's console is already fetched
  --reset-cmd RESET_CMD     Shell command to reset device's power
  --net-device_ip V         Target IP address, default: 192.168.10.101
  --net-host_ip_mask V      Host IP address and mask's length, default: 192.168.10.2/24
  --mem-start_addr V        RAM start address, default: 0x80000000
  --mem-alignment V         RAM alignment for uploading, default: 64K
  --mem-linux_size V        Amount of RAM for Linux, default: 256M
  --mem-uboot_size V        , default: 512K
  --linux_console V         Linux load console, default: ttyAMA0,115200

Action:
  {printenv,ping,download,upload,boot}
    printenv            Print U-Boot environment variables
    ping                Configure network on device and ping host
    download            Download data from device's RAM via TFTP
    upload              Upload data to device's RAM via TFTP
    boot                Upload Kernel and RootFS images into device's RAM and boot it

Examples

There is an example command to upload images into device's memory via TFTP and boot it

foo@bar:~/hiburn$ ./hiburn_app.py --serial /dev/ttyCAM1:115200 --net-device_ip 192.168.10.101 --net-host_ip_mask 192.168.10.2/24 --mem-start_addr 0x80000000 --mem-linux_size 256M boot --uimage /path/to/my/kernel/uImage --rootfs /path/yo/my/rootfs.squashfs`

Notes

  • Since U-Boot usually connects to default TFTP server's port (69) you will need to be a root (or find some workaround like authbind). Another option is --ymodem-mode for uploading via serial port.
  • Existing commands write into your device's RAM only; its flash stays pristine. So the device won't turn into a brick if something goes wrong - just reset it.

The tool is written on Python and it should be easy to check sources and fix/modify it for your needs ๐Ÿ˜

hiburn's People

Contributors

nikitos1550 avatar wsnk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hiburn's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.