On 07/06/2012 12:02 AM, Tormod Volden wrote:
Hi,

I see some alternatives, not necessarily better:
1. Always require an address argument. Explain in the usage text that
a dummy address is needed when deleting or checking. This allows us to
do all Stellaris stuff without introducing more than one new option.
2. Replace "-D -t" with e.g. -T. So use -D for "normal" devices and -T
for Stellaris. Then we would need a third option for "-t -c" unless we
go back to always probing for this prefix. So we will still have to
(or three) new options, so I am not sure this is better than your
suggestion.
3. Let -D delete the suffix as before. Let -T only delete prefix. So
the most usual usage will practically be the same (-D -T vs -D -t),
but it is more clear what each option does, and it is more flexible.
Same issue for -c checking as in (2).

How about compination?

Add -T option to delete just Stellaris prefix. This option could be used by itself or with combination with -D. If used it is without -D there will be check if suffix exists and it does not remove prefix if suffix exists.

Suffix CRC is included with prefix. That is why you can not just remove prefix. You have to remove both or recalculate CRC for suffix.

This will also allow deleting prefix after suffix is already removed. Prefix still needs to be added in combination with suffix.

Adding prefix would work with like now with -s addr.

I'll brew another patch with also other fixes suggested when I can manage find time.

I agree you do not want change behavior of options once they have been released.

-Tommi
This is a lot of discussion for a for a few options, but it is
worthwhile to get this optimal before it is released to the users. It
is easy to add new options, but to change or remove them afterwards is
difficult and causes pain for users.
I agree you do not want change behavior of options once they have been released.

Additionally, it would be an idea to do some check that -T (or -D -t
or -D -s 0 ...) actually deletes something that looks like a Stellaris
prefix, and not just the first 8 bytes of a non-prefixed binary. This
can wait for another patch though.

Thanks for the new patch, just a few comments below.


I check for the first two bytes on prefix if it exists since they are only one fixed. I can later add check that size matches for the image.

I'll cook another patch with also other fixes suggested when I can manage find time to code.

-Tommi



_______________________________________________
devel mailing list
devel@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/devel

Reply via email to