8000 GitHub - EduardoSlong/openhabian: openHABian - empowering the smart home, for Raspberry Pi and Debian systems
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

EduardoSlong/openhabian

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

As an openHABian end user, please check out the official openHAB documentation:

openHABian - Hassle-free openHAB Setup

build shellcheck

Setting up a fully working Linux system with all needed packages and openHAB recommendations is a boring task taking quite some time and Linux newcomers shouldn't worry about these technical details.

A home automation enthusiast doesn't have to be a Linux enthusiast!

openHABian aims to provide a self-configuring Linux system setup specific to the needs of every openHAB user. The project provides two things:

  • A set of scripts to set up openHAB on any Debian/Ubuntu based system
  • Complete SD-card images pre-configured with openHAB and many other openHAB- and Hardware-specific preparations, for the Raspberry Pi and the Pine A64 platforms.

Closely related to openHABian is the repository openhab-linuxpkg which provides linux packages for openHAB. openHABian uses those packages to setup openHAB with some additional configurations.

Installation and Setup

Please check the official documentation article to learn about openHABian and please visit and subscribe to our very active community forum thread.

Development

openHABian is foremost a collection of bash script version handled and deployed using GIT. In the current state the scripts can only be invoked through the terminal menu system whiptail. There is a longterm need to better separate the UI part from the script code. A work has started to define conventions and further explain the code base in the document CONTRIBUTING along with development guidelines in general.

A good place to look at to start to understand the code is the file openhabian-setup.sh.

Building Hardware Images

Take a look at the build.bash script to get an idea of the process. Simply explained run the code below with platform being either rpi or pine64. The RPi image is based on the Raspbian Lite standard image while the Pine64 image is based on build-pine64-image.

$ sudo bash ./build.bash platform

As the script uses openhab/openhabian git repository during installation it must sometimes be changed to test code from other repositories, like a new feature in a fork. There are two commands for replacing the git repo with a custom one. The first command uses the current checked-out repository used in the filesystem:

$ sudo bash build.bash platform dev-git

The second command uses a fully customizable repository:

$ sudo bash build.bash platform dev-url branch url

Testing

Testing is done continuously with Travis using the test framework Bats and the linter Shellcheck. As the tests focus on installing software, a docker solution is used for easy build-up and teardown. To run the test suite execute the commands below or "$ ./test.bash docker-full". Docker and Shellcheck need to be installed. For more details regarding the tests see Test Architecture in CONTRIBUTING.

docker build --tag openhabian/openhabian-bats .
docker run -it openhabian/openhabian-bats bash -c 'bats -r -f "unit-." .'

docker run --name "install-test" --privileged -d openhabian/openhabian-bats
docker exec -it install-test bash -c "./build.bash local-test && mv ~/.profile ~/.bash_profile && /etc/rc.local"
docker exec -it install-test bash -c 'bats -r -f "installation-." .'
docker exec -it install-test bash -c 'bats -r -f "destructive-." .'

docker stop install-test
docker rm install-test

Run the linter by executing:

shellcheck -s bash openhabian-setup.sh
shellcheck -s bash functions/*.bash
shellcheck -s bash build-image/*.bash

Happy Hacking!

About

openHABian - empowering the smart home, for Raspberry Pi and Debian systems

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 99.0%
  • Other 1.0%
0