diff options
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index a4e627fef8..5522209534 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
@@ -56,6 +56,7 @@ ROOTFS_POSTPROCESS_COMMAND_append_qemuall = "${SSH_DISABLE_DNS_LOOKUP}" | |||
56 | SORT_PASSWD_POSTPROCESS_COMMAND ??= " sort_passwd; " | 56 | SORT_PASSWD_POSTPROCESS_COMMAND ??= " sort_passwd; " |
57 | python () { | 57 | python () { |
58 | d.appendVar('ROOTFS_POSTPROCESS_COMMAND', '${SORT_PASSWD_POSTPROCESS_COMMAND}') | 58 | d.appendVar('ROOTFS_POSTPROCESS_COMMAND', '${SORT_PASSWD_POSTPROCESS_COMMAND}') |
59 | d.appendVar('ROOTFS_POSTPROCESS_COMMAND', 'rootfs_reproducible;') | ||
59 | } | 60 | } |
60 | 61 | ||
61 | systemd_create_users () { | 62 | systemd_create_users () { |
@@ -256,10 +257,17 @@ python write_image_manifest () { | |||
256 | os.symlink(os.path.basename(manifest_name), manifest_link) | 257 | os.symlink(os.path.basename(manifest_name), manifest_link) |
257 | } | 258 | } |
258 | 259 | ||
259 | # Can be use to create /etc/timestamp during image construction to give a reasonably | 260 | # Can be used to create /etc/timestamp during image construction to give a reasonably |
260 | # sane default time setting | 261 | # sane default time setting |
261 | rootfs_update_timestamp () { | 262 | rootfs_update_timestamp () { |
262 | date -u +%4Y%2m%2d%2H%2M%2S >${IMAGE_ROOTFS}/etc/timestamp | 263 | if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then |
264 | # Convert UTC into %4Y%2m%2d%2H%2M%2S | ||
265 | sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S` | ||
266 | else | ||
267 | sformatted=`date -u +%4Y%2m%2d%2H%2M%2S` | ||
268 | fi | ||
269 | echo $sformatted > ${IMAGE_ROOTFS}/etc/timestamp | ||
270 | bbnote "rootfs_update_timestamp: set /etc/timestamp to $sformatted" | ||
263 | } | 271 | } |
264 | 272 | ||
265 | # Prevent X from being started | 273 | # Prevent X from being started |
@@ -328,3 +336,16 @@ python rootfs_log_check_recommends() { | |||
328 | if 'unsatisfied recommendation for' in line: | 336 | if 'unsatisfied recommendation for' in line: |
329 | bb.warn('[log_check] %s: %s' % (d.getVar('PN'), line)) | 337 | bb.warn('[log_check] %s: %s' % (d.getVar('PN'), line)) |
330 | } | 338 | } |
339 | |||
340 | # Perform any additional adjustments needed to make rootf binary reproducible | ||
341 | rootfs_reproducible () { | ||
342 | if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then | ||
343 | # Convert UTC into %4Y%2m%2d%2H%2M%2S | ||
344 | sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S` | ||
345 | echo $sformatted > ${IMAGE_ROOTFS}/etc/version | ||
346 | bbnote "rootfs_reproducible: set /etc/version to $sformatted" | ||
347 | |||
348 | find ${IMAGE_ROOTFS}/etc/gconf -name '%gconf.xml' -print0 | xargs -0r \ | ||
349 | sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g' | ||
350 | fi | ||
351 | } | ||