Results 1 to 4 of 4
Hey again, I'm having problems compiling 2.2.26 on my fairly modern system - it's erroring out (the error's at the end of this post). I've done some poking around on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-12-2009 #1
- Join Date
- Jun 2009
Compiling a 2.2.26 kernel on a "modern" system
I'm having problems compiling 2.2.26 on my fairly modern system - it's erroring out (the error's at the end of this post). I've done some poking around on the 'Web and have GCC 2.95.3 installed (as well as 4.3.3, 3.3.6, 3.4.6 ) but not much else.
(PS: I'm using 2.2.26 because of its size - I'm guessing that 2.2 will be smaller than 2.4, which in turn will be smaller than 2.6, and since my project is pretty much static and won't evolve much beyond its initial state I don't need support for much more than XFree86, which existed back then so yeah. See http://www.linuxforums.org/forum/linux-kernel/147953-can-512-byte-bootloader-start-hybrid-kernel-initrd.html for further info.)
I'm guessing I need the right headers at this point from what I've read so I assume the next step is to grab the appropriate version of libc, compile that and from there I should be able to compile anything I want.
However, since I don't want libc to try and compile itself all over my existing version and cause my system to have a nuclear meltdown and send 0s and 1s to Mars and back because it's all confuzled about which version of libc it is and isn't using, I'm betting I need a chroot at this point. :P
So, in short, I need help with the following:
- How do I create a chroot? I gave the 'Net a cursory glance but didn't turn anything poignant up.
- I think I need libc version 5. Is this correct?
- What's the smallest version of XFree86 that works well with this kernel, if anybody knows?
- What else do I need to do, if anything?
Here's what GCC's complaining with currently (warning, this is long....):
I also noticed this curiosity. If I hand various gcc versions -Iinclude/ (in reference to <kernel tree root>/include/), they produce the following output which seems rather similar:
In file included from init/main.c:15: include/linux/proc_fs.h:284: parse error before `mode_t' include/linux/proc_fs.h:284: warning: no semicolon at end of struct or union include/linux/proc_fs.h:285: warning: type defaults to `int' in declaration of `nlink' include/linux/proc_fs.h:285: warning: data definition has no type or storage class
In file included from init/main.c:15: include/linux/proc_fs.h:284: error: syntax error before "mode_t" include/linux/proc_fs.h:284: warning: no semicolon at end of struct or union include/linux/proc_fs.h:285: warning: type defaults to `int' in declaration of `nlink' include/linux/proc_fs.h:285: warning: data definition has no type or storage class
In file included from init/main.c:15: include/linux/proc_fs.h:284: error: expected specifier-qualifier-list before ‘mode_t’ include/linux/proc_fs.h:303: error: expected declaration specifiers or ‘...’ before ‘off_t’ include/linux/proc_fs.h:306: warning: ‘struct file’ declared inside parameter list include/linux/proc_fs.h:306: warning: its scope is only this definition or declaration, which is probably not what you want include/linux/proc_fs.h:309: error: expected declaration specifiers or ‘...’ before ‘off_t’ include/linux/proc_fs.h: In function ‘proc_scsi_register’: include/linux/proc_fs.h:345: error: ‘struct proc_dir_entry’ has no member named ‘ops’
Thanks in advance!
- 06-12-2009 #2
Are you using /usr/src ? If so please read Hazel comments below that might help
- 06-12-2009 #3
- Join Date
- Jun 2009
No, I'm not, but thanks for pointing me to that piece of information - filed away
I'm compiling, er, trying to compile, in /storage/linux-2.2.26, to be specific. :P
By the way, I'd like to use klibc, unless there's a smaller C lib out there that will compile X?
- 06-14-2009 #4
- Join Date
- Jun 2009
Okay guys, a bit of an update.
After duking it out with several kernel trees, I've finally reached the following conclusion:
2.2 simply doesn't want to play ball, for reasons unknown. I've tried the 2.4 methods below on the most recent 2.2 kernel but no dice. It may need a GCC version older than 2.95.3, perhaps even EGCS (http://en.wikipedia.org/wiki/GNU_Compiler_Collection#EGCS)!
2.4 will compile - thanks to user 'strcmp''s post to this page (http://kerneltrap.org/node/5785) I downloaded an old binary release of binutils (2.9.1, from http://www.kernel.org/pub/linux/devel/binutils/2.9.1/binutils-126.96.36.199.25-glibc.x86.tar.bz2), handed its copy of `as' some LD_PRELOAD magic (basically just telling it where lib/libbfd-188.8.131.52.25.so was), and was I amazed when it worked!
However, I've discovered 2.4 kernels don't have initramfs support (where the initrd is compiled into the kernel). I kinda wanted that feature.
UPDATE!: Ignore the following text, please! I feel so silly! I forgot to do 'make bzImage', and tried to use the 'vmlinux' file in the root kernel folder... hahaha
-- Start --
And somewhat more critical, I've tried compiling both 2.4.0 (worked like a charm with gcc 3.3 and the above version of binutils! ) and 2.4.10 and GRUB likes neither of them. It complains with "Error 13: Invalid or unsupported executable format". Why?
Since I've been working on getting GRUB smaller, I initially thought "well okay, maybe my changes broke GRUB" but no.
Here's a screenshot: http://img268.imageshack.us/img268/392/grubfailurezcropped.png
The GRUB you see is from the same stage1/stage2 I use for my hard drive. So...
I've also tried googling, but no luck there.
If you'd like to help/say "why" along with me I've put a 2.4.10 kernel online to save you the trouble of having to go find GCC 3.3, convince it to work with as from the binutils above, then finally compile a kernel yourself.
In case you actually want to, uh, use it for something, I put the .config in with it (saved as 'config' without the dot so you can actually see the file):
>> http://www.box.net/shared/p0nf48vuip (kernel 2.4.10, "vanilla" make menuconfig (ie 'make menuconfig', 'exit', 'yes, save' - no changes made). Requires a PIII since that's what the default was - I just doublechecked).
I've been considering the possibility that it's the GRUB version (0.97) I'm using that's the problem, and that at some point the kernel format changed and GRUB's only compatible with the new format. But that doesn't make any sense, even in theory!
-- End --