ADD_SUBDIRECTORY(src/battery-monitor)
ADD_SUBDIRECTORY(src/libdeviced)
-ADD_SUBDIRECTORY(src/tools/devicectl)
-ADD_SUBDIRECTORY(src/tools/partition-switch)
+ADD_SUBDIRECTORY(tools/devicectl)
+ADD_SUBDIRECTORY(tools/board)
IF(TIZEN_FEATURE_USBHOST_TEST STREQUAL on)
ADD_SUBDIRECTORY(tests/usb-host-ffs-test-daemon)
ENDIF()
#if #{?usb_module} == on ==> always on
%{_bindir}/direct_set_debug.sh
%{TZ_SYS_DUMPGEN}/dump_pmstate_log.sh
-%attr(2551,root,root) %{_bindir}/partition_switch
+%attr(2551,root,root) %{_bindir}/device_board_switch_partition
+%attr(2551,root,root) %{_bindir}/device_board_set_boot_success
+%attr(2551,root,root) %{_bindir}/device_board_clear_boot_mode
+%attr(2551,root,root) %{_bindir}/device_board_get_boot_mode
#endif
%files auto-test
+++ /dev/null
-SET(CMAKE_C_FLAGS ENV${CFLAGS})
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(REQUIRED_PKGS REQUIRED hal-api-device)
-FOREACH(flag ${REQUIRED_PKGS_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS ${EXTRA_CFLAGS})
-
-ADD_EXECUTABLE(partition_switch partition-switch.c)
-SET_TARGET_PROPERTIES(partition_switch PROPERTIES COMPILE_FLAGS "-fPIE")
-SET_TARGET_PROPERTIES(partition_switch PROPERTIES LINK_FLAGS "-pie")
-TARGET_LINK_LIBRARIES(partition_switch ${REQUIRED_PKGS_LDFLAGS})
-
-INSTALL(TARGETS partition_switch DESTINATION bin)
+++ /dev/null
-#include <hal/device/hal-board.h>
-
-int main(int argc, char *argv[])
-{
- return hal_device_board_switch_partition(argc, argv);
-}
--- /dev/null
+SET(CMAKE_C_FLAGS ENV${CFLAGS})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(REQUIRED_PKGS REQUIRED hal-api-device)
+FOREACH(flag ${REQUIRED_PKGS_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS ${EXTRA_CFLAGS})
+
+MACRO(ADD_BOOT_EXECUTABLE BINARY_NAME SRCS)
+ ADD_EXECUTABLE(${BINARY_NAME} ${SRCS})
+ SET_TARGET_PROPERTIES(${BINARY_NAME} PROPERTIES COMPILE_FLAGS "-fPIE")
+ SET_TARGET_PROPERTIES(${BINARY_NAME} PROPERTIES LINK_FLAGS "-pie")
+ TARGET_LINK_LIBRARIES(${BINARY_NAME} ${REQUIRED_PKGS_LDFLAGS})
+ INSTALL(TARGETS ${BINARY_NAME} DESTINATION bin)
+ENDMACRO()
+
+ADD_BOOT_EXECUTABLE(device_board_switch_partition switch-partition.c)
+ADD_BOOT_EXECUTABLE(device_board_set_boot_success set-boot-success.c)
+ADD_BOOT_EXECUTABLE(device_board_clear_boot_mode clear-boot-mode.c)
+ADD_BOOT_EXECUTABLE(device_board_get_boot_mode get-boot-mode.c)
--- /dev/null
+/*
+ * device-board-clear-boot-mode
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <hal/device/hal-board.h>
+
+int main(int argc, char *argv[])
+{
+ return hal_device_board_clear_boot_mode();
+}
--- /dev/null
+/*
+ * device-board-get-boot-mode
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <hal/device/hal-board.h>
+
+int main(int argc, char *argv[])
+{
+ char buffer[1024] = { 0, };
+ int ret;
+
+ ret = hal_device_board_get_boot_mode(buffer, sizeof(buffer));
+ if (ret == 0)
+ printf("%s", buffer);
+
+ return ret;
+}
--- /dev/null
+/*
+ * device-board-set-boot-success
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <hal/device/hal-board.h>
+
+int main(int argc, char *argv[])
+{
+ return hal_device_board_set_boot_success();
+}
--- /dev/null
+/*
+ * device-board-switch-partition
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <hal/device/hal-board.h>
+
+int main(int argc, char *argv[])
+{
+ return hal_device_board_switch_partition(argc, argv);
+}