08-08-2017 10:19 PM
WARNING
A bug in petalinux-config will delete the entire petalinux project directory instantly. Let this be a warning to all of us to make sure we're using source control and checking in often.
If the petalinux tools cannot find the intended hw-description directory, they will issue something like an "rm -rf *" in the CURRENT WORKING DIRECTORY which wipes out all of your work.
This is petalinux 2017.2. During an experiment (to force an update and try to work around another bug, for another post) I moved the hw-description directory. Here's what happened next:
tactical@tactical-VirtualBox:~/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/project-spec$ mv hw-description/ hw-description.old tactical@tactical-VirtualBox:~/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/project-spec$ cd .. tactical@tactical-VirtualBox:~/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1$ petalinux-config --get-hw-description ../../trp-0043-workspace/hw/system.sdk/ --oldconfig INFO: Getting hardware description... petalinux-config: line 357: pushd: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/project-spec/hw-description/: No such file or directory INFO: Rename system_wrapper.hdf to system.hdf petalinux-config: line 362: popd: directory stack empty [INFO] generating Kconfig for project ERROR: Hardware description file "/home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/project-spec/hw-description/system.hdf" doesn't exist. ERROR: Failed to generate /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/build/misc/config/Kconfig.syshw ERROR: Failed to Kconfig project petalinux-yocto: line 404: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/.petalinux/usage_statistics_token: No such file or directory cat: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/.petalinux/usage_statistics_token: No such file or directory petalinux-yocto: line 404: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/.petalinux/usage_statistics_token: No such file or directory cat: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/.petalinux/usage_statistics_token: No such file or directory ERROR: Failed to generate System hardware Kconfig file. petalinux-config: line 95: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/.petalinux/usage_statistics_token: No such file or directory cat: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/.petalinux/usage_statistics_token: No such file or directory ^Cpetalinux-config: line 95: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/.petalinux/usage_statistics_token: No such file or directory cat: /home/tactical/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1/.petalinux/usage_statistics_token: No such file or directory ^Ctactical@tactical-VirtualBox:~/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1$ ls build system.hdf tactical@tactical-VirtualBox:~/projects/zcu102/zcu102-vivado-petalinux-scratch-2017.1$ ls -l total 7984 drwxrwxr-x 3 tactical tactical 4096 Aug 9 14:43 build -rw-rw-r-- 1 tactical tactical 8169835 Aug 9 14:43 system.hdf
Note the ^C ^C, but it was too late. Days of work gone.
I know error handling in tcl and shell scripting isn't easy but PLEASE FIX this. If a script encounters an error please abort immediately and do not issue dangerous commands like rm in a detectable error state!
08-16-2017 03:37 AM
Hi
Thanks for catching up the issue.
We will check to see if we can make this as a warning. Till then, what we recommend is to create an empty folder with hw-description instead of renaming.
Also, may I know what exactly you are trying to acheive by removing this?
Best Regards
Shabbir
08-16-2017 01:40 PM
08-22-2017 10:03 PM
@shabbirk I had a design which included an AXI interrupt controller. Importing this design into petalinux broke the generation of the xparameters.h file (it terminated half way through, as the generating process terminated unexpectedly) which broke the fsbl and pmu builds. It was not being regenerated after removing the block from hardware, so I was trying to force a complete BSP update including fsbl and pmu fw.
I'll make a new thread for that as I believe it's a bug.
Leigh
02-04-2018 04:57 AM - edited 02-04-2018 05:04 AM
@sandeepg, @lcameron can you please clarify the exact issue here?
I'm not following this completely ... : is the issue that when you run petalinux-config --get_hw_description, and you enter a wrong path to the .hdf file, the complete petalinux folder gets deleted?
also, what does the option --old-config exactly do? Does it keep any manual modifications to the config / kernel-config / ... you did with the previous .hdf? So if you omit the --old-config, all your manual work is gone too?
02-06-2018 08:18 PM
Hi @ronnywebers,
Can you provide more details on this. Are you specifying the path where you don't hdf ?
The --oldconfig option allows you to parse the edited config file onto Kconfig, so that it can pull the dependencies.
02-07-2018 12:53 AM - edited 02-07-2018 12:53 AM
I was probably not clear in my question, sorry :
I was just wondering if I understood the initial question from @lcameron correctly, that if you give a wrong path to the .hdf file, and thus petalinux does not find a .hdf, that it just wipes out the entire project with this command :
petalinux-config --get-hw-description ./wrong_path_to_hdf/
or even with :
petalinux-config --get-hw-description ./wrong_path_to_hdf/ --oldconfig
regarding my second question :
so --oldconfig does not create a new KCONFIG file, but uses the existing one as is? And omitting --oldconfig just wipes out the existing KCONFIG file, and regenerates it based on the .hdf info ?
05-15-2019 02:10 PM
I was just bitten by this bug and I extremely upset.
I was changing that target hardware platform, and I was having trouble with the new platform in petalinux, so I deleted the hw-description directory. Now, all my !@#$ is gone.
11-20-2019 01:00 PM
I am seeing something similar in 2019.1, only it only removes the project-spec directory. Annoying, but not as bad.
11-20-2019 03:36 PM
Hi @eliezer ,
In 2019.1 we removed --oldconfig as this was contradicting with open source make oldconfig hence it was renamed as silientconfig.
In terms of opensource --oldconfig: Update current kernel configurations with your .config file and prompting for any new options that have been added to the kernel.
Silentconfig is used to configure the hdf parsing without GUI option.
Make sure you read 2019.1 petalinux docs(UG1144) and 2019.1 release notes AR https://www.xilinx.com/support/answers/72293.html
11-20-2019 03:40 PM
Yeah I had copied my project-spec from a 2018 project, once I created it normally I no longer had this issue.