1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
|
/*--------------------------------------------------------------------------*\
LINUX_LOGO 2.07 -- Shows a Logo With some System Info - 14 July 1998
by Vince Weaver (weave@eng.umd.edu, http://www.glue.umd.edu/~weave )
http://www.vince.weaver.org/
SUPPORTS Linux (Intel, m68k, Alpha, Sparc) and some non-Linux OS's
\*--------------------------------------------------------------------------*/
HISTORY:
Back in the summer of '97 there was a recurring topic on the linux-kernel
list about having a "boot-up" penguin in the kernel. There were many
arguments back and forth, but eventually the primary consensus was that
this would be better done in user-space. [though with the advent
of GGI, etc, a graphical approach may become standard. Patches did
float around of a Vga-font hack to get a penguin...]
So using a ppm to ansi converter from Rasterman [www.rasterman.com],
a trial version of THEDRAW under DosEmu, and just some talents left
over from my Ansi-art BBS days I hacked together a rough likeness
of Ewing's Linux Penguin. I added some system info from /proc, and
linux_logo was born.
The program itself has grown more "feature-full" as people around the
world sent in their patches. The newer versions are primarily minor
cosmetic fixes. But I get a lot of positive feedback from this tiny
little program I created one summer day........
----------------------------------------------------------------------->
POTENTIAL USES FOR linux_logo
----------------------------------------------------------------------->
* BOOT UP PENGUIN: just stick "/usr/local/bin/linux_logo" in an rc file.
[/etc/rc.d/rc.M is a good place if you are running Slackware. Place
it right above where sendmail causes a pause.]
* MOTD/LOGIN: You can have the penguin appear at the login prompt.
FOR SLACKWARE/OPENLINUX
Add the following lines to /etc/rc.d/rc.S [in slackware]
or to /etc/rc.d/rc.local [OpenLinux]
/usr/local/bin/linux_logo > /etc/issue
/usr/local/bin/linux_logo > /etc/issue.net
and the penguin appears at all the login prompts, even remote ones.
FOR REDHAT: Here is how to do the above with a Redhat distribution.
[thanks to Esperandi]
"I love your Penguin Linux Logo login thing. It only took me a couple
minutes but I figured out how to get it working with Red Ht and its
rc files. I was kinda new to Red Hat, having used Slackware for a
billion years, and the rc files were totally different. But I found
the best way to implement the penguin quite beautifully was to go
into the rc.local files go down to the bottom, and above the line
that reads:
echo "" > /etc/issue
Insert this line:
/usr/bin/linux_logo > /etc/issue
and then change the echo line after it to:
echo "" >> /etc/issue
FOR DEBAIN:
[thanks to <rlovison@simons-rock.edu> ]
Nice program! Just wanted to let you know how I used it within a
Debian system. I have the logo appear above any text in the message
of the day and as long as the day's message remains under a few lines,
it works out wonderfully. First I renamed the Debian default
/etc/motd, created a new one with touch motd', used the following
command:
/usr/local/bin/linux_logo > /etc/motd
and then added a line of text at the end of the file. Next I edited
/etc/init.d/boot. In the following lines which appear near the end
of the file:
if [ "$EDITMOTD" != no ]
then
uname -a > /tmp/motd
sed 1d /etc/motd >> /tmp/motd
mv /tmp/motd /etc/motd
fi
change the third line to:
/usr/local/bin/linux_logo > /tmp/motd
and the fourth line to:
sed 1,18d /etc/motd >> /tmp/motd
and as long as EDITMOTD is set to yes at the beginning of the file, it
should work.
* NETWORK LOGIN:
Note: for platforms that do not have color ansi telnet connections
you might want to use the new "linux_logo -a" option. This gives
a plain ascii [though less exciting and uglier] output. However
boring telnet clients like win95's can then see the Penguin. To
add this functionality, follow the above instructions, but instead
of:
/usr/local/bin/linux_logo > /etc/issue.net
use the following in the appropriate place
/usr/local/bin/linux_logo -a > /etc/issue.net
* PENGUIN PORT: You can set up a port on your Linux box to answer connections
with the Penguin!
Add the following line to /etc/services
penguin 54321/tcp penguin
Add the following line to /etc/inetd.conf
penguin stream tcp nowait root /usr/local/bin/linux_logo
Restart inetd (killall -HUP inetd) and you have it!!
Locally "telnet your.host penguin" will do it. From other machines
you will need the port number ("telnet your.host 1234").. it is easy
to customize.. just pick a port number and away you go!
----------------------------------------------------------------------->
INSTALLING linux_logo
----------------------------------------------------------------------->
untar and uncompress the file
tar -xzvf linux_logo-2.07.tar.gz
enter the directory
cd linux_logo-2.07
edit the Makefile and be sure everything is set up the way you want.
[on stock Linux systems it should work without any changes]
compile the program
make
you can install it by hand
cp linux_logo /usr/local/bin
"make install" will do this for you. You can place it anywhere you want,
but /usr/local/bin is as good a place as any.
--------------------------------------------------------------------------->
USAGE
--------------------------------------------------------------------------->
Usage: ./linux_logo [-ascii] [-banner] [-classic] [-f] [-g] [-h] [-kX] [-l]
[-n] [-o Num] [-p] [-rX] [-s] [-u] [-v] [-w Num]
[-ascii] -- Display logo as ascii only monochrome
[-banner] - New default Banner Logo!
[-classic]- The Old [original] linux_logo look
[-f] -- force the screen clear before drawing
[-g] -- give system info only
[-h] -- this help screen
[-kX] -- X is a character to replace the background one.
[-l] -- display logo only
[-n] -- toggle periods off [may make cleaner output
[-o Num] -- offset output Num spaces to the right
[-p] -- preserve cursor location
[-rX] -- X is a character to replace '#' with in banner mode
[-s] -- skip Bogomips [speeds up on non-Linux platforms]
[-u] -- shows the uptime
[-v] -- version information
[-w Num] -- set width of screen to Num [default 80]
More detailed explanations:
[-ascii] : This option makes linux_logo output no fancy colors. This is
useful if you are viewing linux_logo over a black and white
terminal, or a terminal that can't handle fancy escape sequences
well [like default win95 telnet].
[-banner]: This option makes sure you are viewing the new 'banner' style
output, which the author prefers. I actually didn't draw this
logo; Albert Lai did and let me use it.
[-classic]:This option makes linux_logo display the 'classic' [i.e. pre 2.0]
style logo. Apparently many people prefer this version. I made
it myself using some complex manipulation of TheDraw and of
the 'official' logo.xpm that comes with the linux_sources.
[-f] : This option simply clears the screen before drawing the logo.
[-g] : This option makes linux_logo display the system_info only.
[Note.. this option only works in banner mode]. This is
useful if you have your own, better, ansi logo and you don't
want to mess with include files. Just
"cat My_Logo >> out; linux_logo -g >> out" to get your logo with
my sysinfo.
[-h] : This simply displays the help screen, which is much less verbose
than this write-up.
[-kX] : This option lets you change which character is used when drawing
the background of the logo. Just put the character you want
instead of X. See the next section to learn how to use non-ascii
values [like the IBM line-drawing values] instead.
[-l] : This option displays the logo only [Only works in banner mode].
This is useful if for whatever reason you don't want to see the
system info.
[-n] : This option toggles periods off. It makes the classic logo look
somewhat nicer. It has no effect on the banner logo.
[-o Num] : This option will offset the logo towards the right of the screen
Num spaces.
[-p] : This option preserves the position of the cursor on the screen
while drawing the logo under it.
[-rX] : This option is similar to the -kX option described above, only
it replaces the foreground character not the background one.
[-s] : This option skips the bogomips test on non-linux ports. On
platforms that don't have the bogomips value in a /proc file,
linux_logo calculates the value itself using a GPL'd routine.
This can take a while, especially on slower machines, so it can
be disabled.
[-u] : This option displays the uptime along with the other system
information. While useless when putting logos in issue or motd
files, this option comes in handy if you are using linux_logo
to impress your friends. Also, when used in conjunction with
the -g option, you can use linux_logo in Server-Side includes
in web pages.
[-v] : This option displays the version of linux_logo you are using.
[-w Num] : Use this option to set the width of the screen. It helps in trying
to center the banner mode. Default is 80 columns.
--------------------------------------------------------------------------->
NEAT THINGS TO DO
--------------------------------------------------------------------------->
Changing the output character of the banner
+ You do this with the -rX option where X is the character to output
instead of the default #
+ Some interesting chars to use instead are $ % X * and ~
+ If you have an IBM-VGA font loaded with ibm's extended graphics
characters [ascii codes 128-256] you can output these commands when
using the bas shell via
linux_logo -R$'\nnn'
Where you replace nnn with the octal [base eight] code for the ascii
value. Some neat values of nnn to try are 333 316 260 and 263
[Note.. this only seems to work properly with bash 2.0 and greater]
--------------------------------------------------------------------------->
TROUBLESHOOTING
--------------------------------------------------------------------------->
Know bugs:
Will not support >9 CPU SMP machines currently.
Different architectures have odd /proc files. If you send me
a copy of relevant files (/proc/cpuinfo and /proc/version usually)
I can see about adding support.
On non-Linux platforms the BogoMips check can be quite slow. To skip
it use "linux_logo -s"
To make easy updated to ansi files with difficult editors,
the combination ^[ is read as the ESC code (#27 decimal)
so this combination cannot be used in a picture.
------------------------------------------------------------------------>
CUSTOMIZING "TWEAKING" THE SYSTEM INFO OUTPUT
------------------------------------------------------------------------>
To customize some options of linux_logo, try editing the defaults
in the "defaults.h" file.
The cpuinfo supplied in /proc/cpuinfo is not always the most
desirable text to be displayed as the cpuinfo. In the relevant
sysinfo_x.c file there is a place where I add custom outputs to
"beautify" the output. For instance I parse the ugly
"K6 (166 - 266)" given by /proc/cpuinfo and have it instead just
print "K6".
If your particular chip gives ugly output, send me a sample /proc/cpuinfo
and what you'd rather it say. I have already added fixes for the K6
and certain Cyrix chips.
Unfortunately the 2.0.x kernels don't know about newer chips. So to get
linux_logo to recognize your Pentium II and newer chips, unless you
can find some sort of distinguishing feature that distinguishes them
in /proc/cpuinfo from a pentium pro, my only suggestion is to wait
for Linux 2.2.x [or run a 2.1.x development kernel].
------------------------------------------------------------------------>
TOOLS TO CREATE OTHER LOGOS
------------------------------------------------------------------------>
The image was created using the logo.xpm from the Linux distribution,
ppm2ansi by Carsten Haitzler -- http://www.cse.unsw.edu.au/~s2154962/
and was hand edited using THEDRAW under dosemu 0.66.7
Another good ansi editor [under development] from Adam Lackorzynski
can be obtained at http://www.inf.tu-dresden.de/~al10/aae/
------------------------------------------------------------------------->
WHERE TO GET LINUX_LOGO:
------------------------------------------------------------------------->
http://www.glue.umd.edu/~weave/vmwprod/
http://www.vince.weaver.org/vmwprod/
http://sunsite.unc.edu/pub/Linux/logos/penguin/linux_logo-2.07.tar.gz
Check out other programs by me at http://www.glue.umd.edu/~weave/vmwprod
-------------------------------------------------------------------------->
THANKS
-------------------------------------------------------------------------->
Many thanks to the people sending in patches and /proc/cpuinfo entries.
Without you linux_logo wouldn't work on many machines.
Also many Thanks to Marie Prosser who is always there for me.
-----------------
Vince
weave@eng.umd.edu
vince@weaver.org
|