Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bpf.o to craned rpm pack #384

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,14 @@ install(FILES
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

# Install configuration files
if(ENABLE_BPF)
install(FILES
${CMAKE_BINARY_DIR}/src/Misc/BPF/cgroup_dev_bpf.o
DESTINATION /usr/local/lib64/bpf/
COMPONENT cranedc
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
endif()

install(FILES ${CMAKE_SOURCE_DIR}/etc/config.yaml
DESTINATION /etc/crane/
COMPONENT cranectldc
Expand Down
4 changes: 2 additions & 2 deletions src/Craned/CgroupManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,8 +1316,8 @@ bool CgroupV2::SetDeviceAccess(const std::unordered_set<SlotId> &devices,

auto &bpf_devices = m_cgroup_bpf_devices;
for (const auto &[_, this_device] : Craned::g_this_node_device) {
if (!devices.contains(this_device->dev_id)) {
for (const auto &dev_meta : this_device->device_metas) {
if (!devices.contains(this_device->slot_id)) {
for (const auto &dev_meta : this_device->device_file_metas) {
short op_type = 0;
if (dev_meta.op_type == 'c') {
op_type |= BPF_DEVCG_DEV_CHAR;
Expand Down
2 changes: 1 addition & 1 deletion src/Craned/CgroupManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ enum class ControllerFile : uint64_t {
inline const char *kTaskCgPathPrefix = "Crane_Task_";
inline const char *RootCgroupFullPath = "/sys/fs/cgroup";
#ifdef CRANE_ENABLE_BPF
inline const char *BpfObjectFile = "/etc/crane/cgroup_dev_bpf.o";
inline const char *BpfObjectFile = "/usr/local/lib64/bpf/cgroup_dev_bpf.o";
inline const char *BpfDeviceMapFile = "/sys/fs/bpf/craned_dev_map";
inline const char *BpfMapName = "craned_dev_map";
inline const char *BpfProgramName = "craned_device_access";
Expand Down
Loading