From 289ae275133ac2278b0592280da2da91c0848a24 Mon Sep 17 00:00:00 2001
From: Qiyang Sun <qs2g22@soton.ac.uk>
Date: Sat, 2 Nov 2024 21:33:30 +0000
Subject: [PATCH] Add script to print message of the day

---
 recipes-core/fastinit/files/print_motd.sh | 54 +++++++++++++++++++++++
 recipes-core/fastinit/print_motd.1        | 18 ++++++++
 2 files changed, 72 insertions(+)
 create mode 100755 recipes-core/fastinit/files/print_motd.sh
 create mode 100644 recipes-core/fastinit/print_motd.1

diff --git a/recipes-core/fastinit/files/print_motd.sh b/recipes-core/fastinit/files/print_motd.sh
new file mode 100755
index 0000000..3b867dd
--- /dev/null
+++ b/recipes-core/fastinit/files/print_motd.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+less << EOF
+
+$(uname -a)
+
+Welcome to Minimal Autonomous Rover (MAR) GNU/Linux System!
+
+MAR GNU/Linux is free and open-source software.
+Copyright (C) 2024 Qiyang Sun and the MAR Project Maintainers.
+
+University of Southampton
+University Road, Southampton, United Kingdom  SO17 1BJ
+
+* Repository:      https://git.soton.ac.uk/qs2g22/meta-marfb
+* Support:         mailto:qs2g22@soton.ac.uk
+
+The programs included with the MAR GNU/Linux system are free software;
+the exact distribution terms for each program are described in the
+license/ and spdx/ folders of the release archives. MAR GNU/Linux is
+distributed in the hope that it will be useful, but it comes with
+ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
+
+=> You  receive this  message  of  the  day  because  of  the  fastinit
+   configuration.  To change the runlevel, refer to manpage fastinit(8)
+   which is not shipped in this image. Message of the day should not be
+   printed to serial output because it will confuse the rover.
+=> Heavy serial outputs like this affect performance.
+=> Uptime: $(uptime)
+
+Press 'q' to quit pager and continue.
+
+EOF
+
+clear
+
+cat << EOF
+
+Welcome to Minimal Autonomous Rover (MAR) GNU/Linux System!
+
+MAR GNU/Linux is free and open-source software.
+Copyright (C) 2024 Qiyang Sun and the MAR Project Maintainers.
+
+The programs included with the MAR GNU/Linux system are free software;
+the exact distribution terms for each program are described in the
+license/ and spdx/ folders of the release archives. MAR GNU/Linux is
+distributed in the hope that it will be useful, but it comes with
+ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
+
+* Change runlevel before connecting serial to rover.
+* To read the full message again, run print_motd.sh.
+
+EOF
+
+sleep 1s
diff --git a/recipes-core/fastinit/print_motd.1 b/recipes-core/fastinit/print_motd.1
new file mode 100644
index 0000000..07406cc
--- /dev/null
+++ b/recipes-core/fastinit/print_motd.1
@@ -0,0 +1,18 @@
+.TH PRINT_MOTD 1 "November 2024" "Version 0.1" "General Commands Manual"
+.SH NAME
+print_motd.sh \- print message of the day
+.SH SYNOPSIS
+.B /usr/sbin/print_motd.sh
+
+.SH DESCRIPTION
+
+Prints uname, welcome message, copyright (free and open software) information, postal address, website, (non-)warranty, help, caveat and uptime information to the less pager, clear screen, prints welcome message, copyright (free and open software) information, (non-)warranty and help information to stdout, and wait 1 second.
+
+.SH SEE ALSO
+.BR runlevel (8),
+.BR fastinit (8)
+
+.SH AUTHOR
+The 
+.B print_motd
+script was first written by Qiyang Sun <qs2g22@soton.ac.uk>, and is maintained by the MAR24 project maintainers.
-- 
GitLab