Analysis of warning: %post(sysvinit-inittab-2.88dsf-r10.zcu102_zynqmp) scriptlet failed




This post analyzes the warning message seen when running petalinux-build on a ZCU102 on release 2018.2 it comes to a conclusion that differs from Xilinx's.


Warning


WARNING: petalinux-user-image-1.0-r0 do_rootfs: [log_check] petalinux-user-image: found 1 warning message in the logfile:

[log_check] warning: %post(sysvinit-inittab-2.88dsf-r10.zcu102_zynqmp) scriptlet failed, exit status 1


Xilinx's Answer Record


Xilinx lists the following info in an Answer Record (AR) at [link]:

The post install scripts are deferred for the first run on target. These warnings can be ignored.


Further investigation


1. Get the recipe (petalinux-user-image-1.0-r0) and task (do_rootfs) from the message above or from typing grep warning ./build/build.log


2. Find log.task_order by typing find . -name "log.task_order" | grep petalinux-user-image to get all the tasks run:

3. Look at the file to get the specific log by typing cat build/tmp/work/zcu102_zynqmp-xilinx-linux/petalinux-user-image/1.0-r0/temp/log.task_order

4. Open the file and search for "warning" you'll see:

This is an error related to installing an RPM package. Type find . -name "sysvinit-inittab-2.88dsf-r10*" to find the RPM: ./build/tmp/deploy/rpm/zcu102_zynqmp/sysvinit-inittab-2.88dsf-r10.zcu102_zynqmp.rpm


5. Type sudo apt install rpm


6. Type rpm -qp --scripts ./build/tmp/deploy/rpm/zcu102_zynqmp/sysvinit-inittab-2.88dsf-r10.zcu102_zynqmp.rpm


You'll see:


7. Type find . -name "petalinux-user-image*.bb" to locate the petalinux-user-image-1.0-r0.bb recipe:

8. The file contains:

Which roughly corresponds to lines like this in build/tmp/work/zcu102_zynqmp-xilinx-linux/petalinux-user-image/1.0-r0/temp/log.do_rootfs


9. recipes-core/images/petalinux-image-common.inc is located in the PetaLinux Tools install directory: /opt/pkg/petalinux

Note 1: all of these files are the same

Note 2: this may be an indication of inefficiencies in the build system


10. In petalinux-image-common.inc the core-image class is inherited:

11. Back to build/tmp/work/zcu102_zynqmp-xilinx-linux/petalinux-user-image/1.0-r0/temp/log.do_rootfs:


At the top of the file is DEBUG: Executing python function extend_recipe_sysroot

The DEBUG: Executing python before the warning is do_rootfs. This implies that the environment that the scriptlet executes in may be built by the do_sysroot Python function:


12. Back to rpm -qp --scripts ./build/tmp/deploy/rpm/zcu102_zynqmp/sysvinit-inittab-2.88dsf-r10.zcu102_zynqmp.rpm


A break down of this script:


Path 1

if $D is empty and /proc/consoles exists then

for 115200;ttyPS0 and 11520;hvc0

set j to ttyPS0 for 115200;ttyPS0 then set j to hvc0 for 11520;hvc0 on the next iteration

set k to 115200;ttyPS0 then set k to11520;hvc0 on the next iteration

if ttyPS0 (or hvc0) isn't in /proc/consoles then

if k is null or k isn't in /proc/consoles or there doesn't exist /dev/ttyPS0 or /dev/hvc0

then edit /etc/inittab in place and delete ttyPS0 or hv0 if it exists at all

i.e. if the console device doesn't exist in the system, don't use it in /etc/inittab

if $D is empty and /proc/consoles exists then restart init and re-read /etc/inittab


Path 2

if /proc/consoles doesn't exist then return 1, which is what we see.


13. What inittab is installed into the rootfs?


There are 8 inittab files:

Note 1: all of the sysvinit-inittab/inittab files are the same

Note 2: all of the files/inittab are the same


In both sysvinit-inittab/inittab and files/inittab there is no console mentioned.



Conclusion


Xilinx listed: The post install scripts are deferred for the first run on target. These warnings can be ignored.


...but based on my analysis, this is not accurate. The scriptlet appears to only run at the point the RPM is installed; this means that the scriptlet is not "deferred" for the first run of the target, its never run.


Assuming the analysis is correct, the warning can still be ignored in this case because the inittabs in the 2018.2 PetaLinux Tools release doesn't contains any consoles.



References

©2018 by Centennial Software Solutions LLC. Proudly created with Wix.com