diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2012-09-18 18:39:49 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-12-06 12:31:08 +0000 |
commit | 6b76f04195911a40d868d988b8223db0f88ac8a9 (patch) | |
tree | c1bb5ef1131ca27019f71b73e84c3786a6931797 /meta/classes/image.bbclass | |
parent | dde5e6402ad8284d55effc032cfbe1bb21867778 (diff) | |
download | poky-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.bbclass | 20 |
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 | ||
157 | IMAGE_POSTPROCESS_COMMAND ?= "" | 157 | IMAGE_POSTPROCESS_COMMAND ?= "" |
158 | MACHINE_POSTPROCESS_COMMAND ?= "" | 158 | MACHINE_POSTPROCESS_COMMAND ?= "" |
159 | ROOTFS_POSTPROCESS_COMMAND ?= "" | 159 | ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; " |
160 | 160 | ||
161 | # some default locales | 161 | # some default locales |
162 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" | 162 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" |
@@ -166,15 +166,29 @@ LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IM | |||
166 | PSEUDO_PASSWD = "${IMAGE_ROOTFS}" | 166 | PSEUDO_PASSWD = "${IMAGE_ROOTFS}" |
167 | 167 | ||
168 | do_rootfs[nostamp] = "1" | 168 | do_rootfs[nostamp] = "1" |
169 | do_rootfs[dirs] = "${TOPDIR}" | 169 | do_rootfs[dirs] = "${TOPDIR} ${WORKDIR}/intercept_scripts" |
170 | do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock" | 170 | do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock" |
171 | do_rootfs[cleandirs] += "${S}" | 171 | do_rootfs[cleandirs] += "${S} ${WORKDIR}/intercept_scripts" |
172 | do_build[nostamp] = "1" | 172 | do_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. |
176 | do_rootfs[umask] = "022" | 176 | do_rootfs[umask] = "022" |
177 | 177 | ||
178 | |||
179 | run_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 | |||
178 | fakeroot do_rootfs () { | 192 | fakeroot 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 |