Skip to content

Commit

Permalink
objects: Rename ulpatch-hello to hello
Browse files Browse the repository at this point in the history
this object actually just for test.

Signed-off-by: Rong Tao <rongtao@cestc.cn>
  • Loading branch information
Rtoax committed May 14, 2024
1 parent 474b4d2 commit 65f2a3f
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ set(ULPATCH_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include/ulpatch/)
set(ULPATCH_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/ulpatch/)
# see src/patch/objects/ftrace/CMakeLists.txt
set(FTRACE_MCOUNT_OBJ ftrace-mcount.obj)
# see src/patch/objects/ulpatch-hello/CMakeLists.txt
set(ULPATCH_HELLO_OBJ ulpatch-hello.obj)
# see src/patch/objects/hello/CMakeLists.txt
set(ULPATCH_HELLO_OBJ hello.obj)

# check processor architecture
# only support x86_64 and aarch64 right now.
Expand Down Expand Up @@ -121,7 +121,7 @@ endif()

# macro ULPATCH_FTRACE_OBJ_PATH="/usr/share/ulpatch/ftrace-mcount.obj" for example
set(UTILS_FLAGS "${UTILS_FLAGS}" ULPATCH_FTRACE_OBJ_PATH="${ULPATCH_SHARE_DIR}${FTRACE_MCOUNT_OBJ}")
# macro ULPATCH_HELLO_OBJ_PATH="/usr/share/ulpatch/ulpatch-hello.obj" for example
# macro ULPATCH_HELLO_OBJ_PATH="/usr/share/ulpatch/hello.obj" for example
set(UTILS_FLAGS "${UTILS_FLAGS}" ULPATCH_HELLO_OBJ_PATH="${ULPATCH_SHARE_DIR}${ULPATCH_HELLO_OBJ}")


Expand Down Expand Up @@ -155,7 +155,7 @@ DESTINATION ${ULPATCH_INCLUDE_DIR}
install(
PROGRAMS
${PROJECT_SOURCE_DIR}/src/patch/objects/ftrace/${FTRACE_MCOUNT_OBJ}
${PROJECT_SOURCE_DIR}/src/patch/objects/ulpatch-hello/${ULPATCH_HELLO_OBJ}
${PROJECT_SOURCE_DIR}/src/patch/objects/hello/${ULPATCH_HELLO_OBJ}
DESTINATION ${ULPATCH_SHARE_DIR}
)

Expand Down
2 changes: 1 addition & 1 deletion src/patch/objects/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# Copyright (C) 2022-2024 Rong Tao <rtoax@foxmail.com>
#
add_subdirectory(ftrace)
add_subdirectory(ulpatch-hello)
add_subdirectory(hello)

Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ target_compile_definitions(${ULPATCH_OBJ_TARGET} PRIVATE
ULPATCH_TEST
)

set(ULPATCH_HELLO_OBJ ulpatch-hello.obj)
set(ULPATCH_HELLO_OBJ hello.obj)

set(make_include ${PROJECT_SOURCE_DIR}/src/)
message(STATUS "=== Compile ulpatch hello object ${make_include}")
add_custom_command(
TARGET ${ULPATCH_OBJ_TARGET}
COMMAND make INCS1="-I${make_include}" FTRACE_OBJ=${ULPATCH_HELLO_OBJ}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/patch/objects/ulpatch-hello
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/patch/objects/hello
)

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ifdef ULPATCH_HELLO_OBJ
TARGETS = $(ULPATCH_HELLO_OBJ)
else
TARGETS = ulpatch-hello.obj
TARGETS = hello.obj
endif

CC = gcc
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ aux_source_directory(. DIR_SRCS)
aux_source_directory(arch DIR_ARCH_SRCS)
aux_source_directory(elf DIR_ELF_SRCS)
aux_source_directory(patch DIR_PATCH_SRCS)
aux_source_directory(patch/object/ulpatch-hello/ DIR_PATCH_OBJ_HELLO_SRCS)
aux_source_directory(patch/object/hello/ DIR_PATCH_OBJ_HELLO_SRCS)
aux_source_directory(utils DIR_UTILS_SRCS)

add_executable(ulpatch_test
Expand Down
2 changes: 1 addition & 1 deletion src/tests/patch/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static const struct ulpatch_object {
} ulpatch_objs[] = {
/* /usr/share/ulpatch/ftrace-mcount.obj */
{ULPATCH_FTRACE_OBJ_PATH},
/* /usr/share/ulpatch/ulpatch-hello.obj */
/* /usr/share/ulpatch/hello.obj */
{ULPATCH_HELLO_OBJ_PATH},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/**
* This is target function to patch, the patch object see
* src/patch/objects/ulpatch-hello/
* src/patch/objects/hello/
*/
void hello_world(void)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/hello/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEMP=$(getopt \
--long error \
--long verbose \
--long help \
-n ulpatch-hello-test -- "$@")
-n ulpatch-tests-hello -- "$@")

test $? != 0 && __usage__ 1

Expand Down
2 changes: 1 addition & 1 deletion ulpatch.spec
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ popd
%{_mandir}/man8/ulpinfo.8.gz
%{_mandir}/man8/ultask.8.gz
%{_datadir}/ulpatch/ftrace-mcount.obj
%{_datadir}/ulpatch/ulpatch-hello.obj
%{_datadir}/ulpatch/hello.obj

%files devel
%{_includedir}/ulpatch/meta.h
Expand Down

0 comments on commit 65f2a3f

Please sign in to comment.