avrdude: ERROR: address 0x1f010 out of range at line 2 of ATmegaBOOT_644P.hex
That address is out of range indeed: it is > 64K.
Since the error is at line 2, I guess line 1 contains a so called "extended segment address record" (long live wikipedia). These are used to accomplish addressing over 64K. It are lines looking like this:
:02000002xxxxyy
If line 1 looks like this, try deleting it. Or just post the hex file you use.
Recently I built optiboot_atmega644p.hex and flashed it to my sanguino rbk using ArduinoISP.
I used these command lines:
avrdude -pm644p -c avrisp -b 19200 -P /dev/ttyUSB0 -e -u -U lock:w:0x3f:m -U efuse:w:0xFD:m -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m
avrdude -pm644p -c avrisp -b 19200 -P /dev/ttyUSB0 -U flash:w:optiboot_atmega644p.hex:i -U lock:w:0x2f:m
It worked fine.
I attached it, it is only 1.4K
optiboot_atmega644p.hex (1.44 KB)