# Bootsplash Patch for 2.6.5 Kernel

## Kow

Bootsplash Patch for 2.6.5-rc1:

*May or may not work on newer kernel source trees(at the time of this thread this was the latest)

*This is not an official Gentoo patch

http://home.comcast.net/~kd.drake/bootsplash-3.1.3-2.6.5-r1.patch

or if you'd rather have a bzip2 version:

http://24.118.29.210/files/bootsplash-3.1.3-2.6.5-r1.patch.bz2

I did this because the latest patch in the ebuild tree is 2.6.3-rc1 and the corresponding patch is rejecting fbcon.c, so I put this one together.

Note: I did test it, and it runs flawlessly.

Instructions:

1. You will have to right click --> Save

2. Prepare the kernel source tree (needs 2.6.5-rc1 original source). Meaning no gentoo patchsets (it might work but it would be risky).

3. CD into the directory

4. Run patch -p1 < path/to/bootsplash-3.1.3-2.6.5-r1.patch

    or if using bz2 version:

   Run bzip2 -dc path/to/bootsplash-3.1.3-2.6.5-r1.patch | patch -p1

----------

## paulisdead

Works perfectly, thanks.

----------

## YopWongSapn

FYI.....

The newer emerge version(s) of bootsplash come with bootsplash_patch that you can run to patch the kernel without downloading the patch elsewhere.

----------

## Kow

The latest bootsplash ebuild does not have a bootsplash patch that will work for 2.6.5.. the latest is the 2.6.3-r1.patch.bz2 which will not patch fbcon.c because of changes.....

 *

 * Patching the kernel (branch: 2.6) in /usr/src/linux ...

 *

patching file drivers/char/keyboard.c

patching file drivers/char/n_tty.c

Hunk #1 succeeded at 994 (offset 25 lines).

patching file drivers/char/vt.c

Hunk #1 succeeded at 3143 (offset 35 lines).

patching file drivers/video/bootsplash/bootsplash.c

patching file drivers/video/bootsplash/bootsplash.h

patching file drivers/video/bootsplash/decode-jpg.c

patching file drivers/video/bootsplash/decode-jpg.h

patching file drivers/video/bootsplash/Kconfig

patching file drivers/video/bootsplash/Makefile

patching file drivers/video/bootsplash/render.c

patching file drivers/video/console/fbcon.c

Hunk #3 succeeded at 413 (offset 1 line).

Hunk #4 succeeded at 437 (offset 1 line).

Hunk #5 succeeded at 467 (offset 1 line).

Hunk #6 succeeded at 503 (offset 1 line).

Hunk #7 succeeded at 535 (offset 1 line).

Hunk #8 succeeded at 822 (offset 1 line).

Hunk #9 succeeded at 905 (offset 1 line).

Hunk #10 succeeded at 1083 (offset 1 line).

Hunk #11 succeeded at 1164 (offset 1 line).

Hunk #12 succeeded at 1474 (offset 1 line).

Hunk #13 succeeded at 1545 (offset 1 line).

Hunk #14 succeeded at 1674 (offset 1 line).

Hunk #15 succeeded at 1721 (offset 1 line).

Hunk #16 succeeded at 1808 (offset 10 lines).

Hunk #17 succeeded at 1990 (offset 10 lines).

Hunk #18 FAILED at 2448.

1 out of 18 hunks FAILED -- saving rejects to file drivers/video/console/fbcon.c.rej

patching file drivers/video/console/fbcon.h

patching file drivers/video/Kconfig

Hunk #1 succeeded at 909 (offset -13 lines).

patching file drivers/video/Makefile

patching file drivers/video/vesafb.c

patching file include/linux/console_struct.h

patching file include/linux/fb.h

Hunk #1 succeeded at 525 with fuzz 1 (offset 55 lines).

patching file kernel/panic.c

Hunk #1 succeeded at 82 (offset -1 lines).

Hunk #2 succeeded at 111 (offset -1 lines).

!!! ERROR: media-gfx/bootsplash-0.6-r9 failed.

!!! Function pkg_config, Line 150, Exitcode 1

!!! (no error message)

Hence no it does not.  :Smile: 

----------

## dsd

Heres one for 2.6.5-rc2-mm1 - Kow's previous patch didnt apply against this kernel - and after a manual rediff i had to change a little bit of the code to get it to work (see notes at top of patch for more info)

http://www.reactivated.net/patches/linux-kernel/2.6.5/bootsplash-3.1.3-2.6.5-rc2-mm1.patch

tested and working.

----------

## Cicero

Patches clean here, but could someone make one for 3.1.4?   :Very Happy: 

Despite it not being on bootspash.org, 3.1.4 can be found in the same place on the ftp server as 3.1.3:

ftp://ftp.suse.com/pub/people/stepan/bootsplash/kernel/bootsplash-3.1.4-2.6.3.diff

----------

## Godvalve

 *dsd wrote:*   

> Heres one for 2.6.5-rc2-mm1 - Kow's previous patch didnt apply against this kernel - and after a manual rediff i had to change a little bit of the code to get it to work (see notes at top of patch for more info)
> 
> http://www.reactivated.net/patches/linux-kernel/2.6.5/bootsplash-3.1.3-2.6.5-rc2-mm1.patch
> 
> tested and working.

 

Blah! I tried this patch on 2.6.5-rc1-mm1 and it failed. There were issues right with Hunk 1. It spit out something about portions of the patch  already being there and I was given:   Assume -R [n]

I tried the patch once by saying no to everything, then I started again (with the clean sources) and said yes to everything. I'm doing an emerge sync right now in the hopes that 2.6.5-rc2-mm1 is in it.

Any suggestions?

BTW, Hunks 7-18 were the only ones to succeed.

----------

## dsd

 *Godvalve wrote:*   

> Blah! I tried this patch on 2.6.5-rc1-mm1 and it failed. There were issues right with Hunk 1. It spit out something about portions of the patch  already being there and I was given:   Assume -R [n]
> 
> 

 

the patch wont work on 2.6.5-rc1-mm1.

the issue that you were having sounds more like that you were patching over the top of another patch or something. but anyway, it wouldnt work however you did it.

remember, to take "clean sources" you need to completely remove the /usr/src/linux-x.y.z directory. i dont think remerging is enough.

 *Quote:*   

> 
> 
> I tried the patch once by saying no to everything, then I started again (with the clean sources) and said yes to everything. I'm doing an emerge sync right now in the hopes that 2.6.5-rc2-mm1 is in it.

 

you might want to hold on a few minutes, im working on a bootsplash-3.1.4 diff for this kernel.

----------

## nx12

This patch is just an update or has some new features??

----------

## dsd

it appears to have a couple of minor bugfixes plus some improved buffer management

here's a diff of 3.1.4 against 2.6.5-rc2-mm1

again, i had to update the code a little (the same way as in the last patch)

tested by me, working

http://www.reactivated.net/patches/linux-kernel/2.6.5/bootsplash-3.1.4-2.6.5-rc2-mm1.patch

----------

## Godvalve

 *dsd wrote:*   

> here's a diff of 3.1.4 against 2.6.5-rc2-mm1
> 
> again, i had to update the code a little (the same way as in the last patch)
> 
> tested by me, working

 

Well.... I wasn't able to grab 2.6.5-rc2-mm1 with an emerge sync & emerge -k mm-sources. 

So, what patch do I use against 2.6.5-rc1-mm1? Is there a patch? How do I find 2.6.5-rc2-mm1 sources if that's the only way to use the patch? (Is there a reason that 2.6.5-rc2-mm1 isn't available through portage?)

All help greatly appreciated!

*Update*

I found the sources for 2.6.5-rc2-mm1 HERE

(Now I just need to figure out how to build them .... lol)

----------

## Kow

When I originally did it I was using the latest bootsplash version in gentoo's portage tree, I didn't want to go into developer (or unofficial) versions and have people think they were somewhat official, I see a new bootsplash release in my portage tree, and they're using 3.1.4 now.

EDIT: Release 12 at the time I wrote this is still arch masked I believe. The current official does not have the 2.6.5's in them (as 2.6.5 isn't technically official either).

I do not think it's worthwhile for them to keep making patches for all these minor versions, When it comes to the 2.6.5 solid release they'll prolly get a patch for that and the solid mm source patch.

If you know how to create patches and manually put code into the kernel source tree (which you have to do before you create the patch) and want to spend the time doing it, I'd personally say go for it. But if you do not want to monkey around with it, and really love bootsplash, i'd just go 2.6.3 --> 2.6.4 --> 2.6.5 --> 2.6.6.. etc and skip the inbetween, which could be quite buggy versions.

----------

## keli

 *dsd wrote:*   

> it appears to have a couple of minor bugfixes plus some improved buffer management
> 
> here's a diff of 3.1.4 against 2.6.5-rc2-mm1
> 
> again, i had to update the code a little (the same way as in the last patch)
> ...

 

The patch itself worked flawlessly against 2.6.5-rc2-mm2 as well. I'm compiling the new kernel right now, let's see what it does  :Smile: 

----------

## keli

And, we have a winner!!!   :Very Happy:  The patch works flawlessly, and I have a properly working system again  :Smile: 

Since mm-sources-2.6.5 came out, I had a sort-of broken framebuffer - the machine froze every time I wanted to switch back from X to fb console. (even though at startup, before entering X, the fb bootsplash/console worked just fine )

Muchos gracias!  :Smile: 

----------

## Godvalve

 *keli wrote:*   

> The patch itself worked flawlessly against 2.6.5-rc2-mm2 as well. I'm compiling the new kernel right now, let's see what it does ........
> 
> And, we have a winner!!!  The patch works flawlessly

 

Maybe you can give me a hand (Starts begging...): 

1)I downloaded linux-2.6.5-rc2.tar.gz from Kernel.org to /usr/src/. 

2)I extracted it and changed my symlink.

3)Then, I cd /usr/src/linux and downloaded 2.6.5-rc2-mm1.

4)I then applied the patch. Is this correct so far? 

5)Then (still in the dir /usr/src/linux) I downloaded http://www.reactivated.net/patches/linux-kernel/2.6.5/bootsplash-3.1.4-2.6.5-rc2-mm1.patch and applied the patch as per the instructions. 

Is this everything you did? (Oh... I compiled the kernel and and moved bzImage over to /boot (which was mounted) as well as following the rest of the instructions from the The Gentoo Framebuffer, Bootsplash & Grubsplash How-To). The only thing I changed on my own was the resolution to 1024x768. 

Why can't I get bootsplash to come up?  :Confused: 

Thx in advance!

----------

## aminal

I'm about to compile 2.6.5-rc2-mm3 and I'd like to put the mm patch in so I dont have to turn around and compile again.  once I DL it, where do I put it?  (I've never patched a kernel before)

thanks!

----------

## aminal

??? I'm trying to wait for an answer before compiling

----------

## aminal

ok - I know I have to do 

patch -p0 < file.patch

BUt then it asks what file to patch.  I don't know what I'm sposed to put

edit **

 *Quote:*   

>  cant find file to patch at input line 5 
> 
> Perhaps you used the wrong -p or --strip option?
> 
> The text leading to this was:
> ...

 

???

----------

## markedmann

Isn't that supposed to be 

```
patch -p1 < /whereis/myfile/to.patch 
```

?

I could be wrong, but I'm pretty sure

Cya,

-Mark

----------

## aminal

Well the patch was in the same directory I was in so, not in this case, I dont think.

Thanks though

----------

## Evil Dark Archon

for kernel patches the standard is patch -p1 and that seems to also be the case here.

----------

## aminal

 *Evil Dark Archon wrote:*   

> for kernel patches the standard is patch -p1 and that seems to also be the case here.

 

I tried that as well and got the same result.

----------

## Kow

Make sure you run the patch from within the kernel source directory... ie 

```

cd /usr/src/linux-2.6.5-whatever/

patch -p1 < /directory/to/bootsplash-whatever.patch

```

----------

## aminal

 *Kow wrote:*   

> Make sure you run the patch from within the kernel source directory... ie 
> 
> ```
> 
> cd /usr/src/linux-2.6.5-whatever/
> ...

 

Yep.  Did that.  I'm pretty sure the patch at least starts to work, but it errs out, I believe because a directory is missing or something:

 *Quote:*   

> |diff -X dontdiff-kernel -urN linux-2.6.5-rc2-mm1/drivers/char/keyboard.c |linux-dsd/drivers/char/keyboard.c
> 
> |--- linux-2.6.5-rc2-mm1/drivers/char/keyboard.c 2004-03-22 17:52:20.000000000 |+0000
> 
> |+++ linux-dsd/drivers/char/keyboard.c 2004-03-22 17:55:31.038486720 +0000 

 

That code above is in the very beginning of the patch.  If I'm reading it right it's doing a diff between those to .c files in those directories.  The problem is (I think) - the latter directory "linux-dsd/drivers/char/keyboard.c" wasn't anywhere to be found.  Thats the only thing I can think of.

----------

## keli

Well, here's what I did:

1) emerged 2.6.5-rc2-mm2 (this practically unpacks it to /usr/src/linux-2.6.5-rc2-mm2, nothing more)

2) I downloaded the rc2-mm1 patch mentioned above

3) I did a search & replace from rc2-mm1 to rc2-mm2 in the patch, although that shouldn't be necessary

4) point the symlink /usr/src/linux to the new kernel dir

5) cd /usr/src/linux

6) patch -p1 < /path/to/downloaded patch (the -p1 should take care of exactly that AFAIK: removing the first dir name in the oatch - in this case the "linux-2.6.5-whatever" since you are in that dir anyway.)

7) copy old config file to /usr/src/linux/.config 

 :Cool:  make menuconfig - just for a quick check although I didn't had to change anything (I used bootsplash before as well, but if you didn't check out this therad: https://forums.gentoo.org/viewtopic.php?t=49036 )

9) make && make modules_install

10) make install

11) fix the grub.conf & restart

That's about it  :Smile: 

----------

## dsd

ok, let me try and explain the -p option of patch!

should clear up some things.

there is no "accepted" -p option for kernel-specific patches, because the -p option depends on which directory you are patching from!

take the first part of my patch:

```
diff -X dontdiff-kernel -urN linux-2.6.5-rc2-mm1/drivers/char/keyboard.c linux-dsd/drivers/char/keyboard.c

--- linux-2.6.5-rc2-mm1/drivers/char/keyboard.c   2004-03-22 17:52:20.000000000 +0000

+++ linux-dsd/drivers/char/keyboard.c   2004-03-22 17:55:31.038486720 +0000
```

the -pX option specificies how many directories to *ignore* from the start of the file-to-patch +++ and --- lines.

if you are in /usr/src/linux, and you run

"patch -p0 < bootsplash-3.1.4-2.6.5-rc2-mm1.patch"

then it will first try and open (and patch) the following file

```
(/usr/src/linux/)linux-dsd/drivers/char/keyboard.c
```

ignore the (brackets), i'm just indicating the current directory again

this file obviously doesnt exist - you dont have a "linux-dsd" directory.

if you specify the -p1 option, it will ignore the first directory from the file-to-patch line, which in this case is "linux-dsd", and it will now try and patch teh file:

```
(/usr/src/linux/)drivers/char/keyboard.c
```

you do have a "drivers" directory, so this is correct - asking patch to ignore the first directory in order to find each file to patch.

in short: you need to be in the root of your specific kernels source directory, and use the -p1 option so that it doesnt go looking in "linux-dsd"

if this still gives you problems, post the error messages here. but im 100% sure it will work if you are trying to patch an appropriate kernel

----------

## aminal

dsd:  I'm *pretty* sure I did the -p1 option in the kernel root directory, but I'll try again when get home.  Thanks a ton.

----------

## Jefklak

Nice quickie DSD! It's really intresting. 

I'd like to know more about the patch structure.

```
diff -X dontdiff-kernel -urN linux-2.6.5-rc2-mm1/drivers/char/keyboard.c linux-dsd/drivers/char/keyboard.c

--- linux-2.6.5-rc2-mm1/drivers/char/keyboard.c   2004-03-22 17:52:20.000000000 +0000

+++ linux-dsd/drivers/char/keyboard.c   2004-03-22 17:55:31.038486720 +0000

@@ -1059,6 +1059,14 @@

          if (keycode < BTN_MISC)

             printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);

 

+#ifdef CONFIG_BOOTSPLASH

+   /* This code has to be redone for some non-x86 platforms */

+   if (down == 1 && (keycode == 0x3c || keycode == 0x01)) {   /* F2 and ESC on PC keyboard */

+      extern int splash_verbose(void);

+      if (splash_verbose())

+         return;

+   }

+#endif

 #ifdef CONFIG_MAGIC_SYSRQ          /* Handle the SysRq Hack */

    if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) {

       sysrq_down = down;

```

Let me guess:

--- linux-2.6.5-rc2-mm1/drivers/char/keyboard.c	2004-03-22 17:52:20.000000000 +0000

Means wipe this file out and replace it with the +++ one? full path // date // time // chmod settings? (+0000)

And "@@ -1059,6 +1059,14 @@" means err something at line x, char y but that - and + isn't really clearly... The code beneath (the if) is where it is located and the code beneath with all the "+"-es is the code wich has to be placed under it. Right?

----------

## Kow

 *Quote:*   

> 
> 
> Usage: diff [OPTION]... FILES
> 
> Compare files line by line.
> ...

 

That's diff --help and that is what is used to create patches.

The command is:

```

diff -urN linux.orig linux > my_changes.diff

```

linux.orig is the original linux directory structure... such as you just extracted linux-2.6.4 and its in the linux-2.6.4 directory.

linux is your modified structure such as linux-2.6.4-kowsversion

I would do 

diff -urN linux-2.6.4 linux-2.6.4-kowsversion > kows.patch

* I used .patch because that is what everyone uses and makes more sense.

-u = defines the number of matching context to where the text should be applied..

ie one file is:

a

b

c

d

e

f

g

and you want to be 1234 inbetween d and e... using -u with no number specified automatically assumes 3 lines of text around where you want to put the patch in must be the same... ie

it will put in:

b

c

d

+ 1234

e

f

g

N means create new files if they dont exist in the original.

r means recursive.. check all directories and subdirectories (kernel has many).

What causes patches to fail is when you apply patches not made for that kernel version. If the revisions since the original are slight chances are the patch will still work with an offset (the lines where the same text was found at was all offset by x amount of lines)... This itself is not a bad way to go about things until the code gets changed within the vicinity of the patch, in which case you will get Hunk x failed at .... Meaning it couldnt apply that portion of the patch (the rest was applied) because it couldnt find the correct place to apply the patch, this means part of the patch failed and SHOULD NOT BE USED. DO NOT USE THIS SOURCE if this occurs as it's not complete and is guaranteed to not work.

Even if the patch gets applied successfully to a version not meant for the patch you can still have problems... The code in the bootsplash patch for example could rely on other code which may not be there or may have changed.. ie causing bootsplash to perhaps freeze on the bootup screen.  :Smile: 

Hope this cleared things up a bit more on patches, they are actually VERY easy.  :Smile: 

----------

## Kow

And when patches do not work that is where our patches come in.

I patch the hunks that work, then manually put in the code that doesnt work, test it, and if it works I do the diff command from the original (ie a linux-2.6.4 patched with 2.6.5-rc1) to get the 2.6.5-rc1 bootsplash patch...

That is where the problem with a BUNCH of patches to one source comes in.

If you have a file... file.txt where its contents is:

1

2

3

4

5

6

And apply a patch that makes it

1

2

3

abc

4

5

6

And have another patch that looks at the original and applies something between 4 and 5 (lets assume the contents of the file goes up to 100 or some far off number)...

it will look for:

2

3

4

But if you are applying the patch to an already patched (with the abc) it will fail because it's looking for:

2

3

4

When in all actuality after the 1st patch it's:

2

3

abc

4

Which is applying a buncha patches is fun and takes a while and why a huge patchset such as gentoo's is complicated, but I'm sure they have their whole process to get around this problem (I havent actually looked at the contents of the gentoo patchsets yet).

----------

## dsd

 *Jefklak wrote:*   

> Nice quickie DSD! It's really intresting. 
> 
> I'd like to know more about the patch structure.

 

i think Kows explanation is probably enough to answer you, but here's my additions to clarify:

When patching software, you maintain two copies of the software source: the original one, and another one where you make your modifications.

In this case, I emerged mm-sources-2.6.5-rc2-mm1 and then copied /usr/src/linux-2.6.5-rc2-mm1 to /usr/src/linux-dsd

I then went into /usr/src/linux-dsd and did the dirty work of applying, fixing, and testing the bootsplash code.

next, diff comes in. diff is a very flexibile utility that compares two files (or directory structures). diff also has the capabilities of producing "unified diffs", and these are in exactly the right format for the "patch" utility to work with. (you use "diff -u" to get unified diff output)

the diff command I used was:

diff -X dontdiff -urN linux-2.6.5-rc2-mm1 linux-dsd

i redirected the output of this command into a file and posted it here. thats all there was too it - i didnt directly write the file that i uploaded. diff makes things much easier here  :Smile: 

the "---" and "+++" lines simply show the two files that were being compared. i don't really understand the @@ lines, i'm assuming that they refer to line numbers somehow. i dont _need_ to understand any of these lines, as they are outputted by diff and inputted by patch. as long as you know the basic command-line syntax of "diff" and "patch", then thats all you need to go by.

if you ever get into hacking, or even basic text file manipulation, diff and patch can be a godsend  :Smile: 

----------

## Jefklak

Thanks a lot guys!

I managed to create my own "kernel patch"   :Cool: 

Nice info!!

----------

## madtomkidd

A little help,  please?

For some reason, I´m seeing the framebuffer image when I exit (I have xdm in the default run level), but not when I´m starting.

Also, I´m not seeing the bootsplash run.

One thing I just noticed is that I don´t have the initrd option configurable in my kernel config... it just isn´t there.

I´ve been running 2.6.5-rc1-mm1 and just tried with 2.6.5-rc2-mm3 and the same thing is happening.

I´m new to the whole patching thing... but I´m wondering if some of the failed messages I´m seeing are the cause.

Any suggestions/ideas would be appreciated!

----------

## dsd

the initrd (initial ram disk) option appears after you enable ram disks.

----------

## madtomkidd

thanks... i'm trying the recompile... I guess i overlooked this and only had the ram disks as a module, and it has to be * to get the initrd to show up.

Hopefully, this is all I'm missing!

----------

## Kow

Im using love-sources which looks like the previous patches work fine..

Just wondering, do the 2.6.5-rc2 patches work in rc3? If not I can make another if needed.

----------

## Enderson

what about mm-sources-2.6.5_rc3-r1?

How can I make a patch for it?

I don't want to use the patche for other kernel to make my patch, where can I

get the full source of the bootsplash kernel files, and then male a diff(is it possible?).

----------

## Admiral LSD

The 2.6.5-rc2 patch included with the latest bootsplash package (0.6-r12) has a patch for 2.6.5-rc2 that seems to work perfectly well with both vanilla, -bk and -mm releases, even on 2.6.5-rc3.

----------

## dsd

 *emaia wrote:*   

> I don't want to use the patche for other kernel to make my patch, where can I
> 
> get the full source of the bootsplash kernel files, and then male a diff(is it possible?).

 

the bootsplash source is posted as a patch in the first place. the only way to produce a patch for a newer kernel is to run the original patch through and then manually fix the bits that didnt apply correctly.

the official patches are posted here:

ftp://ftp.suse.com/pub/people/stepan/bootsplash/kernel/

you should find enough info in this thread to know how to use diff and patch to work on this!

----------

## Godvalve

I've finally got the bootsplash working. Thank you all who helped!

Now I want to get silent mode working during boot. Has anyone got silent mode to work in 2.6.5? I currently have framebuffer working, I have a bg picture on tty that shows all my text but the boot runs automagically in verbose mode. I've searched around on this forum and the net and I understand that there was a patch made for the gentoo baselayer (or something) that lets a progress bar show on boot but it was for the 2.4 kernel series. Does anyone have any suggestions?

Just to give you a head-start with the research I've done:

https://forums.gentoo.org/viewtopic.php?p=987946&highlight=#987946

http://www.aichler.net/gentoo/bootsplash/news.html

http://kerneltrap.org/node/view/1039

As I was compiling that list I realized that some people are suggesting a kernel patch to fix this problem and some a baselayout patch. I just don't want to break anything by doing something stupid. (BTW, how do I find out the baselayout version I am using?)

----------

## Godvalve

*bump*

----------

## Enderson

 *Godvalve wrote:*   

> (BTW, how do I find out the baselayout version I am using?)

 

```
#emerge -s baselayout
```

It will inform you latest available and installed versions.

----------

