diff --git a/software/debian/deb_folder/rules b/software/debian/deb_folder/rules index 1a31c29c..bc5e36f8 100755 --- a/software/debian/deb_folder/rules +++ b/software/debian/deb_folder/rules @@ -45,6 +45,8 @@ override_dh_install: ${ROOT}/etc/init.d/usm-initialize install -m 500 service-files/lvm-snapshot-restore.sh \ ${ROOT}/etc/init.d/lvm-snapshot-restore + install -m 500 service-files/reset-boot-counter.sh \ + ${ROOT}/etc/init.d/reset-boot-counter install -m 600 service-files/software.conf \ ${ROOT}/etc/software/software.conf install -m 644 service-files/policy.json \ diff --git a/software/service-files/reset-boot-counter.service b/software/service-files/reset-boot-counter.service new file mode 100644 index 00000000..4c8cb2bd --- /dev/null +++ b/software/service-files/reset-boot-counter.service @@ -0,0 +1,13 @@ +[Unit] +Description=Reset Boot Counter +DefaultDependencies=no +After=controllerconfig.service storageconfig.service workerconfig.service pmon.service + +[Service] +Type=oneshot +ExecStart=/etc/init.d/reset-boot-counter +TimeoutStartSec=300 +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/software/service-files/reset-boot-counter.sh b/software/service-files/reset-boot-counter.sh new file mode 100644 index 00000000..64a95a30 --- /dev/null +++ b/software/service-files/reset-boot-counter.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Copyright (c) 2025 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +### BEGIN INIT INFO +# Description: reset-boot-counter +# +# Short-Description: Reset Boot Counter +# Provides: reset-boot-counter +# Required-Start: +# Required-Stop: +# Default-Start: 3 5 +# Default-Stop: 3 5 +### END INIT INFO + +NAME=$(basename $0) +BOOT_ENV="/boot/efi/EFI/BOOT/boot.env" + +grub-editenv $BOOT_ENV set boot_failure="0" + +exit 0