Skip to content

Commit 165da69

Browse files
committed
Build script update
1 parent 4c92c1e commit 165da69

File tree

3 files changed

+124
-67
lines changed

3 files changed

+124
-67
lines changed

build.yml

Lines changed: 122 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- libjasper1
3333
- libwebp6
3434
- libtiff5
35+
- libconfig++9v5
3536

3637
- name: Install Python 3 pip
3738
apt:
@@ -72,6 +73,11 @@
7273
hdmi_group=1
7374
hdmi_mode=62
7475
state: present
76+
77+
- name: Identify as camera
78+
copy:
79+
src: piplatform.txt
80+
dest: /boot/piplatform.txt
7581

7682
- name: SSH directory
7783
file:
@@ -153,75 +159,75 @@
153159
name: busybox-syslogd
154160
state: latest
155161

156-
# - name: fstab change (ro boot)
157-
# replace:
158-
# backup: no
159-
# dest: /etc/fstab
160-
# regexp: "^(.*vfat.*)defaults(?:,ro)?(.*)"
161-
# replace: "\\1defaults,ro\\2"
162+
- name: fstab change (ro boot)
163+
replace:
164+
backup: no
165+
dest: /etc/fstab
166+
regexp: "^(.*vfat.*)defaults(?:,ro)?(.*)"
167+
replace: "\\1defaults,ro\\2"
162168

163-
# - name: fstab change (ro rootfs)
164-
# replace:
165-
# backup: no
166-
# dest: /etc/fstab
167-
# regexp: "^(.*ext4.*)defaults(?:,ro)?(.*)"
168-
# replace: "\\1defaults,ro\\2"
169+
- name: fstab change (ro rootfs)
170+
replace:
171+
backup: no
172+
dest: /etc/fstab
173+
regexp: "^(.*ext4.*)defaults(?:,ro)?(.*)"
174+
replace: "\\1defaults,ro\\2"
169175

170-
# - name: fstab tmpfs
171-
# lineinfile:
172-
# path: /etc/fstab
173-
# line: "{{ item }}"
174-
# state: present
175-
# with_items:
176-
# - "tmpfs /tmp tmpfs nosuid,nodev 0 0"
177-
# - "tmpfs /var/log tmpfs nosuid,nodev 0 0"
178-
# - "tmpfs /var/tmp tmpfs nosuid,nodev 0 0"
176+
- name: fstab tmpfs
177+
lineinfile:
178+
path: /etc/fstab
179+
line: "{{ item }}"
180+
state: present
181+
with_items:
182+
- "tmpfs /tmp tmpfs nosuid,nodev 0 0"
183+
- "tmpfs /var/log tmpfs nosuid,nodev 0 0"
184+
- "tmpfs /var/tmp tmpfs nosuid,nodev 0 0"
179185

180-
# - name: Create dhcpcd.resolv.conf
181-
# copy:
182-
# src: /etc/resolv.conf
183-
# dest: /tmp/dhcpcd.resolv.conf
184-
# remote_src: yes
186+
- name: Create dhcpcd.resolv.conf
187+
copy:
188+
src: /etc/resolv.conf
189+
dest: /tmp/dhcpcd.resolv.conf
190+
remote_src: yes
185191

186-
# - name: Delete stuff
187-
# file:
188-
# path: "{{ item }}"
189-
# state: absent
190-
# with_items:
191-
# - /var/lib/dhcp
192-
# - /var/lib/dhcpcd5
193-
# - /var/spool
194-
# - /etc/resolv.conf
195-
# - /var/lib/systemd/random-seed
192+
- name: Delete stuff
193+
file:
194+
path: "{{ item }}"
195+
state: absent
196+
with_items:
197+
- /var/lib/dhcp
198+
- /var/lib/dhcpcd5
199+
- /var/spool
200+
- /etc/resolv.conf
201+
- /var/lib/systemd/random-seed
196202

197-
# - name: Link stuff to tmpfs
198-
# file:
199-
# src: /tmp
200-
# dest: "{{ item }}"
201-
# state: link
202-
# with_items:
203-
# - /var/lib/dhcp
204-
# - /var/lib/dhcpcd5
205-
# - /var/spool
203+
- name: Link stuff to tmpfs
204+
file:
205+
src: /tmp
206+
dest: "{{ item }}"
207+
state: link
208+
with_items:
209+
- /var/lib/dhcp
210+
- /var/lib/dhcpcd5
211+
- /var/spool
206212

207-
# - name: Link dhcpcd.resolv.conf
208-
# file:
209-
# src: /tmp/dhcpcd.resolv.conf
210-
# dest: /etc/resolv.conf
211-
# state: link
213+
- name: Link dhcpcd.resolv.conf
214+
file:
215+
src: /tmp/dhcpcd.resolv.conf
216+
dest: /etc/resolv.conf
217+
state: link
212218

213-
# - name: Link random-seed
214-
# file:
215-
# src: /tmp/random-seed
216-
# dest: /var/lib/systemd/random-seed
217-
# state: link
218-
# force: yes
219+
- name: Link random-seed
220+
file:
221+
src: /tmp/random-seed
222+
dest: /var/lib/systemd/random-seed
223+
state: link
224+
force: yes
219225

220-
# - name: Alter random-seed service
221-
# lineinfile:
222-
# dest: /lib/systemd/system/systemd-random-seed.service
223-
# line: ExecStartPre=/bin/echo "" >/tmp/random-seed
224-
# insertafter: RemainAfterExit=yes
226+
- name: Alter random-seed service
227+
lineinfile:
228+
dest: /lib/systemd/system/systemd-random-seed.service
229+
line: ExecStartPre=/bin/echo "" >/tmp/random-seed
230+
insertafter: RemainAfterExit=yes
225231

226232
- name: Create raspindi
227233
file:
@@ -353,6 +359,12 @@
353359
url: https://github.com/raspberry-pi-camera/raspindi/raw/v{{ raspindi_version }}/etc/raspindi.conf.default
354360
dest: /boot/raspindi.conf
355361

362+
- name: Set camera number
363+
lineinfile:
364+
path: /boot/raspindi.conf
365+
regexp: "^camera_number"
366+
line: 'camera_number = "{{ cam_number }}";'
367+
356368
- name: Link config file
357369
file:
358370
src: /boot/raspindi.conf
@@ -368,11 +380,54 @@
368380
- pix-plym-splash
369381
state: present
370382

371-
- name: Splash
383+
- name: Create plymouth theme dir
384+
file:
385+
path: /usr/share/plymouth/themes/raspindi
386+
state: directory
387+
388+
- name: Plymouth Theme
372389
get_url:
373-
url: https://github.com/raspberry-pi-camera/raspindi/raw/v{{ raspindi_version }}/assets/splash.png
374-
dest: /usr/share/plymouth/themes/pix/splash.png
390+
url: https://github.com/raspberry-pi-camera/plymouth-theme/raw/master/raspindi/{{ item }}
391+
dest: /usr/share/plymouth/themes/raspindi/{{ item }}
392+
with_items:
393+
- raspindi.plymouth
394+
- raspindi.script
395+
- splash.png
396+
397+
- name: Set Plymouth Theme
398+
shell:
399+
cmd: plymouth-set-default-theme raspindi
400+
401+
- name: Create monitor server dir
402+
file:
403+
path: /opt/monitor-server/
404+
state: directory
405+
406+
- name: Download montor server
407+
unarchive:
408+
src: https://github.com/raspberry-pi-camera/monitor-server/archive/master.tar.gz
409+
remote_src: yes
410+
extra_opts:
411+
- '--strip-components=1'
412+
dest: /opt/monitor-server/
375413

376-
- name: Shut down
377-
command: /sbin/shutdown -t now
378-
when: shutdown | default(True)
414+
- name: Install dependencies
415+
pip:
416+
executable: /usr/bin/pip3
417+
requirements: /opt/monitor-server/requirements.txt
418+
state: present
419+
420+
- name: Monitor Server service
421+
get_url:
422+
url: https://github.com/raspberry-pi-camera/monitor-server/raw/master/monitor-server.service
423+
dest: /etc/systemd/system/monitor-server.service
424+
425+
- name: Enable Monitor Server service
426+
systemd:
427+
daemon_reload: yes
428+
name: monitor-server
429+
enabled: yes
430+
431+
# - name: Shut down
432+
# command: /sbin/shutdown -t now
433+
# when: shutdown | default(True)

files/piplatform.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
camera

vars.yml.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22

33
camname: "cambuild"
4+
cam_number: -1
45
ssh_key: "Your-Key-Here"
56
rapsindi_version: "1.0.0"
67
atem_version: "1.0.0"

0 commit comments

Comments
 (0)