<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/pepe2k/scripts/mkhash.c, branch v21.02.1</title>
<subtitle>Staging tree of Piotr Dymacz</subtitle>
<id>https://git.openwrt.org/openwrt/staging/pepe2k/atom?h=v21.02.1</id>
<link rel='self' href='https://git.openwrt.org/openwrt/staging/pepe2k/atom?h=v21.02.1'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/'/>
<updated>2020-12-22T18:11:50Z</updated>
<entry>
<title>scripts: add -N option to mkhash for printing without newline</title>
<updated>2020-12-22T18:11:50Z</updated>
<author>
<name>INAGAKI Hiroshi</name>
</author>
<published>2020-12-17T14:44:28Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=fdcdbdfdef512e0fdd719a704cff827a0633f5dc'/>
<id>urn:sha1:fdcdbdfdef512e0fdd719a704cff827a0633f5dc</id>
<content type='text'>
Added "-N" option, it allow printing hash(es) without newline.

Signed-off-by: INAGAKI Hiroshi &lt;musashino.open@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: mkhash on FreeBSD</title>
<updated>2020-11-28T04:01:22Z</updated>
<author>
<name>Piotr Stefaniak</name>
</author>
<published>2020-08-07T16:28:41Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=1db9b5b6d65052eea7819cf0aee5163846a36bed'/>
<id>urn:sha1:1db9b5b6d65052eea7819cf0aee5163846a36bed</id>
<content type='text'>
Apply patch from
https://bugs.openwrt.org/index.php?do=details&amp;task_id=971
in order to make it easier to build OpenWRT on FreeBSD.

Signed-off-by: Piotr Stefaniak &lt;pstef@freebsd.org&gt;
</content>
</entry>
<entry>
<title>scripts: mkhash fail on hashing a folder</title>
<updated>2020-11-09T10:54:29Z</updated>
<author>
<name>Paul Spooren</name>
</author>
<published>2020-07-17T08:19:32Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=fcd3e13779ca644bfbb0940f39fdf13203bf8211'/>
<id>urn:sha1:fcd3e13779ca644bfbb0940f39fdf13203bf8211</id>
<content type='text'>
mkhash currently returns the hash of an empty input when trying to hash
a folder. This can be missleading in caseswhere e.g. an env variable is
undefined which should contain a filename. `mkhash ./path/to/$FILE`
would exit with code 0 and return a legit looking checksum.

A better behaviour would be to fail with exit code 1, which imitates the
behaviour of `md5sum` and `sha256sum`.

To avoid hashing of folders the `stat()` is checked.

Hashing empty inputs result in the following checksums:
md5: d41d8cd98f00b204e9800998ecf8427e
sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Signed-off-by: Paul Spooren &lt;mail@aparcar.org&gt;
</content>
</entry>
<entry>
<title>scripts: mkhash fix return code handling</title>
<updated>2020-11-09T10:54:29Z</updated>
<author>
<name>Paul Spooren</name>
</author>
<published>2020-07-17T08:19:31Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=fac98f1c54a16073e28ab11adf195f9917a30ef6'/>
<id>urn:sha1:fac98f1c54a16073e28ab11adf195f9917a30ef6</id>
<content type='text'>
If hashing a file fails mkhash shouldn't just silently fail. Now check
after each call of `hash_file()` the return and exit early in case of
errors. The return value which was previously ignored and would always
return 0.

Signed-off-by: Paul Spooren &lt;mail@aparcar.org&gt;
</content>
</entry>
<entry>
<title>scripts: mkhash show -n option in usage</title>
<updated>2020-11-09T10:52:19Z</updated>
<author>
<name>Paul Spooren</name>
</author>
<published>2020-07-17T03:43:30Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=91a0dc5161e25085a01edd66b1d8da19593dcc4a'/>
<id>urn:sha1:91a0dc5161e25085a01edd66b1d8da19593dcc4a</id>
<content type='text'>
The -n option prints the filename of hashed files next to the calculated
checksum. Reflect that in the usage message.

user@dawn:~/src/openwrt/openwrt$ ./a.out md5 -n .config
eb06db36e7b6751cb18801945e46bf5d .config

Signed-off-by: Paul Spooren &lt;mail@aparcar.org&gt;
</content>
</entry>
<entry>
<title>build: add a small standalone utility for calculating md5/sha256 hash</title>
<updated>2017-01-05T10:09:12Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2016-12-25T15:23:34Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=dad48c6438f0a4c42ad34842a88e82280d971d90'/>
<id>urn:sha1:dad48c6438f0a4c42ad34842a88e82280d971d90</id>
<content type='text'>
This will be used to simplify the build system code for checking hashes.
Instead of using various variants of md5sum / openssl, use one simple
utility for all of them

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
</feed>
