diff options
15 files changed, 34531 insertions, 105 deletions
diff --git a/packages/linux/linux-openzaurus-2.6.14-rc1/.mtn2git_empty b/packages/linux/linux-openzaurus-2.6.14-rc1/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/linux/linux-openzaurus-2.6.14-rc1/.mtn2git_empty diff --git a/packages/linux/linux-openzaurus-2.6.14-rc1/add-elpp-stuff.patch b/packages/linux/linux-openzaurus-2.6.14-rc1/add-elpp-stuff.patch new file mode 100644 index 0000000000..04ab185f4f --- /dev/null +++ b/packages/linux/linux-openzaurus-2.6.14-rc1/add-elpp-stuff.patch @@ -0,0 +1,26985 @@ + +# +# Patch managed by http://www.holgerschurig.de/patcher.html +# + +--- /dev/null ++++ linux-2.6.12/Documentation/fb/elpp.txt +@@ -0,0 +1,181 @@ ++ ++ ELPP, The Enhanced Linux Progress Patch v1.0 ++ -------------------------------------------- ++ ++CONTENTS ++0. ChangeLog. ++1. What is ELPP. ++2. Who needs it. ++3. Requirements. ++4. How to use it. ++5. Uninstalling. ++6. Creating Themes. ++7. Sample Bootloader entries. ++ ++ ++0. The following is the summary of changes from ELPP-v0.1 ++ -> New format for themes ++ -> Fixes ++ -> Reserving part of palette for ELPP colors ++ ++ ++1. What is ELPP? ++ Hides the bootup messages and shows a fancy logo at boot. It ++can however show a configurable number of messages while at the same ++time showing the logo and a progress bar. The success, failure and ++the warning messages of the initscripts can also be shown here. ++ ++ ++2. Who needs it? ++ A few rare people who are not interested in the messages shown when ++booting. (like the friend of Cajus Pollmeier, The author of the original ++Linux Progress Patch). A few of my friends use it but I dont. ++ ++ ++3. Requirements: ++ Requires a vesa capable machine. Linux 2.6 or later are supported. ++If you are looking for patch for 2.4, you can have a look at the Linux ++Progress Patch at "http://freshmeat.net/projects/lpp/". You ++might also be interested in the bootsplash <http://www.bootsplash.org> ++ ++ ++4. How to use it? ++ -> Download a fresh 2.6 kernel from http://www.kernel.org/ ++ -> Download the patch from http://elpp.foofighter.de/ ++ -> Apply the patch... ++ cd linux-2.6.XX ++ bzip2 -cd /path/to/patch/elpp-1.0-2.6.XX.bz2 | patch -p1 ++ -> Configure and compile the Kernel ++ ++ make xconfig (or menuconfig etc.); ++ ++ and then enable the following ++ ++ File systems ++ -> Pseudo filesystems ++ -> /proc file system ++ ++ Device Drivers ++ -> Block Devices ++ -> RAM disk support (and INITRD support too) ++ ++ Device Drivers ++ -> Graphics Support ++ -> Support for FrameBuffer devices ++ -> Enhanced Linux Progress Patch ++ ++ Device Drivers ++ -> Graphics Support ++ -> Console Display Driver Support ++ -> Framebuffer Console support ++ ++ and select atleast one driver (VESA Preffered) for FB under ++ DeviceDrivers -> Graphics Support -> Support for FrameBuffer Devices. ++ ++ After finishing with the configuration, you need to do a ++ make bzImage, make modules, make modules_install and a make install ++ to install the new kernel. ++ ++ -> Configure your boot loader. ++ ++ Based on your hardware you need to select a vesa mode. Check ++ linux-2.6.XX/Documentation/fb/vesafb.txt for more information. ++ passing vga=0x301 would in most cases be sufficient. However ++ higher resolutions are also supported. ++ ++ To display the display of messages, you need to pass the ++ arguments "console=/dev/tty2 CONSOLE=/dev/tty2" to the kernel. ++ ++ Please refer to the sample LILO and GRUB entries at the bottom. ++ ++ -> Change the initscripts. ++ Changing the init scripts would do the job of passing messages ++ and progress to the kernel. Take a look at the distributed ++ files etc/rc and etc/init.d/functions for the modifications. ++ ++ Hint: Search for the word progress and the matches would ++ reveal the changes done. ++ ++ In case of RedHat9 The distributed initscripts can directly be used. ++ ++ Here's what the modifications mean... ++ 1. If you echo a string "10 Hello world" into /proc/progress ++ the initial number is taken as progress and the other ++ part of the string forms the message to be displayed. ++ ++ 2. If the message starts with a '=' it indicates the ++ success/failure of the previous message. ++ =s is for success. ++ =f is for failure. ++ =w is for warning. ++ ++ 3. If the message starts with a '!' its a command. ++ !c to clear the previous messages. ++ !s to enable/disable the progress bar. ++ ++ ++5. Uninstalling: ++ For uninstalling ELPP you can install your backup kernel and ++for the initscripts you may need to reinstall the package that provides ++them. ++ ++ ++6. Creating Themes: ++ Themes for ELPP-v1.0 are in the form of initrd files. The ++application which is also distributed along with this patch can be used ++for creating themes. ++ For creating themes using the application, load an image into ++the application and select the locations/colors for the progress bar ++and messages to appear. For distortion free boot-screen use images ++with not more than 200 colors. For this you can use the GNU image ++manipulation program (GIMP). The steps involved are as below: ++ ++ -> Open your favorite image in GIMP. ++ -> In the context menu... go to Image->Mode->Indexed ++ -> In the dialog that pops up, se the colors to 200. ++ -> Save the image in PNG (avoid gif please) ++ ++once you create the theme, save it and you get a file with .eti extension. ++You can either use this file directly as your initrd or append this ++to your initrd. ie., cat IMG_NAME.eti >> /boot/initrd... See your ++bootloaders documentation for further information on using initrd. ++ ++Note: The size of the theme image will be equal to the size of the input ++ image. Please ensure that the size of image is according to the ++ entry in BootLoader... If the resolution of theme is greater than ++ that of the screen, the system would not crash but the behaviour of ++ the boot screen is not assured. However, when a smaller image is ++ given... it is centered to the screen. ++ ++Note2: If no themes are loaded using the INITRD, the default inbuilt theme ++ is shown. ++ ++7. Sample Boot Loader entries: ++ The following examples demonstrate using a theme from file smile.eti ++on a 640x480 resolution. For more details on the FB modes refer to the Linux ++kernel documentation... Documentation/fb/vesa.txt in the kernel source tree. ++The following the summary of modes: ++ ++ | 640x480 800x600 1024x768 1280x1024 ++ ----+------------------------------------- ++ 256 | 0x301 0x303 0x305 0x307 ++ 32k | 0x310 0x313 0x316 0x319 ++ 64k | 0x311 0x314 0x317 0x31A ++ 16M | 0x312 0x315 0x318 0x31B ++ ++ ++ -> In lilo its done as.. ++ image=/boot/vmlinux-2.6.XX ++ label=Linux-ELPP ++ vga=0x301 ++ append="console=/dev/tty2 CONSOLE=/dev/tty2" ++ initrd=/boot/smile.eti ++ ++ ->In grub its just ++ kernel /boot/vmlinux vga=0x301 console=/dev/tty2 CONSOLE=/dev/tty2 ++ initrd /boot/initrd-2.6.XX ++ ++ ++ ----------------------------------------- ++ Comments, queries and changes welcome at: ++ Matthias Kunze <elpp at foofighter.de> +--- linux-2.6.12/drivers/video/Kconfig~add-elpp-stuff.patch ++++ linux-2.6.12/drivers/video/Kconfig +@@ -108,6 +108,11 @@ + This is particularly important to one driver, matroxfb. If + unsure, say N. + ++config FB_ELPP ++ bool "Enhanced Linux Progress Patch" ++ depends on FB && PROC_FS ++ default y ++ + config FB_CIRRUS + tristate "Cirrus Logic support" + depends on FB && (ZORRO || PCI) +--- linux-2.6.12/drivers/video/console/Makefile~add-elpp-stuff.patch ++++ linux-2.6.12/drivers/video/console/Makefile +@@ -31,6 +31,8 @@ + obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += tileblit.o + endif + ++obj-$(CONFIG_FB_ELPP) += elpp.o symbols_16x16.o ++ + obj-$(CONFIG_FB_STI) += sticore.o font.o + + # Targets that kbuild needs to know about +--- /dev/null ++++ linux-2.6.12/drivers/video/console/elpp.c +@@ -0,0 +1,685 @@ ++ ++/* ++ * The Enhanced Linux Progress Patch ++ * by Prasad <prasad_s@students.iiit.net>, IIIT - Hyderabad, INDIA ++ * ++ * drivers/video/console/elpp.c ELPP implementation file ++ * ++ * This file is part of the Enhanced Linux Progress Patch. ++ * ++ * ELPP 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 2 of the License, or ++ * (at your option) any later version. ++ * ++ * Foobar 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 ELPP; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ */ ++ ++#include <linux/config.h> ++#include <linux/initrd.h> ++#include <linux/module.h> ++#include <linux/types.h> ++#include <linux/sched.h> ++#include <linux/fs.h> ++#include <linux/kernel.h> ++#include <linux/delay.h> ++#include <linux/tty.h> ++#include <linux/console.h> ++#include <linux/string.h> ++#include <linux/kd.h> ++#include <linux/slab.h> ++#include <linux/fb.h> ++#include <linux/vt_buffer.h> ++#include <linux/vt_kern.h> ++#include <linux/vmalloc.h> ++#include <linux/selection.h> ++#include <linux/smp.h> ++#include <linux/init.h> ++#include <linux/font.h> ++#include <linux/proc_fs.h> ++#include <linux/version.h> ++#include <linux/linux_logo.h> ++#include <linux/elpp.h> ++#include <asm/io.h> ++#include <asm/irq.h> ++#include <asm/system.h> ++#include <asm/uaccess.h> ++ ++#define MAX_MSG_LENGTH 100 ++ ++struct elpp_messages { ++ char text[MAX_MSG_LENGTH]; ++ short success; ++ short flag; ++}; ++ ++extern const struct linux_logo logo_linux_elpp; ++ ++struct elpp_prefs backup_prefs = { ++ .bar_x = 275, ++ .bar_y = 300, ++ .bar_length = 365, ++ .bar_width = 10, ++ .msg_length = 45, ++ .num_messages = 7, ++ .msg_x = 275, ++ .msg_y = 185, ++ .bar_bg = {0x00,0x00,0xff}, ++ .bar_fg = {0xff,0x00,0x00}, ++ .warning_bg = {0x00,0x00,0x00}, ++ .warning_fg = {0xff,0xff,0xff}, ++ .error_bg = {0x00,0x00,0x00}, ++ .error_fg = {0xff,0xff,0xff}, ++ .success_bg = {0x00,0x00,0x00}, ++ .success_fg = {0xff,0xff,0xff}, ++ .warning_symbol_bg = {0x00,0x00,0x00}, ++ .warning_symbol_fg = {0xff,0xff,0x00}, ++ .error_symbol_bg = {0x00,0x00,0x00}, ++ .error_symbol_fg = {0xff,0x00,0x00}, ++ .success_symbol_bg = {0x00,0x00,0x00}, ++ .success_symbol_fg = {0x00,0xff,0x00} ++}; ++ ++struct elpp_struct elpp = {NULL,0,1,0,0,NULL,NULL,NULL, ++ NULL,NULL,NULL,0,0,0,0,0}; ++ ++static u16 translated_bar_x, translated_bar_y; ++static u16 translated_msg_x, translated_msg_y; ++ ++#define BAR_X translated_bar_x ++#define BAR_Y translated_bar_y ++#define BAR_WIDTH elpp.prefs->bar_length ++#define BAR_HEIGHT elpp.prefs->bar_width ++#define MSG_LENGTH elpp.prefs->msg_length ++#define NUM_MSGS elpp.prefs->num_messages ++#define MSG_X translated_msg_x ++#define MSG_Y translated_msg_y ++#define BAR_BG elpp.prefs->bar_bg ++#define BAR_FG elpp.prefs->bar_fg ++#define WRN_BG elpp.prefs->warning_bg ++#define WRN_FG elpp.prefs->warning_fg ++#define WRN_SYM_BG elpp.prefs->warning_symbol_bg ++#define WRN_SYM_FG elpp.prefs->warning_symbol_fg ++#define ERR_BG elpp.prefs->error_bg ++#define ERR_FG elpp.prefs->error_fg ++#define ERR_SYM_BG elpp.prefs->error_symbol_bg ++#define ERR_SYM_FG elpp.prefs->error_symbol_fg ++#define SUC_BG elpp.prefs->success_bg ++#define SUC_FG elpp.prefs->success_fg ++#define SUC_SYM_BG elpp.prefs->success_symbol_bg ++#define SUC_SYM_FG elpp.prefs->success_symbol_fg ++ ++#define MSG_CUR \ ++ elpp.messages[(elpp.msg_position + NUM_MSGS ) % NUM_MSGS] ++#define MSG_PREV \ ++ elpp.messages[(elpp.msg_position + NUM_MSGS - 1) % NUM_MSGS] ++#define MSG_NEXT \ ++ elpp.messages[(elpp.msg_position + 1) % NUM_MSGS] ++#define COLOR(x) (elpp.colors_base + x) ++ ++static const unsigned char colors[14][3]; ++ ++enum ELPP_COLORS { eBAR_FG, eBAR_BG, ++ eSUC_FG, eSUC_BG, eSUC_SYM_FG, eSUC_SYM_BG, ++ eWRN_FG, eWRN_BG, eWRN_SYM_FG, eWRN_SYM_BG, ++ eERR_FG, eERR_BG, eERR_SYM_FG, eERR_SYM_BG }; ++ ++enum ELPP_STATUS { eSUCCESS=1, eWARNING, eFAILURE }; ++ ++/* ASCII to Integer... needed for progress */ ++static int elpp_atoi(const char *name) ++{ ++ int val = 0; ++ ++ for (;; name++) { ++ switch (*name) { ++ case '0'...'9': ++ val = 10*val+(*name-'0'); ++ break; ++ default: ++ return val; ++ } ++ } ++} ++ ++/* Parse the message passed from userspace */ ++static int elpp_parse(const char *str) ++{ ++ int progress = -1, success = 0; ++ char *msg_text; ++ ++ if( str[0] == '!' ) { ++ ++ /* Its a command... */ ++ if( str[1] == 'c' ) { ++ ++ int i; ++ for(i=0; i<NUM_MSGS; i++) ++ elpp.messages[i].flag = 0; ++ elpp.msg_position = 0; ++ ++ } else if( str[1] == 's' ) ++ elpp.booting = 1 - elpp.booting; ++ ++ /* return without updating */ ++ return 0; ++ } else if( str[0] == '=' ) { ++ ++ /* Was the previous operation successful??? */ ++ ++ switch (str[1]) { ++ case 's': ++ success = eSUCCESS; ++ break; ++ case 'f': ++ success = eFAILURE; ++ break; ++ case 'w': ++ success = eWARNING; ++ break; ++ default: ++ success = 0; ++ break; ++ } ++ ++ if( MSG_PREV.flag == 1 ) ++ MSG_PREV.success = success; ++ ++ /* return without updating */ ++ return 0; ++ } ++ ++ if (elpp.booting == 0) ++ return 0; ++ ++ /* Its the LPP style input, Progress followed by Message */ ++ progress = elpp_atoi(str); ++ msg_text = strchr(str,' ') + 1; ++ strncpy( MSG_CUR.text, msg_text, strlen(msg_text)+1); ++ MSG_CUR.flag = 1; ++ MSG_CUR.success = 0; ++ ++ elpp.msg_position++; ++ if(elpp.msg_position == NUM_MSGS) ++ elpp.msg_position = 0; ++ ++ progress = (progress > 100)? 100: progress; ++ return progress; ++} ++ ++/* Based on accel_putc in fbcon.c */ ++static void elpp_render_char(struct font_desc *font, ++ int ch, int xx, int yy, int fgcol, int bgcol) ++{ ++ struct fb_image image; ++ unsigned short charmask = 0xff; ++ unsigned int scan_align = elpp.info->pixmap.scan_align - 1; ++ unsigned int buf_align = elpp.info->pixmap.buf_align - 1; ++ unsigned int size, pitch; ++ unsigned int width = (font->width + 7) >> 3; ++ u8 *src, *dst; ++ ++ image.dx = xx; ++ image.dy = yy; ++ image.width = font->width; ++ image.height = font->height; ++ image.fg_color = fgcol; ++ image.bg_color = bgcol; ++ image.depth = 1; ++ ++ pitch = width + scan_align; ++ pitch &= ~scan_align; ++ size = pitch * font->height; ++ size += buf_align; ++ size &= ~buf_align; ++ dst = fb_get_buffer_offset(elpp.info, &(elpp.info->pixmap), size); ++ image.data = dst; ++ src = font->data + (ch & charmask) * font->height * width; ++ ++ fb_pad_aligned_buffer(dst, pitch, src, width, image.height); ++ elpp.info->fbops->fb_imageblit(elpp.info, &image); ++} ++ ++/* Show the messages */ ++static void elpp_show_messages(void) ++{ ++ struct font_desc *font = get_default_font(elpp.info->var.xres, ++ elpp.info->var.yres); ++ struct font_desc *icons = &symbols_16x16; ++ int i,counter=0; ++ struct fb_fillrect rect; ++ ++ rect.dy = MSG_Y; ++ rect.dx = MSG_X; ++ rect.width = MSG_LENGTH * font->width; ++ rect.height = font->height * NUM_MSGS; ++ rect.rop = 0; ++ rect.color = COLOR(eSUC_BG); ++ elpp.info->fbops->fb_fillrect(elpp.info, &rect); ++ ++ i = elpp.msg_position ? elpp.msg_position - 1 : NUM_MSGS - 1; ++ ++ for(counter = 0; counter < NUM_MSGS; i = i ? i-1 : NUM_MSGS-1, counter++){ ++ ++ int j; ++ int textbg,textfg,iconbg,iconfg; ++ ++ rect.dy = MSG_Y + font->height * (NUM_MSGS-counter-1); ++ rect.height = font->height; ++ ++ /* Set the background for text */ ++ switch(elpp.messages[i].success) { ++ default: ++ case eSUCCESS: ++ rect.color = COLOR(eSUC_BG); ++ textbg = COLOR(eSUC_BG); ++ textfg = COLOR(eSUC_FG); ++ iconbg = COLOR(eSUC_SYM_BG); ++ iconfg = COLOR(eSUC_SYM_FG); ++ break; ++ case eWARNING: ++ rect.color = COLOR(eWRN_BG); ++ textbg = COLOR(eWRN_BG); ++ textfg = COLOR(eWRN_FG); ++ iconbg = COLOR(eWRN_SYM_BG); ++ iconfg = COLOR(eWRN_SYM_FG); ++ break; ++ case eFAILURE: ++ rect.color = COLOR(eERR_BG); ++ textbg = COLOR(eERR_BG); ++ textfg = COLOR(eERR_FG); ++ iconbg = COLOR(eERR_SYM_BG); ++ iconfg = COLOR(eERR_SYM_FG); ++ break; ++ } ++ elpp.info->fbops->fb_fillrect(elpp.info, &rect); ++ ++ if(elpp.messages[i].flag == 0) ++ break; ++ ++ /* Show the text now */ ++ for( j = 0; j < strlen(elpp.messages[i].text); j++ ) { ++ elpp_render_char( font, elpp.messages[i].text[j], ++ MSG_X + font->width * j, ++ MSG_Y + font->height * (NUM_MSGS-counter-1), textfg, textbg ); ++ } ++ ++ /* Show the bitmap for success/failure/warning */ ++ if(elpp.messages[i].success != 0) { ++ elpp_render_char( icons, (elpp.messages[i].success - 1) * 2, ++ MSG_X + (font->width * (MSG_LENGTH - 3)), ++ MSG_Y + font->height * (NUM_MSGS - counter - 1), ++ iconfg, iconbg ); ++ elpp_render_char( icons, (elpp.messages[i].success - 1) * 2 + 1, ++ MSG_X + (font->width * (MSG_LENGTH - 2)), ++ MSG_Y + font->height * (NUM_MSGS - counter - 1), ++ iconfg, iconbg ); ++ } ++ } ++} ++ ++/* Update the contents on the screen */ ++static void elpp_show_progress(int progress) ++{ ++ struct fb_fillrect rect; ++ ++ /* Draw the BG of progress Bar */ ++ rect.dx = BAR_X; ++ rect.dy = BAR_Y; ++ rect.height = BAR_HEIGHT; ++ rect.width = BAR_WIDTH; ++ rect.color = COLOR(eBAR_BG); ++ rect.rop = 0; ++ elpp.info->fbops->fb_fillrect(elpp.info, &rect); ++ ++ /* Draw the progress */ ++ rect.dx = BAR_X; ++ rect.dy = BAR_Y + 1; ++ rect.width = (progress * BAR_WIDTH)/100; ++ rect.height = BAR_HEIGHT - 2; ++ rect.color = COLOR(eBAR_FG); ++ elpp.info->fbops->fb_fillrect(elpp.info, &rect); ++ ++} ++ ++/* Function that can be called from other parts of kernel */ ++void elpp_progress(char *str) ++{ ++ int progress; ++ ++ progress = elpp_parse(str); ++ if( progress > 0 ) { ++ elpp_show_progress(progress); ++ elpp_show_messages(); ++ } ++} ++ ++/* Something written into /proc/progress */ ++static ssize_t elpp_proc_write(struct file *file, const char *buf, ++ size_t length, loff_t *offset) ++{ ++ int progress; ++ char tmp_string[MSG_LENGTH]; ++ int len = length < MSG_LENGTH ? length : MSG_LENGTH; ++ ++ /* If disabled do not process input */ ++ if( elpp.disable == 1 ) ++ return length; ++ ++ copy_from_user(tmp_string,buf, len ); ++ tmp_string[len-1] = '\0'; ++ progress = elpp_parse(tmp_string); ++ if( progress > 0 ) { ++ elpp_show_progress(progress); ++ elpp_show_messages(); ++ } ++ ++ /* We have read the entire string */ ++ return length; ++} ++ ++/* /proc/progress access permissions */ ++int elpp_permissions(struct inode *inode, int op, struct nameidata *dummy) ++{ ++ /* W for root */ ++ if ( op == 2 && current->euid == 0 ) ++ return 0; ++ return -EACCES; ++} ++ ++/* Create proc entry */ ++static struct file_operations elpp_file_operations = { ++ .owner = THIS_MODULE, ++ .write = elpp_proc_write ++}; ++ ++static struct inode_operations elpp_inode_operations = { ++ .lookup = &elpp_file_operations, ++ .permission = elpp_permissions ++}; ++ ++/* Registers an entry in the /proc directory */ ++void __init elpp_register(void) ++{ ++ elpp.proc_progress_entry = create_proc_entry("progress", ++ S_IFREG | S_IRUGO | S_IWUSR, &proc_root ); ++ if( elpp.proc_progress_entry == NULL ) ++ { ++ printk("[ELPP] Unable to create proc entry.\n"); ++ return; ++ } ++ ++ elpp.proc_progress_entry->owner = THIS_MODULE; ++ elpp.proc_progress_entry->proc_iops = &elpp_inode_operations; ++ elpp.proc_progress_entry->write_proc = elpp_proc_write; ++} ++ ++static inline unsigned safe_shift(unsigned d, int n) ++{ ++ return n < 0 ? d >> -n : d << n; ++} ++ ++/* Based on fb_set_logocmap() */ ++static void __init elpp_set_cmap(void) ++{ ++ struct fb_cmap palette_cmap; ++ u16 palette_green[14]; ++ u16 palette_blue[14]; ++ u16 palette_red[14]; ++ int i; ++ ++ palette_cmap.len = 14; ++ palette_cmap.red = palette_red; ++ palette_cmap.green = palette_green; ++ palette_cmap.blue = palette_blue; ++ palette_cmap.transp = NULL; ++ palette_cmap.start = 235; ++ for (i = 0; i < 14; ++i) { ++ palette_cmap.red[i] = colors[i][0] << 8 | colors[i][0]; ++ palette_cmap.green[i] = colors[i][1] << 8 | colors[i][1]; ++ palette_cmap.blue[i] = colors[i][2] << 8 | colors[i][2]; ++ } ++ fb_set_cmap(&palette_cmap, elpp.info); ++ ++ elpp.colors_base = 235; ++} ++ ++/* Based on fb_set_logo_truepalette() */ ++static void __init elpp_set_truepalette(void) ++{ ++ unsigned char mask[9] = { 0,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff }; ++ struct fb_info *info = elpp.info; ++ unsigned char redmask, greenmask, bluemask; ++ int redshift, greenshift, blueshift; ++ int i; ++ ++ /* ++ * We have to create a temporary palette since console palette is only ++ * 16 colors long. ++ */ ++ /* Bug: Doesn't obey msb_right ... (who needs that?) */ ++ redmask = mask[info->var.red.length < 8 ? info->var.red.length : 8]; ++ greenmask = mask[info->var.green.length < 8 ? info->var.green.length : 8]; ++ bluemask = mask[info->var.blue.length < 8 ? info->var.blue.length : 8]; ++ redshift = info->var.red.offset - (8 - info->var.red.length); ++ greenshift = info->var.green.offset - (8 - info->var.green.length); ++ blueshift = info->var.blue.offset - (8 - info->var.blue.length); ++ ++ for ( i = 0; i < 14; i++) { ++ elpp.palette[i+32] = (safe_shift((colors[i][0] & redmask), redshift) | ++ safe_shift((colors[i][1] & greenmask), greenshift) | ++ safe_shift((colors[i][2] & bluemask), blueshift)); ++ } ++ ++ elpp.colors_base = 32; ++} ++ ++/* Based on fb_set_logo_directpalette() */ ++static void __init elpp_set_directpalette(void) ++{ ++ struct fb_info *info = elpp.info; ++ int redshift, greenshift, blueshift; ++ int i; ++ ++ redshift = info->var.red.offset; ++ greenshift = info->var.green.offset; ++ blueshift = info->var.blue.offset; ++ ++ for (i = 32; i < 46; i++) ++ elpp.palette[i] = i << redshift | i << greenshift | i << blueshift; ++ ++ elpp.colors_base = 32; ++} ++ ++void __init elpp_find_initrd_theme(void) ++{ ++ unsigned long i, j, k, theme_complete=0; ++ int imgW, imgH, img_size, clut_size; ++ ++ printk("[ELPP] Searching for initrd_theme preferences... "); ++#ifdef BLK_DEV_INITRD ++ if( ! initrd_start ) ++ goto find_initrd_theme_end; ++ for(i = initrd_start; i < initrd_end - sizeof(struct elpp_prefs); i++){ ++ if(strncmp((char *)i,"ELPP-THEME-START",16) == 0) { ++ printk("Found at 0x%08lx\n", i); ++ elpp.prefs = vmalloc(sizeof(struct elpp_prefs)); ++ memcpy(elpp.prefs, (void*)(i+16), sizeof(struct elpp_prefs)); ++ ++ printk("[ELPP] Searching for initrd_theme image... "); ++ for(j = i; j < initrd_end; j++) { ++ if(strncmp((char *)j,"ELPP-START-IMAGE",16) == 0) { ++ printk("Found at 0x%08lx\n", j); ++ elpp.logo = vmalloc(sizeof(struct linux_logo)); ++ memcpy(elpp.logo, (void*)(j+16), sizeof(struct linux_logo)); ++ elpp.logo->clut = NULL; ++ elpp.logo->data = NULL; ++ imgW = elpp.logo->width; ++ imgH = elpp.logo->height; ++ img_size = imgW * imgH * sizeof(char); ++ clut_size = elpp.logo->clutsize * 3 * sizeof(char); ++ printk("[ELPP] Image: (%d,%d), %d colors\n", ++ imgW, imgH, elpp.logo->clutsize); ++ ++ for(k = j+sizeof(struct linux_logo); k < initrd_end; k++){ ++ if(strncmp((char *)k, "ELPP-START-IMAGE-DATA",21) == 0){ ++ elpp.logo->data = vmalloc(img_size); ++ memcpy((void *)elpp.logo->data, ++ (void*)(k+21), img_size); ++ k+=img_size; ++ } ++ if(strncmp((char *)k, "ELPP-START-IMAGE-CLUT",21) == 0){ ++ elpp.logo->clut = vmalloc(clut_size); ++ memcpy((void*)elpp.logo->clut, ++ (void*)(k+21), clut_size); ++ k+=clut_size; ++ } ++ if(strncmp((char *)k, "ELPP-THEME-END", 14) == 0) { ++ theme_complete = 1; ++ goto find_initrd_theme_end; ++ } ++ } ++ goto find_initrd_theme_end; ++ } ++ } ++ goto find_initrd_theme_end; ++ } ++ } ++#endif ++find_initrd_theme_end: ++ if(theme_complete != 1) { ++ printk("Not found or Incomplete\n"); ++ printk("[ELPP] Disabling the Progress Patch\n"); ++ if(elpp.logo && elpp.logo->data) ++ vfree((void *)elpp.logo->data); ++ if(elpp.logo && elpp.logo->clut) ++ vfree((void *)elpp.logo->clut); ++ if(elpp.logo) ++ vfree(elpp.logo); ++ ++ elpp.logo = (struct linux_logo*)(&logo_linux_elpp); ++ elpp.prefs = &backup_prefs; ++ } ++} ++ ++u16 __init elpp_translate_x(u16 x) ++{ ++ if(elpp.logo->width < elpp.info->var.xres) ++ return (x + ((elpp.info->var.xres - elpp.logo->width)/2)); ++ else ++ return x; ++} ++ ++u16 __init elpp_translate_y(u16 y) ++{ ++ if(elpp.logo->height < elpp.info->var.yres) ++ return (y + ((elpp.info->var.yres - elpp.logo->height)/2)); ++ else ++ return y; ++} ++ ++/* Initialize ELPP */ ++int __init elpp_init(void) ++{ ++ extern signed char con2fb_map[MAX_NR_CONSOLES]; ++ struct fb_info *info; ++ ++ /* Are we using the FB */ ++ if(num_registered_fb == 0) { ++ printk("[ELPP] There is no registered frame buffer\n"); ++ goto error_return; ++ } ++ ++ /* Which console am I using for showing the ProgressBar */ ++ elpp.console = fg_console; ++ elpp.info = registered_fb[(int)con2fb_map[elpp.console]]; ++ if(elpp.info == NULL) { ++ printk("[ELPP] The current console is not on a FrameBuffer\n"); ++ goto error_return; ++ } ++ ++ info = elpp.info; ++ if(elpp.logo->width > info->var.xres ) { ++ printk("[ELPP] Logo is bigger than the screen\n"); ++ goto error_return; ++ } ++ ++ /* Prepare the colors */ ++ ++ memcpy((void*)colors[eBAR_BG], elpp.prefs->bar_bg, 3); ++ memcpy((void*)colors[eBAR_FG], elpp.prefs->bar_fg, 3); ++ ++ memcpy((void*)colors[eSUC_FG], elpp.prefs->success_fg, 3); ++ memcpy((void*)colors[eSUC_BG], elpp.prefs->success_bg, 3); ++ memcpy((void*)colors[eSUC_SYM_FG], elpp.prefs->success_symbol_fg, 3); ++ memcpy((void*)colors[eSUC_SYM_BG], elpp.prefs->success_symbol_bg, 3); ++ ++ memcpy((void*)colors[eWRN_FG], elpp.prefs->warning_fg, 3); ++ memcpy((void*)colors[eWRN_BG], elpp.prefs->warning_bg, 3); ++ memcpy((void*)colors[eWRN_SYM_FG], elpp.prefs->warning_symbol_fg, 3); ++ memcpy((void*)colors[eWRN_SYM_BG], elpp.prefs->warning_symbol_bg, 3); ++ ++ memcpy((void*)colors[eERR_FG], elpp.prefs->error_fg, 3); ++ memcpy((void*)colors[eERR_BG], elpp.prefs->error_bg, 3); ++ memcpy((void*)colors[eERR_SYM_FG], elpp.prefs->error_symbol_fg, 3); ++ memcpy((void*)colors[eERR_SYM_BG], elpp.prefs->error_symbol_bg, 3); ++ ++ switch (info->fix.visual) { ++ ++ case FB_VISUAL_TRUECOLOR: ++ if (info->var.bits_per_pixel >= 8) ++ elpp.needs_truepalette = 1; ++ break; ++ case FB_VISUAL_DIRECTCOLOR: ++ if (info->var.bits_per_pixel >= 24) { ++ elpp.needs_directpalette = 1; ++ elpp.needs_cmapreset = 1; ++ } ++ break; ++ case FB_VISUAL_PSEUDOCOLOR: ++ elpp.needs_cmapreset = 1; ++ break; ++ } ++ ++ if(elpp.needs_cmapreset) ++ elpp_set_cmap(); ++ ++ if(elpp.needs_truepalette || elpp.needs_directpalette) { ++ elpp.palette = vmalloc(256*4); ++ if(!elpp.palette) ++ goto error_return; ++ if (elpp.needs_truepalette) ++ elpp_set_truepalette(); ++ else ++ elpp_set_directpalette(); ++ ++ elpp.saved_palette = info->pseudo_palette; ++ info->pseudo_palette = elpp.palette; ++ } ++ ++ /* Allocate memory to the message structures */ ++ elpp.messages = vmalloc(sizeof(struct elpp_messages)*NUM_MSGS); ++ if(!elpp.messages) ++ goto error_return; ++ memset(elpp.messages,0,sizeof(struct elpp_messages)*NUM_MSGS); ++ ++ /* Every thing is ok... now perform some calculations */ ++ translated_msg_x = elpp_translate_x(elpp.prefs->msg_x); ++ translated_msg_y = elpp_translate_y(elpp.prefs->msg_y); ++ translated_bar_x = elpp_translate_x(elpp.prefs->bar_x); ++ translated_bar_y = elpp_translate_y(elpp.prefs->bar_y); ++ ++ return 0; ++error_return: ++ elpp.disable = 1; ++ return -1; ++} ++ +--- linux-2.6.12/drivers/video/console/fbcon.c~add-elpp-stuff.patch ++++ linux-2.6.12/drivers/video/console/fbcon.c +@@ -91,6 +91,9 @@ + #include <asm/machdep.h> + #include <asm/setup.h> + #endif ++#ifdef CONFIG_FB_ELPP ++#include <linux/elpp.h> ++#endif + + #include "fbcon.h" + +@@ -107,7 +110,7 @@ + }; + + struct display fb_display[MAX_NR_CONSOLES]; +-static signed char con2fb_map[MAX_NR_CONSOLES]; ++signed char con2fb_map[MAX_NR_CONSOLES]; + static signed char con2fb_map_boot[MAX_NR_CONSOLES]; + static int logo_height; + static int logo_lines; +@@ -997,6 +1000,19 @@ + softback_top = 0; + } + } ++ ++ #ifdef CONFIG_FB_ELPP ++ extern struct elpp_struct elpp; ++ ++ if(elpp.init == 0) { ++ if(elpp_init() == 0) { ++ elpp_register(); ++ } ++ elpp.init = 1; ++ } ++ #endif ++ ++ + } + + static void fbcon_deinit(struct vc_data *vc) +@@ -1997,6 +2013,12 @@ |
