#!/bin/sh -e
[ -z "$DEBUG" ] || set -x
echo "########## ca-certificates-20211016: target install ##########"
cd /home/ych/rk3568/buildroot
touch /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.stamp_installed
if [ -r /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.files-list-target.txt ]; then cd /home/ych/rk3568/buildroot/output/rockchip_rk3568/target; cat /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.files-list-target.txt | xargs md5sum /dev/null > /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.md5 2>/dev/null || true; cd -; fi
cd /home/ych/rk3568/buildroot
/usr/bin/install -d -m 0755 /home/ych/rk3568/buildroot/output/rockchip_rk3568/target/usr/share/ca-certificates
/usr/bin/install -d -m 0755 /home/ych/rk3568/buildroot/output/rockchip_rk3568/target/etc/ssl/certs
PATH="/home/ych/rk3568/buildroot/output/rockchip_rk3568/host/bin:/home/ych/rk3568/buildroot/output/rockchip_rk3568/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" /usr/bin/make -j21 -C /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016 install DESTDIR=/home/ych/rk3568/buildroot/output/rockchip_rk3568/target
rm -f /home/ych/rk3568/buildroot/output/rockchip_rk3568/target/usr/sbin/update-ca-certificates
# Remove any existing certificates under /etc/ssl/certs
rm -f /home/ych/rk3568/buildroot/output/rockchip_rk3568/target/etc/ssl/certs/*
# Create symlinks to certificates under /etc/ssl/certs
# and generate the bundle
cd /home/ych/rk3568/buildroot/output/rockchip_rk3568/target ; for i in `find usr/share/ca-certificates -name "*.crt" | LC_COLLATE=C sort` ; do ln -sf ../../../$i etc/ssl/certs/`basename ${i} .crt`.pem ; cat $i ; done >/home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/ca-certificates.crt
# Create symlinks to the certificates by their hash values
/home/ych/rk3568/buildroot/output/rockchip_rk3568/host/bin/c_rehash /home/ych/rk3568/buildroot/output/rockchip_rk3568/target/etc/ssl/certs
# Install the certificates bundle
/usr/bin/install -D -m 644 /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/ca-certificates.crt /home/ych/rk3568/buildroot/output/rockchip_rk3568/target/etc/ssl/certs/ca-certificates.crt
cd /home/ych/rk3568/buildroot
cd /home/ych/rk3568/buildroot
rm -f -rf  /home/ych/rk3568/buildroot/output/rockchip_rk3568/target/share/info/dir
cd /home/ych/rk3568/buildroot
if test -n "" ; then rm -f -f  ; fi
cd /home/ych/rk3568/buildroot/output/rockchip_rk3568/target; find . \( -type f -o -type l \) -cnewer /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.stamp_installed | tee /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.files-list-target.txt | /home/ych/rk3568/buildroot/output/rockchip_rk3568/host/bin/tar --no-recursion --ignore-failed-read -cf /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/ca-certificates-20211016.tar -T -; true;
cd /home/ych/rk3568/buildroot/output/rockchip_rk3568/target; if [ -r /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.md5 ]; then md5sum -c /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.md5 2>&1 | grep "FAILED$" | cut -d':' -f1 > /home/ych/rk3568/buildroot/output/rockchip_rk3568/build/ca-certificates-20211016/.files-list-target-update.txt; fi
