diff --git a/cmd/CMakeLists.txt b/cmd/CMakeLists.txt index 21baf36ad801..813522b16478 100644 --- a/cmd/CMakeLists.txt +++ b/cmd/CMakeLists.txt @@ -11,3 +11,4 @@ add_subdirectory(zstream) add_subdirectory(os/windows/kstat) add_subdirectory(os/windows/zfsinstaller) add_subdirectory(raidz_test) +add_subdirectory(zinject) diff --git a/cmd/zinject/CMakeLists.txt b/cmd/zinject/CMakeLists.txt new file mode 100644 index 000000000000..d34a3c63df8b --- /dev/null +++ b/cmd/zinject/CMakeLists.txt @@ -0,0 +1,22 @@ + +use_clang() + +um_add_executable(zinject + zinject.c + translate.c + os/windows/resource.rc +) + +target_link_libraries(zinject PRIVATE + libnvpair + libuutil + libuuid + libzfs + libzfs_core + libzpool +) +install(TARGETS zinject RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +install(FILES $ + DESTINATION "${CMAKE_INSTALL_BINDIR}" + OPTIONAL +) diff --git a/cmd/zinject/os/windows/resource.h b/cmd/zinject/os/windows/resource.h new file mode 100644 index 000000000000..8a09cc650089 --- /dev/null +++ b/cmd/zinject/os/windows/resource.h @@ -0,0 +1,15 @@ +// {{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resource.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/cmd/zinject/os/windows/resource.rc b/cmd/zinject/os/windows/resource.rc new file mode 100644 index 000000000000..aa31f8d4c6e3 --- /dev/null +++ b/cmd/zinject/os/windows/resource.rc @@ -0,0 +1,110 @@ +// Microsoft Visual C++ generated resource script. +// +#include +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (India) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENN) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_INDIA +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "400904b0" + BEGIN + VALUE "CompanyName", "TODO: " + VALUE "FileDescription", "zinject.exe" + VALUE "FileVersion", "1.0.0.1" + VALUE "LegalCopyright", "Copyright (C) 2021" + VALUE "OriginalFilename", "resource.rc" + VALUE "ProductName", "zinject.exe" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x4009, 1200 + END +END + +#endif // English (India) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/cmd/zinject/zinject.c b/cmd/zinject/zinject.c index a11b6d0b7fac..bb577c3f551a 100644 --- a/cmd/zinject/zinject.c +++ b/cmd/zinject/zinject.c @@ -145,7 +145,6 @@ #include #include #include -#include #include #include