AnsweredAssumed Answered

How to change init.d rc boot files for fsl-image-kernelitb?

Question asked by pro-supportengineer Employee on May 22, 2016
Latest reply on May 25, 2016 by pro-supportengineer

How do customers add a binary file to init.d for fsl-image-kernelitb for the ls1043 and how does a customer modify the init.d recipe for fsl-image-kernelitb to execute the binary at boot time?  The fsl-image-kenrelitb uses the fsl-core-image rootfs by default. Need to add a binary to sbin and/or preferably etc to execute at boot time as a quick hack to check boot performance and modify run levels for the binary.

 

When I modify poky/meta/recipes-core/initscripts/initscripts_1.0.bb and add a binary, the binary gets added to aarch64-fsl-linux/image/etc/eos.  It never gets copied to the rootfs for the fsl-image-kernelitb bitbake.  What is the equivalent recipe for the ls1043. Please answer with more than one or two sentences to avoid wasting time.  Clear explanation and no links to yocto documentation please.

 

I modified the initscripts_1.0.bb recipe in poky/meta/recipes-core/initscripts provided below and then placed the binary "eos" under initscripts-1.0/eos.  I then did the fsl-image-kernelitb bitbake.  The bitbake does a bake of aarch64-fsl-linux and eos the binary is moved to packages-split/initscripts/etc/init.d/eos and images/etc/init.d/eos as shown.  But it does not get packaged in rootfs under ls1043ardb-fsl-linux or under core or anywhere else. 

 

First, it’s unclear how to add a binary to the correct recipes for rootfs /etc/init.d for the fsl-image-kernelitb bitbake that uses core as the default. Second, it is unclear what to modify to get eos to execute at boot time for fsl-image-kernelitb if the image only appears under aarch64-fsl-linux.  Any assistance will help.  I provide the modified initscripts_1.0.bb recipe below and the directories where the eos binary is copied.

 

The bitbake command I used: bitbake fsl-image-kernelitb

 

Placed the binary in this directory and modified the initscripts_1.0.bb recipe as shown below:


./poky/meta/recipes-core/initscripts/initscripts-1.0/eos

 

Then on doing the bitbake, the eos binary was copied to these locations:

 

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/eos

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/packages-split/initscripts/etc/rcS.d/S96eos

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/packages-split/initscripts/etc/init.d/.debug/eos

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/packages-split/initscripts/etc/init.d/eos

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/image/etc/rcS.d/S96eos

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/image/etc/init.d/eos

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/package/etc/rcS.d/S96eos

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/package/etc/init.d/.debug/eos

./build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/package/etc/init.d/eos

 

The initscripts_1.0.bb file:

 

Located here: Linux-LS1043A-SDK-V0.5-20151223-yocto/poky/meta/recipes-core/initscripts/initscripts_1.0.bb

 

SUMMARY = "SysVinit scripts"
DESCRIPTION = "Initscripts provide the basic system startup initialization scripts for the system.  These scripts include actions such as filesystem mounting, fsck, RTC manipulation and other actions routinely performed at system startup.  In addition, the scripts are also used during system shutdown to reverse the actions performed at startup."
SECTION = "base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
PR = "r155"
INHIBIT_DEFAULT_DEPS= "1"
SRC_URI = "file://functions\
           file://halt \
           file://umountfs \
           file://devpts.sh \
           file://devpts \
           file://hostname.sh\
           file://mountall.sh\
           file://banner.sh \
           file://bootmisc.sh\
           file://mountnfs.sh\
           file://reboot \
           file://checkfs.sh\
           file://single \
           file://sendsigs
           file://urandom \
           file://rmnologin.sh \
           file://checkroot.sh\  
           file://umountnfs.sh \
           file://sysfs.sh \        
           file://populate-volatile.sh \    
           file://read-only-rootfs-hook.sh \
           file://volatiles \
           file://save-rtc.sh\
           file://GPLv2.patc\
           file://dmesg.sh \
           file://eos \    
           file://logrotate-dmesg.conf \

"

.

.

.

do_install () {

#

# Create directories and install device independent scripts

#

......
install -m 0755   ${WORKDIR}/eos ${D}${sysconfdir}/init.d


#

# Create runlevel links

#

# Run eos and change start sequence as needed

update-rc.d -r ${D} eos start 96 S .

... Rest is original .bb file.

}

 

When doing a bitbake of the fsl-image-core, I receive the following errors:

 

setup-poky -m ls1043ardb

/home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release was created before.

Back to build project /home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release.

Modify files under /home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release/conf/ to update.

tlsmith@Latitude-E7440:~/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release$ bitbake fsl-image-core

Loading cache: 100% |###########################################| ETA:  00:00:00

Loaded 2028 entries from dependency cache.

Parsing recipes: 100% |#########################################| Time: 00:00:00

Parsing of 1573 .bb files complete (1572 cached, 1 parsed). 2028 targets, 126 skipped, 2 masked, 0 errors.

NOTE: Resolving any missing task queue dependencies

 

Build Configuration:

BB_VERSION        = "1.22.0"

BUILD_SYS         = "x86_64-linux"

NATIVELSBSTRING   = "Ubuntu-14.04"

TARGET_SYS        = "aarch64-fsl-linux"

MACHINE           = "ls1043ardb"

DISTRO            = "fsl-networking"

DISTRO_VERSION    = "1.6.1"

TUNE_FEATURES     = "aarch64"

meta       

meta-yocto 

meta-yocto-bsp    = "(detachedfrom65a7a85):error:"

meta-fsl-arm      = "(detachedfrom05f1748):error:"

meta-fsl-networking = "(detachedfromae11e55):error:"

meta-fsl-testing  = "(detachedfromfff2c5f):fff2c5fab98f29034d718c210a493fffb33ef142"

meta-fsl-toolchain

meta-virtualization = "<unknown>:<unknown>"

meta-oe    

meta-networking

meta-perl  

meta-webserver

toolchain-layer   = "(detachedfrom4203436):error:"

meta-linaro-toolchain = "(detachedfrom6452ef4):error:"

 

NOTE: Preparing runqueue

NOTE: Executing SetScene Tasks

NOTE: Executing RunQueue Tasks

ERROR: QA Issue: non debug package contains .debug directory: initscripts path /work/aarch64-fsl-linux/initscripts/1.0-r155/packages-split/initscripts/etc/init.d/.debug/eos

ERROR: QA run found fatal errors. Please consider fixing them.

ERROR: Function failed: do_package_qa

ERROR: Logfile of failure stored in: /home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/temp/log.do_package.3238

ERROR: Task 964 (/home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/poky/meta/recipes-core/initscripts/initscripts_1.0.bb, do_package) failed with exit code '1'

NOTE: Tasks Summary: Attempted 1397 tasks of which 1393 didn't need to be rerun and 1 failed.

Waiting for 0 running tasks to finish:

 

Summary: 1 task failed:

  /home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/poky/meta/recipes-core/initscripts/initscripts_1.0.bb, do_package

Summary: There were 3 ERROR messages shown, returning a non-zero exit code.

tlsmith@Latitude-E7440:~/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release$ bitbake fsl-image-core

Loading cache: 100% |###########################################| ETA:  00:00:00

Loaded 2028 entries from dependency cache.

Parsing recipes: 100% |#########################################| Time: 00:00:00

Parsing of 1573 .bb files complete (1572 cached, 1 parsed). 2028 targets, 126 skipped, 2 masked, 0 errors.

 

The log.do_package.3238 contains the following:

 

DEBUG: Executing python function sstate_task_prefunc

DEBUG: Python function sstate_task_prefunc finished

DEBUG: Executing python function do_package

DEBUG: Executing python function package_get_auto_pr

DEBUG: Python function package_get_auto_pr finished

DEBUG: Executing python function perform_packagecopy

NOTE: initscripts: Rename /etc/init.d/functions -> /etc/init.d/functions.initscripts

DEBUG: Python function perform_packagecopy finished

DEBUG: Executing python function split_and_strip_files

DEBUG: runstrip: 'aarch64-fsl-linux-strip' --remove-section=.comment --remove-section=.note '/home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/package/etc/init.d/eos'

DEBUG: Python function split_and_strip_files finished

DEBUG: Executing python function fixup_perms

DEBUG: Python function fixup_perms finished

DEBUG: Executing python function populate_packages_updatealternatives

NOTE: adding update-alternatives calls to postinst/postrm for initscripts-functions

NOTE:   update-alternatives --install /etc/init.d/functions functions /etc/init.d/functions.initscripts 90

 

NOTE:   update-alternatives --remove  functions /etc/init.d/functions.initscripts

 

DEBUG: Python function populate_packages_updatealternatives finished

DEBUG: Executing python function package_do_split_locales

DEBUG: No locale files in this package

DEBUG: Python function package_do_split_locales finished

DEBUG: Executing python function populate_packages

DEBUG: Python function populate_packages finished

DEBUG: Executing python function do_package_qa

NOTE: DO PACKAGE QA

NOTE: Checking Package: initscripts-functions

NOTE: Checking Package: initscripts-dbg

NOTE: Checking Package: initscripts-staticdev

NOTE: Checking Package: initscripts-dev

NOTE: Checking Package: initscripts-doc

NOTE: Checking Package: initscripts-locale

NOTE: Checking Package: initscripts

NOTE: aarch64-fsl-linux-objdump -p /home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/packages-split/initscripts/etc/init.d/eos

NOTE: aarch64-fsl-linux-objdump -p /home/tlsmith/Linux-LS1043A-SDK-V0.5-20151223-yocto/build_ls1043ardb_release/tmp/work/aarch64-fsl-linux/initscripts/1.0-r155/packages-split/initscripts/etc/init.d/.debug/eos

ERROR: QA Issue: non debug package contains .debug directory: initscripts path /work/aarch64-fsl-linux/initscripts/1.0-r155/packages-split/initscripts/etc/init.d/.debug/eos

ERROR: QA run found fatal errors. Please consider fixing them.

DEBUG: Python function do_package_qa finished

DEBUG: Python function do_package finished

ERROR: Function failed: do_package_qa

 

  • Why is .debug created and how can this be avoided?
  • Is this .debug error preventing the eos binary from being copied to fsl-image-core/rootfs/etc/init.d when doing a bitbake of either fsl-image-core or fsl-image-kernelitb?
  • If not, what needs to be changed to allow a new executable to be added to the init.d scripts and run for fsl-image-core and fsl-image-kernelitb when booting?

 

ls tmp/work/ls1043ardb-fsl-linux/fsl-image-core/1.0-r0/rootfs/etc/init.d/eos

ls: cannot access eos: No such file or directory

Original Attachment has been moved to: initscripts_1.0.bb.zip

Outcomes