mirror of
https://xff.cz/git/u-boot/
synced 2025-09-12 22:22:09 +02:00
Drop ubsha1 tool
This seems to have been used by ppc4xx which was removed a while back. The Kconfig does not exist so it is never built. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
3
Makefile
3
Makefile
@@ -1454,9 +1454,6 @@ u-boot-with-spl.kwb: u-boot.bin spl/u-boot-spl.bin FORCE
|
|||||||
$(call if_changed,mkimage)
|
$(call if_changed,mkimage)
|
||||||
$(BOARD_SIZE_CHECK)
|
$(BOARD_SIZE_CHECK)
|
||||||
|
|
||||||
u-boot.sha1: u-boot.bin
|
|
||||||
tools/ubsha1 u-boot.bin
|
|
||||||
|
|
||||||
u-boot.dis: u-boot
|
u-boot.dis: u-boot
|
||||||
$(OBJDUMP) -d $< > $@
|
$(OBJDUMP) -d $< > $@
|
||||||
|
|
||||||
|
1
tools/.gitignore
vendored
1
tools/.gitignore
vendored
@@ -33,7 +33,6 @@
|
|||||||
/relocate-rela
|
/relocate-rela
|
||||||
/spl_size_limit
|
/spl_size_limit
|
||||||
/sunxi-spl-image-builder
|
/sunxi-spl-image-builder
|
||||||
/ubsha1
|
|
||||||
/update_octeon_header
|
/update_octeon_header
|
||||||
/version.h
|
/version.h
|
||||||
/xway-swap-bytes
|
/xway-swap-bytes
|
||||||
|
@@ -29,7 +29,6 @@ CONFIG_CMD_LOADS = y
|
|||||||
CONFIG_CMD_NET = y
|
CONFIG_CMD_NET = y
|
||||||
CONFIG_XWAY_SWAP_BYTES = y
|
CONFIG_XWAY_SWAP_BYTES = y
|
||||||
CONFIG_NETCONSOLE = y
|
CONFIG_NETCONSOLE = y
|
||||||
CONFIG_SHA1_CHECK_UB_IMG = y
|
|
||||||
CONFIG_ARCH_SUNXI = y
|
CONFIG_ARCH_SUNXI = y
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -217,11 +216,6 @@ hostprogs-$(CONFIG_ARCH_SUNXI) += sunxi-spl-image-builder
|
|||||||
sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o lib/bch.o
|
sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o lib/bch.o
|
||||||
|
|
||||||
hostprogs-$(CONFIG_NETCONSOLE) += ncb
|
hostprogs-$(CONFIG_NETCONSOLE) += ncb
|
||||||
hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1
|
|
||||||
|
|
||||||
ubsha1-objs := os_support.o ubsha1.o lib/sha1.o
|
|
||||||
|
|
||||||
HOSTCFLAGS_ubsha1.o := -pedantic
|
|
||||||
|
|
||||||
hostprogs-$(CONFIG_ARCH_KIRKWOOD) += kwboot
|
hostprogs-$(CONFIG_ARCH_KIRKWOOD) += kwboot
|
||||||
hostprogs-$(CONFIG_ARCH_MVEBU) += kwboot
|
hostprogs-$(CONFIG_ARCH_MVEBU) += kwboot
|
||||||
|
@@ -1,83 +0,0 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0+
|
|
||||||
/*
|
|
||||||
* (C) Copyright 2007
|
|
||||||
* Heiko Schocher, DENX Software Engineering, <hs@denx.de>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "os_support.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <u-boot/sha1.h>
|
|
||||||
|
|
||||||
int main (int argc, char **argv)
|
|
||||||
{
|
|
||||||
unsigned char output[20];
|
|
||||||
int i, len;
|
|
||||||
|
|
||||||
char *imagefile;
|
|
||||||
char *cmdname = *argv;
|
|
||||||
unsigned char *ptr;
|
|
||||||
unsigned char *data;
|
|
||||||
struct stat sbuf;
|
|
||||||
unsigned char *ptroff;
|
|
||||||
int ifd;
|
|
||||||
int off;
|
|
||||||
|
|
||||||
if (argc > 1) {
|
|
||||||
imagefile = argv[1];
|
|
||||||
ifd = open (imagefile, O_RDWR|O_BINARY);
|
|
||||||
if (ifd < 0) {
|
|
||||||
fprintf (stderr, "%s: Can't open %s: %s\n",
|
|
||||||
cmdname, imagefile, strerror(errno));
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
if (fstat (ifd, &sbuf) < 0) {
|
|
||||||
fprintf (stderr, "%s: Can't stat %s: %s\n",
|
|
||||||
cmdname, imagefile, strerror(errno));
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
len = sbuf.st_size;
|
|
||||||
ptr = (unsigned char *)mmap(0, len,
|
|
||||||
PROT_READ, MAP_SHARED, ifd, 0);
|
|
||||||
if (ptr == (unsigned char *)MAP_FAILED) {
|
|
||||||
fprintf (stderr, "%s: Can't read %s: %s\n",
|
|
||||||
cmdname, imagefile, strerror(errno));
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* create a copy, so we can blank out the sha1 sum */
|
|
||||||
data = malloc (len);
|
|
||||||
memcpy (data, ptr, len);
|
|
||||||
off = SHA1_SUM_POS;
|
|
||||||
ptroff = &data[len + off];
|
|
||||||
for (i = 0; i < SHA1_SUM_LEN; i++) {
|
|
||||||
ptroff[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
sha1_csum ((unsigned char *) data, len, (unsigned char *)output);
|
|
||||||
|
|
||||||
printf ("U-Boot sum:\n");
|
|
||||||
for (i = 0; i < 20 ; i++) {
|
|
||||||
printf ("%02X ", output[i]);
|
|
||||||
}
|
|
||||||
printf ("\n");
|
|
||||||
/* overwrite the sum in the bin file, with the actual */
|
|
||||||
lseek (ifd, SHA1_SUM_POS, SEEK_END);
|
|
||||||
if (write (ifd, output, SHA1_SUM_LEN) != SHA1_SUM_LEN) {
|
|
||||||
fprintf (stderr, "%s: Can't write %s: %s\n",
|
|
||||||
cmdname, imagefile, strerror(errno));
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
free (data);
|
|
||||||
(void) munmap((void *)ptr, len);
|
|
||||||
(void) close (ifd);
|
|
||||||
}
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
Reference in New Issue
Block a user