From 8734e33747a9a8ad12564251e62fe262b238ba0a Mon Sep 17 00:00:00 2001 From: Renuka Varry Date: Mon, 27 Apr 2026 19:48:23 +0000 Subject: [PATCH] RDKEMW-10725:gstreamer-cleanup conditions when cdl_flashed_file_name is missing 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 recipies-multimedia 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 30131b16..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/sh -c 'if [[ ! -f /opt/previous_flashed_file_name || ! -f /opt/cdl_flashed_file_name || ${CDLFILE} != *"${PREV_CDLFILE}"* ]]; then echo "Removing gstreamer registry on bootup after CDL"; 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