Linux Progress Patch - a simple kernel patch
C.Pollmeier@gmx.net
---

0. License

 See COPYING.


1. What's this?

 Taking the description simple, I'd say: This is a sort of kernel modification
 that hides all these messages at bootup and instead shows a user defined logo
 (or whatever) with a progress bar and at your opinion a small piece of text.
 It can also come up with a kind of "warning" or "fail" logo, if the initscripts
 think: Wait - something went wrong here.


2. Why this?

 Short story.

 Guy:   Hey Cajus. Can you tell me what all these messages are trying to tell
        me? Just getting confused...
 Cajus: They tell you what the kernel is doing, trying to find hardware etc.
 Guy:   Grr. It's so confusing. Can't you hide them?
 Cajus: Why? ... Come on. Just ignore them, but - wait

 Now you know it. I'm not using it for my own PC, 'cos I like these messages, 
 but for some reason many people like it more quiet at boot up.


3. Hardware requirements

 You need a "vesa" graphics capable machine, wich is able to display at least
 640x480 points, using 256 (8-Bit) Colors. You are not limited to this
 resolution - of course. You can switch to 1280x1024 in True Color, too. The
 logo itself has colors out of a pool of 240 colors, which has a sense.
 Imageine the memory consumption of a picture in true color and 1280x1024. Its
 much too big to fit in your bootup memory. You'll get a "virtual memory 
 exhausted" message.


4. Installation


 4.1 Prepare the kernel

 Get a clean kernel (2.2.18/2.4.0 at the moment) from
 http://www.kernel.org or a mirror.  Unpack it (it will write to a
 'linux' subdirectory of your current directory; don't overwrite an
 existing 'linux'!) via:

 # gzip -cd linux-2.4.0.tar.gz | tar xvf -
 (or bzip2 -cd linux-2.4.0.tar.bz2 | tar xvf -)

 Do some housekeeping.
 # mv linux linux-2.4.0

 Now apply the patch from this package:
 # cd linux-2.4.0
 # bzip2 -cd <the-right-path>/lpp-2.4.0-3.bz2 | patch -p1

 Configure and install your kernel as usual, include at least these option:

 Code maturity level options -> Prompt for development and/or incomplete
 code/drivers:

 Enable the experimental stuff!

 Console Drivers -> Video mode selection support
                 -> Support for frame buffer devices (EXPERIMENTAL)
		 -> VESA Framebuffer support (RIVA/MATROX whatever should be ok)
		 -> Enable Linux Progress Patch (EXPERIMENTAL) (NEW)

 Or in other words: CONFIG_EXPERIMENTAL, CONFIG_VIDEO_SELECT, CONFIG_FB,
                    CONFIG_LPP, CONFIG_VESA_FB

 Go, build and install your new kernel, remember to keep a backup option in your
 lilo.conf.
 The kernel part is now (nearly) ready run. Ony point is missing:

 Edit you lilo.conf, to use these parameters for the new image:
 vga=0x301
 append="console=/dev/tty2 CONSOLE=/dev/tty2"
 Take a look at /usr/src/linux/Documentation/fb/vesafb.txt for more modes.

 If you want to test your kernel setup, you may reboot now, but since the boot 
 up scripts have not been modified, the progress bar will only fill 50%...


 4.2 Modifications for the init scripts

 Please read this ENTIRELY before rebooting.

 To let the progress bar continue its work during the execution of the init
 scripts, just use the rc and rcS files. THESE WORK ONLY FOR DEBIAN SYSTEMS,
 so if you are using SuSE, RedHat, Mandrake or whatever, you have to modify
 the scripts yourself.  I'm using progress.dat for the strings to be shown up.
 Just copy it to /etc.

 Stay tuned and watch out for any changes.

 Setting the progress is easy. If you want to get the message "initializing
 sound" on the screen, using a progress of 52%, you will do it this way:

 # echo "52 initializing sound" > /proc/progress

 In case of a warning or an error, just let the user know:

 # echo w > /proc/progress
 or
 # echo f > /proc/progress

 This puts a "warning" or "failure" symbol on the screen. The user can switch to
 another console (where the bootmessages are) in order to check whats going on.
 In order to put the bootmessages on another console, you should use some
 additional entries on your append line. See above.

 Any percent value greater than 100 will disable the proc interface.


4.3 Get rid of it
 
 Why? Ok. For temporary reasons you can specify something like "vga=4" in your
 lilo.conf. For permanent removal install your backup kernel.


5. Customization

 Well lets do some kind of contest :-) Send me your boot screens, I'll put 
 screen shots and files on the website and organize some voting stuff. I made
 a small stupid script to make "theme" install easy for you. To create your
 own, read the following text and the README of the templates directory. 

 Just download the theme tar-ball you want, and install it via:
 # ./theme_install name.tar.gz [path to your kernel directory]

 Then you can rebuild your kernel and enjoy your new screen.

 
 5.1 How to create your own boot logo stuff

 First design the boot screen with your favorite painting ware. Remember that
 you are limited to a 8-bit color depth picture for memory consumtion reasons.
 Save it as "tif" if you use the fblogo package, save it as pcx if you're
 planning to use "bootlogo".

 Write down the coordinates and size of the progress bar. Decide where to put
 the text. Decide where to put the error/warning icons. You can modify the
 length of the text, too. Remember to write down your logo dimensions, too.


 5.2 Extra pixels

 There are some pixels with extra functionality. They are located in
 the progress bar:

    The progress bar...
    -------------------------------- - -  -     -
    |1234555666
    |AB  555666
    |AB  555666
    -------------------------------- - -  -     -
    1: progress bar foreground color
    A: together with 1, the stripe of color used as the progress bar
       forground (see STRIPE_BAR below)
    2: progress bar background color
    B: together with 2, the stripe of color used as the progress bar
       background (see STRIPE_BAR below)
    3: text foreground color
    4: text background color
    5: pixels for "warning" logo,
       dimensions PROGRESS_BAR_HEIGHT X PROGRESS_BAR_HEIGHT
    6: pixels for "failure" logo, 
       dimensions PROGRESS_BAR_HEIGHT X PROGRESS_BAR_HEIGHT

    |---|    or, if the progress bar is is vertical...
    |1AA|    
    |2BB|    warning and failure logos (5 & 6) remain square
    |3  |
    |4  |
    |555|
    |555|
    |555|
    |666|
    |666|
    |666|

  5.3 Remember to fill these lines in the "definitions" file,
      customize it to YOUR values:

    The coordinate system (X,Y) used is:

    The pixel in the upper left corner is (0,0)
    X increases to the right
    Y increases as you go down

    EXAMPLE:

    /* Dimensions of the logo */
    #define LOGO_W              640
    #define LOGO_H              480

    /* These describe the position and size of the progress bar. */
    /* Coordinates of the bar's top left corner pixel. */
    #define PROGRESS_BAR_X      0
    #define PROGRESS_BAR_Y      469
    /* Coordinates of the bar's bottom right corner pixel. */
    #define PROGRESS_CORNER_X   640
    #define PROGRESS_CORNER_Y   480
    /* _Instead_ of bottom right corner; you could give width and height.
     * #define PROGRESS_BAR_WIDTH  640
     * #define PROGRESS_BAR_HEIGHT 11
     */

    /* 0 means the progress bar forground and background colors are solid,
     * defined by only the pixels marked 1 and 2 in the diagram.
     * 1 means the progress bar is a repeated stripe of color; the stripe
     * for the forground defined by the pixels marked 1 and A in the diagram,
     * and the stripe for the background defined by the pixels marked
     * 2 and B in the diagram.
     * (Optional, defaults to 0.) */
    #define STRIPE_BAR 1

    /* The progress bar is vertical when 1, horizontal when 0.
     * (Optional, defaults to false.) */
    #define PROGRESS_VERTICALLY 0

    /* 0 means progress of the bar is from left to right (top to
     * bottom when vertical), 1 means from right to left (bottom to top
     * when vertical).  
     * (Optional, defaults to false.) */
    #define REVERSE_DIRECTION   0

    /* The position of the upper left pixel of the text area. */
    
    #define TEXT_X              0
    #define TEXT_Y              458

    /* These should be the same in future, lenght of text in characters */
    #define MAX_TEXT_LEN        60
    #define MESSAGE_LENGTH      60

    /* Enables a scrolling text field of 4 lines.
     * (Optional, defaults to 1.) */
    #define LPP_TEXT_BLOCK_HEIGHT 4

    /* Position of the upper left pixel of the warning/error icon. */
    #define ICON_X              0
    #define ICON_Y              446


    5.4 Save and package

    Convert your tif file with the contributed "fblogo" tool:
    # fblogo my_logo.tif linux_logo.h

    Generate a tar file, containing "linux_logo.h" and "definitions".
    (May also contain COPYING, CREDITS, README, if desired.  The
     README is displayed when the theme is installed.)
    # mkdir mytheme
    # mv linux_logo.h mytheme
    # mv definitions mytheme
    # tar cvfz mytheme.tar.gz mytheme

    You can now install the theme with "theme_install".


    6 Additional information
    
    Many of you request, that they want to see "some" kernel messages
    during bootup. So here is a simple solution:

    Design your bootlogo not to fill the whole screen i.e. 640x400. Don't
    specify the console/CONSOLE stuff then. The kernel messages will show
    up in the bottom of the screen.


    7 Troubleshooting

    If you have a problem compiling fblogo (i.e. RedHat 6.2) try
    obtaining fblogo-0.1.tar.gz from the web.  (Try 'www.google.com/linux'.)

Enjoy,
-Cajus <C.Pollmeier@gmx.net>

