Skip to content

Commit

Permalink
have all tools print the version number
Browse files Browse the repository at this point in the history
  • Loading branch information
ivop committed Dec 14, 2013
1 parent 6c58c18 commit e8c7847
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rkcrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <string.h>

#include "rkcrc.h"
#include "version.h"

static const char strings[2][4] = { "KRNL", "PARM" };

Expand All @@ -50,7 +51,9 @@ int main(int argc, char *argv[]) {
case 'p': which = 1; break;
default:
usage:
fprintf(stderr, "usage: %s [-k|-p] infile outfile\n", progname);
fprintf(stderr, "%s v%d.%d\nusage: %s [-k|-p] infile outfile\n",
progname, RKFLASHTOOL_VERSION_MAJOR,
RKFLASHTOOL_VERSION_MINOR, progname);
exit(1);
}
}
Expand Down
5 changes: 5 additions & 0 deletions rkmisc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MAJOR=`grep MAJOR version.h | { read A B C; echo $C; }`
MINOR=`grep MINOR version.h | { read A B C; echo $C; }`

test "$#" -eq 2 || { cat << __EOF__
rkmisc v$MAJOR.$MINOR
usage: rkmisc action outfile
generate a misc "partition"
Expand Down
5 changes: 5 additions & 0 deletions rkparameters
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MAJOR=`grep MAJOR version.h | { read A B C; echo $C; }`
MINOR=`grep MINOR version.h | { read A B C; echo $C; }`

test "$#" -eq 3 || { cat << __EOF__
rkparameters v$MAJOR.$MINOR
usage: rkparameters model fw_version partitionsfile
e.g. rkparameters arnova7g2 1.2.3 mtdparts.txt
Expand Down
5 changes: 5 additions & 0 deletions rkparametersblock
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MAJOR=`grep MAJOR version.h | { read A B C; echo $C; }`
MINOR=`grep MINOR version.h | { read A B C; echo $C; }`

test "$#" -eq 2 || { cat << __EOF__
rkparametersblock v$MAJOR.$MINOR
usage: rkparametersblock parametersfile outfile
needs rkcrc to function correctly
Expand Down

0 comments on commit e8c7847

Please sign in to comment.