]> git.saurik.com Git - apple/system_cmds.git/blame - zic.tproj/install_zoneinfo.sh
system_cmds-805.250.2.tar.gz
[apple/system_cmds.git] / zic.tproj / install_zoneinfo.sh
CommitLineData
fc6d9e4b 1#!/bin/sh
9726c137
A
2set -e
3set -x
fc6d9e4b 4
cf37c299 5if [ -n "$RC_BRIDGE" ]; then
887d5eed 6 ACTUAL_PLATFORM_NAME="bridgeos"
cf37c299
A
7else
8 ACTUAL_PLATFORM_NAME="${PLATFORM_NAME}"
9fi
10
c40d5e06
A
11# This sets up the paths for the default set of zoneinfo files
12# On iOS, watchOS, and tvOS, this is handled by tzd in coordination with
13# launchd on first boot.
14# On macOS, the directory needs to be setup # during mastering for SIP
15# protection, and the symlink for the BaseSystem.
16# On bridgeOS tzd doesn't exist, so needs this all setup statically.
17default_zoneinfo_setup()
18{
19 mkdir -p "${DSTROOT}/private/var/db/timezone"
20 chmod 555 "${DSTROOT}/private/var/db/timezone"
21 ln -hfs "/usr/share/zoneinfo.default" "${DSTROOT}/private/var/db/timezone/zoneinfo"
22}
23
cf37c299 24case "$ACTUAL_PLATFORM_NAME" in
c40d5e06 25iphone*|appletv*|watch*|macosx)
9726c137
A
26 ditto "${BUILT_PRODUCTS_DIR}/zoneinfo" "${DSTROOT}/usr/share/zoneinfo.default"
27 ln -hfs "/var/db/timezone/zoneinfo" "${DSTROOT}/usr/share/zoneinfo"
887d5eed 28 case "$ACTUAL_PLATFORM_NAME" in
c40d5e06
A
29 macosx)
30 default_zoneinfo_setup
887d5eed
A
31 ;;
32 esac
9726c137 33 ;;
c40d5e06
A
34bridge*)
35 # Since bridgeOS lacks any mechanism to change timezones (currently),
36 # and in the interest of saving space, only GMT is installed.
37 mkdir -p "${DSTROOT}/usr/share/zoneinfo.default"
38 chmod 555 "${DSTROOT}/usr/share/zoneinfo.default"
39 ditto "${BUILT_PRODUCTS_DIR}/zoneinfo/GMT" "${DSTROOT}/usr/share/zoneinfo.default/GMT"
40 default_zoneinfo_setup
41 ;;
9726c137 42*)
cf37c299 43 echo "Unsupported platform: $ACTUAL_PLATFORM_NAME"
9726c137
A
44 exit 1
45 ;;
46esac
c40d5e06 47