summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2012-09-18 18:39:49 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-06 12:31:08 +0000
commit6b76f04195911a40d868d988b8223db0f88ac8a9 (patch)
treec1bb5ef1131ca27019f71b73e84c3786a6931797 /meta/classes/image.bbclass
parentdde5e6402ad8284d55effc032cfbe1bb21867778 (diff)
downloadpoky-6b76f04195911a40d868d988b8223db0f88ac8a9.tar.gz
image.bbclass: run postinst scripts once, at rootfs time
This patch will allow the repeating postinst scriptlets to be run only once, on host, at do_rootfs time. This will lower the time for rootfs generation and, also, instead of running some time consuming scriptlets at target's first boot, we will do on the host. (From OE-Core rev: 0d239328b1c6b9e4afadad75972d359181fbe1a5) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass20
1 files changed, 17 insertions, 3 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 7b24e4e285..719d871bca 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -156,7 +156,7 @@ inherit ${IMAGE_CLASSES}
156 156
157IMAGE_POSTPROCESS_COMMAND ?= "" 157IMAGE_POSTPROCESS_COMMAND ?= ""
158MACHINE_POSTPROCESS_COMMAND ?= "" 158MACHINE_POSTPROCESS_COMMAND ?= ""
159ROOTFS_POSTPROCESS_COMMAND ?= "" 159ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; "
160 160
161# some default locales 161# some default locales
162IMAGE_LINGUAS ?= "de-de fr-fr en-gb" 162IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
@@ -166,15 +166,29 @@ LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IM
166PSEUDO_PASSWD = "${IMAGE_ROOTFS}" 166PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
167 167
168do_rootfs[nostamp] = "1" 168do_rootfs[nostamp] = "1"
169do_rootfs[dirs] = "${TOPDIR}" 169do_rootfs[dirs] = "${TOPDIR} ${WORKDIR}/intercept_scripts"
170do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock" 170do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
171do_rootfs[cleandirs] += "${S}" 171do_rootfs[cleandirs] += "${S} ${WORKDIR}/intercept_scripts"
172do_build[nostamp] = "1" 172do_build[nostamp] = "1"
173 173
174# Must call real_do_rootfs() from inside here, rather than as a separate 174# Must call real_do_rootfs() from inside here, rather than as a separate
175# task, so that we have a single fakeroot context for the whole process. 175# task, so that we have a single fakeroot context for the whole process.
176do_rootfs[umask] = "022" 176do_rootfs[umask] = "022"
177 177
178
179run_intercept_scriptlets () {
180 if [ -d ${WORKDIR}/intercept_scripts ]; then
181 cd ${WORKDIR}/intercept_scripts
182 echo "Running intercept scripts:"
183 for script in *; do
184 if [ "$script" = "*" ]; then break; fi
185 echo "> Executing $script"
186 chmod +x $script
187 ./$script
188 done
189 fi
190}
191
178fakeroot do_rootfs () { 192fakeroot do_rootfs () {
179 #set -x 193 #set -x
180 # When use the rpm incremental image generation, don't remove the rootfs 194 # When use the rpm incremental image generation, don't remove the rootfs