# 7.1-RELEASE-i386-dvd1.iso & SHA256



## z3n (Jan 6, 2009)

Hi all.

I downloaded:

```
ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/7.1/7.1-RELEASE-i386-dvd1.iso.gz
ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/7.1/CHECKSUM.MD5
ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/7.1/CHECKSUM.SHA256
```

and then

```
$
$ gunzip 7.1-RELEASE-i386-dvd1.iso.gz
$
$ md5sum -c CHECKSUM.MD5
...
7.1-RELEASE-i386-dvd1.iso: OK
...
$
$ sha256sum -c CHECKSUM.SHA256
...
7.1-RELEASE-i386-dvd1.iso: FAILED
...
$
```

I need to download the DVD again? For example from the torrent?


----------



## ale (Jan 6, 2009)

What gunzipping it and trying again?

```
$ gunzip -c 7.1-RELEASE-i386-dvd1.iso.gz > 7.1-RELEASE-i386-dvd1.iso
$ sha256 7.1-RELEASE-i386-dvd1.iso 
SHA256 (7.1-RELEASE-i386-dvd1.iso) = 303be4ce844f0cb18aa38a41988dc5fba960427dbcc69263410308176cb5875f
```


----------



## gnemmi (Jan 6, 2009)

ON a side note ... where did you get *sha256sum* ... I can't find it in here 


```
[gonzalo@inferna ~]% make search name=sha256sum -C /usr/ports/
[gonzalo@inferna ~]%
```

Thanks


----------



## ale (Jan 6, 2009)

gnemmi said:
			
		

> ON a side note ... where did you get *sha256sum* ... I can't find it in here
> 
> 
> ```
> ...


linux?


----------



## gnemmi (Jan 6, 2009)

FreeBSD?


----------



## ale (Jan 6, 2009)

What I was meaning is - is he doing it from linux?
emulators/linux_base-f8 has it


----------



## ale (Jan 6, 2009)

You can find it also in sysutils/coreutils, that is the port of some utilities commonly used in linux, as gsha256sum.


----------



## gnemmi (Jan 6, 2009)

Thanks ale, it's working now 
The only quirk is that the bin is called "gsha256sum" instead of plain "sha256sum"

Thanks for your informative post


----------



## Andrius (Jan 6, 2009)

Or you could just use sha256(1) from base system without reinventing the wheel.


----------



## ale (Jan 6, 2009)

gnemmi asked about sha256sum but not about md5sum so I thought he was just curios about the former.
Probably because he as just the latter but installed from his linux_base.
With my [post=8029]post[/post] I was replaying to gnemmi supposing that z3n was checking the image from linux while he was probably asking because he was running md5sum from a linux_base package without sha256sum.

EDIT:
One advantage of md5sum or sha256sum over the corresponding FreeBSD implementation is the -c option to automatically check the sum against the ones reported in a file as z3n showed.


----------



## gnemmi (Jan 6, 2009)

ale said:
			
		

> EDIT:
> One advantage of md5sum or sha256sum over the corresponding FreeBSD implementation is the -c option to automatically check the sum against the ones reported in a file as z3n showed.



That was it ...
I used md5 and sha256 but I'm tired of checking their output against CHECKSUM.MD5 and CHECKSUM.SHA256 .. so -c was all I needed ... (I dont want to check long undecipherable strings against other long undechiperable strings ... an "ok" does just fine  )

If you by any chance know how to get md5 and sha256 work as md5sum/sha256sum -c please let me know 

Yet still: thanks ale for the hints


----------



## ale (Jan 6, 2009)

gnemmi said:
			
		

> If you by any chance know how to get md5 and sha256 work as md5sum/sha256sum -c please let me know


I don't know. Anyway creating a shell script for that should be very easy!



			
				gnemmi said:
			
		

> Yet still: thanks ale for the hints


You're welcome!


----------



## gnemmi (Jan 7, 2009)

ale said:
			
		

> I don't know. Anyway creating a shell script for that should be very easy!



Probably .. but adding a -c to md5 and sha256 shouldn't, theoretically, be that hard to do .. and seems like a much cleaner implmentation .. let alone a downright useful command line option


----------



## ezeaguerre (Apr 8, 2009)

Give it a try: http://ezeaguerre.googlepages.com/md5.tar.bz2 
Inside the tar archive there's a "patch.txt" file with the patch... and the standalone files if you want them. The patch should be applied in /usr/src/sbin/md5.


----------



## gnemmi (Apr 21, 2009)

Has anyone else tried this patch?
It's _really_ is usefull !
It works flawlessly in here.
Any chance to get this into base md5 ???


----------

