Skip to contentSkip to conversation

Invalid checksums for SRC_URI ignored?

DISCUSSION Michael Opdenacker 4 participants 5 messages Jan 19, 2022

lore
Share & tools
lore
#0 lore raw

Greetings,

I reused a simple "hello" recipe and added a non-matching checksum to it:

...
SRC_URI = "file://helloworld.c" SRC_URI[md5sum] = "34f0efd76b4f18888888888833cdd129"
...

The rest of the recipe comes from
https://git.openembedded.org/openembedded-core/tree/meta-skeleton/recipes-skeleton/hello-single.

Why doesn't Bitbake stop, reporting that the checksum doesn't match the source file?
Anyway, why does the recipe build without a checksum? Shouldn't checksums be mandatory?

I'm using the "master" version of Poky.

Thanks in advance
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#1 lore raw
Quoted 10 lines · Michael Opdenacker

Greetings,

I reused a simple "hello" recipe and added a non-matching checksum to it:

...
SRC_URI = "file://helloworld.c" SRC_URI[md5sum] = "34f0efd76b4f18888888888833cdd129"
...

Quoted 7 lines

The rest of the recipe comes from
https://git.openembedded.org/openembedded-core/tree/meta-skeleton/recipes-skeleton/hello-single.

Why doesn't Bitbake stop, reporting that the checksum doesn't match the source file?
Anyway, why does the recipe build without a checksum? Shouldn't checksums be mandatory?

Checksums are for files that are fetched via http:// and friends, not local files.

Ross

#2 lore raw
In reply to Michael Opdenacker

Hi,

Quoted 9 lines · Michael Opdenacker

Greetings,

I reused a simple "hello" recipe and added a non-matching checksum to it:

...
SRC_URI = "file://helloworld.c" SRC_URI[md5sum] = "34f0efd76b4f18888888888833cdd129"
...

Quoted 7 lines

The rest of the recipe comes from
https://git.openembedded.org/openembedded-core/tree/meta-skeleton/recipes-skeleton/hello-single.

Why doesn't Bitbake stop, reporting that the checksum doesn't match the source file?
Anyway, why does the recipe build without a checksum? Shouldn't checksums be mandatory?

No they are not mandatory for all fetchers. They are only used for content downloaded from non-local archives. https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-fetching.html#the-download-fetch

https://github.com/openembedded/bitbake/blob/32180d5057c818a69987aada482e82acf3c72ef2/lib/bb/fetch2/__init__.py#L1268

^^ here you can see the selection of URI's that automatically needs a checksum.

Best regards,
/Peter

#3 lore raw

Peter, Ross

Quoted 27 lines · Peter Bergin

Hi,

Quoted 10 lines · Michael Opdenacker

Greetings,

I reused a simple "hello" recipe and added a non-matching checksum to it:

...
SRC_URI = "file://helloworld.c" SRC_URI[md5sum] = "34f0efd76b4f18888888888833cdd129"
...

Quoted 8 lines

The rest of the recipe comes from
https://git.openembedded.org/openembedded-core/tree/meta-skeleton/recipes-skeleton/hello-single.

Why doesn't Bitbake stop, reporting that the checksum doesn't match the source file?
Anyway, why does the recipe build without a checksum? Shouldn't checksums be mandatory?

No they are not mandatory for all fetchers. They are only used for content downloaded from non-local archives.
https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-fetching.html#the-download-fetch

Quoted 5 lines

https://github.com/openembedded/bitbake/blob/32180d5057c818a69987aada482e82acf3c72ef2/lib/bb/fetch2/__init__.py#L1268

^^ here you can see the selection of URI's that automatically needs a checksum.

Thanks for your replies. This all makes perfect sense then. Thanks again
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw
Quoted 30 lines · Michael Opdenacker

Peter, Ross

Quoted 27 lines · Peter Bergin

Hi,

Quoted 10 lines · Michael Opdenacker

Greetings,

I reused a simple "hello" recipe and added a non-matching checksum to it:

...
SRC_URI = "file://helloworld.c" SRC_URI[md5sum] = "34f0efd76b4f18888888888833cdd129"
...

Quoted 8 lines

The rest of the recipe comes from
https://git.openembedded.org/openembedded-core/tree/meta-skeleton/recipes-skeleton/hello-single.

Why doesn't Bitbake stop, reporting that the checksum doesn't match the source file?
Anyway, why does the recipe build without a checksum? Shouldn't checksums be mandatory?

No they are not mandatory for all fetchers. They are only used for content downloaded from non-local archives.
https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-fetching.html#the-download-fetch

Quoted 8 lines
Quoted 5 lines

https://github.com/openembedded/bitbake/blob/32180d5057c818a69987aada482e82acf3c72ef2/lib/bb/fetch2/__init__.py#L1268

^^ here you can see the selection of URI's that automatically needs a checksum.

Thanks for your replies. This all makes perfect sense then.

Personally, I think where the checksums are present, we should check them regardless of url type though. I think I have an open bug related to this and the uninative fetching.

Cheers,

Richard