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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
1,522 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).
6 Replies
Newbie n3vu0r
Newbie
1,455 Views
Registered: ‎07-09-2018

Re: PetaLinux 2018.1 Install Fails on Debian Stretch

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.

Visitor vladdino
Visitor
1,188 Views
Registered: ‎07-26-2018

Re: PetaLinux 2018.1 Install Fails on Debian Stretch and Fedora 28

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

Observer rdrehmel
Observer
674 Views
Registered: ‎11-10-2016

Re: PetaLinux 2018.1 Install Fails on Debian Stretch and Fedora 28


@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.

Visitor pmusumeci
Visitor
624 Views
Registered: ‎11-12-2018

Re: PetaLinux 2018.1 Install Fails on Debian Stretch and Fedora 28

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
Moderator
Moderator
603 Views
Registered: ‎04-24-2017

Re: PetaLinux 2018.1 Install Fails on Debian Stretch and Fedora 28

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.
---------------------------------------------------------------------------
0 Kudos
Visitor boyangdu
Visitor
300 Views
Registered: ‎11-06-2014

Re: PetaLinux 2018.1 Install Fails on Debian Stretch

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