FreeBSD 5.4 amd64 Linux Ded 1.1.2484.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Geffeh

    #1

    FreeBSD 5.4 amd64 Linux Ded 1.1.2484.0

    I am trying to get the Battlefield 2 dedicated server running on a FreeBSD 5.4 machine on my home network for some fun with my uni housemates.

    I downloaded the dedicated server installer straight from EAGames this morning, so I should in theory have the latest version.

    I have installed the linux_base-rh-9 port and also installed bash2 as well because I know that Linux machines have that as the /bin/sh whereas FreeBSD uses csh as /bin/sh

    When I try to install the server, I 'accept' and 'yes' for it (dont know if I really need punkbuster though, but also trying this with 'no' doesnt really make much difference)

    Code:
    I then come to this point in the installation and get this output.
    
    The target installation directory is where the bf2 directory will be created
    and must be an existing directory.
    Enter your target installation directory: /usr/home/battlefield/BF2
    test: -a: unexpected operator
    Installing BF2 to /usr/home/battlefield/BF2/bf2...
    cp: bin//libdice_py.so: No such file or directory
    cp: bin//libaidll.so: No such file or directory
    cp: bin//bf2: No such file or directory
    Installing PunkBuster...
    cp: pb_: No such file or directory
    mv: rename /usr/home/battlefield/BF2/bf2/pb_ to /usr/home/battlefield/BF2/bf2/pb: No such file or directory
    
    Installation complete.
    I have examined the man pages of test in both FreeBSD and Linux and as far as I can tell both use the -a switch to perform an AND operation

    I have since tried it using
    ./bf2-linuxded-1.1.2484.0-installer.sh --target tmp
    so this extracts the files into a folder called tmp in the current directory.

    reading through the license.sh I have found on line 59
    if test -a "$TARGET/bf2"; then
    this is obviously not an AND operation, I am assuming that it might need to be -e instead to test for the existence of that directory

    the cp lines, well looking around line 76 there is this
    Code:
    MACH=""
    case `uname -m` in
            i[3456]86) MACH="ia-32"
            ;;
            x86_64) MACH="amd-64"
            ;;
    esac
    
    echo Installing BF2 to "$TARGET/bf2"...
    cp -r \
            admin \
            adminutils \
            mods \
            python \
            readmes \
            pylib-2.3.4.zip \
            rotate_demo.cfg \
            lowercaseDir.py \
            start.sh \
            "$TARGET/bf2"
    
    mkdir "$TARGET/bf2/bin"
    cp "bin/$MACH/bf2" "bin/$MACH/libaidll.so" "bin/$MACH/libdice_py.so" "$TARGET/bf2/bin"
    
    if [ "$PB" = 'yes' ]; then
            echo Installing PunkBuster...
            cp -r pb_$MACH "$TARGET/bf2";
            mv "$TARGET/bf2/pb_$MACH" "$TARGET/bf2/pb"
    fi
    it looks like the case statement is the part causing the problem at least on my system.

    in FreeBSD the uname -m command gives 'amd64', I dont have access to any Linux amd64 servers to check what their uname -m gives though I would assume it to be x86_64


    Making these changes and then running ./license.sh from the tmp folder allows me to properly install the server, but then attempting to run ./start.sh I get the following error

    $ ./start.sh
    ELF binary type "0" not known.
    /usr/home/battlefield/BF2/bf2/bin/bf2: 1: Syntax error: "(" unexpected


    Any ideas about how I can get this to work, and please do not tell me to install Windows or Linux on the server instead of FreeBSD.

    Thanks in advance for any help
  • Geffeh

    #2
    Re: FreeBSD 5.4 amd64 Linux Ded 1.1.2484.0

    Messed with the license.sh file again to make it install the ia_32 version instead of the amd64 version and that is at least loading, so not quite sure what that means with respect to the amd64 version, but I would still like to get the amd64 version to work.

    Comment

    • H00bler

      #3
      Re: FreeBSD 5.4 amd64 Linux Ded 1.1.2484.0

      I extracted the files as you did using --target, then edited the start.sh and license.sh to fix the bad info in the case statement that sets the MACH variable. I hard set MACH to be amd-64 to match whats found in the bf2/bin directory.
      I commented out the part in start.sh after #TODO: remove before release to avoid an irellevant error report.
      I looked up -a, and I found that it checks if a file exists, its not an AND operator, so I think it made sense as used.

      I have both scripts working as I believe they should, and like you I ran into the following error when I run ./start.sh:
      ELF binary type "0" not known.

      I did some searching on 'ELF binary type' and found a command for setting the 'ELF type', brandelf.
      I used this to try different types, 3 for Linux, 9 for fbsd. Setting to type 3 produced an error message that leads me to believe my linux compat is not set up right:
      ELF binary type "3" not known.
      ./bf2_f: Exec format error. Binary file not executable.

      Setting to type 9 produced an error message that leads me to belive my linux compat isn't right, but also that the 64bit specifics aren't set up right:
      ELF interpreter /lib64/ld-linux-x86-64.so.2 not found

      I sent mail to my sysadmin asking about the state of our linux compat. I suspect the kernal needs a recompile, or some libraries need updating.

      Thanks,

      -dave

      EDIT: I found this page, its worth checking out. http://entertainment.newsforge.com/a...1538225&tid=22

      Comment

      • Geffeh

        #4
        Re: FreeBSD 5.4 amd64 Linux Ded 1.1.2484.0

        I gave up in the end and ran the i386 version which runs fine.
        I will update the bf2 dedicated server and try that again. Mine hasnt been running for a little bit as the demand has gone down.

        Comment

        Working...