Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 2004 00:17:34 +0200
From:      Lars Tunkrans <lars.tunkrans@bredband.net>
To:        ports@FreeBSD.org
Cc:        obrien@FreeBSD.org
Subject:   How I got linux emulation to work for AMD64 on RC1
Message-ID:  <417ECCFE.7010105@bredband.net>

next 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.

I posted this on freebsd-amd64  three days ago and no one has yet been opposed to this
procedure. If you update the linux-base Makefile it can still be tested before 5.3 RELEASE.



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. These commands need to be
      incerted in the linux_base Makefile ( for production use) in addition to the
      patch under (5.)

# cd /usr/compat/linux
# brandelf -t Linux sbin/ldconfig
# brandelf -t Linux sbin/sln
# brandelf -t Linux sbin/rpm
# echo '/usr/X11R6/lib' > etc/ld.so.conf
# 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?417ECCFE.7010105>