Stop displaying error if dlconf is disabled 43/322043/1 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20250516.202936 accepted/tizen/unified/x/20250517.132204
authorMateusz Moscicki <m.moscicki2@samsung.com>
Wed, 2 Apr 2025 09:52:32 +0000 (11:52 +0200)
committerMateusz Moscicki <m.moscicki2@samsung.com>
Wed, 2 Apr 2025 10:33:15 +0000 (12:33 +0200)
In case the glibc is built without dlconf support, the
/hal/etc/ld.so.cache building attempt to results in an error about
unsupported `-I` option by ld.so. This commit turns out the display of
the error in this case.

Change-Id: I0f0bf043ebf3e94753bb24ba848889197888c01e

scripts/iot-hal-backend.post

index a79809d688d444d1e6bd3358ab64d394e871dc76..064e85b9c42deccb1b17c7aa0627e0717730a70f 100644 (file)
@@ -137,4 +137,11 @@ build_time=$(/bin/date -u --date @$build_ts +%H:%M:%S)
 /hal/lib64
 EOF
 
-/usr/sbin/ldconfig -I -C /hal/etc/ld.so.cache -f /tmp/dlconf.txt
+ldconfig_result=$(/usr/sbin/ldconfig -I -C /hal/etc/ld.so.cache -f /tmp/dlconf.txt 2>&1)
+if [ $? != 0 ]; then
+       if [[ "$ldconfig_result" == *"invalid option -- 'I'"* ]]; then
+               echo "/hal/etc/ld.so.cache will not be generated - glibc was compiled without dlconf support"
+       else
+               echo "$ldconfig_result"
+       fi
+fi