diff options
| author | Quentin Thébault <quentin.thebault@defenso.fr> | 2026-04-02 16:38:47 +0000 |
|---|---|---|
| committer | Ahmad Khalifa <vexeduxr@FreeBSD.org> | 2026-04-18 11:27:26 +0000 |
| commit | 0bd9b26d19e256c1ef0de57b0fe7d1627e07f6dc (patch) | |
| tree | 4eda61cbae56370e353b482efb7c7d424371c691 /sys/dev/vt/vt_core.c | |
| parent | 89d68ee568ebd900fa6561a9ceaf1047f8950e57 (diff) | |
splash: add shutdown splash
This commit adds a shutdown splash to the existing kernel startup splash(4)
screen feature. It can be customized by providing a PNG image to the
shutdown_splash directive loader.conf(5).
Sponsored by: Defenso
MFC after: 2 weeks
Reviewed by: vexeduxr, ziaee, manu
Differential Revision: https://reviews.freebsd.org/D55140
(cherry picked from commit 4b862c713ac5556ab4bd1828b47c5eb9cb28e067)
Diffstat (limited to 'sys/dev/vt/vt_core.c')
| -rw-r--r-- | sys/dev/vt/vt_core.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index ef95df208863..ccba43a821d1 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1682,8 +1682,13 @@ vtterm_splash(struct vt_device *vd) uintptr_t image; vt_axis_t top, left; - si = MD_FETCH(preload_kmdp, MODINFOMD_SPLASH, struct splash_info *); if (!(vd->vd_flags & VDF_TEXTMODE) && (boothowto & RB_MUTE)) { + if (rebooting == 1) { + si = MD_FETCH(preload_kmdp, MODINFOMD_SHTDWNSPLASH, struct splash_info *); + vd->vd_driver->vd_blank(vd, TC_BLACK); + } else { + si = MD_FETCH(preload_kmdp, MODINFOMD_SPLASH, struct splash_info *); + } if (si == NULL) { top = (vd->vd_height - vt_logo_height) / 2; left = (vd->vd_width - vt_logo_width) / 2; @@ -1830,6 +1835,15 @@ vt_init_font_static(void) vt_font_assigned = font; } +#ifdef DEV_SPLASH +static int +vt_shutdown_splash(struct vt_window *vw) +{ + vtterm_splash(vw->vw_device); + return (0); +} +#endif + static void vtterm_cnprobe(struct terminal *tm, struct consdev *cp) { @@ -3175,6 +3189,10 @@ vt_upgrade(struct vt_device *vd) /* For existing console window. */ EVENTHANDLER_REGISTER(shutdown_pre_sync, vt_window_switch, vw, SHUTDOWN_PRI_DEFAULT); +#ifdef DEV_SPLASH + EVENTHANDLER_REGISTER(shutdown_pre_sync, + vt_shutdown_splash, vw, SHUTDOWN_PRI_DEFAULT); +#endif } } } |
