Skip to content

Commit df14958

Browse files
Release 2.0.12
1 parent 72d99a1 commit df14958

File tree

6 files changed

+45
-26
lines changed

6 files changed

+45
-26
lines changed

.github/workflows/apt.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
name: Hyperion APT Build
2-
on: [workflow_call]
2+
on:
3+
workflow_call:
4+
secrets:
5+
APT_GPG:
6+
required: true
7+
APT_USER:
8+
required: true
9+
APT_PASSWORD:
10+
required: true
11+
APT_DRAFT:
12+
required: true
313

414
jobs:
515
setup:
@@ -93,7 +103,7 @@ jobs:
93103

94104
- name: Include artifacts into the package source
95105
run: |
96-
for file in artifact/*.deb; do
106+
for file in artifact/hyperion_*.deb; do
97107
if [ -f "$file" ]; then
98108
dist=${file#*~}
99109
dist=${dist%_*}

.github/workflows/pull-request.yml

-8
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,3 @@ jobs:
199199
with:
200200
name: windows
201201
path: windows
202-
203-
##########################
204-
###### APT workflow ######
205-
##########################
206-
207-
apt_build:
208-
name: APT Build
209-
uses: hyperion-project/hyperion.ng/.github/workflows/apt.yml@master

.github/workflows/push-master.yml

+5
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,8 @@ jobs:
201201
name: APT Build
202202
needs: [Linux, macOS, windows]
203203
uses: hyperion-project/hyperion.ng/.github/workflows/apt.yml@master
204+
secrets:
205+
APT_GPG: ${{ secrets.APT_GPG }}
206+
APT_USER: ${{ secrets.APT_USER }}
207+
APT_PASSWORD: ${{ secrets.APT_PASSWORD }}
208+
APT_DRAFT: ${{ secrets.APT_DRAFT }}

cmake/package-scripts/postinst

+6-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ BOOT_BERRYBOOT=$(grep -m1 -c '\(/var/media\|/media/pi\)/berryboot' /etc/mtab)
3636
#get current system ip
3737
NET_IP=`hostname -I | cut -d " " -f1`
3838

39-
# search for users in system, returns first entry
40-
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
41-
4239
START_MSG=""
4340

4441
# service registration if no gui is present (only on initial installation and not upgrade)
@@ -50,6 +47,7 @@ if [ "$IS_UPGRADE" = false ]; then
5047
then
5148
# systemd
5249
echo "---> init deamon: systemd"
50+
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
5351
install_file /usr/share/hyperion/service/hyperion.systemd /etc/systemd/system/hyperion@.service
5452
systemctl enable hyperion"@${FOUND_USR}".service
5553
START_MSG="--> systemctl start hyperion for user ${FOUND_USR}"
@@ -78,6 +76,11 @@ else
7876
if [ -z "${DISPLAY}" ] && [ -z "${WAYLAND_DISPLAY}" ] && [ -z "${XDG_CURRENT_DESKTOP}" ]; then
7977
#cleanup service files also on upgrade (non gui user)
8078
rm -r /usr/share/hyperion/service 2>/dev/null
79+
#start existing service on upgrade
80+
CURRENT_SERVICE=$(systemctl list-units --all | { grep -o "hyperion*.*\.service" || true; })
81+
if [ ! -z ${CURRENT_SERVICE} ]; then
82+
systemctl start "${CURRENT_SERVICE}"
83+
fi
8184
fi
8285
fi
8386

cmake/package-scripts/preinst

+10-7
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,29 @@
22

33
echo "---Hyperion ambient light preinst ---"
44

5-
# search for users in system, returns first entry
6-
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
7-
85
# stop running daemon before we install/upgrade
96
if pgrep hyperiond > /dev/null 2>&1
107
then
118
if grep -m1 systemd /proc/1/comm > /dev/null
129
then
13-
echo "--> stop init deamon: systemd"
1410
# systemd
15-
systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
11+
echo "--> stop init deamon: systemd"
12+
CURRENT_SERVICE=$(systemctl list-units --all | { grep -o "hyperion*.*\.service" || true; })
13+
if [ ! -z ${CURRENT_SERVICE} ]; then
14+
systemctl stop "${CURRENT_SERVICE}" 2> /dev/null
15+
else
16+
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
17+
systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
18+
fi
1619
elif [ -e /sbin/initctl ]
1720
then
18-
echo "--> stop init deamon: upstart"
1921
# upstart
22+
echo "--> stop init deamon: upstart"
2023
initctl stop hyperiond 2>/dev/null
2124
initctl stop hyperion 2>/dev/null
2225
else
23-
echo "--> stop init deamon: sysV"
2426
# sysV
27+
echo "--> stop init deamon: sysV"
2528
service hyperiond stop 2>/dev/null
2629
service hyperion stop 2>/dev/null
2730
fi

cmake/package-scripts/prerm

+12-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ "$2" = "in-favour" ]; then
99
fi
1010

1111
# Don't clean-up just for an upgrade.`
12-
if [ "$action" = "upgrade" ] ; then
12+
if [ "$UPGRADE" = "upgrade" ] ; then
1313
exit 0
1414
fi
1515

@@ -22,27 +22,33 @@ pgrep hyperiond > /dev/null 2>&1 && HYPERION_RUNNING=true
2222

2323
if grep -m1 systemd /proc/1/comm > /dev/null
2424
then
25-
echo "---> stop init deamon: systemd"
2625
# systemd
27-
$HYPERION_RUNNING && systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
26+
echo "---> stop init deamon: systemd"
27+
CURRENT_SERVICE=$(systemctl list-units --all | { grep -o "hyperion*.*\.service" || true; })
28+
if [ ! -z ${CURRENT_SERVICE} ]; then
29+
$HYPERION_RUNNING && systemctl stop "${CURRENT_SERVICE}" 2> /dev/null
30+
systemctl -q disable "${CURRENT_SERVICE}" 2> /dev/null
31+
else
32+
$HYPERION_RUNNING && systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
33+
systemctl -q disable hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
34+
fi
2835
# disable user specific symlink
2936
echo "---> Disable service and remove entry"
30-
systemctl -q disable hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
3137
rm -v /etc/systemd/system/hyperion.service /etc/systemd/system/hyperiond@.service /etc/systemd/system/hyperion@.service 2> /dev/null
3238

3339
elif [ -e /sbin/initctl ]
3440
then
35-
echo "---> stop init deamon: upstart"
3641
# upstart
42+
echo "---> stop init deamon: upstart"
3743
$HYPERION_RUNNING && initctl stop hyperiond
3844
$HYPERION_RUNNING && initctl stop hyperion
3945
echo "---> Remove upstart service"
4046
rm -v /etc/init/hyperion* 2>/dev/null
4147
initctl reload-configuration
4248

4349
else
44-
echo "---> stop init deamon: sysV"
4550
# sysV
51+
echo "---> stop init deamon: sysV"
4652
$HYPERION_RUNNING && service hyperiond stop 2> /dev/null
4753
$HYPERION_RUNNING && service hyperion stop 2> /dev/null
4854
echo "---> Remove sysV service"

0 commit comments

Comments
 (0)