Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Bootsplash Patch for 2.6.5 Kernel

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
42 posts
  • Previous
  • 1
  • 2
Author
Message
dsd
Developer
Developer
Posts: 2162
Joined: Sun Mar 30, 2003 10:54 am
Location: nr London

  • Quote

Post by dsd » Fri Mar 26, 2004 11:55 am

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:

Code: Select all

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

Code: Select all

(/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:

Code: Select all

(/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
http://dev.gentoo.org/~dsd
Top
aminal
Apprentice
Apprentice
Posts: 170
Joined: Wed Mar 17, 2004 2:33 am
Location: Baltimore, MD

  • Quote

Post by aminal » Fri Mar 26, 2004 1:19 pm

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.
Top
Jefklak
l33t
l33t
Posts: 818
Joined: Sun Oct 26, 2003 10:47 am
Location: Belgium
Contact:
Contact Jefklak
Website

  • Quote

Post by Jefklak » Fri Mar 26, 2004 3:20 pm

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

Code: Select all

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?
{Linux User #333296}
Kernel 2.6.9-nitro4!
<< hurrah
Top
Kow
Apprentice
Apprentice
Posts: 227
Joined: Sun Dec 28, 2003 6:51 am

  • Quote

Post by Kow » Fri Mar 26, 2004 4:53 pm

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

-i --ignore-case Ignore case differences in file contents.
--ignore-file-name-case Ignore case when comparing file names.
--no-ignore-file-name-case Consider case when comparing file names.
-E --ignore-tab-expansion Ignore changes due to tab expansion.
-b --ignore-space-change Ignore changes in the amount of white space.
-w --ignore-all-space Ignore all white space.
-B --ignore-blank-lines Ignore changes whose lines are all blank.
-I RE --ignore-matching-lines=RE Ignore changes whose lines all match RE.
--strip-trailing-cr Strip trailing carriage return on input.
-a --text Treat all files as text.

-c -C NUM --context[=NUM] Output NUM (default 3) lines of copied context.
-u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified context.
--label LABEL Use LABEL instead of file name.
-p --show-c-function Show which C function each change is in.
-F RE --show-function-line=RE Show the most recent line matching RE.
-q --brief Output only whether files differ.
-e --ed Output an ed script.
--normal Output a normal diff.
-n --rcs Output an RCS format diff.
-y --side-by-side Output in two columns.
-W NUM --width=NUM Output at most NUM (default 130) print columns.
--left-column Output only the left column of common lines.
--suppress-common-lines Do not output common lines.
-D NAME --ifdef=NAME Output merged file to show `#ifdef NAME' diffs.
--GTYPE-group-format=GFMT Similar, but format GTYPE input groups with GFMT.
--line-format=LFMT Similar, but format all input lines with LFMT.
--LTYPE-line-format=LFMT Similar, but format LTYPE input lines with LFMT.
LTYPE is `old', `new', or `unchanged'. GTYPE is LTYPE or `changed'.
GFMT may contain:
%< lines from FILE1
%> lines from FILE2
%= lines common to FILE1 and FILE2
%[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER
LETTERs are as follows for new group, lower case for old group:
F first line number
L last line number
N number of lines = L-F+1
E F-1
M L+1
LFMT may contain:
%L contents of line
%l contents of line, excluding any trailing newline
%[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number
Either GFMT or LFMT may contain:
%% %
%c'C' the single character C
%c'\OOO' the character with octal code OOO

-l --paginate Pass the output through `pr' to paginate it.
-t --expand-tabs Expand tabs to spaces in output.
-T --initial-tab Make tabs line up by prepending a tab.
--tabsize=NUM Tab stops are every NUM (default 8) print columns.

-r --recursive Recursively compare any subdirectories found.
-N --new-file Treat absent files as empty.
--unidirectional-new-file Treat absent first files as empty.
-s --report-identical-files Report when two files are the same.
-x PAT --exclude=PAT Exclude files that match PAT.
-X FILE --exclude-from=FILE Exclude files that match any pattern in FILE.
-S FILE --starting-file=FILE Start with FILE when comparing directories.
--from-file=FILE1 Compare FILE1 to all operands. FILE1 can be a directory.
--to-file=FILE2 Compare all operands to FILE2. FILE2 can be a directory.

--horizon-lines=NUM Keep NUM lines of the common prefix and suffix.
-d --minimal Try hard to find a smaller set of changes.
--speed-large-files Assume large files and many scattered small changes.

-v --version Output version info.
--help Output this help.

FILES are `FILE1 FILE2' or `DIR1 DIR2' or `DIR FILE...' or `FILE... DIR'.
If --from-file or --to-file is given, there are no restrictions on FILES.
If a FILE is `-', read standard input.

Report bugs to <bug-gnu-utils@gnu.org>.
That's diff --help and that is what is used to create patches.

The command is:

Code: Select all

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. :)

Hope this cleared things up a bit more on patches, they are actually VERY easy. :)
-Kow
Top
Kow
Apprentice
Apprentice
Posts: 227
Joined: Sun Dec 28, 2003 6:51 am

  • Quote

Post by Kow » Fri Mar 26, 2004 5:05 pm

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).
-Kow
Top
dsd
Developer
Developer
Posts: 2162
Joined: Sun Mar 30, 2003 10:54 am
Location: nr London

  • Quote

Post by dsd » Fri Mar 26, 2004 6:37 pm

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 :)

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 :)
http://dev.gentoo.org/~dsd
Top
Jefklak
l33t
l33t
Posts: 818
Joined: Sun Oct 26, 2003 10:47 am
Location: Belgium
Contact:
Contact Jefklak
Website

  • Quote

Post by Jefklak » Sat Mar 27, 2004 2:15 pm

Thanks a lot guys!
I managed to create my own "kernel patch" 8)
Nice info!!
{Linux User #333296}
Kernel 2.6.9-nitro4!
<< hurrah
Top
madtomkidd
Apprentice
Apprentice
User avatar
Posts: 170
Joined: Mon Jan 13, 2003 4:36 pm
Location: Dayton, OH
Contact:
Contact madtomkidd
Website

  • Quote

Post by madtomkidd » Sun Mar 28, 2004 3:53 am

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!
Top
dsd
Developer
Developer
Posts: 2162
Joined: Sun Mar 30, 2003 10:54 am
Location: nr London

  • Quote

Post by dsd » Sun Mar 28, 2004 2:27 pm

the initrd (initial ram disk) option appears after you enable ram disks.
http://dev.gentoo.org/~dsd
Top
madtomkidd
Apprentice
Apprentice
User avatar
Posts: 170
Joined: Mon Jan 13, 2003 4:36 pm
Location: Dayton, OH
Contact:
Contact madtomkidd
Website

  • Quote

Post by madtomkidd » Wed Mar 31, 2004 1:59 am

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!
Top
Kow
Apprentice
Apprentice
Posts: 227
Joined: Sun Dec 28, 2003 6:51 am

  • Quote

Post by Kow » Wed Mar 31, 2004 5:03 am

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.
-Kow
Top
Enderson
Retired Dev
Retired Dev
User avatar
Posts: 141
Joined: Wed Nov 12, 2003 2:40 pm
Location: Arapiraca/Maceió, AL, Brazil
Contact:
Contact Enderson
Website

  • Quote

Post by Enderson » Thu Apr 01, 2004 2:37 am

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?).
--
Nothing to say here!
Top
Admiral LSD
Guru
Guru
User avatar
Posts: 522
Joined: Fri Jun 27, 2003 3:53 am
Location: Northam, W.A., Australia

  • Quote

Post by Admiral LSD » Thu Apr 01, 2004 6:21 am

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.
Wasurenaide...
...watashi ga iru koto o.
Itsudatte soba ni iru yo.

Registered Linux user #319839
Top
dsd
Developer
Developer
Posts: 2162
Joined: Sun Mar 30, 2003 10:54 am
Location: nr London

  • Quote

Post by dsd » Thu Apr 01, 2004 8:52 am

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!
http://dev.gentoo.org/~dsd
Top
Godvalve
n00b
n00b
User avatar
Posts: 34
Joined: Fri Jun 27, 2003 10:45 am
Location: Canada

... one month later

  • Quote

Post by Godvalve » Tue Apr 20, 2004 12:19 am

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:
http://forums.gentoo.org/viewtopic.php? ... ht=#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?)
Slartibartfast touched a button and added, not entirely reassurringly, 'It scares the willies out of me. Hold tight.'
Top
Godvalve
n00b
n00b
User avatar
Posts: 34
Joined: Fri Jun 27, 2003 10:45 am
Location: Canada

  • Quote

Post by Godvalve » Tue Apr 20, 2004 11:47 pm

*bump*
Slartibartfast touched a button and added, not entirely reassurringly, 'It scares the willies out of me. Hold tight.'
Top
Enderson
Retired Dev
Retired Dev
User avatar
Posts: 141
Joined: Wed Nov 12, 2003 2:40 pm
Location: Arapiraca/Maceió, AL, Brazil
Contact:
Contact Enderson
Website

Re: ... one month later

  • Quote

Post by Enderson » Thu Apr 22, 2004 1:22 am

Godvalve wrote:(BTW, how do I find out the baselayout version I am using?)

Code: Select all

#emerge -s baselayout
It will inform you latest available and installed versions.
--
Nothing to say here!
Top
Post Reply

42 posts
  • Previous
  • 1
  • 2

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic