Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Logic PD support staff and engineers participate, Logic PD does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Logic PD engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Logic PD product download, please subscribe to the TDG Forum of interest.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 03 Mar 2006 08:40 PM by  peter_vc
SOLVED: get Embedix BDK to work on newer Linux Distributions
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages
JadePhoenix
New Member
New Member
Posts:


--
20 Jul 2004 02:39 AM
    Hello again,

    i finally got the Embedix BDK to work on newer linux distributions.

    These instructions apply for "Fedora Core 2" but might work for others.

    As i mentioned in another thread, the main problem is that some commandline tools in the supplied chrooted chain are not large filesystem aware.
    This results in some spawned makes to exit prematurely or return incorrect results (like the MAKEDEV package).

    Following steps to fix this.
    I had to reinstall the BDK because i couldnt get some packages (like MAKEDEV) to regenerate their stuff.
    Make sure you uninstalled each BDK supplied packages via "rpm -ev Embedix..." and clean up the whole /opt/Embedix mess (rm -rf).

    1.) Install BDK from CDROM (./install.sh)
    DO NOT execute make -f Makefile.bdk yet!

    2.) Fix the broken chroot host tools:

    Tools affected (to my knowledge) so far:

    Quote:

    /bin/chown
    /usr/bin/find
    /usr/bin/md5sum (is not supplied by BDK but used in build scripts?)


    Rename the installed tools:

    Quote:

    EM_ROOT_DIR=/opt/Embedix
    mv $EM_ROOT_DIR/bin/chown $EM_ROOT_DIR/bin/chown-orig
    mv $EM_ROOT_DIR/usr/bin/find $EM_ROOT_DIR/usr/bin/find-orig


    Copy host supplied (LFS enabled) tools.

    Quote:

    cp /bin/chown $EM_ROOT_DIR/bin/chown-new
    cp /usr/bin/find $EM_ROOT_DIR/usr/bin/find-new
    cp /usr/bin/md5sum $EM_ROOT_DIR/usr/bin/md5sum-new


    Now copy some necessary dynamic link libraries to a new lib path.
    This is extremly important because the host supplied ones are linked to a GLIBC with ABI that is binary incompatible to chrooted chain supplied one.
    (You will get dreaded dynamic linker error).

    Extract the tool dependecy chain with "ldd" and "strace" command!
    For my tools these libs were necessary:

    Quote:

    if [ ! -d $EM_ROOT_DIR/lib-new ]; then
    mkdir $EM_ROOT_DIR/lib-new
    mkdir $EM_ROOT_DIR/lib-new/tls
    fi
    cp /lib/ld-linux.so.2 $EM_ROOT_DIR/lib-new
    cp /lib/tls/libc.so.6 $EM_ROOT_DIR/lib-new/tls
    cp /lib/tls/libc-2.3.3.so $EM_ROOT_DIR/lib-new/tls
    cp /lib/libselinux.so.1 $EM_ROOT_DIR/lib-new
    cp /lib/libnss* $EM_ROOT_DIR/lib-new


    Now create a wrapper script for each tool.
    The wrapper script for each tool read like follows:

    Example1
    Quote:

    #!/bin/sh
    /lib-new/ld-linux.so.2 --library-path /lib-new /bin/chown-new $*


    Example2

    Quote:

    #!/bin/sh
    set -f # avoid wildcard expansion
    /lib-new/ld-linux.so.2 --library-path /lib-new /usr/bin/find-new "$@"


    ...

    Copy each wrapper script in place.

    Quote:

    cp chown.sh $EM_ROOT_DIR/bin/chown
    cp find.sh $EM_ROOT_DIR/usr/bin/find
    cp md5sum.sh $EM_ROOT_DIR/usr/bin/md5sum


    3) Execute make first time to create dirs

    Quote:

    /usr/sbin/chroot $EM_ROOT_DIR bash -c "cd /bdk/lh79520; make -f Makefile.bdk firsttime"


    4) Apply LogicPD patch...
    (backup stuff first then unpack/tar lpd-linux-LLH79520-04.tgz into path)

    5) Fix LPD stuff:

    Missing symlink in src/linux/include (ln -s asm-arm asm)
    Patching LPD build.sh to incorporate missing ncurses fix.

    Quote:

    --- build.sh.old 2004-07-19 12:34:02.384997312 +0200
    +++ build.sh 2004-07-19 12:34:55.069987976 +0200
    @@ -1665,7 +1665,7 @@
    set -x -e
    export PATH=/opt/Embedix/tools/arm-linux/bin/:/opt/Embedix/tools/bin:/opt/Embedix/bin:/opt/Embedix/usr/bin:/opt/Embedix/usr/local/bin
    cd $PROJECT_DIR/build/rpmdir/BUILD/ncurses-5.2
    -make
    +make libdir=$DEV_IMAGE/$prefix/lib
    cd $BUILD_DIR
    rm -f libncurses.da libform.da libmenu.da libpanel.da
    ar -rv libform.da obj_s/fld_arg.o obj_s/fld_attr.o obj_s/fld_current.o obj_s/fld_def.o obj_s/fld_dup.o obj_s/fld_ftchoice.o obj_s/fld_ftlink.o obj_s/fld_info.o obj_s/fld_just.o obj_s/fld_link.o obj_s/fld_max.o obj_s/fld_move.o obj_s/fld_newftyp.o obj_s/fld_opts.o obj_s/fld_pad.o obj_s/fld_page.o obj_s/fld_stat.o obj_s/fld_type.o obj_s/fld_user.o obj_s/frm_cursor.o obj_s/frm_data.o obj_s/frm_def.o obj_s/frm_driver.o obj_s/frm_hook.o obj_s/frm_opts.o obj_s/frm_page.o obj_s/frm_post.o obj_s/frm_req_name.o obj_s/frm_scale.o obj_s/frm_sub.o obj_s/frm_user.o obj_s/frm_win.o obj_s/fty_alnum.o obj_s/fty_alpha.o obj_s/fty_enum.o obj_s/fty_int.o obj_s/fty_ipv4.o obj_s/fty_num.o obj_s/fty_regex.o


    6) Regenerate the whole stuff using make -f Makefile.bdk <option>

    This worked for me. I can now use this (rather old) toolchain.

    Regards
    Anonymous
    Posts:


    --
    24 Nov 2004 12:05 PM
    A bit late but.... Thank you so much for posting your solution here.

    Thanks again,
    peter_vc
    New Member
    New Member
    Posts:


    --
    03 Mar 2006 08:40 PM
    This works great under Suse 10.0 x86 but not on Suse 10.0 X64.

    Thanks for your patches Jade Phoenix !
    You are not authorized to post a reply.