Skip to content

Commit

Permalink
init: split S95hello into two to accommodate upcoming bmcd
Browse files Browse the repository at this point in the history
Prior to this change, script S95hello.sh would:

1. mount sdcard
2. call scripts
3. print ASCII art
4. launch bmc daemon

However, the new version of BMC daemon (aptly named bmcd) which warrants
its own proper startup script, needs to launch after steps 1-2, but
prior to ASCII-art being printed.

Split steps 1-2 and 3 into their own scripts, with priorities 93 and 99
respectively, and remove redundant .sh suffix. The new daemon will start
at priority 94. User-defined scripts can run on priorities 95-98.

The ASCII-art could be moved to /etc/issue by using a post-build.sh
script, however this would cause the art to be printed several times
on boot and login.
  • Loading branch information
ruslashev committed Sep 5, 2023
1 parent 7ecaf2d commit 5fd7d41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

start() {
if [ "$1" = "start" ]; then
mkdir -p /mnt/sdcard

if [ -b /dev/mmcblk0p1 ]; then
Expand All @@ -9,12 +9,6 @@ start() {
mount /dev/mmcblk0 /mnt/sdcard
fi

echo " _____ _ _ ____ ___ _ _ ____ "
echo "|_ _| | | | _ \|_ _| \ | |/ ___|"
echo " | | | | | | |_) || || \| | | _ "
echo " | | | |_| | _ < | || |\ | |_| |"
echo " |_| \___/|_| \_\___|_| \_|\____|"

echo 3 4 1 7 > /proc/sys/kernel/printk

sleep 1
Expand All @@ -23,8 +17,4 @@ start() {
bmc &

/etc/test_ping.sh &
}

if [ "$1" = "start" ]; then
start
fi
9 changes: 9 additions & 0 deletions tp2bmc/board/tp2bmc/overlay/etc/init.d/S99hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

if [ "$1" = "start" ]; then
echo " _____ _ _ ____ ___ _ _ ____ "
echo "|_ _| | | | _ \|_ _| \ | |/ ___|"
echo " | | | | | | |_) || || \| | | _ "
echo " | | | |_| | _ < | || |\ | |_| |"
echo " |_| \___/|_| \_\___|_| \_|\____|"
fi

0 comments on commit 5fd7d41

Please sign in to comment.