Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Oct 2004 16:14:29 +0200
From:      Francois Tigeot <ftigeot@wolfpond.org>
To:        freebsd-amd64@freebsd.org
Cc:        marcel@freebsd.org
Subject:   Fallback elf brand and Linux emulation
Message-ID:  <20041006141429.GD6180@aoi.wolfpond.org>

next in thread | raw e-mail | index | archive | help

--M9NhX3UHpAaciwkO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

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

--M9NhX3UHpAaciwkO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-linux_base

--- 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
+.endif
 RPMDIR=			${DISTDIR}/${DIST_SUBDIR}
 
 REMOVE_DIRS=		boot dev home root tmp var/tmp usr/local usr/tmp
@@ -118,7 +121,7 @@
 			etc/protocols
 BRAND_FILES=		bin/rpm sbin/ldconfig sbin/sln
 
-FALLBACK_ELF_MIB=	kern.fallback_elf_brand
+FALLBACK_ELF_MIB=	kern.elf32.fallback_brand
 LINUX_ELF=		3
 PREVIOUS_ELF!=		/sbin/sysctl -n ${FALLBACK_ELF_MIB}
 

--M9NhX3UHpAaciwkO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041006141429.GD6180>