View previous topic :: View next topic |
Author |
Message |
epall Tux's lil' helper
Joined: 16 May 2004 Posts: 77 Location: Silicon Valley, CA, USA
|
Posted: Sat Jun 26, 2004 5:54 pm Post subject: gentoo-dev-sources-2.6.7 and swsusp2 |
|
|
Has anybody been successful at patching gentoo-dev-sources-2.6.7 with the swsusp2 patches? I've seen a lot about gentoo-dev-sources-2.6.5 (esp. https://forums.gentoo.org/viewtopic.php?t=170548), but nothing about 2.6.7. When I try to patch, I get a whole bunch of errors and the compile doesn't work. Any ideas? |
|
Back to top |
|
|
epall Tux's lil' helper
Joined: 16 May 2004 Posts: 77 Location: Silicon Valley, CA, USA
|
Posted: Sat Jun 26, 2004 6:14 pm Post subject: |
|
|
Okay, I tried it on vanilla sources 2.6.7 and got errors too. I think the issue is that the kernel already has swsusp patched in and I'm trying to mess with it by patching in swsusp2. Any ideas? |
|
Back to top |
|
|
jdong n00b
Joined: 01 Mar 2004 Posts: 41
|
Posted: Mon Jun 28, 2004 1:17 pm Post subject: |
|
|
I just cleanly patched it; I'm building/testing it too. (Gentoo-dev-sources 2.6.7-r6)
You need to grab http://prdownloads.sourceforge.net/swsusp/software-suspend-2.0.0.88-for-2.6.7.tar.bz2?use_mirror=heanet
un-tar it.
You don't need to patch everything...
Here's what's required, in this order:
20-software-suspend-linux-2.6.7-rev1-whole
30-software-suspend-core-2.0-whole
31-software-suspend-core-2.0.0.88-incremental
The patch should turn up a reject at drivers/char/keyboard.c.rej. Manually patch it in -- there's one #include statement and an #ifdef #endif clause that needs to be inserted.
Then, follow that HOWTO for the rest. |
|
Back to top |
|
|
jdong n00b
Joined: 01 Mar 2004 Posts: 41
|
Posted: Mon Jun 28, 2004 1:29 pm Post subject: |
|
|
Update: Doesn't look too good:
Dunno why it'd mess up SCSI... I'm just ommiting SCSI/SATA support from my kernel for now. And trying again.
Code: |
CC [M] drivers/scsi/sym53c8xx_2/sym_misc.o
CC [M] drivers/scsi/sym53c8xx_2/sym_nvram.o
LD [M] drivers/scsi/sym53c8xx_2/sym53c8xx.o
CC drivers/scsi/dmx3191d.o
drivers/scsi/NCR5380.c:756: warning: `NCR5380_print_options' defined but not used
drivers/scsi/NCR5380.c:396: warning: `phases' defined but not used
drivers/scsi/NCR5380.c:699: warning: `NCR5380_probe_irq' defined but not used
CC drivers/scsi/ide-scsi.o
LD drivers/scsi/sd_mod.o
LD drivers/scsi/sr_mod.o
CC drivers/scsi/sg.o
LD drivers/scsi/built-in.o
CC [M] drivers/scsi/scsi_transport_spi.o
CC [M] drivers/scsi/advansys.o
drivers/scsi/advansys.c: In function `advansys_detect':
drivers/scsi/advansys.c:4622: warning: `check_region' is deprecated (declared at include/linux/ioport.h:121)
drivers/scsi/advansys.c: In function `AscSearchIOPortAddr11':
drivers/scsi/advansys.c:10006: warning: `check_region' is deprecated (declared at include/linux/ioport.h:121)
CC [M] drivers/scsi/u14-34f.o
CC [M] drivers/scsi/ultrastor.o
CC [M] drivers/scsi/aha152x.o
CC [M] drivers/scsi/aha1542.o
In file included from drivers/scsi/aha1542.c:43:
include/linux/mca-legacy.h:12:2: warning: #warning "MCA legacy - please move your driver to the new sysfs api"
CC [M] drivers/scsi/aic7xxx_old.o
CC [M] drivers/scsi/ips.o
CC [M] drivers/scsi/fdomain.o
drivers/scsi/fdomain.c: In function `fdomain_isa_detect':
drivers/scsi/fdomain.c:763: warning: `check_region' is deprecated (declared at include/linux/ioport.h:121)
CC [M] drivers/scsi/g_NCR5380.o
CC [M] drivers/scsi/g_NCR5380_mmio.o
CC [M] drivers/scsi/NCR53c406a.o
drivers/scsi/NCR53c406a.c:610: warning: `NCR53c406a_setup' defined but not used
CC [M] drivers/scsi/sym53c416.o
drivers/scsi/sym53c416.c: In function `sym53c416_probe':
drivers/scsi/sym53c416.c:627: warning: `check_region' is deprecated (declared at include/linux/ioport.h:121)
drivers/scsi/sym53c416.c: In function `sym53c416_detect':
drivers/scsi/sym53c416.c:715: warning: `check_region' is deprecated (declared at include/linux/ioport.h:121)
CC [M] drivers/scsi/dtc.o
drivers/scsi/NCR5380.c:396: warning: `phases' defined but not used
CC [M] drivers/scsi/eata_pio.o
drivers/scsi/eata_pio.c: In function `get_pio_conf_PIO':
drivers/scsi/eata_pio.c:596: warning: `check_region' is deprecated (declared at include/linux/ioport.h:121)
CC [M] drivers/scsi/eata.o
CC [M] drivers/scsi/dc395x.o
CC [M] drivers/scsi/tmscsim.o
drivers/scsi/tmscsim.c:521: warning: `dc390_setup' defined but not used
CC [M] drivers/scsi/megaraid.o
CC [M] drivers/scsi/gdth.o
CC [M] drivers/scsi/libata-core.o
drivers/scsi/libata-core.c:3441:40: macro "create_workqueue" requires 2 arguments, but only 1 given
drivers/scsi/libata-core.c: In function `ata_init':
drivers/scsi/libata-core.c:3441: error: `create_workqueue' undeclared (first use in this function)
drivers/scsi/libata-core.c:3441: error: (Each undeclared identifier is reported only once
drivers/scsi/libata-core.c:3441: error: for each function it appears in.)
make[2]: *** [drivers/scsi/libata-core.o] Error 1
make[1]: *** [drivers/scsi] Error 2
make: *** [drivers] Error 2
|
|
|
Back to top |
|
|
Romses Apprentice
Joined: 20 Jan 2004 Posts: 257 Location: Frankfurt
|
Posted: Mon Jun 28, 2004 6:34 pm Post subject: |
|
|
@jdong
i have this problem, but no idea, what i have to insert...
Can you post the file or the manual patch?
Greetz Romses |
|
Back to top |
|
|
aloha99 n00b
Joined: 06 Jun 2004 Posts: 20
|
Posted: Mon Jun 28, 2004 9:03 pm Post subject: |
|
|
Romses wrote: | @jdong
i have this problem, but no idea, what i have to insert...
Can you post the file or the manual patch?
|
Ditto that. I'm comfortable with C, but am clueless about kernel programming. I too would greatly appreciate a brief explanation of what you did to patch gentoo-dev-sources. |
|
Back to top |
|
|
epall Tux's lil' helper
Joined: 16 May 2004 Posts: 77 Location: Silicon Valley, CA, USA
|
Posted: Mon Jun 28, 2004 9:27 pm Post subject: |
|
|
okay, so I've successfully patched vanilla-sources-2.6.7 and have a nice, working kernel. I can even hibernate. The only problem is, when I try to come out of hibernation, my system hangs on trying to "load the old kernel" or something. It says something about no status because it's tricky, but I get a hang. I've tried giving it more time (1min+) but no use. What's wrong? |
|
Back to top |
|
|
spiceweasel n00b
Joined: 15 Feb 2004 Posts: 36 Location: San Diego
|
Posted: Tue Jun 29, 2004 4:18 am Post subject: |
|
|
I tried to apply those patches to gentoo-dev-sources-2.6.7-r5 (don't know where to get r6) and I got the following error :
Code: | CC drivers/char/keyboard.o
drivers/char/keyboard.c: In function `kbd_keycode':
drivers/char/keyboard.c:1099: error: `software_suspend_state' undeclared (first use in this function)
drivers/char/keyboard.c:1099: error: (Each undeclared identifier is reported only once
drivers/char/keyboard.c:1099: error: for each function it appears in.)
drivers/char/keyboard.c:1099: error: `SOFTWARE_SUSPEND_RUNNING' undeclared (first use in this function)
drivers/char/keyboard.c:1105: error: `SOFTWARE_SUSPEND_SANITY_CHECK_PROMPT' undeclared (first use in this function)
drivers/char/keyboard.c:1107: warning: implicit declaration of function `wakeup_suspend'
drivers/char/keyboard.c:1109: error: `SOFTWARE_SUSPEND_CONTINUE_REQ' undeclared (first use in this function)
drivers/char/keyboard.c:1130: error: `SUSPEND_REBOOT' undeclared (first use in this function)
drivers/char/keyboard.c:1131: warning: implicit declaration of function `schedule_suspend_message'
make[2]: *** [drivers/char/keyboard.o] Error 1
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2
|
How did others get this to work? |
|
Back to top |
|
|
jdong n00b
Joined: 01 Mar 2004 Posts: 41
|
Posted: Tue Jun 29, 2004 2:17 pm Post subject: |
|
|
Ok, here we go, a little patching tutorial.
Issue the patch command: sudo patch -p1 </home/jdong/software-suspend-2.0.0.88-for-2.6.7/20-software-suspend-linux-2.6.7-rev1-whole
You get output like:
Code: |
patching file arch/arm/kernel/ecard.c
patching file arch/i386/kernel/apm.c
patching file arch/i386/kernel/cpu/mcheck/non-fatal.c
patching file arch/i386/kernel/io_apic.c
patching file arch/i386/kernel/process.c
patching file arch/i386/kernel/signal.c
patching file arch/i386/kernel/smp.c
patching file arch/i386/mm/init.c
patching file arch/i386/mm/pageattr.c
patching file arch/i386/power/cpu.c
patching file arch/i386/power/Makefile
patching file arch/i386/power/suspend2.c
patching file arch/ppc/Kconfig
patching file arch/ppc/kernel/signal.c
patching file arch/ppc/kernel/vmlinux.lds.S
patching file arch/ppc/Makefile
patching file arch/ppc/mm/init.c
patching file arch/ppc/platforms/pmac_feature.c
patching file arch/ppc/power/cpu.c
patching file arch/ppc/power/cpu_reg.S
..blah...
patching file drivers/char/keyboard.c
Hunk #2 FAILED at 42.
|
Note the FAILED hunk. If you can't see it, do a find . -name "*.rej".
Now, open up both the .rej and the corresponding .c file into an editor of your choice.
In this case, it's ./drivers/char/keyboard.c.rej and ./drivers/char/keyboard.c
Here's the contents of the rej:
Code: | ***************
*** 41,49 ****
#include <linux/sysrq.h>
#include <linux/input.h>
static void kbd_disconnect(struct input_handle *handle);
extern void ctrl_alt_del(void);
/*
* Exported functions/variables
*/
--- 42,56 ----
#include <linux/sysrq.h>
#include <linux/input.h>
+ #include <linux/suspend.h>
+
static void kbd_disconnect(struct input_handle *handle);
extern void ctrl_alt_del(void);
+ #ifdef CONFIG_PM
+ extern void wakeup_suspend(void);
+ #endif
+
/*
* Exported functions/variables
*/
|
Basic rules of PATCHes: The - sign means to remove a line, the + sign means to add a line. The --- separates the - section from the + section.
So, interpreting this patch, it wants to add #include <linux/suspend.h> and, add
#ifdef CONFIG_PM
extern void wakeup_suspend(void);
#endif
after the declaration of ctrl_alt_del(void);
Now, look at the keyboard.c file.
Here's a snippet of the beginning:
Code: |
#include <linux/config.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/random.h>
#include <linux/init.h>
#include <linux/completion.h>
#include <linux/slab.h>
#include <linux/kbd_kern.h>
#include <linux/kbd_diacr.h>
#include <linux/vt_kern.h>
#include <linux/sysrq.h>
#include <linux/input.h>
#include <linux/speakup.h>
#ifdef CONFIG_SPEAKUP_MODULE
spk_key_func addr_spk_key = NULL;
#endif
static void kbd_disconnect(struct input_handle *handle);
extern void ctrl_alt_del(void);
/*
* Exported functions/variables
*/
|
Now, we can see why the patch failed. The real keyboard.c contains a whole hell of a lot more code than what the patch expected -- probably Gentoo patched features, like Speakup (CONFIG_SPEAKUP_MODULE).
Now, let's add in the two blocks we need.
C Programmers: You will probably understand what the two things are. One's an include statement for the header file of the swsusp2 code. The other is a function declaration, and only do it if a certain macro is defined. You'll know that these can go virtually anywhere -- you got it easy!!
So, final beginning:
Code: |
#include <linux/config.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/random.h>
#include <linux/init.h>
#include <linux/completion.h>
#include <linux/slab.h>
#include <linux/kbd_kern.h>
#include <linux/kbd_diacr.h>
#include <linux/vt_kern.h>
#include <linux/sysrq.h>
#include <linux/input.h>
#include <linux/suspend.h>
#include <linux/speakup.h>
#ifdef CONFIG_SPEAKUP_MODULE
spk_key_func addr_spk_key = NULL;
#endif
static void kbd_disconnect(struct input_handle *handle);
#ifdef CONFIG_PM
extern void wakeup_suspend(void);
#endif
extern void ctrl_alt_del(void);
/*
* Exported functions/variables
*/
|
Now, the only problem is in the SCSI modules -- somehow they're messed up. Since I don't use SCSI/SATA, I just unchecked all the SCSI components. I don't have a fix for the SCSI errors. |
|
Back to top |
|
|
Romses Apprentice
Joined: 20 Jan 2004 Posts: 257 Location: Frankfurt
|
Posted: Tue Jun 29, 2004 3:16 pm Post subject: |
|
|
I solved the scsi-problem with a little workaround.
i noticed, that i have activates SATA in the scsi-section.
This is stupid, because i didn't have SATA.
After disabeling SATA, my kernel compiles
Greetz from Germany Romses |
|
Back to top |
|
|
jdong n00b
Joined: 01 Mar 2004 Posts: 41
|
Posted: Tue Jun 29, 2004 5:44 pm Post subject: |
|
|
Romses wrote: | I solved the scsi-problem with a little workaround.
i noticed, that i have activates SATA in the scsi-section.
This is stupid, because i didn't have SATA.
After disabeling SATA, my kernel compiles
Greetz from Germany Romses |
I actually have a SATA card (two, to be exact) but I don't have any drives yet. No swsusp works for me, amd64_agp (Athlon64/Opteron AGPGART) always causes video corruption on resume, and disabling AGPGART impacts 3d performance too much... |
|
Back to top |
|
|
val Apprentice
Joined: 30 Jun 2004 Posts: 234
|
Posted: Wed Jul 07, 2004 11:10 pm Post subject: |
|
|
I used software-suspend-2.0.0.93-for-2.6.7.tar.bz2 and it patched cleanly but won't compile. The compile errors are:
Code: | arch/i386/kernel/process.c: In function `sys_fork':
arch/i386/kernel/process.c:583: error: `DECLARE_SWSUSP_LOCAL_VAR' undeclared (first use in this function)
arch/i386/kernel/process.c:583: error: (Each undeclared identifier is reported only once
arch/i386/kernel/process.c:583: error: for each function it appears in.)
arch/i386/kernel/process.c:584: warning: implicit declaration of function `SWSUSP_ACTIVITY_START'
arch/i386/kernel/process.c:586: error: `SWSUSP_ACTIVITY_END' undeclared (first use in this function)
arch/i386/kernel/process.c: In function `sys_clone':
arch/i386/kernel/process.c:596: error: `DECLARE_SWSUSP_LOCAL_VAR' undeclared (first use in this function)
arch/i386/kernel/process.c:607: error: `SWSUSP_ACTIVITY_END' undeclared (first use in this function)
arch/i386/kernel/process.c: In function `sys_vfork':
arch/i386/kernel/process.c:625: error: `DECLARE_SWSUSP_LOCAL_VAR' undeclared (first use in this function)
arch/i386/kernel/process.c:629: error: `SWSUSP_ACTIVITY_END' undeclared (first use in this function)
make[1]: *** [arch/i386/kernel/process.o] Error 1
make: *** [arch/i386/kernel] Error 2
|
The offending code is in process.c:
Code: | asmlinkage int sys_fork(struct pt_regs regs)
{
int result;
DECLARE_SWSUSP_LOCAL_VAR;
SWSUSP_ACTIVITY_START(0);
result = do_fork(SIGCHLD, regs.esp, ®s, 0, NULL, NULL);
SWSUSP_ACTIVITY_END;
return result;
} |
Looking for the missing variables:
Code: | root@patsy linux # pwd
/usr/src/linux/include/linux
root@patsy linux # grep DECLARE_SWSUSP *.h
root@patsy linux # grep SWSUSP_ACTIVITY *.h
root@patsy linux #
|
Anybody? |
|
Back to top |
|
|
BigGerman n00b
Joined: 12 Jul 2004 Posts: 1
|
Posted: Mon Jul 12, 2004 1:07 am Post subject: worked for me, 2.6.7 and swsusp .98 |
|
|
I used vanilla 2.6.7 sources from kernel.org and .98 patches from swsusp. Patched and compiled without error. Hibernates fine; KDE, wireless, sound - all works on resume.
Laptop is Fujitsu E7110. Amazing, I was looking for this for long time.
I did encounter a few problems: couple times I had to reboot again to get it to wake up. |
|
Back to top |
|
|
loony Apprentice
Joined: 25 Feb 2004 Posts: 199
|
Posted: Fri Jul 16, 2004 9:53 am Post subject: |
|
|
Thank you, thank you and again thank you!!! Finally I got it to work with your little tutorial!!!
jdong wrote: | Ok, here we go, a little patching tutorial.
|
loony |
|
Back to top |
|
|
epall Tux's lil' helper
Joined: 16 May 2004 Posts: 77 Location: Silicon Valley, CA, USA
|
Posted: Fri Jul 16, 2004 4:10 pm Post subject: |
|
|
My issue was USB. Compiling usb stuff (including ohci-hcd) as modules made everything work beautifully! 2.0.0.100 is great! |
|
Back to top |
|
|
aloha99 n00b
Joined: 06 Jun 2004 Posts: 20
|
Posted: Sun Jul 25, 2004 6:18 am Post subject: |
|
|
I finally had enough time to do this ... and in not very much time at all I had suspend-to-disk finally working! Thanks go to Tuxlover's how-to, but also big shoutouts to jdong.
Thanks again! _________________ When I was 14, I couldn't believe how stupid my father was.
When I was 21, I couldn't believe how much he'd learned in only 7 years.
-- Mark Twain |
|
Back to top |
|
|
wap32. n00b
Joined: 11 Jun 2004 Posts: 8 Location: Portugal
|
Posted: Sat Aug 07, 2004 10:39 pm Post subject: |
|
|
Ok, I patched the kernel with software-suspend-2.0.0.88-for-2.6.7 and it compiled cleanly(thanks to jdong) , I can even hibernate =D.
I only have one problem, after patching the kernel, I can no longer load the ndiswrapper module, which I need to get my wireless card working.
When I compile my kernel it gives me this error:
Code: | if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.6.7-gentoo-r11; fi
WARNING: /lib/modules/2.6.7-gentoo-r11/misc/ndiswrapper.ko needs unknown symbol __per_cpu_offset
WARNING: /lib/modules/2.6.7-gentoo-r11/misc/ndiswrapper.ko needs unknown symbol __preempt_spin_lock
WARNING: /lib/modules/2.6.7-gentoo-r11/misc/ndiswrapper.ko needs unknown symbol del_timer_sync
|
I had no idea what the problem was(I am not exactly new to linux, but I'm a bit of a n00b), so I started messing up with things, seeing if I could get it working, and while doing it, I copied the old System.map(the one I had before patching the kernel) and it no longer gave me an error.
I thought "Yes!!", but that thought turned into the opposite when I rebooted.
I still couldn't(and still can't =) load the ndiswrapper module.
When I do "modprobe ndiswrapper" it says the module has an invalid format.
Does anyone have a clue what the problem is, and if there is a solution?? |
|
Back to top |
|
|
Wilko n00b
Joined: 11 Jun 2004 Posts: 35 Location: Calgary (Chillin with Jerome.) Ab, Canada.
|
Posted: Sat Aug 28, 2004 7:45 pm Post subject: |
|
|
I was getting the same errors with a 2.6.8.1 kernel, however I haven't applied the software suspend patch (maybe its in 2.6.8? maybe not)
These errors
Code: |
WARNING: /lib/modules/2.6.7-gentoo-r11/misc/ndiswrapper.ko needs unknown symbol __per_cpu_offset
WARNING: /lib/modules/2.6.7-gentoo-r11/misc/ndiswrapper.ko needs unknown symbol __preempt_spin_lock
WARNING: /lib/modules/2.6.7-gentoo-r11/misc/ndiswrapper.ko needs unknown symbol del_timer_sync |
They went away when I upgraded ndiswrapper to version 0.10, maybe that can help? _________________ Signature:
This is a block of text that can be added to posts you make. There is a 255 character limit |
|
Back to top |
|
|
Cheesepie Apprentice
Joined: 19 Jan 2004 Posts: 154
|
Posted: Sun Sep 26, 2004 10:28 pm Post subject: |
|
|
[ content removed, DMCA ]
Last edited by Cheesepie on Thu Feb 09, 2023 12:51 am; edited 1 time in total |
|
Back to top |
|
|
el*Loco Tux's lil' helper
Joined: 29 Jan 2003 Posts: 91 Location: Cologne, Germany
|
Posted: Sat Dec 11, 2004 11:19 pm Post subject: |
|
|
wap32. wrote: | I only have one problem, after patching the kernel, I can no longer load the ndiswrapper module, which I need to get my wireless card working. |
Same problem here
Ich weiss auch nicht wie ich da drumherum komme ... _________________ WARNING: Do not let Dr. Mario touch your genitals. He is not a real doctor! |
|
Back to top |
|
|
|