cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
5,963 Views
Registered: ‎05-05-2018

PetaLinux 2018.1 Install Fails on Debian Stretch

PetaLinux 2018.1 install fails on a standard Debian Stretch system.  The install scripts appear to be relying on incorrect behavior by the shell (verified on Ubuntu 14.04.5).

When installing, things seem to go well, but there are three error messages printed:

environment: line 277: locked_signs: bad array subscript

...and only the aarch64 tools are installed to the correct place.  This appears to be a problem with the script passed as an argument to the petalinux-install command.  Digging through the code, the locked_signs error is caused because the dest[] array is not fully populated.  The code in question is:

yocto_sdk="${PLNXINSTALLDIR}/tools/yocto-esdk"
dest_dir="${PLNXINSTALLDIR}/components/yocto/source"
inst_scripts=($(ls "${yocto_sdk}"/petalinux-glibc-x86_64-petalinux-image-minimal-*.sh)) # All valid sdk installer scripts.
read -a dest <<< $(ls "${yocto_sdk}"/petalinux-glibc-x86_64-petalinux-image-minimal-*.sh | sed -e "s/^.*minimal-\(.*\)-toolchain.*/\1/")
The problem is the "ls | sed" command sequence in the last line generates a multi-line response while the bash read builtin only reads a single line (per: https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html#index-read).  I added a wrapper around sed that translates the newlines generated into spaces and the installer completed as expected on an otherwise stock Debian stretch install.
 
The simple sed shim is attached for reference, just drop copy it to /usr/local/bin/sed before running the PetaLinux installer (and move or rename it when you're done).
8 Replies
Highlighted
Newbie
Newbie
5,896 Views
Registered: ‎07-09-2018

Thank you, that solved it! It's still present in PetaLinux 2018.2.

 

It took me a day to find this answer, I ignored the installer errors and instead searched for:

 

ERROR: Failed to source yocto environment
ERROR: Failed to source bitbake

Maybe it helps others to find it this way.

Highlighted
Visitor
Visitor
5,629 Views
Registered: ‎07-26-2018

Just for information

The problem is present also in Fedora (at this moment I 'm working with Fedora 28).

Using the script proposed and changing the sed command the problem is fixed

Participant
Participant
5,115 Views
Registered: ‎11-10-2016


@vladdino wrote:

Just for information

The problem is present also in Fedora (at this moment I 'm working with Fedora 28).

Using the script proposed and changing the sed command the problem is fixed


I can confirm that the same goes for installation of petalinux 2018.3 on Ubuntu 18.04.

Highlighted
Contributor
Contributor
5,065 Views
Registered: ‎11-12-2018

For petalinux 2018.3 install on ubuntu 18.04: Running "/opt/pkg/petalinux/2018.3/tools/common/petalinux/utils/petalinux-env-check" displays
 WARNING: This is not a supported OS
 INFO: Checking free disk space
 INFO: Checking installed tools
 environment: line 311: ((: 10#15~1 > 10#3: syntax error in expression (error token is "~1 > 10#3")
 environment: line 315: ((: 10#15~1 < 10#3: syntax error in expression (error token is "~1 < 10#3")
 INFO: Checking installed development libraries
 INFO: Checking network and other services
Running "strace /opt/pkg/petalinux/2018.3/tools/common/petalinux/utils/petalinux-env-check" shows the unexpected error-like messages occuring just after some test opens of bash related files (until one was found to exist), followed by what appears to be an attempted read of a now known not to exist file before the unexpected messages i.e.
 openat(AT_FDCWD, "/usr/share/locale/en_AU/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
 openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
 openat(AT_FDCWD, "/usr/share/locale-langpack/en_AU/LC_MESSAGES/bash.mo", O_RDONLY) = 3
 fstat(3, {st_mode=S_IFREG|0644, st_size=4228, ...}) = 0
 mmap(NULL, 4228, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8578c23000
 close(3)                                = 0
 openat(AT_FDCWD, "/usr/share/locale-langpack/en/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
 fstat(2, {st_mode=S_IFREG|0664, st_size=109446, ...}) = 0
 write(2, "environment: line 311: ((: 10#15"..., 99environment: line 311: ((: 10#15~1 > 10#3: syntax error in expression (error token is "~1 > 10#3")
) = 99
 write(2, "environment: line 315: ((: 10#15"..., 99environment: line 315: ((: 10#15~1 < 10#3: syntax error in expression (error token is "~1 < 10#3")
) = 99
Maybe this will help with petalinux-env-check.
0 Kudos
Highlighted
Moderator
Moderator
5,044 Views
Registered: ‎04-24-2017

2018.1 PetaLinux supported OS:
- Red Hat Enterprise Workstation/Server 7.2, 7.3, 7.4 (64-bit)
- CentOS 7.2, 7.3, 7.4 (64-bit)
- Ubuntu Linux 16.04.3 (64-bit)

For more details refer UG1144

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Visitor
Visitor
4,741 Views
Registered: ‎11-06-2014

Just to say thank you.

 

This is also the solution for installing petaLinux 2018.3 in ubuntu 18.04, and cause of "Failed to source bitbake".

0 Kudos
Highlighted
Visitor
Visitor
4,105 Views
Registered: ‎06-06-2018

I can confirm that the well described install problem is an issue with the combination PetaLinux 2018.3 / Debian 9.6 too.

The sed workaround does the job here as well.

Many thanks for sharing this!

 

0 Kudos
Highlighted
Visitor
Visitor
3,865 Views
Registered: ‎12-22-2018


@cdsteinkuehler wrote:

PetaLinux 2018.1 install fails on a standard Debian Stretch system.  The install scripts appear to be relying on incorrect behavior by the shell (verified on Ubuntu 14.04.5).

When installing, things seem to go well, but there are three error messages printed:

environment: line 277: locked_signs: bad array subscript

...and only the aarch64 tools are installed to the correct place.  This appears to be a problem with the script passed as an argument to the petalinux-install command.  Digging through the code, the locked_signs error is caused because the dest[] array is not fully populated.  The code in question is:

yocto_sdk="${PLNXINSTALLDIR}/tools/yocto-esdk"
dest_dir="${PLNXINSTALLDIR}/components/yocto/source"
inst_scripts=($(ls "${yocto_sdk}"/petalinux-glibc-x86_64-petalinux-image-minimal-*.sh)) # All valid sdk installer scripts.
read -a dest <<< $(ls "${yocto_sdk}"/petalinux-glibc-x86_64-petalinux-image-minimal-*.sh | sed -e "s/^.*minimal-\(.*\)-toolchain.*/\1/")
The problem is the "ls | sed" command sequence in the last line generates a multi-line response while the bash read builtin only reads a single line (per: https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html#index-read).  I added a wrapper around sed that translates the newlines generated into spaces and the installer completed as expected on an otherwise stock Debian stretch install.
 
The simple sed shim is attached for reference, just drop copy it to /usr/local/bin/sed before running the PetaLinux installer (and move or rename it when you're done).

I followed sed fix and  ran petalinux installer. Installation still failed. and it seemed to have cleared everything in /usr/bin/local directory including sed. Its not clear what all was in thislocation and what all broke. Can someone help in how to rrrrrrrrrrrrrrrrrrestore 

0 Kudos