# building a kernel vs genkernel

## zeurx

hello everyone, i am a long time gentoo user and i know how to build a kernel by hand. with this install of gentoo i decided to use lvm2 on everything but my boot and swap so i needed a initrd, which genkernel makes, but lately i have been having a heck of a time making a kernel with genkernel.

hand build bzImage (JamesS /usr/src/linux # make bzImage modules modules_install):

```
Root device is (254, 0)

Boot sector 512 bytes.

Setup is 2903 bytes.

System is 1729 kB

Kernel: arch/x86_64/boot/bzImage is ready
```

genkernel bzImage (JamesS /usr/src/linux # genkernel --udev --lvm2 --gensplash=livecd-2005.0 kernel):

```
* Gentoo Linux Genkernel; Version 3.1.5

* Compiling Linux Kernel 2.6.11-gentoo-r6 for x86_64...

* kernel: >> Running mrproper...

* config: Using config from /usr/share/genkernel/x86_64/kernel-config-2.6

*         Previous config backed up to .config.bak

*         >> Running oldconfig...

* kernel: >> Cleaning...

*       >> Installing gensplash [ using the livecd-2005.0 theme ]...

*         >> Compiling 2.6.11-gentoo-r6 bzImage...

* ERROR: Failed to compile the "bzImage" target...

* -- Grepping log... --

  SCSI generic support (CHR_DEV_SG) [Y/n/m/?] y

  *

  * Some SCSI devices (e.g. CD jukebox) support multiple LUNs

  *

  Probe all LUNs on each SCSI device (SCSI_MULTI_LUN) [Y/n/?] y

  Verbose SCSI error reporting (kernel size +=12K) (SCSI_CONSTANTS) [N/y/?] n

--

make[1]: `arch/x86_64/kernel/asm-offsets.s' is up to date.

  CC      init/main.o

  GZIP    usr/initramfs_data.cpio.gz

  CHK     include/linux/compile.h

  AS      usr/initramfs_data.o

dnsdomainname: Host name lookup failure

--

  CC      kernel/rcupdate.o

  AS      arch/x86_64/kernel/suspend_asm.o

  CC      arch/x86_64/kernel/early_printk.o

  CC      kernel/intermodule.o

  CC      arch/x86_64/kernel/pci-gart.o

kernel/intermodule.c:179: warning: `inter_module_register' is deprecated (declared at kernel/intermodule.c:38)

kernel/intermodule.c:180: warning: `inter_module_unregister' is deprecated (declared at kernel/intermodule.c:79)

kernel/intermodule.c:183: warning: `inter_module_put' is deprecated (declared at kernel/intermodule.c:160)

--

  CC      kernel/irq/proc.o

  CC      kernel/power/pm.o

  LD      kernel/irq/built-in.o

  CC      kernel/compat.o

kernel/power/pm.c: In function `pm_undo_all':

kernel/power/pm.c:201: warning: `pm_send' is deprecated (declared at kernel/power/pm.c:155)

kernel/power/pm.c: In function `pm_send_all':

kernel/power/pm.c:242: warning: `pm_send' is deprecated (declared at kernel/power/pm.c:155)

kernel/power/pm.c: At top level:

kernel/power/pm.c:259: warning: `pm_register' is deprecated (declared at kernel/power/pm.c:62)

kernel/power/pm.c:260: warning: `pm_unregister' is deprecated (declared at kernel/power/pm.c:86)

kernel/power/pm.c:261: warning: `pm_unregister_all' is deprecated (declared at kernel/power/pm.c:115)

kernel/power/pm.c:262: warning: `pm_send_all' is deprecated (declared at kernel/power/pm.c:234)

--

  CC      drivers/char/keyboard.o

  CC      net/802/p8023.o

  CC      drivers/char/vt.o

  CC      net/802/sysctl_net_802.o

drivers/char/vt.c: In function `vc_allocate':

drivers/char/vt.c:752: warning: `pm_register' is deprecated (declared at include/linux/pm.h:106)

--

  CC      drivers/pci/setup-res.o

  CC      drivers/pci/hotplug.o

  CC      drivers/pci/msi.o

  CC      drivers/pnp/core.o

drivers/pci/msi.c: In function `msi_set_mask_bit':

drivers/pci/msi.c:69: warning: cast from pointer to integer of different size

drivers/pci/msi.c: In function `msi_capability_init':

drivers/pci/msi.c:550: warning: cast to pointer from integer of different size

--

  LD      drivers/scsi/qla2xxx/built-in.o

  LD      drivers/scsi/libata.o

  CC      drivers/video/console/vgacon.o

  CC      drivers/scsi/sata_promise.o

drivers/scsi/sata_promise.c: In function `pdc_ata_init_one':

drivers/scsi/sata_promise.c:671: warning: passing arg 1 of `__readb' makes pointer from integer without a cast

--

  CC      lib/crc32.o

  AR      lib/lib.a

  LD      lib/built-in.o

  GEN     .version

  CHK     include/linux/compile.h

dnsdomainname: Host name lookup failure

--

Root device is (254, 0)

Boot sector 512 bytes.

Setup is 2903 bytes.

System is 6621 kB

System is too big. Try using modules.

make[1]: *** [arch/x86_64/boot/bzImage] Error 1

make: *** [bzImage] Error 2

* Gentoo Linux Genkernel; Version 3.1.5

* ERROR: Failed to compile the "bzImage" target...
```

why does the genkernel make the System to big but when i clean and make it by hand it works just fine? the other question is when i make the modules and modules_isntall.

```
if [ -r System.map ]; then /sbin/depmod -ae -F System.map  2.6.11-gentoo-r6; fi

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol _spin_unlock_irq

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol smp_call_function

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol cpu_online_map

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol _spin_unlock

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol preempt_schedule

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol _spin_unlock_irqrestore

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol add_preempt_count

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol _spin_lock_irq

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol _spin_lock_irqsave

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol _spin_lock

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol memnode_shift

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol sub_preempt_count

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol memnodemap

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol node_data

WARNING: /lib/modules/2.6.11-gentoo-r6/video/nvidia.ko needs unknown symbol smp_processor_id

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol _read_unlock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol unlock_kernel

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol _spin_unlock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol _spin_unlock_irqrestore

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol lock_kernel

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol _spin_lock_irqsave

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol _spin_lock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol _write_lock_irqsave

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol _read_lock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.o needs unknown symbol _write_unlock_irqrestore

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol smp_call_function

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol cpu_online_map

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol unlock_kernel

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol _spin_unlock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol preempt_schedule

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol _spin_unlock_irqrestore

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol add_preempt_count

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol lock_kernel

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol del_timer_sync

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol _spin_lock_irqsave

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol _spin_lock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol memnode_shift

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol sub_preempt_count

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol memnodemap

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol node_data

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol smp_processor_id

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.o needs unknown symbol alloc_pages_current

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol _read_unlock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol unlock_kernel

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol _spin_unlock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol _spin_unlock_irqrestore

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol lock_kernel

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol _spin_lock_irqsave

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol _spin_lock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol _write_lock_irqsave

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol _read_lock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmnet.ko needs unknown symbol _write_unlock_irqrestore

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol smp_call_function

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol cpu_online_map

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol unlock_kernel

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol _spin_unlock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol preempt_schedule

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol _spin_unlock_irqrestore

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol add_preempt_count

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol lock_kernel

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol del_timer_sync

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol _spin_lock_irqsave

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol _spin_lock

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol memnode_shift

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol sub_preempt_count

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol memnodemap

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol node_data

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol smp_processor_id

WARNING: /lib/modules/2.6.11-gentoo-r6/misc/vmmon.ko needs unknown symbol alloc_pages_current
```

vmware will not start without vmmon and when it loads is says unknown symbol, nvidia loads just fine right now... haver rebooted though, vmnet worked just fine last time i tryed to modprobe it which was before the kernel rebuild.

[edit]

i have just tryed genkernel without the gensplash and it outputs this

```
JamesS root # genkernel --udev --lvm2 kernel

* Gentoo Linux Genkernel; Version 3.1.5

* Compiling Linux Kernel 2.6.11-gentoo-r6 for x86_64...

* kernel: >> Running mrproper...

* config: Using config from /usr/share/genkernel/x86_64/kernel-config-2.6

*         Previous config backed up to .config.bak

*         >> Running oldconfig...

* kernel: >> Cleaning...

*         >> Compiling 2.6.11-gentoo-r6 bzImage...

*         >> Compiling 2.6.11-gentoo-r6 modules...

* Copying config for successful build to /etc/kernels/kernel-config-x86_64-2.6.11-gentoo-r6

* initrd: Not building since only the kernel was requested...

*

* Kernel compiled successfully!

*

* Required Kernel Parameters:

*     root=/dev/$ROOT

*     [ And "vga=0x317 splash=verbose" if you use a framebuffer ]

*

*     Where $ROOT is the device node for your root partition as the

*     one specified in /etc/fstab

*

* Do NOT report kernel bugs as genkernel bugs unless your bug

* is about the default genkernel configuration...

*

* Make sure you have the latest genkernel before reporting bugs.
```

i really want a boot splash so i dont really want to take out the genkernel option!  im using gentoo-sources-2.6.11-r6 on a amd64 platform

----------

## Shazam

i would build the kernel by hand. 

```
make && make modules_install && make install 
```

btw you can enable the framebuffersplash in the gentoo-sources w/o using genkernel thingy.

----------

