Avoid build error if etc/adjtime doesn't exist in chroot
authorAndrás Korn <korn-github.com@elan.rulez.org>
Thu, 4 Aug 2022 11:27:13 +0000 (13:27 +0200)
committerAndrás Korn <korn-github.com@elan.rulez.org>
Thu, 4 Aug 2022 11:27:13 +0000 (13:27 +0200)
In scripts/GRMLBASE/18-timesetup, we assume etc/adjtime will definitely
exist and error out if not.

Make it so the lack of a /etc/adjtime file no longer prevents the grml build
from completing.

etc/grml/fai/config/scripts/GRMLBASE/18-timesetup

index da40243..d44efb2 100755 (executable)
@@ -13,7 +13,7 @@ set -e
 # by default it's set to UTC=no
 if [ -n "$UTC" ] && [ "$UTC" = "yes" ] ; then
    echo "UTC is set to 'yes', setting hwclock parameter UTC"
-   sed -i "s/^LOCAL/UTC/" "${target}/etc/adjtime"
+   [ -e "${target}/etc/adjtime" ] && sed -i "s/^LOCAL/UTC/" "${target}/etc/adjtime"
 fi
 
 # default timezone settings