Fallback elf brand and Linux emulation

Francois Tigeot ftigeot at wolfpond.org
Wed Oct 6 07:14:25 PDT 2004


I attempted today to install emulators/linux_base on a 5.3-BETA7 amd64
machine. The port successfully set the sysctl kern.fallback_elf_brand to
the correct linux value but the rpm installation failed with the following
error message: "ELF binary type "0" not known."

I did a quick sysctl -a | grep elf which gave me the following values:

kern.elf64.fallback_brand: 3
kern.fallback_elf_brand: 3
kern.elf32.fallback_brand: -1

Setting kern.elf32.fallback_brand to 3 allowed the port to install.

The same sysctl exists also on the i386 architecture. Is there any reason
to use kern.fallback_elf_brand and not kern.elf32.fallback_brand ?

I have attached a small patch to allow linux_base to install out-of-the
box on amd64. It still seems to work on i386.

Francois Tigeot
-------------- next part --------------
--- Makefile.orig	Wed Oct  6 15:13:33 2004
+++ Makefile	Wed Oct  6 16:05:51 2004
@@ -110,6 +110,9 @@
 RPM=			LC_ALL=C rpm
 RPMFLAGS=		--root ${LINUXBASE} --dbpath ${DBPATH} --nodeps \
 			--replacepkgs --ignoreos --ignorearch
+.if (${ARCH} == "amd64")
+RPMFLAGS+=	--noscripts
 REMOVE_DIRS=		boot dev home root tmp var/tmp usr/local usr/tmp
@@ -118,7 +121,7 @@
 BRAND_FILES=		bin/rpm sbin/ldconfig sbin/sln
-FALLBACK_ELF_MIB=	kern.fallback_elf_brand
+FALLBACK_ELF_MIB=	kern.elf32.fallback_brand
 PREVIOUS_ELF!=		/sbin/sysctl -n ${FALLBACK_ELF_MIB}

More information about the freebsd-amd64 mailing list