Added Mycroft service.

This commit is contained in:
Storm Dragon 2020-12-27 12:24:47 -05:00
parent bc24c3a243
commit 6d75d33fce

View File

@ -144,6 +144,24 @@ mount "${loopdev}p1" /mnt/boot
# Things are mounted now, so set mounted to 0 (bash true) # Things are mounted now, so set mounted to 0 (bash true)
mounted=0 mounted=0
wget "${url[$imageVersion]}" -O- | bsdtar -xpf - -C /mnt wget "${url[$imageVersion]}" -O- | bsdtar -xpf - -C /mnt
# Create Mycroft service file
cat << 'EOF' > /mnt/etc/systemd/system/mycroft.service
[Unit]
Description=Mycroft AI
After=pulseaudio.service
[Service]
User=mycroft
WorkingDirectory=/home/mycroft/
ExecStart=/home/mycroft/mycroft-core/bin/mycroft-start all
ExecStop=/home/mycroft/mycroft-core/bin/mycroft-stop
Type=forking
Restart=no
[Install]
WantedBy=multi-user.target
EOF
arch-chroot /mnt << EOF arch-chroot /mnt << EOF
# set up pacman # set up pacman
pacman-key --init pacman-key --init
@ -182,8 +200,9 @@ sed '/mycroft/d' /etc/sudoers.d/wheel
sed 's/^# %wheel ALL=(ALL) ALL$/%wheel ALL=(ALL) ALL/' /etc/sudoers.d/wheel sed 's/^# %wheel ALL=(ALL) ALL$/%wheel ALL=(ALL) ALL/' /etc/sudoers.d/wheel
# Set the hostname # Set the hostname
echo mycroft > /etc/hostname echo mycroft > /etc/hostname
# Enable services # Enable services
systemctl enable sshd systemctl enable mycroft sshd
# Update fstab for Raspberry Pi 4. # Update fstab for Raspberry Pi 4.
#[[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab #[[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab
EOF EOF