Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetersson committed Oct 11, 2017
2 parents 2b192f3 + 0dc3ee8 commit 71526ea
Show file tree
Hide file tree
Showing 24 changed files with 1,355 additions and 767 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:jessie
FROM debian:stretch
MAINTAINER Viktor Petersson <[email protected]>

RUN apt-get update && \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Quick links:
* [Screenly OSE Home](https://www.screenly.io/ose/)
* [Live Demo](http://ose.demo.screenlyapp.com/)
* [QA Checklist](https://www.forgett.com/checklist/1789089623)
* [API Docs](http://ose.demo.screenlyapp.com/api/docs/)

Screenly OSE works on all Raspberry Pi versions, including Raspberry Pi Zero and Raspberry Pi 3 Model B.

Expand Down
7 changes: 7 additions & 0 deletions ansible/roles/network/files/screenly_net_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
NETWORK_PATH = '/boot/network.ini'
RESOLV_PATH = '/etc/resolv.conf'
NTP_PATH = '/etc/ntp.conf'
BOOT_CONFIG_PATH = '/boot/config.txt'

INTERFACES_TEMPLATE = """# Generated by Screenly Network Manager
auto lo
Expand Down Expand Up @@ -163,6 +164,12 @@ def get_active_iface(config, prefix):


def main():
with open(BOOT_CONFIG_PATH, 'r') as f:
boot_config = f.read()
if "NOOBS" in boot_config:
logging.info("Screenly is installed through NOOBS, the network configuration should not be changed")
return

config = configparser.RawConfigParser()
config.read(NETWORK_PATH)

Expand Down
7 changes: 0 additions & 7 deletions ansible/roles/screenly/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,3 @@
- name: Enable screenly systemd services
command: systemctl enable {{ item }} chdir=/etc/systemd/system
with_items: "{{ screenly_systemd_units }}"

- name: Restart services
command: /bin/true
notify:
- restart-screenly-websocket_server_layer
- restart-screenly-server
- restart-screenly-viewer
63 changes: 58 additions & 5 deletions ansible/roles/system/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
msg: "Detected BerryBoot installation. Skipping some steps."
when: is_berryboot

- name: Check NOOBS
command: cat /boot/config.txt
register: config_txt

- name: Make sure we have proper framebuffer depth
lineinfile:
dest: /boot/config.txt
Expand Down Expand Up @@ -48,16 +52,65 @@
src: /boot/cmdline.txt.orig
dest: /boot/cmdline.txt
force: yes
when: not is_berryboot
when: not is_berryboot and config_txt.stdout.find('NOOBS') == -1

- name: Use Systemd as init and quiet boot process
lineinfile:
replace:
dest: /boot/cmdline.txt
regexp: (^(?!$)((?!quiet init=/lib/systemd/systemd).)*$)
replace: \1 quiet init=/lib/systemd/systemd
when: not is_berryboot

- name: ethN/wlanN names for interfaces
replace:
dest: /boot/cmdline.txt
regexp: (.*)
backrefs: yes
line: \1 quiet init=/lib/systemd/systemd
regexp: (^(?!$)((?!net\.ifnames=0).)*$)
replace: \1 net.ifnames=0
when: not is_berryboot

# Sometimes in some packages there are no necessary files.
# They are required to install pip dependencies.
# In this case we need to reinstall the packages.
- name: Check if cdefs.h exists
stat:
path: /usr/include/arm-linux-gnueabihf/sys/cdefs.h
register: cdefs

- set_fact: cdefs_exist="{{cdefs.stat.exists}}"

- name: Remove libc6-dev
apt:
name: libc6-dev
state: absent
when: not cdefs_exist

- name: Install libc6-dev
apt:
name: libc6-dev
state: present
update_cache: yes
when: not cdefs_exist

- name: Check if cc1plus exists
stat:
path: /usr/lib/gcc/arm-linux-gnueabihf/4.9/cc1plus
register: cc1plus

- set_fact: cc1plus_exist="{{cc1plus.stat.exists}}"

- name: Remove build-essential
apt:
name: build-essential
state: absent
when: not cc1plus_exist

- name: Install build-essential
apt:
name: build-essential
state: present
update_cache: yes
when: not cc1plus_exist

- name: Install Screenly dependencies
apt:
name: "{{ item }}"
Expand Down
5 changes: 5 additions & 0 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,8 @@ cd ~/screenly && git rev-parse HEAD > ~/.screenly/latest_screenly_sha

set +x
echo "Installation completed."

read -p "You need to reboot the system for the installation to complete. Would you like to reboot now? (y/N)" -n 1 -r -s REBOOT && echo
if [ "$REBOOT" == 'y' ]; then
sudo reboot
fi
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Mako==0.7.3
MarkupSafe==0.15
PyHAML==0.1.9
ansible==2.1.0.0
bottle-haml==0.1.4
bottle==0.12.9
flask==0.12.2
flask_restful==0.3.6
flask-restful-swagger-2==0.35
flask-swagger-ui==3.0.12
flask-cors==3.0.3
cffi==1.7.0
certifi==2015.04.28
configparser==3.5.0
Expand All @@ -24,4 +26,3 @@ youtube_dl>=2017.7.2
pyzmq==16.0.2
gevent==1.2.2
gevent-websocket==0.10.1

Loading

0 comments on commit 71526ea

Please sign in to comment.