diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..bacb7796a69564a1e4b64d49cb14d980ca8c8106 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 HiSilicon Technologies Co., Ltd. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ubctl.spec b/ubctl.spec new file mode 100644 index 0000000000000000000000000000000000000000..e6515f86207e09b202510e9bdde2af2e3873ade6 --- /dev/null +++ b/ubctl.spec @@ -0,0 +1,63 @@ +Summary: Implementation of ubctl +Name: ubctl +Version: 1.0.0 +Release: 1 +License: MIT +URL: https://gitee.com/openeuler/ubctl +Source0: %{name}.tar.gz + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: make + +BuildRoot: %{name}-%{version}-%{release} + +%description +This implementation provides ubctl sending and reception. + +%package devel +Summary: Implementation of ubctl(UB) - Tools and header files for developers +Group: Development/Libraries/C +BuildRequires: pkgconfig +Requires: libubctl = %{version}-%{release} + +%description devel +This package is required to develop alternate clients for ubctl. + +The ubctl tool implements UB-related DFX functions by invoking the +ub_fwctl deriver. +This tool is mainly used to parse the command line input by the user and +send query commands to the kernel state. After the kernel state returns +the query results, it parses and prints the expected results. + +%prep +%setup -q -n ubctl + +# %build +# mkdir ubctl/build +# cd ubctl/build +# cmake ../src +# make + +%build +rm -rf build +cmake -S . -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo + +cmake --build build -- -j$(nproc) + +%install +rm -rf %{buildroot} +DESTDIR=%{buildroot} cmake --install build + +%files +%{_bindir}/ubctl + + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog +* Tue Nov 4 2025 Jiaqi Cheng - 1.0.0-1 +- Add ubctl tool to query desired information diff --git a/ubctl.tar.gz b/ubctl.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e76a4f7cb558a7474257fd826927a2b880c9bff7 Binary files /dev/null and b/ubctl.tar.gz differ