├── 10-ldconfig-hook.sh ├── 10-tmpfiles-hook.sh ├── 10-mandb-hook.sh ├── 10-fc-cache-hook.sh ├── 10-motd-hook.sh ├── 10-python-timestamp-hook.sh ├── 10-glib-schemas-hook.sh ├── 10-locale-archive-hook.sh ├── 10-trust-store-hook.sh ├── update-trigger.sh └── update-helper.sh /10-ldconfig-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /usr/bin/ldconfig -X 4 | -------------------------------------------------------------------------------- /10-tmpfiles-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /usr/bin/systemd-tmpfiles --create 4 | -------------------------------------------------------------------------------- /10-mandb-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -x /usr/bin/mandb ]; then 4 | /usr/bin/mandb -q 5 | fi 6 | -------------------------------------------------------------------------------- /10-fc-cache-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -x /usr/bin/fc-cache ]; then 4 | /usr/bin/fc-cache 5 | fi 6 | -------------------------------------------------------------------------------- /10-motd-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -x /usr/bin/motd-update.sh ]; then 4 | /usr/bin/motd-update.sh 5 | fi 6 | -------------------------------------------------------------------------------- /10-python-timestamp-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -x /usr/bin/clr-python-timestamp ]; then 4 | /usr/bin/clr-python-timestamp /usr/lib/python2.7 /usr/lib/python3.6 5 | fi 6 | -------------------------------------------------------------------------------- /10-glib-schemas-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -x /usr/bin/glib-compile-schemas ]; then 4 | /usr/bin/glib-compile-schemas --targetdir=/var/cache/glib-2.0/schemas /usr/share/glib-2.0/schemas 5 | fi 6 | -------------------------------------------------------------------------------- /10-locale-archive-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -e /var/cache/locale/locale-archive ]; then 4 | exit 0 5 | fi 6 | 7 | if [ -x /usr/bin/localdef ]; then 8 | /usr/bin/localedef -i en_US -c -f UTF-8 en_US.UTF-8 9 | fi 10 | -------------------------------------------------------------------------------- /10-trust-store-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -x /usr/bin/clrtrust ]; then 4 | /usr/bin/clrtrust generate 5 | else 6 | rm -fr /var/cache/ca-certs 7 | mkdir -p /var/cache/ca-certs 8 | cp -r --preserve=mode,links /usr/share/ca-certs/.prebuilt-store/* /var/cache/ca-certs 9 | fi 10 | -------------------------------------------------------------------------------- /update-trigger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | prefix="$1" 4 | 5 | # Try to run all hooks in /usr/libexec/updater 6 | for f in "${prefix}"/usr/libexec/updater/*hook.sh ; do 7 | if [ -x "$f" ] && [ -f "$f" ]; then 8 | if [ "$prefix" == "/" ]; then 9 | "$f" &> /dev/null 10 | else 11 | chroot "$prefix" "${f#$prefix}" &> /dev/null 12 | fi 13 | fi 14 | done 15 | -------------------------------------------------------------------------------- /update-helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function help() { 4 | echo "update trigger helper" 5 | echo "usage: update-helper [options] [PATH]" 6 | echo "" 7 | echo " PATH: Run update scripts in a chroot located at PATH (does not use systemd)" 8 | echo "" 9 | echo "options:" 10 | echo " --reexec -r: Will run daemon-reexec instead of daemon-reload (only used with systemctl)" 11 | echo " --no-block -n: Will run the update hooks in the background" 12 | echo " --help -h: display this menu" 13 | echo "" 14 | } 15 | 16 | update() { 17 | local block_flag="" 18 | local reexec= 19 | local prefix="/" 20 | 21 | for var in "$@"; do 22 | case "$var" in 23 | "--help"|"-h") 24 | help 25 | exit 0 26 | ;; 27 | "--no-block"|"-n") 28 | block_flag="--no-block" 29 | ;; 30 | "--reexec"|"-r") 31 | reexec=1 32 | ;; 33 | *) 34 | if [ "$prefix" != "/" ]; then 35 | help 36 | exit -1 37 | fi 38 | prefix="$var" 39 | ;; 40 | esac 41 | done 42 | 43 | systemctl &> /dev/null 44 | # Check if systemd is init and not being run for a chroot update 45 | if [ $? -eq 0 ] && [ "${prefix}" = "/" ]; then 46 | if [ ! -z "${reexec}" ]; then 47 | systemctl daemon-reexec 48 | else 49 | systemctl daemon-reload 50 | fi 51 | 52 | # make sure daemons are restarted if needed, first 53 | if [ -x /usr/bin/clr-service-restart ]; then 54 | /usr/bin/clr-service-restart 55 | fi 56 | 57 | systemctl restart "${block_flag}" update-triggers.target 58 | else # Not using systemd as init, run the trigger scripts 59 | if [ -z "${block_flag}" ]; then 60 | "${prefix}/usr/libexec/updater/update-trigger.sh" "${prefix}" 61 | else 62 | "${prefix}/usr/libexec/updater/update-trigger.sh" "${prefix}" & 63 | fi 64 | fi 65 | } 66 | 67 | update "$@" 68 | --------------------------------------------------------------------------------