bmc-debug-tools/boot_and_check.sh

58 lines
1.4 KiB
Bash
Raw Normal View History

2024-06-13 12:31:56 +02:00
#!/usr/bin/env bash
2024-06-13 15:40:11 +02:00
#
# KGPE-D16 firmware boot process debugging tools via BMC
#
2024-06-13 12:31:56 +02:00
# Copyright (C) 2024 Adrien 'neox' Bourmault <neox@gnu.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2024-06-13 15:40:11 +02:00
set -e
source power.inc
source logs.inc
buffer=mktemp
2024-06-13 12:31:56 +02:00
greyblue='\033[38;5;245m'
color_reset='\033[0m'
## Main program ---------------------------------------------------------------
main()
{
2024-06-13 15:40:11 +02:00
echo 'Welcome to the KGPE-D16 debugging tools'
echo 'Copyright (C) 2024 Adrien "neox" Bourmault <neox@gnu.org>'
stop_logs
echo Starting logs...
start_logs buffer
echo Booting up...
2024-06-13 12:31:56 +02:00
boot
2024-06-13 15:40:11 +02:00
wait_for buffer "Debian GNU/Linux 9"
2024-06-13 12:31:56 +02:00
echo System successfully booted!
2024-06-13 15:40:11 +02:00
wait_for buffer "link becomes ready"
echo Network ready
wait_for buffer "tty"
echo Login should be ready
echo Shutting down
2024-06-13 12:31:56 +02:00
shutdown
echo Successful power cycle!
}
main