On 09/01/2011 03:46, David Miller wrote:
From: Ben Hutchings<ben@decadent.org.uk> Date: Sun, 09 Jan 2011 03:00:40 +0000On Sun, 2011-01-09 at 01:05 +0000, Richard Mortimer wrote:Package: linux-2.6 Version: 2.6.37-1~experimental.1 Severity: normal Boot of linux-image-2.6.37-trunk-sparc64 fails to find the disks and drops to the initramfs prompt. When I try to load the sym53c8xx driver it fails as follows (initramfs) modprobe sym53c8xx [ 122.470284] module scsi_mod: Unknown relocation: 36 FATAL: Error inserting sym53c8xx (/lib/modules/2.6.37-trunk-sparc64/kernel/drive rs/scsi/sym53c8xx_2/sym53c8xx.ko): Invalid module format (initramfs)David, do you have any idea how this could happen?A quick web search finds a similar issue http://kerneltrap.org/mailarchive/linux-kernel/2010/6/16/4583942 but I have not looked into this any further yet.[...] That was apparently a bug in the build scripts for a separate module.And like that case bad build flags are causing this problem too. It means that "-mcode-model=medlow" is not making it into the module build cflags somehow. This relocation can only occur for sparc64 code models other than "medlow".
I did a test Debian build using my Sun Fire V120 running to double check the build with the 2.6.27-1@experimental.1 sources. This fails in the same way that the official build fails.
Looking at the build output it seems to end up building setup_sparc but I think it should be building setup_sparc64 in the rules.
... from the build output ... dh_testdir /usr/bin/make -f debian/rules.gen setup_sparc make[1]: Entering directory `/usr/src/linux-2.6-2.6.37'/usr/bin/make -f debian/rules.real setup-flavour ABINAME='-trunk' ARCH='sparc' COMPILER='gcc-4.4' FEATURESET='none' FLAVOUR='sparc64' INITRD_CMD='update-initramfs' KCONFIG='debian/config/config debian/config/sparc/config debian/config/sparc/config.sparc64' KERNEL_ARCH='sparc' LOCALVERSION='-sparc64' LOCALVERSION_HEADERS='' LOCALVERSION_IMAGE='-sparc64' MAJOR='2.6' MODULES='True' SOURCEVERSION='2.6.37-1~experimental.1' TYPE='plain' UPSTREAMVERSION='2.6.37' VERSION='2.6.37'
make[2]: Entering directory `/usr/src/linux-2.6-2.6.37'python debian/bin/kconfig.py 'debian/build/config.sparc_none_sparc64' debian/config/config debian/config/sparc/config debian/config/sparc/config.sparc64
rm -rf 'debian/build/build_sparc_none_sparc64' mkdir 'debian/build/build_sparc_none_sparc64'cp 'debian/build/config.sparc_none_sparc64' 'debian/build/build_sparc_none_sparc64/.config'
Looking through debian/rules it is using DEB_HOST_ARCH to determine which version of setup_ to run.
richm@shirehall:/usr/src/linux-2.6-2.6.37$ grep DEB_HOST_ARCH debian/rules DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) $(MAKE) -f debian/rules.gen source_$(DEB_HOST_ARCH) $(MAKE) -f debian/rules.gen setup_$(DEB_HOST_ARCH) $(MAKE) -f debian/rules.gen build_$(DEB_HOST_ARCH) $(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH) dpkg-architecture reports the settings as follows richm@shirehall:/usr/src/linux-2.6-2.6.37$ dpkg-architecture DEB_BUILD_ARCH=sparc DEB_BUILD_ARCH_OS=linux DEB_BUILD_ARCH_CPU=sparc DEB_BUILD_ARCH_BITS=32 DEB_BUILD_ARCH_ENDIAN=big DEB_BUILD_GNU_CPU=sparc DEB_BUILD_GNU_SYSTEM=linux-gnu DEB_BUILD_GNU_TYPE=sparc-linux-gnu DEB_HOST_ARCH=sparc DEB_HOST_ARCH_OS=linux DEB_HOST_ARCH_CPU=sparc DEB_HOST_ARCH_BITS=32 DEB_HOST_ARCH_ENDIAN=big DEB_HOST_GNU_CPU=sparc DEB_HOST_GNU_SYSTEM=linux-gnu DEB_HOST_GNU_TYPE=sparc-linux-gnuI will try a package build forcing DEB_HOST_ARCH to sparc64 and see if that builds the right packages.