From 5bef7d60a83a60baed7fd89c7a61086d8499b084 Mon Sep 17 00:00:00 2001 From: Renuka Varry Date: Wed, 6 May 2026 17:15:02 +0000 Subject: [PATCH] RDKEMW-17800:gst-cleanup conditions when cdl_flashed_file_name is not present Reason for change: gstreamer-cleanup is happening on every reboot when /opt/cdl_flashed_file_name is missing. Fixing the issues as well as re-locating gstreamer-cleanup.service file to meta-rdk-video instead of sysint folder Test Procedure: Boot the TV and check for gstreamer-cleanup metrics in rdk_milestones.log Risks: low Signed-off-by: Renuka Varry --- systemd_units/gstreamer-cleanup.service | 38 ------------------------- 1 file changed, 38 deletions(-) delete mode 100644 systemd_units/gstreamer-cleanup.service diff --git a/systemd_units/gstreamer-cleanup.service b/systemd_units/gstreamer-cleanup.service deleted file mode 100644 index 90b0264c..00000000 --- a/systemd_units/gstreamer-cleanup.service +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################## -# If not stated otherwise in this file or this component's LICENSE file the -# following copyright and licenses apply: -# -# Copyright 2020 RDK Management -# -# 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. -############################################################################## - -[Unit] -Description=Cleans up Gstreamer Registry - -After=local-fs.target nvram.service -Before=wpeframework.service - -[Service] -Type=oneshot -RemainAfterExit=Yes -Environment="CDLFILE=$(cat /opt/cdl_flashed_file_name)" -Environment="PREV_CDLFILE=$(cat /opt/previous_flashed_file_name)" -Environment="GST_REGISTRY=/opt/.gstreamer/registry.bin" -ExecStartPre=/bin/sh -c 'if [ -f /lib/rdk/logMilestone.sh ];then sh /lib/rdk/logMilestone.sh "GST_CLEANUP_START"; fi;' -ExecStart=-/bin/bash -c 'CUR_IMAGE=$(grep "^imagename:" /version.txt 2>/dev/null | cut -d ":" -f2 | tr -d " \r\n"); if [[ ! -f /opt/previous_flashed_file_name || ( ! -f /opt/cdl_flashed_file_name && "${PREV_CDLFILE}" != *"${CUR_IMAGE}"* ) || ( -f /opt/cdl_flashed_file_name && "${CDLFILE}" != *"${PREV_CDLFILE}"* ) ]]; then echo "Cleanup and re-creating gstreamer registry on bootup after CDL or FSR"; rm -rf /opt/.gstreamer; GST_REGISTRY_UPDATE=yes gst-inspect-1.0 >/dev/null 2>&1; elif [[ ! -f /opt/.gstreamer/registry.bin ]]; then echo "Gstreamer registry empty"; rm -rf /opt/.gstreamer; GST_REGISTRY_UPDATE=yes gst-inspect-1.0 >/dev/null 2>&1; else echo "gstreamer registry is not removed, previous reboot is not due to CDL"; fi' -ExecStartPost=/bin/sh -c 'if [ -f /lib/rdk/logMilestone.sh ];then sh /lib/rdk/logMilestone.sh "GST_CLEANUP_COMPLETE"; fi;' -ExecStop=/bin/sh -c 'FW_UPDATE_STATE=$(cat /opt/fwdnldstatus.txt | grep FwUpdateState | cut -d "|" -f2); echo "FW_UPDATE_STATE: $FW_UPDATE_STATE"; if [ "$FW_UPDATE_STATE" == "Preparing to reboot" ]; then echo "Removing gstreamer registry after firmware update"; rm -rf /opt/.gstreamer; fi;' - -[Install] -WantedBy=multi-user.target