Re-Initiate the firstboot system utilizing a different approach

ovos-config as tool, starting of with expiring the default passwd
This commit is contained in:
j1nx 2021-04-02 12:22:46 +02:00
parent 690de2d0fc
commit 8766df6b2b
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,16 @@
[Unit]
Description=OVOS First boot run script
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=sysinit.target shutdown.target
ConditionPathIsReadWrite=/etc
ConditionPathExists=/etc/firstboot
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/ovos-config
[Install]
WantedBy=sysinit.target

View File

@ -0,0 +1,10 @@
#!/bin/sh
# Check for first boot flag file
if [ -f "/etc/firstboot" ]; then
echo "[INFO] Expiring the mycroft user's password!"
passwd --expire mycroft
echo "[INFO] Removing firstboot flag!"
rm /etc/firstboot
fi