Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

newbie to uClinux, having install problem

Hello,

This is my first attempt with installing uClinux1.3. I am using Quartus 4.1 SP2 and nios II 1.01 currently. I am trying to run this on a stratix2s60 altera dev kit. When installing the uClinux1.3 it says it had some problem installing the cygwin extension and that i need to read some readme file to manually install it. I cannot find this readme file that talks about this yet. When I try to execute the install_cyg_ext.sh located in the supplemental directory of the uClinux install folders, it says it cannot find the install_setting.cache file. Since the cyg_extensions were not installed correctly, I was not able to follow the tutorials to getting a kernel configured nor compiled. How can I get the install to completely finish the install process?

thanx,

-Quan

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Okay sorry to bring this back up again, but I finally have a resolution.

    I re-installed from scratch the entire group of apps starting with Quartus v4.2 with everything default, then the service pack 1. Then I installed Nios v1.1 and finally the uClinux v1.3. There is no problem anymore with the installation. I did not want to do this earlier because things were already working except for uClinux kernel development. So hopefully for those with similar problems, i would recommend a total clean install of everything and leave the Quartus to install most of the defaults... i think my mistake the first time was i was selective of certain components to install. I did re-install Nios dev kit over and over again several times but it was Quartus re-install that did the trick.

    -Quan
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi all,

    I tried Quan's suggestion of reinstalling everything, but still got the message that "installing the Cygwin extensions" didn't work. The README doesn't say anything about how to install the extensions manually, so I poked around and ran install_cyg_ext.sh manually. It turns out that the installation script misbehaves if you're installing from a directory with a space in the path, as I was. I fixed the script:

    #!/bin/sh
    umount /usr/lib
    #  save our current working directory so we can go back later
    CURDIR=`pwd`
    set -e #  exit on failure
    #  if no variables are specified, pull in info from the install_settings.cache file#  that's created by the installer
    if 
    then
    #  $1 = source bashrc file#  $2 = target user.bashrc file#  $3 = path to eclipse#  $4 = path to altera/kits/nios2 or equivalent (KIT_HOME in registry)#  $5 = application plugin directory name#  $6 = uClibc plugin directory name#  $7 = kernel plugin directory name
    RC_FILE=$1
    USER_RC_FILE=$2
    ECLIPSE_BIN_HOME=$3
    NIOS2_KIT_HOME=$4
    APP_PLUGIN_NAME=$5
    KERNEL_PLUGIN_NAME=$6
    UCLIBC_PLUGIN_NAME=$7
    else
    . ./install_settings.cache
    fi 
    SOURCE_RC=`echo $RC_FILE | sed 's/\\/\//g' | sed 's/ /\ /g'` # replaces \ with / and escapes spaces for use in shell statements
    TARGET_RC=`echo $USER_RC_FILE | sed 's/\\/\//g' | sed 's/ /\ /g'` # replaces \ with / and escapes spaces for use in shell statements
    ECLIPSE_PATH=`echo $ECLIPSE_BIN_HOME | sed 's/\\/\//g'`
    KITS_PATH=`echo $NIOS2_KIT_HOME | sed 's/\\/\//g'`
    NE_ROOT_PATH=`cygpath $KITS_PATH/examples/software/linux`
    APP_PLUGIN_PATH=`cygpath $ECLIPSE_PATH/plugins/$APP_PLUGIN_NAME`
    UCLIBC_PLUGIN_PATH=`cygpath $ECLIPSE_PATH/plugins/$UCLIBC_PLUGIN_NAME`
    KERNEL_PLUGIN_PATH=`cygpath $ECLIPSE_PATH/plugins/$KERNEL_PLUGIN_NAME`
    ECLIPSE_WORKSPACE_PATH=`cygpath $ECLIPSE_PATH/workspace`
    if 
    then
       #  if we cannot find the string in the existing file, it has not
       #  been previously modified.
        if 
        then
            cp -f "$TARGET_RC" "$TARGET_RC.mtx_nios2linux.bak"
            echo "" >> "$TARGET_RC"
            cat "$SOURCE_RC" >> "$TARGET_RC"
       #  otherwise, the user.bashrc already contains the necessary
       #  modifications, so only update the version number/date.
        else
            cp -f "$TARGET_RC" "$TARGET_RC.mtx_nios2linux.bak"
            sed -e 's/Version 1\., Built Fri May 7 11:44am/Version 1\.3, Built December 30th, 2004/g' "$TARGET_RC" > tmp.grep.file
            rm -f "$TARGET_RC"
            cp -f tmp.grep.file "$TARGET_RC"
            rm -f tmp.grep.file
        fi#  no previous user.bashrc found
    else
        cp -f "$SOURCE_RC" "$TARGET_RC"
    fi
    #  add the extra variables to the bashrc file
    echo export LINUX_NE_ROOT=\"$NE_ROOT_PATH\" >> "$TARGET_RC"
    echo export APP_PLUGIN=\"$APP_PLUGIN_PATH\" >> "$TARGET_RC"
    echo export UCLIBC_PLUGIN=\"$UCLIBC_PLUGIN_PATH\" >> "$TARGET_RC"
    echo export KERNEL_PLUGIN=\"$KERNEL_PLUGIN_PATH\" >> "$TARGET_RC"
    echo export ECLIPSE_WORKSPACE=\"$ECLIPSE_WORKSPACE_PATH\" >> "$TARGET_RC"
    cd /usr/include
    rm curses.h form.h menu.h panel.h unctrl.h
    ln -sf /usr/local/include/ncurses/curses.h
    ln -sf /usr/local/include/ncurses/form.h
    ln -sf /usr/local/include/ncurses/menu.h
    ln -sf /usr/local/include/ncurses/panel.h
    ln -sf /usr/local/include/ncurses/unctrl.h
    #  create a temporary file to indicate that we have#  completed running this script.
    cd "$CURDIR"
    touch install_cyg_ext.done

    I also changed run_sh.bat to prepend the Quartus Cygwin path to the PATH, since I have multiple installations of Cygwin on my machine and wanted the installer to use the right one:

    PATH=%QUARTUS_ROOTDIR%\bin\cygwin\bin;%PATH%
    sh %1 %2 %3 %4 %5 %6 %7 %8 %9

    I ran the installer manually with these new scripts and now I can configure my kernel!