diff --git a/buildroot-external/Config.in b/buildroot-external/Config.in index fd2a8d7a..c7578585 100644 --- a/buildroot-external/Config.in +++ b/buildroot-external/Config.in @@ -1,6 +1,7 @@ menu "Mycroft A.I. Personal Assistant" source "$BR2_EXTERNAL_MYCROFTOS_PATH/package/python-mycroft/Config.in" source "$BR2_EXTERNAL_MYCROFTOS_PATH/package/mycroft-service/Config.in" + source "$BR2_EXTERNAL_MYCROFTOS_PATH/package/mycroft-splash/Config.in" menu "Additional drivers, libraries and/or applications" source "$BR2_EXTERNAL_MYCROFTOS_PATH/package/fann/Config.in" source "$BR2_EXTERNAL_MYCROFTOS_PATH/package/respeaker/Config.in" diff --git a/buildroot-external/configs/mycroftos_rpi3_defconfig b/buildroot-external/configs/mycroftos_rpi3_defconfig index d1002322..eb95a878 100644 --- a/buildroot-external/configs/mycroftos_rpi3_defconfig +++ b/buildroot-external/configs/mycroftos_rpi3_defconfig @@ -186,6 +186,7 @@ BR2_PACKAGE_HOST_PYTHON_SIX=y BR2_PACKAGE_HOST_PYTHON_XLRD=y BR2_PACKAGE_PYTHON_MYCROFT=y BR2_PACKAGE_MYCROFT_SERVICE=y +BR2_PACKAGE_MYCROFT_SPLASH=y BR2_PACKAGE_FANN=y BR2_PACKAGE_RESPEAKER=y BR2_PACKAGE_PYTHON_ADAPT_PARSER=y diff --git a/buildroot-external/package/mycroft-service/start-mycroft.sh b/buildroot-external/package/mycroft-service/start-mycroft.sh index 286fc44b..a2c8acab 100755 --- a/buildroot-external/package/mycroft-service/start-mycroft.sh +++ b/buildroot-external/package/mycroft-service/start-mycroft.sh @@ -83,6 +83,7 @@ export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 function init-once() { + fbv -f -d 1 /opt/mycroft/splash/logo.png > /dev/null 2>&1 if ($first_time) ; then echo "Initializing..." # Check if Mycroft log folders are present and if not diff --git a/buildroot-external/package/mycroft-service/stop-mycroft.sh b/buildroot-external/package/mycroft-service/stop-mycroft.sh index 3c5a5862..d664b7ba 100755 --- a/buildroot-external/package/mycroft-service/stop-mycroft.sh +++ b/buildroot-external/package/mycroft-service/stop-mycroft.sh @@ -99,6 +99,7 @@ case ${OPT} in end-process audio end-process speech end-process enclosure + fbv -f -d 1 /opt/mycroft/splash/background.png > /dev/null 2>&1 ;; "bus") end-process messagebus.service @@ -125,4 +126,4 @@ esac # 0 if nothing changed (e.g. --help or no process was running) # 100 at least one process was stopped # 120 if any process had to be killed -exit $result \ No newline at end of file +exit $result diff --git a/buildroot-external/package/mycroft-splash/Config.in b/buildroot-external/package/mycroft-splash/Config.in new file mode 100644 index 00000000..7817135b --- /dev/null +++ b/buildroot-external/package/mycroft-splash/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_MYCROFT_SPLASH + bool "mycroft-splash" + help + Show Mycroft A.I. branded splash screens on boot/halt. + + https://mycroft.ai/ https://www.j1nx.nl diff --git a/buildroot-external/package/mycroft-splash/boot-splashscreen.service b/buildroot-external/package/mycroft-splash/boot-splashscreen.service new file mode 100644 index 00000000..f424c898 --- /dev/null +++ b/buildroot-external/package/mycroft-splash/boot-splashscreen.service @@ -0,0 +1,8 @@ +[Unit] +Description=Mycroft AI boot splash screen + +[Service] +ExecStart=fbv -f -d 1 /opt/mycroft/splash/boot.png > /dev/null 2>&1 + +[Install] +WantedBy=basic.target diff --git a/buildroot-external/package/mycroft-splash/halt-splashscreen.service b/buildroot-external/package/mycroft-splash/halt-splashscreen.service new file mode 100644 index 00000000..c4af7fd3 --- /dev/null +++ b/buildroot-external/package/mycroft-splash/halt-splashscreen.service @@ -0,0 +1,11 @@ +[Unit] +Description=Mycroft AI halt splash screen +DefaultDependencies=no +Before=halt.target + +[Service] +ExecStart=fbv -f -d 1 /opt/mycroft/splash/down.png > /dev/null 2>&1 +Type=oneshot + +[Install] +WantedBy=halt.target poweroff.target diff --git a/buildroot-external/package/mycroft-splash/mycroft-splash.mk b/buildroot-external/package/mycroft-splash/mycroft-splash.mk new file mode 100644 index 00000000..b4b41397 --- /dev/null +++ b/buildroot-external/package/mycroft-splash/mycroft-splash.mk @@ -0,0 +1,36 @@ +################################################################################ +# +# mycroft-splash +# +################################################################################ + +MYCROFT_SPLASH_VERSION = 0.1.0 +MYCROFT_SPLASH_SITE = $(BR2_EXTERNAL_MYCROFTOS_PATH)/package/mycroft-splash +MYCROFT_SPLASH_SITE_METHOD = local +MYCROFT_SPLASH_LICENSE = Apache License 2.0 +MYCROFT_SPLASH_LICENSE_FILES = LICENSE + +define MYCROFT_SPLASH_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 644 $(@D)/boot-splashscreen.service \ + $(TARGET_DIR)/usr/lib/systemd/system/boot-splashscreen.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/basic.target.wants + ln -fs ../../../../usr/lib/systemd/system/boot-splashscreen.service \ + $(TARGET_DIR)/etc/systemd/system/basic.target.wants/boot-splashscreen.service + + $(INSTALL) -D -m 644 $(@D)/halt-splashscreen.service \ + $(TARGET_DIR)/usr/lib/systemd/system/halt-splashscreen.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/halt.target.wants + ln -fs ../../../../usr/lib/systemd/system/halt-splashscreen.service \ + $(TARGET_DIR)/etc/systemd/system/halt.target.wants/halt-splashscreen.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/poweroff.target.wants + ln -fs ../../../../usr/lib/systemd/system/halt-splashscreen.service \ + $(TARGET_DIR)/etc/systemd/system/poweroff.target.wants/halt-splashscreen.service + + $(INSTALL) -D -m 644 $(@D)/off-splashscreen.service \ + $(TARGET_DIR)/usr/lib/systemd/system/off-splashscreen.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/shutdown.target.wants + ln -fs ../../../../usr/lib/systemd/system/off-splashscreen.service \ + $(TARGET_DIR)/etc/systemd/system/shutdown.target.wants/off-splashscreen.service +endef + +$(eval $(generic-package)) diff --git a/buildroot-external/package/mycroft-splash/off-splashscreen.service b/buildroot-external/package/mycroft-splash/off-splashscreen.service new file mode 100644 index 00000000..63b3cb88 --- /dev/null +++ b/buildroot-external/package/mycroft-splash/off-splashscreen.service @@ -0,0 +1,12 @@ +[Unit] +Description=Mycroft AI safe power off splash screen +DefaultDependencies=no +After=umount.target +Before=final.target + +[Service] +ExecStart=fbv -f -d 1 /opt/mycroft/splash/off.png > /dev/null 2>&1 +Type=oneshot + +[Install] +WantedBy=shutdown.target diff --git a/buildroot-external/rootfs-overlay/opt/mycroft/splash/background.png b/buildroot-external/rootfs-overlay/opt/mycroft/splash/background.png new file mode 100644 index 00000000..ec22bf0e Binary files /dev/null and b/buildroot-external/rootfs-overlay/opt/mycroft/splash/background.png differ diff --git a/buildroot-external/rootfs-overlay/opt/mycroft/splash/boot.png b/buildroot-external/rootfs-overlay/opt/mycroft/splash/boot.png index d0f14d47..87f15d62 100644 Binary files a/buildroot-external/rootfs-overlay/opt/mycroft/splash/boot.png and b/buildroot-external/rootfs-overlay/opt/mycroft/splash/boot.png differ diff --git a/buildroot-external/rootfs-overlay/opt/mycroft/splash/down.png b/buildroot-external/rootfs-overlay/opt/mycroft/splash/down.png new file mode 100644 index 00000000..6dcddd93 Binary files /dev/null and b/buildroot-external/rootfs-overlay/opt/mycroft/splash/down.png differ diff --git a/buildroot-external/rootfs-overlay/opt/mycroft/splash/logo.png b/buildroot-external/rootfs-overlay/opt/mycroft/splash/logo.png new file mode 100644 index 00000000..0e5b58fc Binary files /dev/null and b/buildroot-external/rootfs-overlay/opt/mycroft/splash/logo.png differ diff --git a/buildroot-external/rootfs-overlay/opt/mycroft/splash/off.png b/buildroot-external/rootfs-overlay/opt/mycroft/splash/off.png new file mode 100644 index 00000000..36ac30d1 Binary files /dev/null and b/buildroot-external/rootfs-overlay/opt/mycroft/splash/off.png differ