* kernel.bbclass: Fix various bundle_initramfs problems
@ 2013-11-22 14:04 Mike Crowe
2013-11-22 14:04 ` [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" Mike Crowe
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Mike Crowe @ 2013-11-22 14:04 UTC (permalink / raw)
To: openembedded-core
The second of these two patches fix various problems with the
bundle_initramfs feature in kernel.bbclass. The first one reverts a
recent patch which should make the history easier to follow.
Mike.
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" 2013-11-22 14:04 kernel.bbclass: Fix various bundle_initramfs problems Mike Crowe @ 2013-11-22 14:04 ` Mike Crowe 2013-11-22 15:53 ` Bruce Ashfield 2013-11-22 14:04 ` [PATCH 2/2] kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race Mike Crowe 2013-11-22 14:23 ` kernel.bbclass: Fix various bundle_initramfs problems (v2) Mike Crowe 2 siblings, 1 reply; 8+ messages in thread From: Mike Crowe @ 2013-11-22 14:04 UTC (permalink / raw) To: openembedded-core; +Cc: Mike Crowe, Mike Crowe This reverts commit 3baa63b4d588c3262254528b406ede265dd117bf. It broke builds that aren't using kernel-yocto. Signed-off-by: Mike Crowe <mcrowe@brightsign.biz> --- meta/classes/kernel.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 48999fe..ba13e67 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -152,7 +152,7 @@ python do_devshell_prepend () { os.environ["LDFLAGS"] = '' } -addtask bundle_initramfs after do_kernel_link_vmlinux before do_build +addtask bundle_initramfs after do_compile before do_build kernel_do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" 2013-11-22 14:04 ` [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" Mike Crowe @ 2013-11-22 15:53 ` Bruce Ashfield 2013-11-22 15:54 ` Bruce Ashfield 0 siblings, 1 reply; 8+ messages in thread From: Bruce Ashfield @ 2013-11-22 15:53 UTC (permalink / raw) To: Mike Crowe; +Cc: Mike Crowe, Patches and discussions about the oe-core layer On Fri, Nov 22, 2013 at 9:04 AM, Mike Crowe <mac@mcrowe.com> wrote: > This reverts commit 3baa63b4d588c3262254528b406ede265dd117bf. It broke > builds that aren't using kernel-yocto. Can we get a log message of the breakage in the commit ? And a follow up question, have we simply restored the issue that the original commit was fixing ? Bruce > > Signed-off-by: Mike Crowe <mcrowe@brightsign.biz> > --- > meta/classes/kernel.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass > index 48999fe..ba13e67 100644 > --- a/meta/classes/kernel.bbclass > +++ b/meta/classes/kernel.bbclass > @@ -152,7 +152,7 @@ python do_devshell_prepend () { > os.environ["LDFLAGS"] = '' > } > > -addtask bundle_initramfs after do_kernel_link_vmlinux before do_build > +addtask bundle_initramfs after do_compile before do_build > > kernel_do_compile() { > unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE > -- > 1.7.10.4 > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" 2013-11-22 15:53 ` Bruce Ashfield @ 2013-11-22 15:54 ` Bruce Ashfield 0 siblings, 0 replies; 8+ messages in thread From: Bruce Ashfield @ 2013-11-22 15:54 UTC (permalink / raw) To: Mike Crowe; +Cc: Mike Crowe, Patches and discussions about the oe-core layer On Fri, Nov 22, 2013 at 10:53 AM, Bruce Ashfield <bruce.ashfield@gmail.com> wrote: > On Fri, Nov 22, 2013 at 9:04 AM, Mike Crowe <mac@mcrowe.com> wrote: >> This reverts commit 3baa63b4d588c3262254528b406ede265dd117bf. It broke >> builds that aren't using kernel-yocto. > > Can we get a log message of the breakage in the commit ? And a follow up > question, have we simply restored the issue that the original commit was > fixing ? Aha. I see the other patch makes sure that we haven't re-broken anything. Cheers, Bruce > > Bruce > >> >> Signed-off-by: Mike Crowe <mcrowe@brightsign.biz> >> --- >> meta/classes/kernel.bbclass | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass >> index 48999fe..ba13e67 100644 >> --- a/meta/classes/kernel.bbclass >> +++ b/meta/classes/kernel.bbclass >> @@ -152,7 +152,7 @@ python do_devshell_prepend () { >> os.environ["LDFLAGS"] = '' >> } >> >> -addtask bundle_initramfs after do_kernel_link_vmlinux before do_build >> +addtask bundle_initramfs after do_compile before do_build >> >> kernel_do_compile() { >> unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE >> -- >> 1.7.10.4 >> >> _______________________________________________ >> Openembedded-core mailing list >> Openembedded-core@lists.openembedded.org >> http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > > -- > "Thou shalt not follow the NULL pointer, for chaos and madness await > thee at its end" -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race 2013-11-22 14:04 kernel.bbclass: Fix various bundle_initramfs problems Mike Crowe 2013-11-22 14:04 ` [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" Mike Crowe @ 2013-11-22 14:04 ` Mike Crowe 2013-11-22 14:23 ` kernel.bbclass: Fix various bundle_initramfs problems (v2) Mike Crowe 2 siblings, 0 replies; 8+ messages in thread From: Mike Crowe @ 2013-11-22 14:04 UTC (permalink / raw) To: openembedded-core; +Cc: Mike Crowe, Mike Crowe The new do_bundle_initramfs task defeats using the sstate cache. The kernel is resurrected from the sstate cache but ends up being built again since do_bundle_initramfs depends on do_compile. The do_bundle_initramfs task is also marked nostamp which means it will always run. The plan is to run do_bundle_initramfs before do_deploy and then move the code to update the deploy directory to do_deploy but make it write to ${DEPLOYDIR} rather then ${DEPLOY_DIR_IMAGE}. do_bundle_initramfs can also race against do_install since both call into the kernel build system. This is fixed by making do_bundle_initramfs run after do_install (and this therefore also fixes the problem that 3baa63b4d588c3262254528b406ede265dd117bf was addressing.) Signed-off-by: Mike Crowe <mcrowe@brightsign.biz> --- meta/classes/kernel.bbclass | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index ba13e67..4974507 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -134,25 +134,14 @@ do_bundle_initramfs () { echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs" install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin echo "${B}/${KERNEL_OUTPUT}.initramfs" - cd ${B} - # Update deploy directory - if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then - echo "Copying deploy kernel-initramfs image and setting up links..." - initramfs_base_name=${INITRAMFS_BASE_NAME} - initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE} - install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOY_DIR_IMAGE}/${initramfs_base_name}.bin - cd ${DEPLOY_DIR_IMAGE} - ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin - fi fi } -do_bundle_initramfs[nostamp] = "1" python do_devshell_prepend () { os.environ["LDFLAGS"] = '' } -addtask bundle_initramfs after do_compile before do_build +addtask bundle_initramfs after do_install before do_deploy kernel_do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE @@ -479,6 +468,17 @@ kernel_do_deploy() { ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE} cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt + + cd ${B} + # Update deploy directory + if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then + echo "Copying deploy kernel-initramfs image and setting up links..." + initramfs_base_name=${INITRAMFS_BASE_NAME} + initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE} + install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin + cd ${DEPLOYDIR} + ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin + fi } do_deploy[dirs] = "${DEPLOYDIR} ${B}" do_deploy[prefuncs] += "package_get_auto_pr" -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* kernel.bbclass: Fix various bundle_initramfs problems (v2) 2013-11-22 14:04 kernel.bbclass: Fix various bundle_initramfs problems Mike Crowe 2013-11-22 14:04 ` [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" Mike Crowe 2013-11-22 14:04 ` [PATCH 2/2] kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race Mike Crowe @ 2013-11-22 14:23 ` Mike Crowe 2013-11-22 14:23 ` [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" Mike Crowe 2013-11-22 14:23 ` [PATCH 2/2] kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race Mike Crowe 2 siblings, 2 replies; 8+ messages in thread From: Mike Crowe @ 2013-11-22 14:23 UTC (permalink / raw) To: openembedded-core Previously I wrote: > The second of these two patches fix various problems with the > bundle_initramfs feature in kernel.bbclass. The first one reverts a > recent patch which should make the history easier to follow. This version has a better commit message and correct Signed-off-by lines. Mike. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" 2013-11-22 14:23 ` kernel.bbclass: Fix various bundle_initramfs problems (v2) Mike Crowe @ 2013-11-22 14:23 ` Mike Crowe 2013-11-22 14:23 ` [PATCH 2/2] kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race Mike Crowe 1 sibling, 0 replies; 8+ messages in thread From: Mike Crowe @ 2013-11-22 14:23 UTC (permalink / raw) To: openembedded-core; +Cc: Mike Crowe This reverts commit 3baa63b4d588c3262254528b406ede265dd117bf. It broke builds that aren't using kernel-yocto. Signed-off-by: Mike Crowe <mac@mcrowe.com> --- meta/classes/kernel.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 48999fe..ba13e67 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -152,7 +152,7 @@ python do_devshell_prepend () { os.environ["LDFLAGS"] = '' } -addtask bundle_initramfs after do_kernel_link_vmlinux before do_build +addtask bundle_initramfs after do_compile before do_build kernel_do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race 2013-11-22 14:23 ` kernel.bbclass: Fix various bundle_initramfs problems (v2) Mike Crowe 2013-11-22 14:23 ` [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" Mike Crowe @ 2013-11-22 14:23 ` Mike Crowe 1 sibling, 0 replies; 8+ messages in thread From: Mike Crowe @ 2013-11-22 14:23 UTC (permalink / raw) To: openembedded-core; +Cc: Mike Crowe The new do_bundle_initramfs task introduced in 609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a defeats using the sstate cache. The kernel is resurrected from the sstate cache but ends up being built again since do_bundle_initramfs depends on do_compile. The task is no longer nostamp to avoid causing unnecessary rebuilds. The sstate checksum stamps should know when to rebuild. The task now runs before do_deploy and part of the work has been moved to do_deploy where it now writes to ${DEPLOYDIR} rather than ${DEPLOY_DIR_IMAGE} so that the files end up in sstate. The task can also race against do_install since both call into the kernel build system. This is fixed by making do_bundle_initramfs run after do_install (which therefore also fixes the problem that 3baa63b4d588c3262254528b406ede265dd117bf was addressing.) Signed-off-by: Mike Crowe <mac@mcrowe.com> --- meta/classes/kernel.bbclass | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index ba13e67..4974507 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -134,25 +134,14 @@ do_bundle_initramfs () { echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs" install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin echo "${B}/${KERNEL_OUTPUT}.initramfs" - cd ${B} - # Update deploy directory - if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then - echo "Copying deploy kernel-initramfs image and setting up links..." - initramfs_base_name=${INITRAMFS_BASE_NAME} - initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE} - install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOY_DIR_IMAGE}/${initramfs_base_name}.bin - cd ${DEPLOY_DIR_IMAGE} - ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin - fi fi } -do_bundle_initramfs[nostamp] = "1" python do_devshell_prepend () { os.environ["LDFLAGS"] = '' } -addtask bundle_initramfs after do_compile before do_build +addtask bundle_initramfs after do_install before do_deploy kernel_do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE @@ -479,6 +468,17 @@ kernel_do_deploy() { ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE} cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt + + cd ${B} + # Update deploy directory + if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then + echo "Copying deploy kernel-initramfs image and setting up links..." + initramfs_base_name=${INITRAMFS_BASE_NAME} + initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE} + install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin + cd ${DEPLOYDIR} + ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin + fi } do_deploy[dirs] = "${DEPLOYDIR} ${B}" do_deploy[prefuncs] += "package_get_auto_pr" -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-11-22 15:54 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-11-22 14:04 kernel.bbclass: Fix various bundle_initramfs problems Mike Crowe 2013-11-22 14:04 ` [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" Mike Crowe 2013-11-22 15:53 ` Bruce Ashfield 2013-11-22 15:54 ` Bruce Ashfield 2013-11-22 14:04 ` [PATCH 2/2] kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race Mike Crowe 2013-11-22 14:23 ` kernel.bbclass: Fix various bundle_initramfs problems (v2) Mike Crowe 2013-11-22 14:23 ` [PATCH 1/2] Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux" Mike Crowe 2013-11-22 14:23 ` [PATCH 2/2] kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race Mike Crowe
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox