# Not taking my .config into account for compile

## evilAngel

Hey all,

I am experiencing a problem.

I installed a gentoo from stage3 with hardened-source.

After compiling the kernel, i realized that iptables was missing.

Therefore, i moved to /usr/src/linux.

I typed "make mrproper" , then "make menuconfig".

I ticked iptables/netfilter options.

Then I launched "make && make modules_install".

I copied the arch/x86/boot/bzIMage to my /boot folder.

I reboot my system.

However, when listing the /proc/config.gz file, iptables/netfilter are not activated.

Am I doing something wrong ?

Thanks

----------

## honp

And what about grub?

----------

## Hu

Check the output of uname -a to see whether the kernel you are running is the newly built one.  It sounds like you booted the old kernel again.

----------

## d2_racing

Hi, can you post this plz :

```

# emerge --info

# cd /usr/src && ls -la

# cat /boot/grub/grub.conf

```

----------

## evilAngel

 *Quote:*   

> And what about grub?

 

I deleted the former kernel (/boot/gentoo-hardened-2.6.25) and copied my /usr/src/arcg/x86/boot/bzImage under the same name (/boot/gentoo-hardened-2.6.25) in order not to change Grub config.

 *Quote:*   

> # emerge --info
> 
> # cd /usr/src && ls -la
> 
> # cat /boot/grub/grub.conf 

 

When I have access to my PC, il will post the output of these commands.

----------

## huckabuck

You still need to update grub with newly built kernel, even if it is the same name, I just went thru this with 2.6.26-r3 kernel rebuild. 

# grub --no-floppy

grub> root (hd0,0)

grub> setup (hd0)

grub> quit

reboot

----------

## d2_racing

 *huckabuck wrote:*   

> You still need to update grub with newly built kernel, even if it is the same name, I just went thru this with 2.6.26-r3 kernel rebuild. 

 

No you don't have, Grub read the /boot/grub/grub.conf to know which kernel to boot. You only need to reinstall grub when there is a new version of grub only.

----------

## evilAngel

Here are the ouput from my gentoo:

```
# emerge --info 

Portage 2.1.4.5 (hardened/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-hardened-r10 i586)

=================================================================

System uname: 2.6.25-hardened-r10 i586 Geode(TM) Integrated Processor by AMD PCS

Timestamp of tree: Wed, 19 Nov 2008 18:15:02 +0000

app-shells/bash:     3.2_p17-r1

dev-lang/python:     2.4.4-r13

dev-python/pycrypto: 2.0.1-r6

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.61-r1

sys-devel/automake:  1.10.1

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.23-r3

ACCEPT_KEYWORDS="x86"

CBUILD="i486-pc-linux-gnu"

CFLAGS="-O2 -mtune=i686 -pipe"

CHOST="i486-pc-linux-gnu"

CONFIG_PROTECT="/etc /var/bind"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -mtune=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ "

LDFLAGS="-Wl,-O1"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="acl berkdb bzip2 cli cracklib crypt cups dri gdbm gpm hardened iconv isdnlog midi mudflap ncurses nptl nptlonly openmp pam pcre perl pic pppd python readline reflection session spl ssl sysfs tcpd urandom x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
```

```
# cd /usr/src && ls -la 

total 12

drwxr-xr-x  3 root root 4096 Nov 19 20:49 .

drwxr-xr-x 12 root root 4096 Nov 19 19:45 ..

-rw-r--r--  1 root root    0 Jun 11 19:44 .keep

lrwxrwxrwx  1 root root   25 Nov 19 20:49 linux -> linux-2.6.25-hardened-r10

drwxr-xr-x 23 root root 4096 Dec  2 09:24 linux-2.6.25-hardened-r10
```

```
# cat /boot/grub/grub.conf

default 0

timeout 30

title Gentoo Hardened 2.6.25-r10

root (hd0,0)

kernel /boot/kernel-2.6.25-hardened-r10 root=/dev/hda3

title Gentoo Hardened 2.6.25-r10 (rescue)

root (hd0,0)

kernel /boot/kernel-2.6.25-hardened-r10 root=/dev/hda3 init=/bin/bb
```

Also this output:

```
# ls -la /boot

config-kernel-2.6.25-hardened-r10

grub

kernel-2.6.25-hardened-r10

kernel-2.6.25-hardened-r10.backup

kernel-2.6.25-hardened-r10.old

kernel-2.6.25-hardened-r10.old2
```

CONFIG FILE:

```
# zgrep -i filter /proc/config.gz

# CONFIG_NETFILTER is not set
```

```
# grep -i filter /usr/src/linux/.config

CONFIG_NETFILTER=y

CONFIG_NETFILTER_DEBUG=y

CONFIG_NETFILTER_ADVANCED=y

.....
```

Any idea ?

Thanks

----------

## krinn

you did install the kernel by copying it from bzimage, but didn't copy the kernel config file yourself in boot, but there is one there, and i suppose it's the old one that is taken (as the same is the same as the old one and the new one).

This is because (as kernel-2.6.25-hardened-r10.old presence could proof it) that you did kernel install auto previously

1/ grep -i filter /boot/config-kernel-2.6.25-hardened-r10

you might still see CONFIG_NETFILTER is not set

2/ cd /usr/src/linux && make install

so the kernel will rename yours to .old add the new kernel, but also will copy the current (correct) config file to your boot

----------

## cgmoller

Try this.

Check your boot partition in /etc/fstab.  If the noauto option is present then that is your problem.

What you are doing is installing your new kernel to the *mount point* not the partition.

you can confirm this / current status by running mount.

(I believe that the Gentoo install guide suggests noauto as a security measure and after a while you forget these things.  I did.  voice of experience   :Confused:  https://forums.gentoo.org/viewtopic-t-708140-highlight-.html)

to fix, umount /boot

delete *everything* in the *mount point*

touch mount_point_only_no_files

mount /boot

cd /usr/src/linux; make; make modules_install; make install

optionally re run grub-install

----------

## evilAngel

OK, i will try all these solutions.

Thanks

----------

## evilAngel

I removed all files from my /boot folder; except the grub folder.

I moved to /usr/src/linux and launched 

```
make install
```

It gave me back an error as I am not using LILO.

However, it put a vmlinuz file and a System.map file in my /boot folder.

I updated my /boot/grub/grub.conf file to match vmlinuz name.

I reboot.

And when typing 

```
zgrep -i netfilter /proc/config.gz
```

, still having  *Quote:*   

> CONFIG_NETFILTER is not set

 

However, my /usr/src/linux/.config file has all netfilter options activated.

Don't know what is wrong....

----------

## mattjgalloway

Sorry, just coming into this post a bit late, but I figured I *may* be able to help.

Are you definitely mounting your boot mount (assuming it's on a different mount to your root partition) before doing the make install? (Show us cat /etc/mtab and cat /etc/fstab if you like)

Also, try doing a make clean in /usr/src/linux as that will get rid of everything and start again. (Make sure you move away your .config file first just to be sure you have it safe - back it up!)

----------

## evilAngel

Thanks for help.

Sorry, i was in a hurry to get the server back. So i  installed a binary distro (Debian).

But i'll give a new try to Hardened ASAP

----------

