Commit Graph

27 Commits

Author SHA1 Message Date
Leah Rowe
5ba0b98fbc util/nvmutil: correct install usage
one for directory, then copy the binary

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-12 14:01:24 +00:00
Leah Rowe
35ba3aef91 util/nvmutil: fix makefile
forgot to include the binary in the path

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-12 13:56:47 +00:00
Leah Rowe
8269b05a63 util/nvmutil: use install -d instead of mkdir -p
-p isn't portable

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-12 13:53:02 +00:00
Leah Rowe
fe630cba5e util/nvmutil: use chmod instead, in Makefile
yeah, why not use a tool that's been around since the
80s?

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-12 13:43:20 +00:00
Leah Rowe
478c994f34 util/nvmutil: add -m to install on Makefile
also support LDFLAGS

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-12 13:42:12 +00:00
Leah Rowe
6d27853f56 util/nvmutil: use C90 instead of C99
with the other changes made recently, super old
compilers now work.

yes, i needed to change some specifiers in printf.

typedefs provided for uint, and a define included
X OPEN SOURCE 500. and asserts for integers.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-10 09:25:27 +00:00
Leah Rowe
f05a273cb4 util/nvmutil: clean up the Makefile
that option there is already defined in the code

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-09 14:33:21 +00:00
Leah Rowe
f266e2a16c util/nvmutil: standardised Makefile (add all)
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-09 06:46:12 +00:00
Leah Rowe
c96254be8b util/nvmutil: Makefile cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-09 06:38:18 +00:00
Leah Rowe
6a4ad68273 util/nvmutil: add phone section to Makefile
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-09 06:33:52 +00:00
Leah Rowe
ec1e6bd7e8 util/nvmutil: safer / more portable install
explicitly declare the directory path for the given
file (nvmutil), otherwise it's implementation-defined;
on some systems, /bin/nvmutil means a directory named
nvmutil could then contain nvmutil.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-09 06:31:52 +00:00
Leah Rowe
1446df01f2 util/nvmutil: create install dir in Makefile
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-09 06:30:14 +00:00
Leah Rowe
9f75a23a84 util/nvmutil: fix target in Makefile
Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-09 06:28:50 +00:00
Leah Rowe
3b188b4d2b util/nvmutil: specifically enable -std=c99
I also needed: #define _POSIX_C_SOURCE 200809L

I use -pedantic with -Wall -Wextra -Werror, which
forces very strict error handling and ISO C; this
means pread and pwrite aren't available.

The define fixes this.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-09 05:18:53 +00:00
Leah Rowe
1d17a8ffcf util/nvmutil: call it nvmutil in makefile
a package manager by the name "nvm" exists, as
i discovered.

this is a courtesy to them.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-08 01:11:52 +00:00
Leah Rowe
d1ca21628c util/nvmutil: Remove the correct binary on uninstall
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03 02:13:01 +00:00
Leah Rowe
efd50ee548 util/nvmutil: Honour the INSTALL variable
Don't assume "install" is the correct command.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03 02:08:38 +00:00
Leah Rowe
8008838abb util/nvmutil: Don't clean when doing uninstall
The user might wish to uninstall, but not remove the
build that they just did.

The user can still do make clean if they wish.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03 02:06:12 +00:00
Leah Rowe
982f257f58 util/nvmutil: Proper DESTDIR/PREFIX handling
DESTDIR is the root directory where it goes, which
is normally an empty string; PREFIX is where the
bin directory is located, relative to DESTDIR

Default to /usr/local for PREFIX, not /usr, because
/usr/bin is for system utilities.

nvmutil is a local utility.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03 02:03:44 +00:00
Leah Rowe
3f85ae5f85 util/nvmutil: Set CC and CFLAGS only if unset
We don't want to clobber anything that the user set themselves.

Instead, we should respect the user's choice.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03 01:48:52 +00:00
Leah Rowe
57f9906f6d util/nvmutil: Add uninstall to Makefile
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03 01:41:46 +00:00
Leah Rowe
4defe2c608 util/nvmutil: Add distclean to Makefile
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03 01:39:46 +00:00
Riku Viitanen
f12f5c3aee nvmutil: fix makefile
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-11-06 12:53:14 +02:00
Riku Viitanen
9184940f34 nvmutil: make install
make install is nice to have. now respects$(PREFIX) as well.

Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-11-06 01:06:16 +02:00
Leah Rowe
b727f9666b util/: use SPDX license and copyright headers
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 02:49:34 +01:00
Leah Rowe
208620198c Update email address for Leah Rowe copyrights
also, some of them were out of date; years now updated.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 02:27:26 +01:00
Leah Rowe
b3b3642fe2 assimilate nvmutil 2022-11-17 12:07:09 +00:00