mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 15:36:29 +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
|
#!/bin/sh
|
||||||
set -e
|
|
||||||
|
|
||||||
# Check if hassos-config is present
|
# Mount config folder
|
||||||
if ! findfs LABEL="hassos-config" > /dev/null; then
|
systemctl start mnt-config.mount
|
||||||
echo "[Warning] No hassos-config partition found!"
|
if ! systemctl -q is-active mnt-config.mount; then
|
||||||
|
echo "[Warning] No config partition found"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mount config partition
|
|
||||||
mount -o ro LABEL="hassos-config" /mnt/config
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# NetworkManager
|
# NetworkManager
|
||||||
if [ -d /mnt/config/network ]; then
|
if [ -d /mnt/config/network ]; then
|
||||||
@ -18,7 +15,7 @@ if [ -d /mnt/config/network ]; then
|
|||||||
rm -rf /etc/NetworkManager/system-connections/*
|
rm -rf /etc/NetworkManager/system-connections/*
|
||||||
cp -f /mnt/config/network/* /etc/NetworkManager/system-connections/
|
cp -f /mnt/config/network/* /etc/NetworkManager/system-connections/
|
||||||
|
|
||||||
nmcli con reload || true
|
nmcli con reload
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -54,4 +51,4 @@ if ls /mnt/config/*.raucb > /dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup config partition
|
# Cleanup config partition
|
||||||
umount /mnt/config
|
systemctl stop mnt-config.mount
|
||||||
|
Loading…
x
Reference in New Issue
Block a user