mirror of
https://salsa.debian.org/gnuk-team/gnuk/gnuk.git
synced 2024-09-20 02:40:08 +00:00
Added FSIJ serial number support.
This commit is contained in:
parent
73a5065c93
commit
0fb4c91db3
@ -1,5 +1,9 @@
|
||||
2010-10-20 NIIBE Yutaka <gniibe@fsij.org>
|
||||
|
||||
* FSIJ_SERIAL_NUMBER: New.
|
||||
* src/configure (with_fsij): Added FSIJ serial number support.
|
||||
* src/config.h.in (@FSIJ_DEFINE@, @SERIAL_NUMBER_FOUR_BYTES@): New.
|
||||
|
||||
* src/configure: Added CQ STARM target.
|
||||
* boards/CQ_STARM/mcuconf.h: New.
|
||||
* boards/CQ_STARM/board.mk: New.
|
||||
|
2
FSIJ_SERIAL_NUMBER
Normal file
2
FSIJ_SERIAL_NUMBER
Normal file
@ -0,0 +1,2 @@
|
||||
# Email # 4-byte serial number, separated by ':'
|
||||
gniibe@fsij.org 00:00:00:01
|
@ -3,7 +3,8 @@
|
||||
#define ENABLE_VIRTUAL_COM_PORT 1
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
@FSIJ_DEFINE@
|
||||
#ifdef WITH_FSIJ_SERIAL_NUMBER
|
||||
/* FSIJ */
|
||||
#define MANUFACTURER_IN_AID 0xf5, 0x17
|
||||
#else
|
||||
@ -11,6 +12,6 @@
|
||||
#define MANUFACTURER_IN_AID 0xff, 0xfe
|
||||
#endif
|
||||
|
||||
#define SERIAL_NUMBER_IN_AID 0x00, 0x00, 0x00, 0x01
|
||||
#define SERIAL_NUMBER_IN_AID @SERIAL_NUMBER_FOUR_BYTES@
|
||||
|
||||
@DFU_DEFINE@
|
||||
|
27
src/configure
vendored
27
src/configure
vendored
@ -24,8 +24,15 @@ help=no
|
||||
target=OLIMEX_STM32_H103
|
||||
verbose=no
|
||||
with_dfu=default
|
||||
with_fsij=no
|
||||
debug=no
|
||||
|
||||
# check /dev/random
|
||||
if test ! -e /dev/random; then
|
||||
echo "/dev/random is required." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Process each option
|
||||
for option; do
|
||||
case $option in
|
||||
@ -48,6 +55,10 @@ for option; do
|
||||
with_dfu=yes ;;
|
||||
--without-dfu)
|
||||
with_dfu=no ;;
|
||||
--with-fsij)
|
||||
with_fsij=yes ;;
|
||||
--without-fsij)
|
||||
with_fsij=no ;;
|
||||
*)
|
||||
echo "Unrecognized option \`$option'" >&2
|
||||
echo "Try \`$0 --help' for more information." >&2
|
||||
@ -71,6 +82,7 @@ Configuration:
|
||||
CQ_STARM
|
||||
--enable-debug debug with virtual COM port [no]
|
||||
--with-dfu build image for DFU [<target specific>]
|
||||
--with-fsij Use FSIJ serial number [no: random number]
|
||||
EOF
|
||||
exit 0
|
||||
fi
|
||||
@ -95,6 +107,19 @@ CQ_STARM)
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
# --with-fsij option
|
||||
if test "$with_fsij" = "no"; then
|
||||
FSIJ_DEFINE="#undef WITH_FSIJ_SERIAL_NUMBER"
|
||||
SERIAL_NUMBER_FOUR_BYTES=`od -t u1 -N 4 /dev/random | sed -n -e '/^0000000/s/^0000000 *//' -e 's/ */,/gp'`
|
||||
else
|
||||
if test "x$MAIL" = "x"; then
|
||||
echo "Please set MAIL shell variable to select FSIJ serial number." >&2
|
||||
exit 1
|
||||
fi
|
||||
FSIJ_DEFINE="#define WITH_FSIJ_SERIAL_NUMBER 1"
|
||||
SERIAL_NUMBER_FOUR_BYTES=`sed -n -e "/^$MAIL/s/^.* \(..\):\(..\):\(..\):\(..\)/0x\1, 0x\2, 0x\3, 0x\4/p" ../FSIJ_SERIAL_NUMBER`
|
||||
fi
|
||||
|
||||
if test "$debug" = "yes"; then
|
||||
DEBUG_MAKE_OPTION="ENABLE_DEBUG=1"
|
||||
DEBUG_DEFINE="#define DEBUG 1"
|
||||
@ -122,5 +147,7 @@ sed -e "s/@ORIGIN@/$ORIGIN/" -e "s/@FLASH_SIZE@/$FLASH_SIZE/" \
|
||||
< gnuk.ld.in > gnuk.ld
|
||||
sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \
|
||||
-e "s/@DFU_DEFINE@/$DFU_DEFINE/" \
|
||||
-e "s/@FSIJ_DEFINE@/$FSIJ_DEFINE/" \
|
||||
-e "s/@SERIAL_NUMBER_FOUR_BYTES@/$SERIAL_NUMBER_FOUR_BYTES/" \
|
||||
< config.h.in > config.h
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user