%attr(0555,system_fw,system_fw) %{_bindir}/device_board_get_partition_ab_cloned
%attr(0555,system_fw,system_fw) %{_bindir}/device_board_set_partition_status
%attr(0555,system_fw,system_fw) %{_bindir}/device_board_get_partition_status
-%attr(0554,system_fw,system_fw) %{_bindir}/device_board_set_upgrade_status
-%attr(0555,system_fw,system_fw) %{_bindir}/device_board_get_upgrade_status
+%attr(0554,system_fw,system_fw) %{_bindir}/device_board_set_upgrade_progress_status
+%attr(0555,system_fw,system_fw) %{_bindir}/device_board_get_upgrade_progress_status
+%attr(0554,system_fw,system_fw) %{_bindir}/device_board_set_upgrade_state
+%attr(0555,system_fw,system_fw) %{_bindir}/device_board_get_upgrade_state
%files auto-test
%manifest deviced.manifest
ADD_BOOT_EXECUTABLE(device_board_get_partition_status get-partition-status.c)
ADD_BOOT_EXECUTABLE(device_board_set_partition_status set-partition-status.c)
-ADD_BOOT_EXECUTABLE(device_board_set_upgrade_status set-upgrade-status.c)
-ADD_BOOT_EXECUTABLE(device_board_get_upgrade_status get-upgrade-status.c)
+ADD_BOOT_EXECUTABLE(device_board_set_upgrade_progress_status set-upgrade-progress-status.c)
+ADD_BOOT_EXECUTABLE(device_board_get_upgrade_progress_status get-upgrade-progress-status.c)
+
+ADD_BOOT_EXECUTABLE(device_board_set_upgrade_state set-upgrade-state.c)
+ADD_BOOT_EXECUTABLE(device_board_get_upgrade_state get-upgrade-state.c)
--- /dev/null
+/*
+ * device-board-get-upgrade-progress-status
+ *
+ * Copyright (c) 2022 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[])
+{
+ int status;
+ int ret;
+
+ ret = hal_device_board_get_upgrade_progress_status(&status);
+
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("%d\n", status);
+ return 0;
+}
--- /dev/null
+/*
+ * device-board-get-upgrade-state
+ *
+ * Copyright (c) 2024 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>
+
+#define BUFFER_LEN 1024
+
+int main(int argc, char *argv[])
+{
+ char state_buffer[BUFFER_LEN];
+ int ret;
+
+ ret = hal_device_board_get_upgrade_state(state_buffer, BUFFER_LEN);
+ if(ret < 0) {
+ printf("FAILURE\n");
+ return 1;
+ }
+
+ printf("%s\n", state_buffer);
+ return 0;
+}
+++ /dev/null
-/*
- * device-board-get-upgrade-status
- *
- * Copyright (c) 2022 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[])
-{
- int status;
- int ret;
-
- ret = hal_device_board_get_upgrade_status(&status);
-
- if(ret < 0) {
- printf("FAILURE\n");
- return 1;
- }
-
- printf("%d\n", status);
- return 0;
-}
--- /dev/null
+/*
+ * device-board-set-upgrade-progress-status
+ *
+ * Copyright (c) 2022 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 <stdlib.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <hal/device/hal-board.h>
+
+static int parse_integer(const char *str, int *val)
+{
+ char *endptr = NULL;
+ long longval = 0;
+
+ errno = 0;
+ longval = strtol(str, &endptr, 10);
+
+ if(errno || *endptr) {
+ errno = 0;
+ return -EINVAL;
+ }
+
+ if(longval > INT_MAX || longval < INT_MIN) {
+ return -EINVAL;
+ }
+
+ *val = (int)longval;
+
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ int status;
+ int parse_ret, ret;
+
+ if(argc < 2) {
+ goto err;
+ }
+
+ parse_ret = parse_integer(argv[1], &status);
+
+ if(parse_ret < 0) {
+ goto err;
+ }
+
+ ret = hal_device_board_set_upgrade_progress_status(status);
+
+ if(ret < 0) {
+ goto err;
+ }
+
+ printf("SUCCESS\n");
+ return 0;
+
+err:
+ printf("FAILURE\n");
+ return 1;
+}
--- /dev/null
+/*
+ * device-board-set-upgrade-state
+ *
+ * Copyright (c) 2024 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 <stdlib.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <hal/device/hal-board.h>
+
+int main(int argc, char *argv[])
+{
+ char *state_from = NULL;
+ char *state_to = NULL;
+ int ret = 0;
+
+ if(argc < 3)
+ goto error;
+
+ state_from = argv[1];
+ state_to = argv[2];
+
+ ret = hal_device_board_set_upgrade_state(state_from, state_to);
+ if(ret < 0)
+ goto error;
+
+ printf("SUCCESS\n");
+ return 0;
+
+error:
+ printf("FAILURE\n");
+ return 1;
+}
+++ /dev/null
-/*
- * device-board-set-upgrade-status
- *
- * Copyright (c) 2022 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 <stdlib.h>
-#include <errno.h>
-#include <limits.h>
-
-#include <hal/device/hal-board.h>
-
-static int parse_integer(const char *str, int *val)
-{
- char *endptr = NULL;
- long longval = 0;
-
- errno = 0;
- longval = strtol(str, &endptr, 10);
-
- if(errno || *endptr) {
- errno = 0;
- return -EINVAL;
- }
-
- if(longval > INT_MAX || longval < INT_MIN) {
- return -EINVAL;
- }
-
- *val = (int)longval;
-
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- int status;
- int parse_ret, ret;
-
- if(argc < 2) {
- goto err;
- }
-
- parse_ret = parse_integer(argv[1], &status);
-
- if(parse_ret < 0) {
- goto err;
- }
-
- ret = hal_device_board_set_upgrade_status(status);
-
- if(ret < 0) {
- goto err;
- }
-
- printf("SUCCESS\n");
- return 0;
-
-err:
- printf("FAILURE\n");
- return 1;
-}