\ ========== Copyright Header Begin ==========================================
\ Hypervisor Software File: banner.fth
\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
\ - Do no alter or remove copyright notices
\ - Redistribution and use of this software in source and binary forms, with
\ or without modification, are permitted provided that the following
\ - Redistribution of source code must retain the above copyright notice,
\ this list of conditions and the following disclaimer.
\ - Redistribution in binary form must reproduce the above copyright notice,
\ this list of conditions and the following disclaimer in the
\ documentation and/or other materials provided with the distribution.
\ Neither the name of Sun Microsystems, Inc. or the names of contributors
\ may be used to endorse or promote products derived from this software
\ without specific prior written permission.
\ This software is provided "AS IS," without a warranty of any kind.
\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
\ You acknowledge that this software is not designed, licensed or
\ intended for use in the design, construction, operation or maintenance of
\ ========== Copyright Header End ============================================
id: @(#)banner.fth 3.17 04/05/26
purpose: Displays banner describing system configuration
copyright: Copyright 1990-2004 Sun Microsystems, Inc. All Rights Reserved
copyright: Use is subject to license terms.
d# 128 constant max-logo-width
logo? @ if max-logo-width stdout-char-width / 2+ spaces then
oem-logo? if oem-logo drop else sun-logo then ( line# adr )
logo-width logo-height stdout-draw-logo
\ Decide in advance whether or not to display a logo so that the
\ text information may be located correctly.
" device_type" stdout @ ihandle>phandle get-package-property 0= if
( adr len ) get-encoded-string " display" $= logo? !
\ If wrap mode is enabled, and there arent enough lines to display the
\ banner (the banner occupies 6 lines) without wrapping, reposition
screen-#rows stdout-line# - 6 < if
: suppress-banner ( -- ) false to auto-banner? ;
auto-banner? if " banner-" do-drop-in then
cr ?spaces oem-banner type cr cr
?spaces cpu-model type ." , " .keyboard-type cr
?spaces .rom ." , " .memory ." , " .serial cr
?spaces sub-release ". cr
?spaces .ether ." , " .hostid ." ." cr
idprom-valid? 0= if ." The IDPROM contents are invalid" cr then
auto-banner? if " banner+" do-drop-in then
\ If "banner" is executed inside nvramrc, we may assume that the
\ "probe-all install-console banner" sequence has been taken care of,
\ so it isn't necessary to execute it again after nvramrc is finished.
: ?banner ( -- ) min+mode? if banner else suppress-banner then ;