-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nvme cli. Fixes: #562 Signed-off-by: Noel Georgi <[email protected]>
- Loading branch information
Showing
10 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: libnvme | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/openssl:{{ .BUILD_ARG_PKGS }}" | ||
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/libjson-c:{{ .BUILD_ARG_PKGS }}" | ||
steps: | ||
- sources: | ||
- url: https://github.com/linux-nvme/libnvme/archive/refs/tags/{{ .LIBNVME_VERSION }}.tar.gz | ||
destination: libnvme.tar.gz | ||
sha256: 6d5d8ba2cc4c94a61a994c9f7f25b3b26ef973fb5c0daa37729890903f37a1f1 | ||
sha512: 8720f2907a3d13af44fb3deec883cd6eb247d5861c4459b5fe0e67ff9ecfb565462a5faf39d43e08b5284f3e8ca8e72d41b333984beaa45d3287b1a258f3e59d | ||
prepare: | ||
- | | ||
tar xf libnvme.tar.gz --strip-components=1 | ||
mkdir -p /usr/bin | ||
ln -s /toolchain/bin/env /usr/bin/env | ||
ln -s /toolchain/bin/python3 /toolchain/bin/python | ||
pip3 install ninja | ||
export PKG_CONFIG_PATH=/usr/lib/pkgconfig | ||
meson setup \ | ||
-Db_lto=true \ | ||
-Djson-c=enabled \ | ||
-Dpython=disabled \ | ||
.build | ||
build: | ||
- | | ||
meson compile -C .build | ||
install: | ||
- | | ||
DESTDIR=/rootfs meson install -C .build | ||
finalize: | ||
- from: /rootfs | ||
to: /rootfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: v1alpha1 | ||
metadata: | ||
name: nvme-cli | ||
version: "$VERSION" | ||
author: Sidero Labs | ||
description: | | ||
This system extension provides the NVMe command line interface. | ||
compatibility: | ||
talos: | ||
version: ">= v1.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/nvme-cli/basename.patch | ||
--- a/plugins/netapp/netapp-nvme.c 2024-10-31 10:39:11 | ||
+++ b/plugins/netapp/netapp-nvme.c 2024-11-11 21:02:24 | ||
@@ -22,6 +22,7 @@ | ||
#include <unistd.h> | ||
#include <errno.h> | ||
#include <string.h> | ||
+#include <libgen.h> | ||
|
||
#include "common.h" | ||
#include "nvme.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/nvme-cli/locale.patch | ||
diff --git a/nvme-print.c b/nvme-print.c | ||
index 170e5c12..5b1f2e82 100644 | ||
--- a/nvme-print.c | ||
+++ b/nvme-print.c | ||
@@ -797,6 +797,10 @@ static bool is_fahrenheit_country(const char *country) | ||
return false; | ||
} | ||
|
||
+#ifndef LC_MEASUREMENT | ||
+#define LC_MEASUREMENT LC_ALL | ||
+#endif | ||
+ | ||
static bool is_temperature_fahrenheit(void) | ||
{ | ||
const char *locale, *underscore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: nvme-cli | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/openssl:{{ .BUILD_ARG_PKGS }}" | ||
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/libjson-c:{{ .BUILD_ARG_PKGS }}" | ||
- stage: libnvme | ||
from: /rootfs # build dependency | ||
- stage: libnvme | ||
from: /rootfs | ||
to: /rootfs | ||
steps: | ||
- sources: | ||
- url: https://github.com/linux-nvme/nvme-cli/archive/refs/tags/{{ .NVME_CLI_VERSION }}.tar.gz | ||
destination: nvme-cli.tar.gz | ||
sha256: 5e4dc73dbb488c6b1e6ad1c78d0c62b624076fcb0c052bd9039674a1dbd6517b | ||
sha512: 33de20ad990a3b87fef46fa486832edde41907223aa6b8a47606e605b360745fd7e2054226bf93a59b2a09c6bc04d0b684e4b3bb27c3fc0e6110c64a558cadc0 | ||
prepare: | ||
- | | ||
tar xf nvme-cli.tar.gz --strip-components=1 | ||
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig | ||
mkdir -p /usr/bin | ||
ln -s /toolchain/bin/env /usr/bin/env | ||
ln -s /toolchain/bin/python3 /toolchain/bin/python | ||
pip3 install ninja | ||
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig | ||
patch -p1 < /pkg/patches/locale.patch | ||
patch -p1 < /pkg/patches/basename.patch | ||
meson setup \ | ||
-Db_lto=true \ | ||
-Dudevrulesdir=/usr/lib/udev/rules.d \ | ||
-Djson-c=enabled \ | ||
.build | ||
- | | ||
sed -i 's#$VERSION#{{ .NVME_CLI_VERSION }}#' /pkg/manifest.yaml | ||
build: | ||
- | | ||
meson compile -C .build | ||
install: | ||
- | | ||
DESTDIR=/rootfs meson install -C .build | ||
rm -rf /rootfs/usr/local/{include,lib/{dracut,systemd},share} | ||
test: | ||
- | | ||
mkdir -p /extensions-validator-rootfs | ||
cp -r /rootfs/ /extensions-validator-rootfs/rootfs | ||
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml | ||
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}" | ||
finalize: | ||
- from: /rootfs | ||
to: /rootfs | ||
- from: /pkg/manifest.yaml | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERSION: "{{ .NVME_CLI_VERSION }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# renovate: datasource=github-releases depName=linux-nvme/libnvme | ||
LIBNVME_VERSION: v1.11.1 | ||
# renovate: datasource=github-releases depName=linux-nvme/nvme-cli | ||
NVME_CLI_VERSION: v2.11 |