# Unable to squeeze kernel after 9.1 upgrade



## Juanitou (Jan 4, 2013)

Hi

I made my first FreeBSD install (9.0-RELEASE amd64) several weeks ago. For the sake of learning, I made a custom kernel, stripping not needed options and devices. The custom kernel was then around 50 Mb.

I have upgraded today to 9.1-RELEASE with freebsd-update, but when building the custom kernel again, it takes a lot longer, nodevices and nooptions in the config file seem to be more or less ignored and I finish with a kernel of 291 Mb (GENERIC is 302 Mb). Surprised, I check for new devices and options in GENERIC, remove them in my custom kernel config and build again: the new one is smaller, but still takes 286 Mb, far from the pre-upgrade 50 Mb.

I'm certainly missing something obvious, maybe the 9.0 GENERIC kernel was a lot smaller, but I don't think so. I'm seeing a lot of files being built for devices I have disabled...

Best regards,
Juan


----------



## wblock@ (Jan 4, 2013)

Where are you seeing that size?


----------



## Juanitou (Jan 4, 2013)

```
du -h /boot
```


----------



## kpa (Jan 4, 2013)

Check how much the old kernel at /boot/kernel.old is taking space. Also remember that nodevice in the kernel config file does not disable building the module, it just prevents it from being linked in to the kernel. To disable building a module you need MODULES_OVERRIDE or WITHOUT_MODULES  in make.conf(5).


----------



## wblock@ (Jan 4, 2013)

Juanitou said:
			
		

> ```
> du -h /boot
> ```



But that's the size of the kernel, all the separate modules and debug symbol files, and any old kernels.  Try this:
`% ls -lh /boot/kernel/kernel`


----------



## Juanitou (Jan 4, 2013)

What a noob I am! :r

I forgot about the difference between the kernel and the modules. Sure enough, the custom kernel is half the size of GENERIC.

What surprises me is the fact that the pre-9.1 kernel folder was a lot smaller and I've never played with the make.conf variables, I used the standard procedure described in the handbook.

Thank you very much for your time!


----------

