Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Patch my kernel?

  1. #1
    Join Date
    Aug 2009
    Beans
    50

    Patch my kernel?

    I deleted this post off the laptops forum, because it is a question that belongs in the general help forum, and is not specific to laptops. So please don't lock this thread.

    Help, please. I have a Sony Vaio F-series -- a lot of little stuff like the Sony keys, brightness, and the backlit keyboard are not working. I found a patch file, but I don't know how to apply it. Is it a patch for the kernel or the sony-laptop module? -- How do you tell? Anyway, if someone could help I would be most appreciative. The patch can be found here: http://code.google.com/p/vaio-f11-li...3-2.6.39.patch


    Thanks,

    Gary

  2. #2
    Join Date
    May 2009
    Location
    Courtenay, BC, Canada
    Beans
    1,661

    Re: Patch my kernel?

    from that page, if you go to 'project home' then you can see full instructions on how to use it

  3. #3
    Join Date
    Aug 2009
    Beans
    50

    Re: Patch my kernel?

    Yes, that instruction file says to go to /usr/src/linux, but that directory doesn't exist on my system. I have /usr/src/linux-headers-3.0.0.12, and /usr/src/linux-headers-3.0.0.12-generic. Not sure which one has the kernel I need to patch.

    I tried applying the patch in both of those directories, and all I got was a bunch of errors.
    Last edited by eakergd; April 1st, 2012 at 01:27 AM.

  4. #4
    Join Date
    Apr 2011
    Beans
    484

    Re: Patch my kernel?

    Open a terminal window:

    Change directories to the one that your source files are in:

    Code:
    cd /path/to/your/directory
    For example, for Music it would be:

    Code:
    cd /home/myusername/Music
    OR

    Code:
    ~/Music
    The ~ expands to your home directory.

    To apply the patch:

    Code:
    man patch
    Will tell you more about the patch utility.

    You'll have to go over the kernel sources with it. (You can download them from http://www.kernel.org/)

    I'm pretty sure a copy of the Ubuntu version of the Linux kernel is in /usr/src/ and you can patch that version and compile it. (I only link kernel.org in case you want to go the whole mile and compile a whole new kernel. You probably just want the Ubuntu Linux kernel source.)

    Theres Internet tutorials elsewhere on compiling your patched kernel.
    Last edited by Thewhistlingwind; April 1st, 2012 at 03:46 AM.
    Life is an extraordinarily long concatenation of luck and coincidence.

  5. #5
    Join Date
    Jun 2010
    Beans
    96

    Re: Patch my kernel?

    Have you installed linux-source? If thats the case I believe it puts the source in a compressed file in /usr/src (maybe called linux-source-<your version number here>.tar.bz2?). It looks like the tutorial just sorta assumes you uncompress the source into /usr/src/linux.
    </any ideas of what to use as a signature>

  6. #6
    Join Date
    Jun 2010
    Beans
    96

    Re: Patch my kernel?

    Oh and a word of advice as far as kernel recompiling goes: you may want to use xconfig instead of menuconfig-I find it just overall easier to use.
    </any ideas of what to use as a signature>

  7. #7
    Join Date
    Aug 2009
    Beans
    50

    Re: Patch my kernel?

    OK, thanks for the help so far. I downloaded the source files, so now I have linux-source-3.0. Now when I switch to that directory and attempt to patch, I am still getting errors. It says it cannot find the file to patch.

    Here is the output of the patch program:

    dad@dad-laptop:/usr/src/linux-source-3.0.0$ sudo patch -p1 < /home/dad/Desktop/vaio-test13-2.6.39.patch
    can't find file to patch at input line 4
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |Signed-off-by: Marco Chiappero <marco@absence.it>
    |--- a/include/linux/sonypi.h 2011-04-19 06:26:00.000000000 +0200
    |+++ b/include/linux/sonypi.h 2011-04-22 17:15:33.832788228 +0200
    --------------------------
    File to patch: linux-source-3.0.0.tar.bz2
    patching file linux-source-3.0.0.tar.bz2
    Hunk #1 FAILED at 114.
    1 out of 1 hunk FAILED -- saving rejects to file linux-source-3.0.0.tar.bz2.rej
    can't find file to patch at input line 14
    Perhaps you used the wrong -p or --strip option?


    It keeps giving me the same error for each hunk.

    Any ideas what I should try next?

    Thanks,

  8. #8
    Join Date
    Aug 2009
    Beans
    50

    Re: Patch my kernel?

    bump

  9. #9
    Join Date
    Dec 2007
    Location
    Gainesville, Florida
    Beans
    Hidden!
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Patch my kernel?

    Quote Originally Posted by eakergd View Post
    OK, thanks for the help so far. I downloaded the source files, so now I have linux-source-3.0. Now when I switch to that directory and attempt to patch, I am still getting errors. It says it cannot find the file to patch.

    Here is the output of the patch program:

    dad@dad-laptop:/usr/src/linux-source-3.0.0$ sudo patch -p1 < /home/dad/Desktop/vaio-test13-2.6.39.patch
    can't find file to patch at input line 4
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |Signed-off-by: Marco Chiappero <marco@absence.it>
    |--- a/include/linux/sonypi.h 2011-04-19 06:26:00.000000000 +0200
    |+++ b/include/linux/sonypi.h 2011-04-22 17:15:33.832788228 +0200
    --------------------------
    File to patch: linux-source-3.0.0.tar.bz2
    patching file linux-source-3.0.0.tar.bz2
    Hunk #1 FAILED at 114.
    1 out of 1 hunk FAILED -- saving rejects to file linux-source-3.0.0.tar.bz2.rej
    can't find file to patch at input line 14
    Perhaps you used the wrong -p or --strip option?


    It keeps giving me the same error for each hunk.

    Any ideas what I should try next?

    Thanks,
    This looks like a patch for the 2.6.39 kernel, it obviously isn't working for your 3.0.0 kernel. You need to find a patch for your specific kernel or see if the latest kernel has what you need. You may be able to look at the patch in a text editor and apply the code fix manually to the kernel source. You really need to know what you are doing though.

    You can review this to see how to build a new kernel on ubuntu.
    https://wiki.ubuntu.com/KernelTeam/GitKernelBuild
    Last edited by pbrane; April 2nd, 2012 at 12:03 AM.

  10. #10
    Join Date
    May 2010
    Location
    uk
    Beans
    9,249
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Patch my kernel?

    Hi

    From the terminal, type

    Code:
    pwd
    and

    Code:
    ls
    Post back results here.

    Kind regards
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •