Fix prelink to avoid first boot script
cover Fix prelink to avoid first boot script
In most cases the user will have the image-prelink enabled, which will prelink the target image at image creation time. If this is enabled we want to avoid prelinking at first boot. We do this by setting the script exit status to '0' if we detect we're on the host.
Also fixes a small bug found in sstate.bbclass: do_cleansstate
The following changes since commit 8a5c20417d4d6bee6dd0bcdbeb8d4f9e0696a216:
[PATCH] u-boot-mkimage: bump version to 2011.03 (2011-06-28 17:13:12 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib mhatle/prelink
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/prelink
Mark Hatle (2):
sstate.bbclass: Fix an issue if the config changes prelink_git.bb: Only block the postinst script when no image-prelink
meta/classes/sstate.bbclass | 2 ++ meta/recipes-devtools/prelink/prelink_git.bb | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.3.4
PATCH 1/2 sstate.bbclass: Fix an issue if the config changes
We need to check if we know of the task type, before we attempt to process it. In order to reproduce the problem build with:
PACKAGE_CLASSES = "package_ipk"
Then change it to:
PACKAGE_CLASSES = "package_rpm"
Build again -- and then try bitbake -c cleansstate <recipe>
--- meta/classes/sstate.bbclass | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
meta/classes/sstate.bbclass +2 -0
@@ -273,6 +273,8 @@ python sstate_cleanall() { name = manifest.replace(manifest_pattern[:-1], "") namemap = d.getVar('SSTATETASKNAMES', True).split() tasks = d.getVar('SSTATETASKS', True).split() + if name not in namemap: + continue taskname = tasks[namemap.index(name)] shared_state = sstate_state_fromvars(d, taskname[3:]) sstate_clean(shared_state, d)
Signature · 1 line
1.7.3.4
PATCH 2/2 prelink_git.bb: Only block the postinst script when no image-prelink
In reply to Mark HatleIf image-prelink is being used, the system will automatically prelink the target image. This avoids the need to run the postinst prelink script at first boot. However, if the user has not enabled image prelinking -- then we do enable the script to run on first boot.
--- meta/recipes-devtools/prelink/prelink_git.bb | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
meta/recipes-devtools/prelink/prelink_git.bb +4 -2
@@ -10,7 +10,7 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b" SRCREV = "ac461e73b17253a4da25c5aafeac7193b553156c" PV = "1.0+git${SRCPV}" -PR = "r3" +PR = "r4" # # The cron script attempts to re-prelink the system daily -- on
@@ -58,11 +58,13 @@ do_install_append () { install -m 0644 ${WORKDIR}/macros.prelink ${D}${sysconfdir}/rpm/macros.prelink } +# If we're using mklibs-prelink, we want to skip this on the host side +# but still do it if the package is installed on the target... pkg_postinst_prelink() { #!/bin/sh if [ "x$D" != "x" ]; then - exit 1 + ${@base_contains('USER_CLASSES', 'image-prelink', 'exit 0', 'exit 1', d)} fi prelink -a
Signature · 1 line
1.7.3.4
Re: [PATCH 2/2] prelink_git.bb: Only block the postinst script when no image-prelink
Quoted 1 line · Mark Hatle
+# If we're using mklibs-prelink, we want to skip this on the host side
Is it really "mklibs-prelink"? I thought those were two different things.
p.
Re: [PATCH 2/2] prelink_git.bb: Only block the postinst script when no image-prelink
Quoted 5 lines · Phil Blundell
Quoted 1 line · Mark Hatle
+# If we're using mklibs-prelink, we want to skip this on the host side
Is it really "mklibs-prelink"? I thought those were two different things.
Ah, nevermind, I see you changed this in v2.
p.
Richard Purdie
AppliedQuoted 11 lines · Mark Hatle
In most cases the user will have the image-prelink enabled, which will prelink the target image at image creation time. If this is enabled we want to avoid prelinking at first boot. We do this by setting the script exit status to '0' if we detect we're on the host.
Also fixes a small bug found in sstate.bbclass:
do_cleansstateThe following changes since commit
8a5c20417d4d6bee6dd0bcdbeb8d4f9e0696a216:[PATCH] u-boot-mkimage: bump version to 2011.03 (2011-06-28 17:13:12 +0100)
Quoted 7 lines
are available in the git repository at:
git://git.pokylinux.org/poky-contribmhatle/prelink
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/prelinkMark Hatle (2):
sstate.bbclass: Fix an issue if the config changes prelink_git.bb: Only block the postinst script when no image-prelink
Merged to master, thanks.
Richard