Bug 2350

Summary: init-live-boot: CONFIG_UNION_FS changes not updated in init-live.sh
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Tom Zanussi <tom.zanussi>
Component: coreAssignee: Yang Shi <yang.shi>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: Medium CC: bruce.ashfield, dvhart, meta.mr.watcher, meta.watcher, richard.purdie, yang.shi
Version: unspecified   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Tom Zanussi 2012-04-19 19:23:28 UTC
If you turn off CONFIG_UNION_FS in the kernel, the init-live.sh doesn't get updated with UNIONFS="no", so the init script that gets installed still has the old UNIONFS="yes" setting and mounts unionfs, etc, which results in an unbootable system.

The workaround is to just force init-live-boot to be rebuilt after the kernel config change.
Comment 1 Yang Shi 2012-04-19 20:16:33 UTC
So, this is why we add virtual/kernel depend for initramfs-live-boot.

diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
index e85a0e1..f7f0c9d 100644
--- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
+++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
@@ -2,10 +2,17 @@ DESCRIPTION = "A live image init script"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 RDEPENDS = "udev"
+DEPENDS = "virtual/kernel"
 SRC_URI = "file://init-live.sh"

When I did the test, I found I need clean initramfs-live-boot, then rebuild it once kernel config is changed, it can't be rebuilt automatically.
Comment 2 Darren Hart 2012-04-19 23:16:21 UTC
Because the kernel config is in the linux-yocto/meta, bitbake won't detect the change unless the SRCREV is updated. If the SRCREV was updated and initramfs-live-boot doesn't rebuild automatically, then I think we have a bug.
Comment 3 Yang Shi 2012-04-19 23:22:14 UTC
In this usecase, I don't think changing of SRCREV is involved. The changing to kernel config is just to temporarily disable a kernel config (here it is CONFIG_UNION_FS) via "bitbake -c menuconfig linux-yocto", then rebuild kernel.
Comment 4 Darren Hart 2012-04-19 23:28:36 UTC
Bug 2256 might be related.
Comment 5 Yang Shi 2012-04-19 23:36:22 UTC
If we rebuild kernel via the steps suggested in Bug #2256, will or should any package which depends on virtual/kernel be rebuilt automatically?

In my understanding, this should be expected.
Comment 6 Bruce Ashfield 2012-04-20 03:53:08 UTC
This definitely looks to be the same as 2256 to me.
Comment 7 Richard Purdie 2012-04-22 14:36:01 UTC
I've tested this and if the sstate checksum of the kernel changes, the script does rebuild. So if you change the kernel SRCREV or add a fragment to SRC_URI it will notice and update.

Even if we fix 2256 so sstate isn't reused, we're still going to have to be careful with this since its possible to change the kernel config manually but not change the sstate checksum. At that point the user should really know what they're doing though and I'm not sure there is much we can realistically do.

I think the only option will be to shows users a big warning when they use menuconfig that the dependencies of the kernel will not rebuild automatically, they're doing something outside the normal system and are on their own.

*** This bug has been marked as a duplicate of bug 2256 ***