[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#359969: linux-2.6: [powerpc] vmlinuz image generation (mkvmlinuz) is broken in 2.6.16



Package: linux-2.6
Severity: important

I was surprised to find out that 2.6.16 no longer generates proper vmlinuz
image (via mkvmlinuz). I built the kernel deb with:
fakeroot make-kpkg --append-to-version '-pegasos' kernel_image

Trying mkvmlinuz manually after dpkg -i'ng the package fails, too:

peg1:~# /usr/sbin/mkvmlinuz -v -k /boot/vmlinux-2.6.16-pegasos
=== Building for sub-architecture chrp.
=== Using kernel image file /boot/vmlinux-2.6.16-pegasos.
=== Release version seems to be 2.6.16-pegasos.
=== Using object files from /root.
=== Building a bootable compressed kernel image in /boot/vmlinuz-2.6.16-pegasos.
=== Doing build in /tmp/tmp.ShaBYy.
=== Creating compressed kernel image vmlinux.gz...
objcopy -O binary /boot/vmlinux-2.6.16-pegasos /tmp/tmp.ShaBYy/vmlinux
gzip /tmp/tmp.ShaBYy/vmlinux
=== Putting everything into ELF image file image.o...
objcopy -R .comment /root/obj/dummy.o /tmp/tmp.ShaBYy/image.o
objcopy: '/root/obj/dummy.o': No such file
objcopy: error: the input file '/root/obj/dummy.o' is empty
objcopy /tmp/tmp.ShaBYy/image.o /tmp/tmp.ShaBYy/image.o --add-section=.image=/tmp/tmp.ShaBYy/vmlinux.gz --set-section-flags=.image=contents,alloc,load,readonly,data
objcopy: '/tmp/tmp.ShaBYy/image.o': No such file
objcopy: error: the input file '/tmp/tmp.ShaBYy/image.o' is empty
=== Creating bootable kernel image file vmlinuz.chrp...
ld -o /tmp/tmp.ShaBYy/vmlinuz.chrp -T /root/boot/ld.script -e _start -Ttext 0x00800000 /root/obj/crt0.o /root/obj/start.o /root/obj/misc.o /root/obj/common.o /roo
t/obj/chrpmain.o /tmp/tmp.ShaBYy/image.o /root/lib/lib.a /root/lib/ppc.a /root/lib/of.a /root/lib/common.a
ld: cannot open linker script file /root/boot/ld.script: No such file or directory
objcopy -R .comment /tmp/tmp.ShaBYy/vmlinuz.chrp /tmp/tmp.ShaBYy/vmlinuz.chrp
objcopy: '/tmp/tmp.ShaBYy/vmlinuz.chrp': No such file
objcopy: error: the input file '/tmp/tmp.ShaBYy/vmlinuz.chrp' is empty
cp -p /root/boot/note /tmp/tmp.ShaBYy
cp: cannot stat `/root/boot/note': No such file or directory
/root/utils/addnote /tmp/tmp.ShaBYy/vmlinuz.chrp
/usr/sbin/mkvmlinuz: line 26: /root/utils/addnote: No such file or directory
=== Cleaning up...
peg1:~#

It fails because there is no /usr/lib/linux-image-2.6.16-pegasos, like with
2.6.15 for example:
peg1:~# ls /usr/lib/linux-image-2.6.15-pegasos/
boot  lib  obj  utils
peg1:~#

So I figured out why it wasn't generated to the package, and it seems to be
side-effect from this:

(in ruleset/arches/powerpc.mk)

# 2.6.16 and up use powerpc for all major subarches, we keep still ppc for
# obscure subarches though, will probably be changed in the future.
ifeq ($(KERNEL_ARCH_VERSION),post-2.6.15)
  ifneq (,$(findstring $(KPKG_SUBARCH), ppc ppc32 ppc64 powerpc64 powerpc powerp$
    KERNEL_ARCH:=powerpc
  endif
  ifneq (,$(findstring $(KPKG_SUBARCH), apus Amiga APUs nubus prpmc mbx MBX))
    KERNEL_ARCH:=ppc
  endif
endif

So KERNEL_ARCH is powerpc now.

Later:

IMAGE_POST_PROCESS_TARGET := mkvmlinuz_support_install
IMAGE_POST_PROCESS_DIR    := arch/$(KERNEL_ARCH)/boot

Finally:

(in ruleset/targets/image.mk)

ifeq ($(strip $(NEED_IMAGE_POST_PROCESSING)),YES)
	if grep $(IMAGE_POST_PROCESS_TARGET) $(IMAGE_POST_PROCESS_DIR)/Makefile 2>&1 >/dev/null; then \
	    $(MAKE) INSTALL_MKVMLINUZ=$(TMPTOP)$(INSTALL_MKVMLINUZ_PATH) 	            \
	    ARCH=$(KERNEL_ARCH) -C $(IMAGE_POST_PROCESS_DIR) $(IMAGE_POST_PROCESS_TARGET);  \
	fi
endif

That grep fails (arch/ppc/boot/Makefile has mkvmlinuz_support_install,
while arch/powerpc/boot/Makefile doesn't). This results in deb without
the needed files (in /usr/lib/...) for mkvmlinuz to succeed.

My guess is that arch=ppc -> arch=powerpc transition isn't quite complete 
yet.

Regards,
  Harry Sintonen <sintonen@iki.fi>


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-pegasos
Locale: LANG=fi_FI@euro, LC_CTYPE=fi_FI@euro (charmap=ISO-8859-15)



Reply to: