diff options
author | Leah Rowe <vimuser@noreply.codeberg.org> | 2023-11-06 18:05:59 +0000 |
---|---|---|
committer | Leah Rowe <vimuser@noreply.codeberg.org> | 2023-11-06 18:05:59 +0000 |
commit | d3ade2085b6c5d615e89443d163b8647e9ab8515 (patch) | |
tree | 5d8755f5ce32ccabe55c2ebdd9ebf59c6c073e1c /util/nvmutil | |
parent | 931d646df7d660e202293da57db112d7b09c9858 (diff) | |
parent | 866087211fddd5b468841fa29b17b65dbd582b7c (diff) |
Merge pull request 'nvmhelp' (#152) from Riku_V/lbmk:nvmhelp into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/152
Diffstat (limited to 'util/nvmutil')
-rw-r--r-- | util/nvmutil/Makefile | 2 | ||||
-rw-r--r-- | util/nvmutil/nvmutil.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/util/nvmutil/Makefile b/util/nvmutil/Makefile index f9f72370..f25f6dd5 100644 --- a/util/nvmutil/Makefile +++ b/util/nvmutil/Makefile @@ -6,7 +6,7 @@ CC=cc CFLAGS=-Os -Wall -Wextra -Werror -pedantic PREFIX?=/usr/bin -nvm: +nvm: nvmutil.c $(CC) $(CFLAGS) nvmutil.c -o nvm install: nvm diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 0ccfaf32..35abbfae 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: MIT */ /* SPDX-FileCopyrightText: 2022, 2023 Leah Rowe <leah@libreboot.org> */ +/* SPDX-FileCopyrightText: 2023 Riku Viitanen <riku.viitanen@protonmail.com> */ #include <sys/stat.h> @@ -61,8 +62,16 @@ void (*cmd)(void) = NULL; int main(int argc, char *argv[]) { - if (argc < 3) + if (argc < 3) { + fprintf(stderr, "USAGE:\n"); + fprintf(stderr, " %s FILE dump\n", argv[0]); + fprintf(stderr, " %s FILE setmac [MAC]\n", argv[0]); + fprintf(stderr, " %s FILE swap\n", argv[0]); + fprintf(stderr, " %s FILE copy 0|1\n", argv[0]); + fprintf(stderr, " %s FILE brick 0|1\n", argv[0]); + fprintf(stderr, " %s FILE setchecksum 0|1\n", argv[0]); err(errno = ECANCELED, "Too few arguments"); + } flags = (strcmp(COMMAND, "dump") == 0) ? O_RDONLY : flags; filename = argv[1]; #ifdef __OpenBSD__ |