On Monday 21 October 2024, Alexander Kanavin <alex.kana...@gmail.com> wrote:
> On Mon, 21 Oct 2024 at 19:02, Gaël PORTAY <gael.por...@gmail.com> wrote:
>
>> Or, linking the file instead:
>>
>>         rootfs_update_timestamp () {
>>                 if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
>>                         # Convert UTC into %4Y%2m%2d%2H%2M%2S
>>                         sformatted=`date -u -d
@${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
>>                 else
>>                         sformatted=`date -u +%4Y%2m%2d%2H%2M%2S`
>>                 fi
>>                 echo $sformatted > ${IMAGE_ROOTFS}/etc/timestamp
>>                 bbnote "rootfs_update_timestamp: set /etc/timestamp to
$sformatted"
>>         +
>>         +       if [ -x /lib/systemd/systemd ]; then
>>         +           ln -sf /etc/timestamp /usr/lib/clock-epoch
>>         +       }
>>         }
>>
>> Does it look better for you?
>
> This does look better, yes. Will systemd follow the symlink and read
> the mtime of the original file?
>
> Alex
>

I have not tested it so far, but I guess so.

systemd stat() the file, so it should follows symlink.

I will give a try tomorrow.

Also, I wonder what is the best test to symlink the file:
- testing for the ${IMAGE_ROOTFS}/llib/systemd/systemd
- testing for systemd in DISTRO_FEATURES,
- testing for systemd in IMAGE_INSTALL?

https://github.com/systemd/systemd/blob/4d47aa8c0435ad7bcd45aea3a091c22027fc0aa8/src/core/clock-warp.c#L26

Gaël
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206129): 
https://lists.openembedded.org/g/openembedded-core/message/206129
Mute This Topic: https://lists.openembedded.org/mt/109095282/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to