mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 07:26:28 +00:00
Use systemd for config mount (#37)
* Create mnt-config.mount * Update hassos-config * Update mnt-config.mount * Update hassos-config
This commit is contained in:
parent
42f1c4bf01
commit
27cd425f5b
@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HassOS config partition
|
||||
|
||||
[Mount]
|
||||
What=LABEL=hassos-config
|
||||
Where=/mnt/config
|
||||
Type=auto
|
||||
Options=ro
|
@ -1,15 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Check if hassos-config is present
|
||||
if ! findfs LABEL="hassos-config" > /dev/null; then
|
||||
echo "[Warning] No hassos-config partition found!"
|
||||
# Mount config folder
|
||||
systemctl start mnt-config.mount
|
||||
if ! systemctl -q is-active mnt-config.mount; then
|
||||
echo "[Warning] No config partition found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Mount config partition
|
||||
mount -o ro LABEL="hassos-config" /mnt/config
|
||||
|
||||
##
|
||||
# NetworkManager
|
||||
if [ -d /mnt/config/network ]; then
|
||||
@ -18,7 +15,7 @@ if [ -d /mnt/config/network ]; then
|
||||
rm -rf /etc/NetworkManager/system-connections/*
|
||||
cp -f /mnt/config/network/* /etc/NetworkManager/system-connections/
|
||||
|
||||
nmcli con reload || true
|
||||
nmcli con reload
|
||||
fi
|
||||
|
||||
##
|
||||
@ -54,4 +51,4 @@ if ls /mnt/config/*.raucb > /dev/null; then
|
||||
fi
|
||||
|
||||
# Cleanup config partition
|
||||
umount /mnt/config
|
||||
systemctl stop mnt-config.mount
|
||||
|
Loading…
x
Reference in New Issue
Block a user