# kernel compile error with dnsdomainname message [SOLVED]

## polsas

Very new to Gentoo and tyring to build a corporate server (hardened).  At kernel building stage, "make" command terminates very early (in about 30 secs) and resulting image is not bootable.  Exact message is:

-------------------------------------

(chroot) livecd linux # make

  CHK     include/linux/version.h

  CHK     include/linux/utsrelease.h

  SYMLINK include/asm -> include/asm-x86

  CALL    scripts/checksyscalls.sh

  CHK     include/linux/compile.h

dnsdomainname: Unknown host

Kernel: arch/x86/boot/bzImage is ready  (#9)

  Building modules, stage 2.

  MODPOST 2 modules

-------------------------------------

I know that DNS error does not cause kernel build fail, but it seems to be suppressing further message output; therefore cannot view complete process.  Correct cause for kernel build failure is, I suspect,  incorrect specs on USE flags,  but cannot identify the problem.   Also cannot find any notable reference about "dnsdomainname" error at compile by searching for it.

Output of "emerge --info --newuse" is:

--------------------------------------

Portage 2.1.6.7 (hardened/linux/amd64/2008.0, gcc-3.4.6, glibc-2.6.1-r0, 2.6.27-gentoo-r8 x86_64)

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

System uname: Linux-2.6.27-gentoo-r8-x86_64-Intel-R-_Pentium-R-_4_CPU_3.00GHz-with-glibc2.3.2

Timestamp of tree: Wed, 18 Feb 2009 14:45:01 +0000

app-shells/bash:     3.2_p17-r1

dev-lang/python:     2.4.4-r6

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

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="amd64 ~amd64"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer -fforce-addr"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc"

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

CXXFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer -fforce-addr"

DISTDIR="/mnt/arch/portage/distfiles"

FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="ftp://ftp.linux.org.tr/pub/gentoo/"

LDFLAGS="-Wl,-O1"

LINGUAS="tr en"

MAKEOPTS="-j3"

PKGDIR="/mnt/arch/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"

PORTDIR_OVERLAY="/mnt/arch/portage/quad"

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

USE="acl acpi amd64 apache2 berkdb bzip2 clamav cli cracklib crypt cups dri fam ftp gdbm gpm hardened hddtemp iconv imap isdnlog justify midi mmx mozilla mudflap multilib ncurses nptl nptlonly openmp pam pcre pdf perl pic pppd python readline reflection samba session smp spl squid sse sse2 ssl sunray sysfs tcpd urandom xorg zlib"

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"

KERNEL="linux"

LINGUAS="tr en"

USERLAND="GNU"

OF THE OUTPUT, THE ABOVE IS INCLUDED IN make.conf,  WHILE CODE BELOW IS NOT.

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

VIDEO_CARDS="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"

LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" 

ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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"

Kind of out of ideas on where to look next.

ThanksLast edited by polsas on Wed Feb 25, 2009 11:36 am; edited 1 time in total

----------

## energyman76b

the useflags should not have any influence (also you don't use newuse with info). Your kernel built fine. Your modules are failing. And reduced output is a standard 'feature' nowadays. 

try make V=1 when you build the kernel.

----------

## polsas

First, thanks for the reply.

I tried your command, much output on the screen, but in the end there were the same 2 modules as before, which have been included in the /etc/modules.autoload.d/kernel-2.6 file.

I deleted the old kernel and rebuilt it, but GRUB still gives the message "Invalid or unsupported executable format".  Modules are:

/lib/modules/2.6.28-hardened/kernel/drivers/scsi/scsi_wait_scan.ko

/lib/modules/2.6.28-hardened/kernel/arch/x86/kernel/test_nx.ko

these have been placed in the autoload file exactly like this, with full path info.

Please let me know if there is output I should include from any other command?

Regards.

----------

## energyman76b

see  - that error message has nothing to do with your little make 'error'. You are missing something in your config (I think). Please post your kernel config, will you?

And then - please list the steps you made to install your kernel? Is the image in /boot? Do you used a sensible fs for /boot? Is menu.lst/grub.conf set up correctly?

----------

## Hu

What is the output of file vmlinuz, where vmlinuz is the image produced by the build process?  Does it make a difference if you explicitly use the non-hardened version of gcc?  The hardened compiler is supposed to do the right thing for kernel builds, so a manual selection should not be necessary, but it is worth checking.

----------

## krinn

 *polsas wrote:*   

> 
> 
> /lib/modules/2.6.28-hardened/kernel/drivers/scsi/scsi_wait_scan.ko
> 
> /lib/modules/2.6.28-hardened/kernel/arch/x86/kernel/test_nx.ko
> ...

 

for this part, you should just put the name of the module in autoload file: test_nx and scsi_wait_scan

also, if you use scsi disk to boot, don't built the scsi as module, else your kernel will fail to find scsi.

recheck your grub.lst or post it, must have error in it that trigger invalid file format.

----------

## polsas

Thanks for the messages, could not answer as I was out of town for several days.

energyman:  Kernel config attached, /boot is on (hd0,0) format ext2, Grub is setup correctly as I can edit the commands in menu.lst at grub's boot menu.  Image was copied to /boot from /usr/src/linux.  Your question for "steps to install kernel" not understood - command was

# make && make modules_install  and then,

# cp vmilnuz /boot/  and rename the kernel.  Finally edit the autostart file.

partition where /usr is mounted (and the kernel was compiled) is ext4.  copy from ext4 -> ext2 should not create any problem?

Hu:  "output of file vmlinuz" not understood.  Do you mean on-screen messages during the build process - that was included in first post; if not please clarify.  For the kernel config, defaault "hardened profile" was not used, some security constraints were loosened as per suggested in some on-line sources I had found.  Did not try regular profile, will try if the posted conf file does not show conflicts.

Krinn:  HDD is IDE, no SCSI used for boot process.  I am pretty sure Grub & menu.lst are not the source, as I have some experience with those; nevertheless, menu.lst posted per your request.  In aoutoload file, test_nx and scsi_wait_scan should be separated only by single space or each on separate lines?

SEPARATELY:  Unset criteria on USE flags as posted before - is it advisable to use them or leave them out?

could not attach config file - where the hell is the file attach option?

MENU.LST:

default 0

timeout 30

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 2.6.28 Hardened Server

root (hd0,0)

kernel   /kernel-2.6.28-gentoo root=UUID=2e7ac491-67c7-4a46-b080-49db97d19e6d

title Gentoo Linux 2.6.28 (rescue)

root (hd0,0)

kernel   /kernel-2.6.28-gentoo root=UUID=2e7ac491-67c7-4a46-b080-49db97d19e6d init=/bin/bb

----------

## krinn

 *Quote:*   

> 
> 
> # cp vmilnuz /boot/  and rename the kernel.  Finally edit the autostart file.

 

you can simply "mount /boot && make install" and kernel setup will copy your new kernel, rename old one...

same thing but easier way to do it, will also copy system map and config for that kernel

 *Quote:*   

> 
> 
> copy from ext4 -> ext2 should not create any problem?

 

if both partitions are healthy, but as Hu guess (i think), your kernel is unreadable/invalid

 *Quote:*   

> "output of file vmlinuz" not understood.

 

```
mount /boot && cd /boot

ls vmlinuz*

vmlinuz                vmlinuz-2.6.24-gentoo.old  vmlinuz-2.6.27-gentoo-r3      vmlinuz.old

vmlinuz-2.6.24-gentoo  vmlinuz-2.6.25-gentoo-r1   vmlinuz-2.6.27-gentoo-r3.old

file vmlinuz

vmlinuz: Linux kernel x86 boot executable RO-rootFS, root_dev 0x811, swap_dev 0x1, Normal VGA

file vmlinuz-2.6.27-gentoo-r3.old

vmlinuz-2.6.27-gentoo-r3.old: Linux kernel x86 boot executable RO-rootFS, root_dev 0x811, swap_dev 0x1, Normal VGA
```

 *Quote:*   

> In aoutoload file, test_nx and scsi_wait_scan should be separated only by single space or each on separate lines?
> 
> each lines will work

 

```
cat kernel-2.6

# /etc/modules.autoload.d/kernel-2.6:  kernel modules to load when system boots.

....

# aic7xxx

nvidia

skge

raid0

```

good luck

----------

## pdw_hu

Well I haven't read the whole thread, but I also had this error.

Solved it with: 

```

echo "hosts: files dns" >> /etc/nsswitch.conf
```

----------

## polsas

Krinn & Hu:  Thanks for your input; as you stated "your kernel is unreadable/invalid" was the problem, I just had difficulty initially describing it.  So as you instructed, "make install" creates:

----------------------------------

(chroot) livecd boot # ls -la

-rw-r--r--  1 root root  1529061 Feb 23 16:22 System.map-2.6.28-hardened

-rw-r--r--  1 root root    48248 Feb 23 16:22 config-2.6.28-hardened

-rwxr-xr-x  1 root root 13798581 Feb 19 20:25 kernel-2.6.28-gentoo   (old kernel)

-rw-r--r--  1 root root  2808320 Feb 23 16:22 vmlinuz-2.6.28-hardened

Where, # file gives:

kernel-2.6.28-gentoo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped  BUT FOR VMLİNUZ GİVES

vmlinuz-2.6.28-hardened: Linux kernel x86 boot executable RO-rootFS, root_dev 0x302, swap_dev 0x2, Normal VGA

So copying the file does not exactly result in the same outcome?  I rebooted and the kernel started booting - so problem solved & thanks again.

However, I now have 2 other problems (grub & USE Flags).  I opened a new thread for those - please check it, if you could.

https://forums.gentoo.org/viewtopic-p-5508995.html#5508995

----------

## Hu

I suspect you originally copied the wrong file to the boot partition.  The vmlinux file conforms to standard ELF, and is convenient for inspecting that the object code was generated and linked correctly.  The bzImage, also sometimes installed as vmlinuz is a specially formatted self-decompressing kernel image.  This latter file is the one which can boot successfully from the environment prepared by the bootloader.

----------

