Skip to contentSkip to conversation

consumer of mtime in grub-mkstandalone.c:add_tar_file

DISCUSSION Olaf Hering 3 participants 3 messages Dec 2, 2016

lore
Share & tools
lore
#0 lore raw

Who is the consumer of the tar archive generated in util/grub-mkstandalone.c? Why would that consumer need the current mtime of the added file? It breaks what Debian sells as "reproducible builds".
I think the call to grub_util_get_mtime in add_tar_file should be removed.

Olaf

#1 lore raw

02.12.2016 17:51, Olaf Hering пишет:

Quoted 1 line

Who is the consumer of the tar archive generated in util/grub-mkstandalone.c?

It is stored as memory disk inside grub image and $prefix is set to point to it.

Quoted 1 line

Why would that consumer need the current mtime of the added file?

Well ... grub itself most likely does not (at least I do not remember any place where grub would depend on it). OTOH grub-mkstandalone provides for including of arbitrary files into archive and these files can be referenced by grub.cfg which also can be added to archive and contain arbitrary code (and theoretically also out-of-tree modules).

Quoted 3 lines

It breaks what Debian sells as "reproducible builds".
I think the call to grub_util_get_mtime in add_tar_file should be removed.

I think we could set fake mtime for grub own components (we already fake it in mkimage - STABLE_EMBEDDING_TIMESTAMP). For any additional file I would leave it up to user to set desired mtime in advance.

#2 lore raw

By default grub doesn't care about mtime but you can use -nt syntax in test command. This is useful to e.g. find the newest kernel. This being said, it's fine to have an override flag or environment variable to change the mtime to some fixed value

Quoted 29 lines · Andrei Borzenkov

02.12.2016 17:51, Olaf Hering пишет:

Quoted 1 line

Who is the consumer of the tar archive generated in

util/grub-mkstandalone.c?

It is stored as memory disk inside grub image and $prefix is set to point to it.

Quoted 1 line

Why would that consumer need the current mtime of the added file?

Well ... grub itself most likely does not (at least I do not remember any place where grub would depend on it). OTOH grub-mkstandalone provides for including of arbitrary files into archive and these files can be referenced by grub.cfg which also can be added to archive and contain arbitrary code (and theoretically also out-of-tree modules).

Quoted 2 lines

It breaks what Debian sells as "reproducible builds".
I think the call to grub_util_get_mtime in add_tar_file should be

removed.

Quoted 1 line

I think we could set fake mtime for grub own components (we already fake it in mkimage - STABLE_EMBEDDING_TIMESTAMP). For any additional file I would leave it up to user to set desired mtime in advance.

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel