Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions cov_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apt-get update && apt-get install -y libsoup-3.0

#Build rfc
cd $ROOT
rm -rf rfc
git clone https://github.com/rdkcentral/rfc.git
Comment on lines 8 to 10

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm -rf rfc is executed immediately after cd $ROOT without checking whether the cd succeeded. If cd fails (e.g., permission or missing dir), this removal will run in the previous working directory and may delete an unintended rfc folder. Consider using cd "$ROOT" || exit 1 (or set -e) and deleting via an explicit path like rm -rf -- "$ROOT/rfc" to make the target unambiguous.

Copilot uses AI. Check for mistakes.
Comment on lines 8 to 10

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm -rf rfc is executed relative to the current directory. If cd $ROOT ever fails (or ROOT changes), this could delete an unintended rfc directory. Safer pattern: verify cd succeeded and remove using an absolute path (e.g., "$ROOT/rfc"), with ROOT quoted/validated.

Copilot uses AI. Check for mistakes.
cd rfc
autoreconf -i
Expand All @@ -21,7 +22,8 @@ cd ../utils
make && make install

#Build yajl - tr69 alone needs this specific version
cd $ROOT
cd $ROOT
rm -rf yajl
git clone https://github.com/lloyd/yajl.git -b 1.x
Comment on lines 24 to 27

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same risk as above: rm -rf yajl runs after cd $ROOT without validating that the directory change succeeded, so a failed cd could remove the wrong yajl directory. Add a cd "$ROOT" || exit 1 / set -e guard and prefer removing an explicit path (e.g., rm -rf -- "$ROOT/yajl") to avoid unintended deletions.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to 27

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same safety concern as above: rm -rf yajl relies on cd $ROOT having worked and $ROOT being what you expect. Using an absolute path ("$ROOT/yajl") and/or guarding the cd would make the cleanup safer.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to 27

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same risk as above: rm -rf yajl depends on cd $ROOT having succeeded. Consider using an absolute path (rm -rf "$ROOT/yajl") and failing fast if cd doesn’t work.

Copilot uses AI. Check for mistakes.
cd yajl
Comment on lines +25 to 28

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same safety issue as above: rm -rf yajl is executed based on a prior cd $ROOT without checking that the directory change succeeded. Please ensure the script exits if cd "$ROOT" fails (or enable fail-fast) before performing destructive deletes.

Copilot uses AI. Check for mistakes.
mkdir build
Expand All @@ -40,17 +42,23 @@ git clone https://github.com/rdkcentral/rdkvhal-devicesettings-raspberrypi4.git
git clone https://github.com/rdkcentral/iarmbus.git
git clone https://github.com/rdkcentral/remote_debugger.git

git clone https://github.com/rdkcentral/telemetry.git

Comment on lines +45 to +46

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

telemetry is cloned without first removing any existing $ROOT/telemetry directory, while the script does clean other cloned dependencies. This will cause git clone to fail on re-runs in the same container/host; add a corresponding cleanup (or switch to git -C telemetry pull style) for idempotency.

Copilot uses AI. Check for mistakes.


# Build devicesettings version with fixes for native build and use that as a stub
# TODO This is not present in mainline versions. Component maintainers will have to provide this in future.
cd $ROOT
rm -rf devicesettings
git clone https://github.com/rdkcentral/devicesettings.git -b feature/RDKE-539
git clone https://github.com/rdkcentral/devicesettings.git -b feature/RDKEMW-539
cd devicesettings
autoreconf -i
sed -i '/#include "dsAudio.h"/d' /usr/devicesettings/rpc/cli/dsAudio.c
sed -i '/device::HdmiInput::getInstance().isPortConnected(portId);/d' /usr/devicesettings/ds/audioOutputPort.cpp
Comment on lines 56 to 57

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new sed -i edit targets an absolute path under /usr/devicesettings/... even though the script is already in the freshly cloned devicesettings working tree. This makes the script brittle (depends on install location and ROOT always being /usr) and can accidentally edit a different checkout if the path exists from a prior run. Prefer editing the file via a path relative to the current repo directory, and fail clearly if the file isn’t present.

Suggested change
sed -i '/#include "dsAudio.h"/d' /usr/devicesettings/rpc/cli/dsAudio.c
sed -i '/_GetAudioPortType/,/}/d' /usr/devicesettings/rpc/srv/dsAudio.c
sed -i '/device::HdmiInput::getInstance().isPortConnected(portId);/d' /usr/devicesettings/ds/audioOutputPort.cpp
DS_AUDIO_CLI_FILE=rpc/cli/dsAudio.c
DS_AUDIO_SRV_FILE=rpc/srv/dsAudio.c
DS_AUDIO_OUTPUT_PORT_FILE=ds/audioOutputPort.cpp
if [ ! -f "$DS_AUDIO_CLI_FILE" ]; then
echo "ERROR: Missing file: $DS_AUDIO_CLI_FILE" >&2
exit 1
fi
if [ ! -f "$DS_AUDIO_SRV_FILE" ]; then
echo "ERROR: Missing file: $DS_AUDIO_SRV_FILE" >&2
exit 1
fi
if [ ! -f "$DS_AUDIO_OUTPUT_PORT_FILE" ]; then
echo "ERROR: Missing file: $DS_AUDIO_OUTPUT_PORT_FILE" >&2
exit 1
fi
sed -i '/#include "dsAudio.h"/d' "$DS_AUDIO_CLI_FILE"
sed -i '/_GetAudioPortType/,/}/d' "$DS_AUDIO_SRV_FILE"
sed -i '/device::HdmiInput::getInstance().isPortConnected(portId);/d' "$DS_AUDIO_OUTPUT_PORT_FILE"

Copilot uses AI. Check for mistakes.


./configure
make INCLUDE_FILES="-I/usr/rdk-halif-device_settings/include -I/usr/rpc/include -I/usr/devicesettings/rpc/cli -I/usr/devicesettings/rpc/include -I/usr/iarmbus/core/include -I$WORKDIR/src/unittest/stubs -I/usr/devicesettings/rpc/srv -I/usr/rdkvhal-devicesettings-raspberrypi4" libds_la_CPPFLAGS="-I/usr/rdk-halif-device_settings/include -I/usr/devicesettings/ds/include -I$WORKDIR/src/unittest/stubs/ -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/devicesettings/rpc/include -I/usr/devicesettings/rpc/cli/ -I/usr/devicesettings/rpc/srv -I/usr/devicesettings/ds/include -I/usr/devicesettings/ds/" CFLAGS="-fpermissive"
make INCLUDE_FILES="-I/usr/rdk-halif-device_settings/include -I/usr/telemetry/include -I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I /usr/devicesettings/stubs -I/usr/rpc/include -I/usr/devicesettings/rpc/cli -I/usr/devicesettings/rpc/include -I/usr/iarmbus/core/include -I$WORKDIR/src/unittest/stubs -I/usr/devicesettings/rpc/srv -I/usr/rdkvhal-devicesettings-raspberrypi4" libds_la_CPPFLAGS="-I/usr/rdk-halif-device_settings/include -I/usr/devicesettings/ds/include -I$WORKDIR/src/unittest/stubs/ -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/devicesettings/rpc/include -I/usr/devicesettings/rpc/cli/ -I/usr/devicesettings/rpc/srv -I/usr/devicesettings/ds/include -I/usr/devicesettings/ds/" CFLAGS="-fpermissive"
make install
Comment on lines 60 to 62

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated make INCLUDE_FILES=... line embeds a very large, duplicated include-path list inline, which is hard to audit and easy to break with small typos (there are already repeated -I entries). Consider moving these flags into a variable defined once (or using CPPFLAGS/CXXFLAGS exported earlier) to keep this script maintainable.

Copilot uses AI. Check for mistakes.

# Build and deploy stubs for IARMBus
Expand All @@ -67,17 +75,17 @@ cp libWPEFrameworkPowerController.so /usr/local/lib/libWPEFrameworkPowerControll

echo "##### Building tr69hostif module"
cd $WORKDIR
sed -i '/PKG_CHECK_MODULES(\[PROCPS\], \[libproc >= 3.2.8\])/s/^/#/' ./configure.ac
rm -f ./src/unittest/stubs/rdk_debug.h
autoreconf -i
./configure --enable-IPv6=yes
#sed -i '/PKG_CHECK_MODULES(\[PROCPS\], \[libproc >= 3.2.8\])/s/^/#/' ./configure.ac
#rm -f ./src/unittest/stubs/rdk_debug.h
#autoreconf -i
#./configure --enable-IPv6=yes
Comment on lines 76 to +81

make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I/usr/remote_debugger/src/ -DIPV6_SUPPORT" \
AM_LDFLAGS="-L/usr/local/lib -lrbus -lsecure_wrapper -lcurl -lrfcapi -lrdkloggers -llibparodus -lglib-2.0 -lnanomsg -lIARMBus -lWPEFrameworkPowerController -lds -ldshalcli -ldshalsrv -lwrp-c -lwdmp-c -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -L/usr/lib/x86_64-linux-gnu -lyajl -L/usr/local/lib/x86_64-linux-gnu -ltinyxml2" CXXFLAGS="-fpermissive -DPARODUS_ENABLE -DUSE_REMOTE_DEBUGGER"
make install
#make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I/usr/remote_debugger/src/ -DIPV6_SUPPORT" \
#AM_LDFLAGS="-L/usr/local/lib -lrbus -lsecure_wrapper -lcurl -lrfcapi -lrdkloggers -llibparodus -lglib-2.0 -lnanomsg -lIARMBus -lWPEFrameworkPowerController -lds -ldshalcli -ldshalsrv -lwrp-c -lwdmp-c -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -L/usr/lib/x86_64-linux-gnu -lyajl -L/usr/local/lib/x86_64-linux-gnu -ltinyxml2" CXXFLAGS="-fpermissive -DPARODUS_ENABLE -DUSE_REMOTE_DEBUGGER"
#make install
Comment on lines 76 to +85

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build/install steps for tr69hostif have been entirely commented out (autoreconf, configure, make, make install). Since CI workflows call cov_build.sh to build the component before running L2 tests, this change likely causes L2 to run against whatever binary is preinstalled in the container rather than the code under test (or to fail if no binary is present). Please re-enable the build or replace it with an explicit, deterministic alternative that still builds/installs the PR’s sources.

Copilot uses AI. Check for mistakes.
Comment on lines 76 to +85

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All steps that configure/build/install the tr69hostif module (and related setup) are now commented out, leaving only the echo. If this script is used to produce artifacts for L2 runs, this will likely result in missing binaries/config and failing tests. Either restore the build/install steps or replace them with the intended alternative build flow.

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +85

cd ./src/hostif/parodusClient/pal/mock-parodus/
sh mock_parodus_build.sh
#cd ./src/hostif/parodusClient/pal/mock-parodus/
#sh mock_parodus_build.sh
Comment on lines 76 to +88

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tr69hostif build steps (autoreconf, ./configure, make, make install, and mock-parodus build) are now commented out, but the CI workflow still invokes cov_build.sh to build and then runs L2 tests against /usr/local/bin/tr69hostif. As-is, this script will no longer rebuild/install tr69hostif from the current PR, which can make L2 results stale and can also break the native full build workflow that relies on this script. Please either restore the build/install steps or add an explicit, parameterized switch (e.g., an env var) and update workflows accordingly.

Copilot uses AI. Check for mistakes.

ln -sf /usr/local/bin/tr181 /usr/bin/tr181Set
rbuscli set Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MOCASSH.Enable boolean true
#ln -sf /usr/local/bin/tr181 /usr/bin/tr181Set
#rbuscli set Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MOCASSH.Enable boolean true
Comment on lines +78 to +91

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block comments out the configure/build/install steps for tr69hostif (and also mock-parodus build + the tr181Set symlink + RFC enable). In CI, .github/workflows/L2-tests.yml runs cov_build.sh immediately before run_l2.sh, and run_l2.sh starts /usr/local/bin/tr69hostif; with these lines disabled, the binary/symlink/settings may be missing or stale and L2 will fail or become non-deterministic. Re-enable these steps, or explicitly gate them behind an env var/flag and update the workflow to match the intended behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +87 to +91

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The follow-on steps for mock-parodus build and runtime setup (mock_parodus_build.sh, tr181Set symlink, RFC enable via rbuscli) are now commented out. If these are required for the L2 environment, they should remain enabled (or be made conditional with a clear flag) to avoid silently skipping required setup.

Copilot uses AI. Check for mistakes.
Loading