Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Oct 2004 14:25:25 +0200
From:      Lars Tunkrans <lars.tunkrans@bredband.net>
Cc:        freebsd-amd64@freebsd.org
Subject:   HOW TO  to get linux emulation going on AMD64 5.3-RC1 !
Message-ID:  <417B9F35.7050705@bredband.net>
In-Reply-To: <417A462D.5060109@bredband.net>
References:  <20041022031145.23130.qmail@web61110.mail.yahoo.com> <20041022093439.GA15304@cat.robbins.dropbear.id.au> <417A462D.5060109@bredband.net>

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

This is a step by step guide to get linux emulation to run
on AMD64 5.3-RC1 using the standard emulators/linux_base port.

This is pulled together from the previous work done by Tim Robbins and Francois Tigeot.
Do we need to feed this back to a certain authority ?
If the "authority" reads this please respond,
if not I'll mail it to the maintainer of linux_base in a few days.


1.) Put these varaiables in the Kernel config file:
     /usr/src/sys/amd64/conf/your_kernel_config_file



    options     LINPROCFS
    options     COMPAT_43
    options     COMPAT_LINUX32


    Rebuild the kernel and install it !


2.) Edited /etc/fstab  for linprocfs , add the line:


   none	/compat/linux/proc	linprocfs	rw	0	0


3.) Edit  /etc/rc.conf  and add the line:

   linux_enabled="YES"


4.) Reboot.


5.) Patch  /usr/ports/emulators/linux_base/Makefile with
     Francois Tigeot's patch.

     Put the patch below  in /usr/ports/emulators/linux_base/patchfile
     run:

     # patch -p0 < patchfile

---------------<snip>------------------
--- 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}
-------------------<snip>--------------------------


6.)  Install  linux_base

  # cd /usr/ports/emulators/linux_base
  # make install


7.)  Fix the library searchpath for the linux Emulator to
      find the linux X libraries. Brand some binaries as Linux binaries,
      ( this is done in linux_base makefile for i386 )

# cd /usr/compat/linux
# echo '/usr/X11R6/lib' > etc/ld.so.conf
# brandelf -t Linux sbin/ldconfig
# brandelf -t Linux sbin/sln
# brandelf -t Linux sbin/rpm
# sbin/ldconfig

8.)  Reboot again.


Install desired Linux apps and run.


Regards
//Lars






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