diff options
author | 2021-05-09 14:20:58 -0400 | |
---|---|---|
committer | 2021-05-09 14:20:58 -0400 | |
commit | 5fd83771641d15c418f747bd343ba6738d3875f7 (patch) | |
tree | 5abf0f78f680d9837dbd93d4d4c3933bb7509599 /system_cmds/zic.tproj/install_zoneinfo.sh | |
download | apple_cmds-5fd83771641d15c418f747bd343ba6738d3875f7.tar.gz apple_cmds-5fd83771641d15c418f747bd343ba6738d3875f7.tar.zst apple_cmds-5fd83771641d15c418f747bd343ba6738d3875f7.zip |
Import macOS userland
adv_cmds-176
basic_cmds-55
bootstrap_cmds-116.100.1
developer_cmds-66
diskdev_cmds-667.40.1
doc_cmds-53.60.1
file_cmds-321.40.3
mail_cmds-35
misc_cmds-34
network_cmds-606.40.1
patch_cmds-17
remote_cmds-63
shell_cmds-216.60.1
system_cmds-880.60.2
text_cmds-106
Diffstat (limited to 'system_cmds/zic.tproj/install_zoneinfo.sh')
-rwxr-xr-x | system_cmds/zic.tproj/install_zoneinfo.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/system_cmds/zic.tproj/install_zoneinfo.sh b/system_cmds/zic.tproj/install_zoneinfo.sh new file mode 100755 index 0000000..50a9deb --- /dev/null +++ b/system_cmds/zic.tproj/install_zoneinfo.sh @@ -0,0 +1,47 @@ +#!/bin/sh +set -e +set -x + +if [ -n "$RC_BRIDGE" ]; then + ACTUAL_PLATFORM_NAME="bridgeos" +else + ACTUAL_PLATFORM_NAME="${PLATFORM_NAME}" +fi + +# This sets up the paths for the default set of zoneinfo files +# On iOS, watchOS, and tvOS, this is handled by tzd in coordination with +# launchd on first boot. +# On macOS, the directory needs to be setup # during mastering for SIP +# protection, and the symlink for the BaseSystem. +# On bridgeOS tzd doesn't exist, so needs this all setup statically. +default_zoneinfo_setup() +{ + mkdir -p "${DSTROOT}/private/var/db/timezone" + chmod 555 "${DSTROOT}/private/var/db/timezone" + ln -hfs "/usr/share/zoneinfo.default" "${DSTROOT}/private/var/db/timezone/zoneinfo" +} + +case "$ACTUAL_PLATFORM_NAME" in +iphone*|appletv*|watch*|macosx) + ditto "${BUILT_PRODUCTS_DIR}/zoneinfo" "${DSTROOT}/usr/share/zoneinfo.default" + ln -hfs "/var/db/timezone/zoneinfo" "${DSTROOT}/usr/share/zoneinfo" + case "$ACTUAL_PLATFORM_NAME" in + macosx) + default_zoneinfo_setup + ;; + esac + ;; +bridge*) + # Since bridgeOS lacks any mechanism to change timezones (currently), + # and in the interest of saving space, only GMT is installed. + mkdir -p "${DSTROOT}/usr/share/zoneinfo.default" + chmod 555 "${DSTROOT}/usr/share/zoneinfo.default" + ditto "${BUILT_PRODUCTS_DIR}/zoneinfo/GMT" "${DSTROOT}/usr/share/zoneinfo.default/GMT" + default_zoneinfo_setup + ;; +*) + echo "Unsupported platform: $ACTUAL_PLATFORM_NAME" + exit 1 + ;; +esac + |