Skip to contentSkip to conversation

kexec: Cannot determine the file type of arch/x86/boot/bzImage

DISCUSSION Thomas Meyer 6 participants 8 messages Oct 16, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi.

Look at this:

$ file arch/x86/boot/bzImage (tree 821f3eff7cdb9d6c7076effabd46c96c322daed1)
arch/x86/boot/bzImage: Linux kernel x86 boot executable zImage, version
2.6.23 (thomas@hotzenplotz) #39, RO-rootFS, root_dev 0x803, swap_dev
0x1, Prompt for Videomode
$ file /boot/bzImage-2.6.23
/boot/bzImage-2.6.23: Linux kernel x86 boot executable RO-rootFS,
root_dev 0x803, swap_dev 0x1, Normal VGA

and this:

# kexec -l arch/x86/boot/bzImage
Cannot determine the file type of arch/x86/boot/bzImage

How to solve this error?

mfg
thomas

#1 lore raw

On Tue, 16 Oct 2007 21:51:13 +0200 Thomas Meyer wrote:

[adding kexec mailing list]

Quoted 20 lines

Hi.

Look at this:

$ file arch/x86/boot/bzImage (tree 821f3eff7cdb9d6c7076effabd46c96c322daed1)
arch/x86/boot/bzImage: Linux kernel x86 boot executable zImage, version
2.6.23 (thomas@hotzenplotz) #39, RO-rootFS, root_dev 0x803, swap_dev
0x1, Prompt for Videomode
$ file /boot/bzImage-2.6.23
/boot/bzImage-2.6.23: Linux kernel x86 boot executable RO-rootFS,
root_dev 0x803, swap_dev 0x1, Normal VGA

and this:

# kexec -l arch/x86/boot/bzImage
Cannot determine the file type of arch/x86/boot/bzImage

How to solve this error?

Quoted 9 lines

mfg
thomas

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

---
~Randy

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 24 lines · Randy Dunlap

On Tue, 16 Oct 2007 21:51:13 +0200 Thomas Meyer wrote:

[adding kexec mailing list]

Quoted 19 lines

Hi.

Look at this:

$ file arch/x86/boot/bzImage (tree 821f3eff7cdb9d6c7076effabd46c96c322daed1)
arch/x86/boot/bzImage: Linux kernel x86 boot executable zImage, version
2.6.23 (thomas@hotzenplotz) #39, RO-rootFS, root_dev 0x803, swap_dev
0x1, Prompt for Videomode
$ file /boot/bzImage-2.6.23
/boot/bzImage-2.6.23: Linux kernel x86 boot executable RO-rootFS,
root_dev 0x803, swap_dev 0x1, Normal VGA

and this:

# kexec -l arch/x86/boot/bzImage
Cannot determine the file type of arch/x86/boot/bzImage

How to solve this error?

#!/bin/bash
KERNEL_VER=2.6.24_k8.2
CONSOLE=console=uart8250,io,0x3f8,9600n8

./kexec -t bzImage -l bzImage_"$KERNEL_VER" --command-line="apic=debug acpi.debug_level=0x0000000F pci=routeirq nmi_watchdog=2 ramdisk_size=65536 root=/dev/ram0 rw ip=dhcp $CONSOLE" --ramdisk=mydisk8_x86_64.gz

YH

#3 lore raw
In reply to Randy Dunlap
Quoted 23 lines · Randy Dunlap

On Tue, 16 Oct 2007 21:51:13 +0200 Thomas Meyer wrote:

[adding kexec mailing list]

Quoted 18 lines

Look at this:

$ file arch/x86/boot/bzImage (tree 821f3eff7cdb9d6c7076effabd46c96c322daed1)
arch/x86/boot/bzImage: Linux kernel x86 boot executable zImage, version
2.6.23 (thomas@hotzenplotz) #39, RO-rootFS, root_dev 0x803, swap_dev
0x1, Prompt for Videomode
$ file /boot/bzImage-2.6.23
/boot/bzImage-2.6.23: Linux kernel x86 boot executable RO-rootFS,
root_dev 0x803, swap_dev 0x1, Normal VGA

and this:

# kexec -l arch/x86/boot/bzImage
Cannot determine the file type of arch/x86/boot/bzImage

How to solve this error?

$ git bisect good
f77bf01425b11947eeb3b5b54685212c302741b8 is first bad commit
commit f77bf01425b11947eeb3b5b54685212c302741b8
Author: Sam Ravnborg <sam@neptun.(none)>
Date:   Mon Oct 15 22:25:06 2007 +0200

kbuild: introduce ccflags-y, asflags-y and ldflags-y

Introduce ccflags-y, asflags-y and ldflags-y so we soon can deprecate use of EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. This patch does not touch any in-tree users - thats next round. Lets get this committed first and then fix the users of the soon to be deprecated variants next.

The rationale behind this change is to introduce support for makefile fragments like:

ccflags-$(CONFIG_WHATEVER_DEBUG) := -DDEBUG

As a replacement for the uglier:
ifeq ($(CONFIG_WHATEVER_DEBUG),y)
EXTRA_CFLAGS := -DDEBUG
endif

:040000 040000 03915c7c738eefa31f2327521130df23b7dfe95e
e2a1677df3709813ff793fdfa77d80fff9b838a7 M Documentation
:040000 040000 ff4ad149975df39509a18782341f1f8f6a32f07a
663bce3c08a0f2e107cecb0b29edc4fe9d5735a0 M scripts

#4 lore raw
Quoted 48 lines · On Tue, 16 Oct 2007 23:40:54 +0200 Thomas Meyer wrote:
Quoted 23 lines · Randy Dunlap

On Tue, 16 Oct 2007 21:51:13 +0200 Thomas Meyer wrote:

[adding kexec mailing list]

Quoted 18 lines

Look at this:

$ file arch/x86/boot/bzImage (tree 821f3eff7cdb9d6c7076effabd46c96c322daed1)
arch/x86/boot/bzImage: Linux kernel x86 boot executable zImage, version
2.6.23 (thomas@hotzenplotz) #39, RO-rootFS, root_dev 0x803, swap_dev
0x1, Prompt for Videomode
$ file /boot/bzImage-2.6.23
/boot/bzImage-2.6.23: Linux kernel x86 boot executable RO-rootFS,
root_dev 0x803, swap_dev 0x1, Normal VGA

and this:

# kexec -l arch/x86/boot/bzImage
Cannot determine the file type of arch/x86/boot/bzImage

How to solve this error?

$ git bisect good
f77bf01425b11947eeb3b5b54685212c302741b8 is first bad commit
commit f77bf01425b11947eeb3b5b54685212c302741b8
Author: Sam Ravnborg <sam@neptun.(none)>
Date:   Mon Oct 15 22:25:06 2007 +0200

kbuild: introduce ccflags-y, asflags-y and ldflags-y

Introduce ccflags-y, asflags-y and ldflags-y so we soon can deprecate use of EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. This patch does not touch any in-tree users - thats next round. Lets get this committed first and then fix the users of the soon to be deprecated variants next.

The rationale behind this change is to introduce support for makefile fragments like:

ccflags-$(CONFIG_WHATEVER_DEBUG) := -DDEBUG

As a replacement for the uglier:
ifeq ($(CONFIG_WHATEVER_DEBUG),y)
EXTRA_CFLAGS := -DDEBUG
endif

Quoted 6 lines

:040000 040000 03915c7c738eefa31f2327521130df23b7dfe95e
e2a1677df3709813ff793fdfa77d80fff9b838a7 M Documentation
:040000 040000 ff4ad149975df39509a18782341f1f8f6a32f07a
663bce3c08a0f2e107cecb0b29edc4fe9d5735a0 M scripts

This makes 2 big problems with this patch in the last 1 hour.

Probably time to revert it...

---
~Randy

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw
In reply to Thomas Meyer
Quoted 1 line · Thomas Meyer
Quoted 1 line
Quoted 1 line

How to solve this error?

Fixed by following patch.
Sorry for the inconvinience.

Sam

Quoted 1 line

From 7eebb9348655b55553d65fc7cb6cfad292d28dbb Mon Sep 17 00:00:00 2001

From: Sam Ravnborg <sam@neptun.(none)>
Date: Tue, 16 Oct 2007 23:50:33 +0200
Subject: [PATCH] x86: fix boot error introduced by kbuild

x86 uses target specific assignment of EXTRA_AFLAGS, EXTRA_CFLAGS - this caused troubles with introducing asflags-y, ccflags-y.

Fixed the target specific assignments in arch/x86/boot/Makefile and auditted the rest of the kernel for similar usage.

---
 arch/x86/boot/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/boot/Makefile +3 -3
index d6ed8e5..e8756e5 100644
@@ -64,10 +64,10 @@ KBUILD_CFLAGS	:= $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
 KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__
 
 $(obj)/zImage:  IMAGE_OFFSET := 0x1000
-$(obj)/zImage:  EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK)
+$(obj)/zImage:  asflags-y := $(SVGA_MODE) $(RAMDISK)
 $(obj)/bzImage: IMAGE_OFFSET := 0x100000
-$(obj)/bzImage: EXTRA_CFLAGS := -D__BIG_KERNEL__
-$(obj)/bzImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
+$(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__
+$(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
 $(obj)/bzImage: BUILDFLAGS   := -b
 
 quiet_cmd_image = BUILD   $@
Signature · 1 line
1.5.2.4
#6 lore raw
In reply to Thomas Meyer

Sam, please take a look at this:

Il Tue, Oct 16, 2007 at 09:51:13PM +0200, Thomas Meyer ha scritto:

Quoted 6 lines

Look at this:

$ file arch/x86/boot/bzImage (tree 821f3eff7cdb9d6c7076effabd46c96c322daed1)
arch/x86/boot/bzImage: Linux kernel x86 boot executable zImage, version
2.6.23 (thomas@hotzenplotz) #39, RO-rootFS, root_dev 0x803, swap_dev
0x1, Prompt for Videomode

I just noticed the same problem when grub refused to load that thing.

The issue is that the build system created a zImage (and not a bzImage); even passing the target explicitly doesn't solve the problem.

git bisect says:

f77bf01425b11947eeb3b5b54685212c302741b8 is first bad commit commit f77bf01425b11947eeb3b5b54685212c302741b8
Author: Sam Ravnborg <sam@neptun.(none)>
--- (Ops, you have a problem on you git setup)
Date: Mon Oct 15 22:25:06 2007 +0200

kbuild: introduce ccflags-y, asflags-y and ldflags-y

Introduce ccflags-y, asflags-y and ldflags-y so we soon can deprecate use of EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. This patch does not touch any in-tree users - thats next round. Lets get this committed first and then fix the users of the soon to be deprecated variants next.

The rationale behind this change is to introduce support for makefile fragments like:

ccflags-$(CONFIG_WHATEVER_DEBUG) := -DDEBUG

As a replacement for the uglier:
ifeq ($(CONFIG_WHATEVER_DEBUG),y)
EXTRA_CFLAGS := -DDEBUG
endif

:040000 040000 03915c7c738eefa31f2327521130df23b7dfe95e e2a1677df3709813ff793fdfa77d80fff9b838a7 M Documentation
:040000 040000 ff4ad149975df39509a18782341f1f8f6a32f07a 663bce3c08a0f2e107cecb0b29edc4fe9d5735a0 M scripts

I'm building a x86_64 image, using an external directory (O=...) in case it matters.

Bisect log:

git-bisect start
# bad: [821f3eff7cdb9d6c7076effabd46c96c322daed1] Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
git-bisect bad 821f3eff7cdb9d6c7076effabd46c96c322daed1
# good: [bbf25010f1a6b761914430f5fca081ec8c7accd1] Linux 2.6.23
git-bisect good bbf25010f1a6b761914430f5fca081ec8c7accd1
# good: [4d5709a7b7d54fc5882d2943a14988a92d48c00a] Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq git-bisect good 4d5709a7b7d54fc5882d2943a14988a92d48c00a
# good: [b5869ce7f68b233ceb81465a7644be0d9a5f3dbb] Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
git-bisect good b5869ce7f68b233ceb81465a7644be0d9a5f3dbb
# good: [11370ee2c1c578a704f47d5513d57274c335db43] [ALSA] hda-codec: Add two new systems to ALC883 git-bisect good 11370ee2c1c578a704f47d5513d57274c335db43
# good: [05440dfcfcabde6fcf7297dfa5a29f0355b78ffb] rtc-cmos probe() cleanup
git-bisect good 05440dfcfcabde6fcf7297dfa5a29f0355b78ffb
# good: [f20bf6125605acbbc7eb8c9420d7221c91aa83eb] time: introduce xtime_seconds
git-bisect good f20bf6125605acbbc7eb8c9420d7221c91aa83eb
# good: [92d15c2ccbb3e31a3fc71ad28fdb55e1319383c0] Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block
git-bisect good 92d15c2ccbb3e31a3fc71ad28fdb55e1319383c0
# good: [fc8a327db6c46de783b1a4276d846841b9abc24c] Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa git-bisect good fc8a327db6c46de783b1a4276d846841b9abc24c
# good: [3b16cc2d4ccc3949455432241fe378448e77d911] kbuild: move Kai Germaschewski to CREDITS
git-bisect good 3b16cc2d4ccc3949455432241fe378448e77d911
# good: [2f7055c5932ecc02159be375ebda1eee64665d17] [MIPS] MIPSsim: Fix booting from NFS root
git-bisect good 2f7055c5932ecc02159be375ebda1eee64665d17
# good: [52bcc3308ae3344266f55bf98a22c1ac0201eda7] kbuild: enable use of AFLAGS and CFLAGS on commandline git-bisect good 52bcc3308ae3344266f55bf98a22c1ac0201eda7
# good: [8bb00d83d8fc2de5c0614f5d55780107e0c375fe] [MIPS] Increase cp0 compare clockevent min_delta_ns from 0x30 to 0x300. git-bisect good 8bb00d83d8fc2de5c0614f5d55780107e0c375fe
# bad: [f77bf01425b11947eeb3b5b54685212c302741b8] kbuild: introduce ccflags-y, asflags-y and ldflags-y git-bisect bad f77bf01425b11947eeb3b5b54685212c302741b8
# good: [06c5040cdb13d27adad118f2fbfae905a1911b37] kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP git-bisect good 06c5040cdb13d27adad118f2fbfae905a1911b37

Luca

Signature · 3 lines
The trouble with computers is that they do what you tell them, 
not what you want.
D. Cohen
#7 lore raw
In reply to Thomas Meyer
Quoted 13 lines · Thomas Meyer

Hi.

Look at this:

$ file arch/x86/boot/bzImage (tree 821f3eff7cdb9d6c7076effabd46c96c322daed1)
arch/x86/boot/bzImage: Linux kernel x86 boot executable zImage, version
2.6.23 (thomas@hotzenplotz) #39, RO-rootFS, root_dev 0x803, swap_dev
0x1, Prompt for Videomode
$ file /boot/bzImage-2.6.23
/boot/bzImage-2.6.23: Linux kernel x86 boot executable RO-rootFS,
root_dev 0x803, swap_dev 0x1, Normal VGA
Quoted 6 lines

and this:

# kexec -l arch/x86/boot/bzImage
Cannot determine the file type of arch/x86/boot/bzImage

How to solve this error?

Looks like a kbuild error was causing us to build zImage kernels instead of bzImage kernels on x86 and thus kexec didn't recognize the format and so refused to boot it.

Eric