Please Check for Mistakes

John Duncan agley at optusnet.com.au
Sat May 15 23:37:28 PDT 2004


  Hello,
        I realise that is a bit long but could anyone please check this
instruction for mistakes on the FreeBSD side, it will be posted on the
Birmingham University website to help FreeBSD users install and run the
Linux Poplog Virtual Machine.

                     How To Build and Run Linux Poplog on FreeBSD

 
         Linux Poplog can be used on FreeBSD with the Linux ABI support
      provided in the GENERIC kernel. See the FreeBSD Handbook for and
      manual pages for the gory details.To get this support every time
      you run put,

      linux_enable="YES"

      in your /etc/rc.conf and to ensure that FreeBSD recognises the Poplog
      binaries as Linux use this sysctl variable like so,

      # sysctl kern.fallback_elf_brand=3

      This will have to be repeated upon a reboot. You could just try to
      brand the binaries like this,

      # brandelf -t Linux poplog_binaries

      but maybe some parts of the Poplog system are seen as binaries that I
      don't know about.

          First we have to set up a Linux type system under /compat/linux in
      FreeBSD, we do this by building the ports which give us a RedHat 8 set
      of libraries. This is because of the version of the Linux libc that
      Poplog needs now. At the moment these are,

      /usr/ports/emulators/linux_base-8
      /usr/ports/devel/linux_devtools
      /usr/ports/x11/linux-XFree86-libs

          This will install the following packages,

      linux_base-8-8.0_4   linux_devtools-8.0_1  linux-XFree86-libs-4.3.0_2

          After this we will need to install some things that the Poplog
      installation scripts need, we do this by installing the RedHat RPMS
      for RedHat 8.0 en which can be found at sites like rpmfind. We need,

      tcsh-6.12-2.i386.rpm
      tar-1.13.25-8.i386.rpm
      gzip-1.3.3-5.i386.rpm
      textutils-2.0.21-5.i386.rpm
      util-linux-2.11r-10.i386.rpm
      openmotif-2.2.2-12.i386.rpm    ---  only if you want WITH_MOTIF

          You install them like in this example

      # rpm -i --ignoreos --nodeps --root /compat/linux \
      --dbpath /var/lib/rpm tcsh-6.12-2.i386.rpm

          When you install the util-linux RPM you will get the message
 
      group tty does not exist using root

          This does not seem to worry the installation. Another point is
      that although there is a /compat/linux/usr/tmp directory symlinked
      to /var/tmp the Poplog installation can't use this so we need to
      make another one

      # cd /compat/linux
      # mkdir tmp

          Assuming you have downloaded the large Linux Poplog tarball(21MB) 
      to your home directory and had a look at the documentation available
      at the Birmingham University website to see what should happen lets
      start the installation.
      
          I am going to install everything in the default position and so
       that all users can use Poplog, there is now provision in the build
       scripts to install in other places if you want, see the documentation
       for details. First make a directory under /compat/linux for the
       source and copy the tarball into it.

       # cd /compat/linux/usr
       # mkdir -p /compat/linux/usr/local/poplog/src
       # cd /home/whoever
       # cp -p bham-linux-poplog.tar.gz /compat/linux/usr/local/poplog/src
 
          Now enter into a chrooted environment under /compat/linux to untar
       the sources and run the build scripts. First run the ldconfig program
       for the /compat/linux libraries just in case.

       # cd /compat/linux/usr
       # chroot /compat/linux /bin/bash
       bash2.05b# pwd                      ( just to check )
       /
       bash2.05b# cd /lib
       bash2.05b# /sbin/ldconfig
       bash2.05b# cd /usr/X11R6/lib
       bash2.05b# /sbin/ldconfig
       bash2.05b# cd /usr/local/poplog/src
       bash2.05b# zcat bham-linux-poplog.tar.gz | tar xf -

          You now have the build scripts and some documentation in this
       directory. The docs explain a lot, I will just say that there are two
       ways to build, linked with and without Motif. I recommend with Motif
       if this is your first look at Poplog. So run either,
 
       bash2.05b# ./INSTALL_EVERYTHING_WITH_MOTIF      ( or )
       bash2.05b# ./INSTALL_EVERYTHING_WITHOUT_MOTIF

          There are a lot of errors at the start of the build saying,

       cc1: warning: changing search order for system directory "usr/include"
       as it already has been specified as a non-system directory

          I am told these occur when building Poplog on RedHat 8 or 9 so are
       nothing unusual, other errors that appear are normal for any build.

          Exit out of the chroot and copy the whole Birmingham Poplog set up
       into /usr/local for FreeBSD.

        bash2.05b# exit
        # cd /compat/linux/usr/local/poplog
        # cp -pR /compat/linux/usr/local/poplog /usr/local

           Now Poplog depends heavily on environmental variables and there are
        some example configuration scripts bundled with the documentation but
        I will keep things as simple as possible to get you started.

        # cd /usr/local/bin
        # ln -s /usr/local/poplog/local/setup/bin/poplog /usr/local/bin/poplog
        # exit
        > cd
        > rehash
        > setenv usepop /usr/local/poplog/v15.53e
        > setenv poplocal /usr/local/poplog
        > setenv local $poplocal/local
        > source $usepop/pop/com/poplog

           For the other shells
        $ cd
        $ .
        $ usepop=/usr/local/poplog/v15.53e
        $ export usepop
        $ poplocal=/usr/local/poplog
        $ local=$poplocal/local
        $ export poplocal local
        $ . $usepop/pop/com/poplog.sh
  
           Now open up an xterm and try to start Poplog,
       
        > poplog pop11 %x

        if you used Motif you might see this error printed with the start up
        banner,
       
        Can't open shared object
        /usr/local/poplog/current.poplog/pop/extern/lib/libXm.so
        ( Inappropiate ioctl for device )

          I think what happens here is that I have FreeBSD Openmotif installed
        and initially it looks at this but in a few seconds comes good and starts
        up with a control panel.
        
          If you didn't use Motif you might think that the graphical interface
        failed but that is not so, read in a file at the Setpop prompt which is
        a full colon.
 
        Setpop
        : teach teach

         and the graphical editor Xved should start with this file.

           With or without Motif to get familiar keyboard keys to get you going
         on a PC you should enter these two lines at the prompt,

        Setpop
        : uses oldvedxvedkeys
        : oldvedxvedkeys();

          There you go, you now have a wealth of documentation and examples at
        your disposal to help you learn how to program in the Linux Poplog
        Virtual Machine.



                                          Thanks for any help,
                                               John Duncan








More information about the freebsd-emulation mailing list