Failed to build read-only-rootfs image for imx6qsabreauto

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Failed to build read-only-rootfs image for imx6qsabreauto

6,550 Views
csoapy
Contributor III

bitbake core-image-minimal successfully by following steps in README.

But after adding this line to local.conf

EXTRA_IMAGE_FEATURES += "read-only-rootfs"

 and bitbake again, I got error:

ERROR: core-image-minimal-1.0-r0 do_rootfs: The following packages could not be configured offline and rootfs is read-only: ['100-initscripts']
ERROR: core-image-minimal-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: .../fsl-release-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/log.do_rootfs.21691
ERROR: Task 9 (.../fsl-release-bsp/sources/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'

Saying "100-initscripts" package cause the error, but after checking package list by

bitbake -g core-image-minimal && cat pn-depends.dot | grep -v -e '-native' | grep -v digraph | grep -v -e '-image' | awk '{print $1}' | sort | uniq

there is only initscripts shown, not the "100-initscripts"

So, why there is "100-" before package name?

I find some writing commands in initscripts_1.0.bb, maybe that's the cause of do_rootfs error, but why? Are there some steps I missed?

And BTW, how to set "ROOTFS_READ_ONLY=yes" in /etc/default/rcS before bitbake?

Thx!

Labels (2)
Tags (1)
0 Kudos
6 Replies

4,198 Views
kobusg
Contributor I

Experienced the same issue on my build (using krogoth).
inside meta-fsl-bsp-release, there's a initscripts_%.bbappend thats breaking things. 

Its has a pkg_postinst scritp trying to create a symlink under /etc/systemd/... but on non-systemd based images, this fails as the dir doesn't exist. This failure flags the initscripts recipe's pkg_postinst script for execution upon first boot, which is not allowed for read-only.

I fixed this with my own bbappend: 

pkg_postinst_${PN}_append_mx6 () {
   if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
      ln -s /lib/systemd/system/gpuload.service /etc/systemd/system/multi-user.target.wants/
   fi
}

the if statement blocks the failing line from executing on non-systemd based images.  

0 Kudos

4,198 Views
jimmychan
NXP TechSupport
NXP TechSupport

can you attach the log file here? (log.do_rootfs.21691)

0 Kudos

4,198 Views
csoapy
Contributor III

OK, here is the log:

DEBUG: Executing python function do_rootfs
NOTE: configuring RPM platform settings
NOTE: configuring RPM system provides
NOTE: configuring RPM DB settings
NOTE: configuring Smart settings
NOTE: Note: adding Smart channel imx6qsabreauto (70)
NOTE: Note: adding Smart channel cortexa9hf_neon_mx6qdl (65)
NOTE: Note: adding Smart channel cortexa9hf_neon (60)
NOTE: Note: adding Smart channel all (55)
NOTE: adding Smart RPM DB channel
NOTE: Note: configuring RPM cross-install scriptlet_wrapper
NOTE: ###### Generate rootfs #######
NOTE: Executing '/home/yang/elinux/fsl-release-bsp/build-fb/tmp/sysroots/x86_64-linux/usr/bin/createrepo --dbpath /home/yang/elinux/fsl-release-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/core-image-minimal/1.0-r0/rpmdb/all --update -q /home/yang/elinux/fsl-release-bsp/build-fb/tmp/deploy/rpm/all' ...
NOTE: Executing '/home/yang/elinux/fsl-release-bsp/build-fb/tmp/sysroots/x86_64-linux/usr/bin/createrepo --dbpath /home/yang/elinux/fsl-release-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/core-image-minimal/1.0-r0/rpmdb/cortexa9hf_neon --update -q /home/yang/elinux/fsl-release-bsp/build-fb/tmp/deploy/rpm/cortexa9hf_neon' ...
NOTE: Executing '/home/yang/elinux/fsl-release-bsp/build-fb/tmp/sysroots/x86_64-linux/usr/bin/createrepo --dbpath /home/yang/elinux/fsl-release-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/core-image-minimal/1.0-r0/rpmdb/x86_64_nativesdk --update -q /home/yang/elinux/fsl-release-bsp/build-fb/tmp/deploy/rpm/x86_64_nativesdk' ...
NOTE: Executing '/home/yang/elinux/fsl-release-bsp/build-fb/tmp/sysroots/x86_64-linux/usr/bin/createrepo --dbpath /home/yang/elinux/fsl-release-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/core-image-minimal/1.0-r0/rpmdb/imx6qsabreauto --update -q /home/yang/elinux/fsl-release-bsp/build-fb/tmp/deploy/rpm/imx6qsabreauto' ...
NOTE: Executing '/home/yang/elinux/fsl-release-bsp/build-fb/tmp/sysroots/x86_64-linux/usr/bin/createrepo --dbpath /home/yang/elinux/fsl-release-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/core-image-minimal/1.0-r0/rpmdb/cortexa9hf_neon_mx6qdl --update -q /home/yang/elinux/fsl-release-bsp/build-fb/tmp/deploy/rpm/cortexa9hf_neon_mx6qdl' ...
NOTE: Installing the following packages: run-postinsts libgles2-mx6 packagegroup-core-boot libstdc++6 daemontools alsa-utils-aplay
NOTE: to be installed: run-postinsts@all libgles2-mx6@cortexa9hf_neon_mx6qdl packagegroup-core-boot@imx6qsabreauto libstdc++6@cortexa9hf_neon daemontools@cortexa9hf_neon alsa-utils-aplay@cortexa9hf_neon
NOTE: /home/yang/elinux/fsl-release-bsp/build-fb/tmp/sysroots/x86_64-linux/usr/bin/smart --log-level=warning --data-dir=/home/yang/elinux/fsl-release-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/core-image-minimal/1.0-r0/rootfs/var/lib/smart install -y run-postinsts@all libgles2-mx6@cortexa9hf_neon_mx6qdl packagegroup-core-boot@imx6qsabreauto libstdc++6@cortexa9hf_neon daemontools@cortexa9hf_neon alsa-utils-aplay@cortexa9hf_neon
NOTE: Loading cache...
Updating cache... ######################################## [100%]

Computing transaction... Committing transaction...
Preparing... ######################################## [ 0%]
1:Installing alsa-conf ######################################## [ 2%]
2:Installing libc6 ######################################## [ 4%]
3:Installing alsa-conf-base ######################################## [ 6%]
4:Installing ncurses-termi.. ######################################## [ 9%]
5:Installing netbase ######################################## [ 11%]
6:Installing busybox ######################################## [ 13%]
7:Installing update-altern.. ######################################## [ 15%]
8:Installing bash ######################################## [ 18%]
9:Installing libtinfo5 ######################################## [ 20%]
10:Installing sysvinit-pidof ######################################## [ 22%]
11:Installing busybox-hwclock ######################################## [ 25%]
12:Installing init-ifupdown ######################################## [ 27%]
13:Installing kernel-image-.. ######################################## [ 29%]
14:Installing sysvinit-init.. ######################################## [ 31%]
15:Installing busybox-syslog ######################################## [ 34%]
16:Installing libasound2 ######################################## [ 36%]
17:Installing base-files ######################################## [ 38%]
18:Installing busybox-udhcpc ######################################## [ 40%]
19:Installing daemontools ######################################## [ 43%]
20:Installing udev-cache ######################################## [ 45%]
21:Installing run-postinsts ######################################## [ 47%]
22:Installing libuuid1 ######################################## [ 50%]
23:Installing modutils-init.. ######################################## [ 52%]
24:Installing libgcc1 ######################################## [ 54%]
25:Installing base-passwd ######################################## [ 56%]
26:Installing libz1 ######################################## [ 59%]
27:Installing initscripts-f.. ######################################## [ 61%]
28:Installing update-rc.d ######################################## [ 63%]
29:Installing kernel-4.1.15.. ######################################## [ 65%]
30:Installing alsa-utils-ap.. ######################################## [ 68%]
31:Installing libblkid1 ######################################## [ 70%]
32:Installing libstdc++6 ######################################## [ 72%]
33:Installing libkmod2 ######################################## [ 75%]
34:Installing sysvinit ######################################## [ 77%]
35:Installing initscripts ######################################## [ 79%]
36:Installing kernel-module.. ######################################## [ 81%]
37:Installing eudev ######################################## [ 84%]
38:Installing kernel-module.. ######################################## [ 86%]
39:Installing packagegroup-.. ######################################## [ 88%]
40:Installing libgal-mx6 ######################################## [ 90%]
41:Installing libvsc-mx6 ######################################## [ 93%]
42:Installing libegl-mx6 ######################################## [ 95%]
43:Installing libglslc-mx6 ######################################## [ 97%]
44:Installing libgles2-mx6 ######################################## [100%]


Installing packages (44):
alsa-conf libegl-mx6
alsa-conf-base libgal-mx6
alsa-utils-aplay libgcc1
base-files libgles2-mx6
base-passwd libglslc-mx6
bash libkmod2
busybox libstdc++6
busybox-hwclock libtinfo5
busybox-syslog libuuid1
busybox-udhcpc libvsc-mx6
daemontools libz1
eudev modutils-initscripts
init-ifupdown ncurses-terminfo-base
initscripts netbase
initscripts-functions packagegroup-core-boot
kernel-4.1.15+g34a4564 run-postinsts
kernel-image-4.1.15+g34a4564 sysvinit
kernel-module-galcore sysvinit-inittab
kernel-module-imx-gpu-viv sysvinit-pidof
libasound2 udev-cache
libblkid1 update-alternatives-opkg
libc6 update-rc.d

16.0MB of package files are needed. 28.7MB will be used.


NOTE: There are no packages to install
NOTE: Installing complementary packages ...
NOTE: Running ['/home/yang/elinux/fsl-release-bsp/sources/poky/scripts/oe-pkgdata-util', '-p', '/home/yang/elinux/fsl-release-bsp/build-fb/tmp/sysroots/imx6qsabreauto/pkgdata', 'glob', '/home/yang/elinux/fsl-release-bsp/build-fb/tmp/work/imx6qsabreauto-poky-linux-gnueabi/core-image-minimal/1.0-r0/installed_pkgs.txt', '']
NOTE: There are no packages to install
NOTE: Running intercept scripts:
NOTE: Executing write_package_manifest ...
DEBUG: Executing python function write_package_manifest
DEBUG: Python function write_package_manifest finished
NOTE: Executing license_create_manifest ...
DEBUG: Executing python function license_create_manifest
DEBUG: Python function license_create_manifest finished
NOTE: Executing ssh_allow_empty_password ...
DEBUG: Executing shell function ssh_allow_empty_password
DEBUG: Shell function ssh_allow_empty_password finished
NOTE: Executing postinst_enable_logging ...
DEBUG: Executing shell function postinst_enable_logging
DEBUG: Shell function postinst_enable_logging finished
NOTE: Executing rootfs_update_timestamp ...
DEBUG: Executing shell function rootfs_update_timestamp
DEBUG: Shell function rootfs_update_timestamp finished
NOTE: Executing read_only_rootfs_hook ...
DEBUG: Executing shell function read_only_rootfs_hook
DEBUG: Shell function read_only_rootfs_hook finished
NOTE: Executing empty_var_volatile ...
DEBUG: Executing shell function empty_var_volatile
DEBUG: Shell function empty_var_volatile finished
NOTE: Delayed package scriptlet: 100-initscripts
ERROR: The following packages could not be configured offline and rootfs is read-only: ['100-initscripts']
DEBUG: Python function do_rootfs finished
ERROR: Function failed: do_rootfs

0 Kudos

4,198 Views
jimmychan
NXP TechSupport
NXP TechSupport

I tried on my BSP build. I didn't meet this error.

my steps:

1.install the fsl-yocto 4.1.15 BSP

2. build the core-image-minimal  (I want to make sure the default setup build is ok)

3. add EXTRA_IMAGE_FEATURES += "read-only-rootfs" in local.conf

4. build the core-image-minimal again.

0 Kudos

4,198 Views
csoapy
Contributor III

jimmychan‌,

I have tested this as following:

  1. Ubuntu 16.04.4 in VirtualBox 5.2.12 on last Windows 10
  2. Ubuntu 14.04.5 in VirtualBox 5.2.12 on last Windows 10
  3. Ubuntu 16.04.5 in VirtualBox 5.2.12 on last Windows 7
  4. KDE Neon User Edition(based on Ubuntu 16.04) in VirtualBox 5.2.12 on last Windows 7

But the error still exists.

So what's your test environment? 

0 Kudos

4,198 Views
jimmychan
NXP TechSupport
NXP TechSupport

Ubuntu 14.04.5 LTS

0 Kudos