diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a3df33cc..6fcbc68d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] + - Chg posix sh version of mkversion (@doegox) - Chg remove entirely ncurses, not needed nowadays (@doegox) - Chg remove deprecated termcap, use ncurses instead (@ZeroChaos-) - Chg 'hf iclass encrypt' - now takes transport key as param. (@iceman1001) diff --git a/armsrc/Makefile b/armsrc/Makefile index 665c91005..048879d96 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -144,7 +144,7 @@ all: $(OBJS) # version.c should be remade on every time fullimage.stage1.elf should be remade version.c: default_version.c $(OBJDIR)/fpga_version_info.o $(OBJDIR)/fpga_all.o $(THUMBOBJ) $(ARMOBJ) $(info [-] GEN $@) - $(Q)perl ../tools/mkversion.pl .. > $@ || $(COPY) $^ $@ + $(Q)sh ../tools/mkversion.sh > $@ || perl ../tools/mkversion.pl > $@ || $(COPY) $^ $@ fpga_version_info.c: $(FPGA_BITSTREAMS) | $(FPGA_COMPRESSOR) $(info [-] GEN $@) diff --git a/bootrom/Makefile b/bootrom/Makefile index c4103b522..884f01757 100644 --- a/bootrom/Makefile +++ b/bootrom/Makefile @@ -36,7 +36,7 @@ OBJS = $(OBJDIR)/bootrom.s19 # version.c should be remade on every compilation version.c: default_version.c $(info [=] GEN $@) - $(Q)perl ../tools/mkversion.pl .. > $@ || $(COPY) $^ $@ + $(Q)sh ../tools/mkversion.sh > $@ || perl ../tools/mkversion.pl > $@ || $(COPY) $^ $@ all: $(OBJS) diff --git a/common_arm/default_version.c b/common_arm/default_version.c index e1e5dc64c..b4b8ae17d 100644 --- a/common_arm/default_version.c +++ b/common_arm/default_version.c @@ -1,5 +1,5 @@ #include "proxmark3_arm.h" -/* This is the default version.c file that Makefile.common falls back to if perl is not available */ +/* This is the default version.c file that Makefile.common falls back to if neither sh nor perl are available */ const struct version_information __attribute__((section(".version_information"))) version_information = { VERSION_INFORMATION_MAGIC, 1, /* version 1 */ diff --git a/doc/md/Installation_Instructions/Linux-Installation-Instructions.md b/doc/md/Installation_Instructions/Linux-Installation-Instructions.md index 476309fb6..aa3ce9272 100644 --- a/doc/md/Installation_Instructions/Linux-Installation-Instructions.md +++ b/doc/md/Installation_Instructions/Linux-Installation-Instructions.md @@ -25,7 +25,7 @@ Install the requirements ```sh sudo apt-get install p7zip git ca-certificates build-essential libreadline5 libreadline-dev \ -libusb-0.1-4 libusb-dev perl pkg-config wget gcc-arm-none-eabi libnewlib-dev libqt4-dev +libusb-0.1-4 libusb-dev pkg-config wget gcc-arm-none-eabi libnewlib-dev libqt4-dev ``` If you don't need the graphical components of the Proxmark3 client, you can skip the installation of `libqt4-dev`. diff --git a/doc/md/Installation_Instructions/Mac-OS-X-Homebrew-Installation-Instructions.md b/doc/md/Installation_Instructions/Mac-OS-X-Homebrew-Installation-Instructions.md index f38d2056c..f2d87aa66 100644 --- a/doc/md/Installation_Instructions/Mac-OS-X-Homebrew-Installation-Instructions.md +++ b/doc/md/Installation_Instructions/Mac-OS-X-Homebrew-Installation-Instructions.md @@ -66,7 +66,7 @@ These instructions will show how to setup the environment on OSX to the point wh 2. Install dependencies: ``` -brew install readline p7zip libusb-compat perl qt5 wget pkgconfig +brew install readline p7zip libusb-compat qt5 wget pkgconfig brew install RfidResearchGroup/proxmark3/arm-none-eabi-gcc ``` diff --git a/doc/md/Installation_Instructions/Windows-Installation-Instructions.md b/doc/md/Installation_Instructions/Windows-Installation-Instructions.md index 631b864c1..1df9e541b 100644 --- a/doc/md/Installation_Instructions/Windows-Installation-Instructions.md +++ b/doc/md/Installation_Instructions/Windows-Installation-Instructions.md @@ -99,7 +99,7 @@ Enter WSL prompt (`wsl`) and from there, follow the [Linux Installation Instruct ```sh sudo apt-get update sudo apt-get install p7zip git ca-certificates build-essential libreadline5 libreadline-dev libusb-0.1-4 \ -libusb-dev perl pkg-config wget gcc-arm-none-eabi libstdc++-arm-none-eabi-newlib \ +libusb-dev pkg-config wget gcc-arm-none-eabi libstdc++-arm-none-eabi-newlib \ libqt4-dev ``` diff --git a/tools/mkversion.sh b/tools/mkversion.sh new file mode 100755 index 000000000..b91eab8af --- /dev/null +++ b/tools/mkversion.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Output a version.c file that includes information about the current build +# From mkversion.pl +# pure sh POSIX as now even on Windows we use WSL or ProxSpace with sh available + +# Clear environment locale so that git will not use localized strings +export LC_ALL="C" +export LANG="C" + +# if you are making your own fork, change this line to reflect your fork-name +fullgitinfo="RRG/Iceman" +# GIT status 0 = dirty, 1 = clean , 2 = undecided +clean=2 + +# Do we have acces to git command? +commandGIT=$(env which git) + +if [ "$commandGIT" != "" ]; then + + # now avoiding the "fatal: No names found, cannot describe anything." error by fallbacking to abbrev hash in such case + gitversion=$(git describe --dirty --always) + gitbranch=$(git rev-parse --abbrev-ref HEAD) + if [ "$gitversion" != "${gitversion%-dirty}" ]; then + clean=0 + else + clean=1 + fi + if [ "$gitbranch" != "" ] && [ "$gitversion" != "" ]; then + fullgitinfo="${fullgitinfo}/${gitbranch}/${gitversion}" + ctime="$(date '+%Y-%m-%d %H:%M:%S')" + else + fullgitinfo="${fullgitinfo}/master/release (git)" + fi +else + fullgitinfo="${fullgitinfo}/master/release (no_git)" + dl_time=$(stat --printf="%y" ../README.md) + # POSIX way... + ctime=${dl_time%.*} +fi + +# Crop so it fits within 50 characters C string, so max 49 chars +# POSIX way +fullgitinfoextra="${fullgitinfo#??????????????????????????????????????????????}" +if [ "$fullgitinfoextra" != "$fullgitinfo" ]; then + fullgitinfo46="${fullgitinfo%"${fullgitinfoextra}"}" + fullgitinfo="${fullgitinfo46}..." +fi +cat <