Heinrich Schuchardt | 896f5dc | 2023-01-25 19:15:00 +0100 | [diff] [blame] | 1 | Reproducible builds |
| 2 | =================== |
| 3 | |
| 4 | In order to achieve reproducible builds, timestamps used in the U-Boot build |
| 5 | process have to be set to a fixed value. |
| 6 | |
| 7 | This is done using the SOURCE_DATE_EPOCH environment variable which specifies |
| 8 | the number of seconds since 1970-01-01T00:00:00Z. |
| 9 | |
| 10 | Example |
| 11 | ------- |
| 12 | |
| 13 | To build the sandbox with 2023-01-01T00:00:00Z as timestamp we can use: |
| 14 | |
| 15 | .. code-block:: bash |
| 16 | |
| 17 | make sandbox_defconfig |
| 18 | SOURCE_DATE_EPOCH=1672531200 make |
| 19 | |
| 20 | This date is shown when we launch U-Boot: |
| 21 | |
| 22 | .. code-block:: console |
| 23 | |
| 24 | ./u-boot -T |
| 25 | U-Boot 2023.01 (Jan 01 2023 - 00:00:00 +0000) |
Simon Glass | 828d70d | 2023-02-21 12:40:29 -0700 | [diff] [blame] | 26 | |
| 27 | The same effect can be obtained with buildman using the `-r` flag. |