]>
Commit | Line | Data |
---|---|---|
fc6d9e4b | 1 | #!/bin/sh |
9726c137 A |
2 | set -e |
3 | set -x | |
fc6d9e4b | 4 | |
cf37c299 | 5 | if [ -n "$RC_BRIDGE" ]; then |
887d5eed | 6 | ACTUAL_PLATFORM_NAME="bridgeos" |
cf37c299 A |
7 | else |
8 | ACTUAL_PLATFORM_NAME="${PLATFORM_NAME}" | |
9 | fi | |
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. | |
17 | default_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 | 24 | case "$ACTUAL_PLATFORM_NAME" in |
c40d5e06 | 25 | iphone*|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 |
34 | bridge*) |
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 | ;; | |
46 | esac | |
c40d5e06 | 47 |