UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 61877

2014.2 - PetaLinux - "sed: -e expression #1, char 49: unknown option to `s'" Infinitie Loop When Exiting MenuConfig

Description

When exiting the PetaLinux menuconfig, the terminal becomes stuck and echoes an infinite loop of messages similar to the following:

sed: -e expression #1, char 49: unknown option to `s'
sed: -e expression #1, char 49: unknown option to `s'
sed: -e expression #1, char 64: unknown option to `s'
sed: -e expression #1, char 27: unknown option to `s'
sed: -e expression #1, char 31: unknown option to `s'
sed: -e expression #1, char 28: unknown option to `s'
sed: -e expression #1, char 37: unknown option to `s'
sed: -e expression #1, char 34: unknown option to `s'
sed: -e expression #1, char 52: unknown option to `s'
sed: -e expression #1, char 19: unknown option to `s'
sed: -e expression #1, char 58: unknown option to `s'
sed: -e expression #1, char 51: unknown option to `s'
sed: -e expression #1, char 49: unknown option to `s'

Solution

Despite referencing the sed command this scenario is actually related to an incompatibility with newer versions of the grep command.  

Newer versions of grep have changed how parsing of regular expressions is handled with the -e option.

This scenario is most prevalent on newer operating systems that are not explicitly supported by PetaLinux 2014.2. 

For a list of the operating systems supported by PetaLinux 2014.2 please see the PetaLinux 2014.2 Installation Guide (UG976).

It is possible to work around this scenario by ensuring that an older (and compatible) version of grep is visible in the $PATH before the normal system-wide version of grep.  

The steps below describe how to download and compile an older version of grep from source code. 

In this instance, the version of grep currently available with Red Hat Enterprise Linux 6.5 is used.

  1. Download and extract the source code for grep 2.6.3 from the following GNU download site: http://ftp.gnu.org/gnu/grep/grep-2.6.3.tar.gz
  2. Ensure that gcc is installed and available in the $PATH.
  3. cd into the directory where grep-2.6.3.tar.gz was extracted (normally grep-2.6.3)
  4. Configure grep for your system by using the ./configure command
  5. After configuring, build grep using the make command
  6. After the build is complete, the grep binary will be available in <EXTRACTION_PATH>/src.
  7. Source the PetaLinux 2014.2 tools using the source <PETALINUX_INSTALL_PATH/settings.(c)sh script
  8. Manually update the path command to reference the version of grep that was just compiled:
    a) For BASH, use export PATH=<EXTRACTION_PATH>/src:${PATH}
    b) For CSH, use setenv PATH <EXTRACTION_PATH>/src:${PATH}
  9. Verify that the path was updated and correctly picks up the desired version of grep with the command which grep. 
    It should echo back <EXTRACTION_PATH>/src
  10. Continue to use the PetaLinux tools as normal.
AR# 61877
Date Created 08/28/2014
Last Updated 08/29/2014
Status Active
Type General Article
Tools
  • PetaLinux
  • PetaLinux - 2014.2