Skip to content

Commit 8c11197

Browse files
committed
🦸‍ Home Assistant Supervised in Docker
1 parent 157c62a commit 8c11197

File tree

8 files changed

+24
-13
lines changed

8 files changed

+24
-13
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Hass-Super Post init
3+
After=network-online.target
4+
5+
[Service]
6+
Type=oneshot
7+
ExecStart=run-parts /opt/init-wrapper/post-init.d
8+
StandardOutput=append:/tmp/hassio.log
9+
StandardError=append:/tmp/hassio.log
10+
11+
[Install]
12+
WantedBy=multi-user.target
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /bin/sh
2+
3+
set -ex
4+
5+
date '+%Y-%m-%d %H:%M:%S Started.' >> /tmp/hassio.log

build/opt/init-wrapper/post-init.d/09-docker-apt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
set -ex
44

55
if [ $(cat /etc/timezone) = "Asia/Shanghai" ]; then
6-
mv -f /etc/apt/sources.list.d/docker.ustc /etc/apt/sources.list.d/docker.list
6+
cat /opt/docker.ustc > /etc/apt/sources.list.d/docker.list
77
apt-get -qq update >/dev/null
88
fi

build/opt/init-wrapper/post-init.d/10-docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22

3-
set -ex
3+
set -x
44

55
if [ -f /var/run/docker.pid ]; then
66
exit 0
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#! /bin/sh
22

3-
# fix for Synology
4-
mkdir -p /run/systemd/unit-root/bin
5-
mkdir -p /run/systemd/unit-root/lib/modules
6-
ls -al /run/systemd/unit-root >> /tmp/hassio.log
7-
8-
sed -i -e "s/ProtectSystem=true/ProtectSystem=false/" /lib/systemd/system/NetworkManager.service
9-
systemctl mask systemd-tmpfiles-setup systemd-tmpfiles-clean
3+
if [ "$SYNOLOGY" = "true" ]; then
4+
systemctl enable post-init
5+
fi

build/opt/init-wrapper/pre-init.d/99-install-post-init

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@ if [ ! -f /etc/rc.local ]; then
55
chmod +x /etc/rc.local
66
fi
77

8-
now=$(date "+%Y-%m-%d %H:%M:%S")
98
cmd="run-parts /opt/init-wrapper/post-init.d"
10-
11-
echo "echo '$now Started.' >> /tmp/hassio.log" >> /etc/rc.local
129
echo "$cmd >> /tmp/hassio.log 2>&1" >> /etc/rc.local

build/scripts/02-init-wrapper

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ find /tmp/build/opt/init-wrapper/sbin \
2323
install -m 644 -o root -g root -p -D ${f} ${f#/tmp/build}
2424
done
2525

26+
cp -rf /tmp/build/lib/* /lib/

build/scripts/10-hassio-apt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ chmod a+r /etc/apt/keyrings/docker*
3131

3232
arch=$(dpkg --print-architecture)
3333
echo "deb [arch=$arch signed-by=/etc/apt/keyrings/docker.asc] $DOWNLOAD_URL/linux/debian bookworm stable" > /etc/apt/sources.list.d/docker.list
34-
echo "deb [arch=$arch signed-by=/etc/apt/keyrings/dockcn.asc] $DOCKER_CHINA/linux/debian bookworm stable" > /etc/apt/sources.list.d/docker.ustc
34+
echo "deb [arch=$arch signed-by=/etc/apt/keyrings/dockcn.asc] $DOCKER_CHINA/linux/debian bookworm stable" > /opt/docker.ustc
3535
apt-get -qq update >/dev/null
3636
apt-get -y -qq install docker-ce-cli containerd.io docker-compose-plugin docker-ce-rootless-extras docker-buildx-plugin >/dev/null
3737
apt-get -y -qq install iptables libip6tc2 libnetfilter-conntrack3 libnfnetlink0 libnftnl11 netbase >/dev/null

0 commit comments

Comments
 (0)