✨ feat(region): default china installs to Asia/Shanghai

- ✨ offline China first boots preselect `Asia/Shanghai` from the region profile instead of the top of the list
- 📝 profiles may name a `timezone`; first-boot setup reads it for the region in `/etc/omarchy/region`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdXqTwm63rRMwotZ1xqLC8
This commit is contained in:
Kros DaiandClaude Opus 5.5 committed 2026-10-06 22:14:56 -04:00
1 parent d53b24cfc7
commit 1454e04b7f
4 files changed
+51 -2

No files matched your search

+16 -1
View File
@@ -16,6 +16,7 @@ set -euo pipefail
PROVISIONING_DIR=/var/lib/omarchy/provisioning
OMARCHY_PATH="${OMARCHY_PATH:-/usr/share/omarchy}"
LOG_FILE=/var/log/omarchy-provision-owner.log
REGION_MARKER=/etc/omarchy/region
if (( EUID != 0 )); then
echo "Error: omarchy-provision-owner must run as root" >&2
@@ -650,7 +651,21 @@ user_form() {
omarchy_prompt_hostname || return $?
step "Let's set your timezone..."
omarchy_prompt_timezone || return $?
omarchy_prompt_timezone "$(region_timezone)" || return $?
}
# The zone a region profile preselects when there is no geo guess, which is
# every offline first boot. Reads the marker omarchy-apply-pacman reads; global,
# missing, or malformed regions offer nothing.
region_timezone() {
local region=global profile
if [[ -r $REGION_MARKER ]]; then
region=$(<"$REGION_MARKER")
fi
profile="$OMARCHY_PATH/default/regions/$region/timezone"
if [[ $region =~ ^[a-z]{2}$ && -r $profile ]]; then
head -n 1 "$profile"
fi
}
confirm_form() {
+1
View File
@@ -0,0 +1 @@
Asia/Shanghai
+2 -1
View File
@@ -20,13 +20,14 @@ Regional content comes from the same runtime used by the ISO: either the `--loca
- `packages`: additional target packages, one name per line, with blank lines and `#` comments allowed. The builder merges these into the ISO's copy of `omarchy-base.packages`, so they are both included in the offline repository and installed on the target. The source manifest is not modified.
- `pacman/`: repository fragments used by the runtime finalizer. The builder also adds the community repository to its writable online config to obtain regional packages; it does not change its Arch channel mirrors.
- `timezone` (optional): one zone name, such as `Asia/Shanghai`. The setup form preselects it in the timezone list when the network geo guess is unavailable, which is always the case offline. Both callers pass it: the ISO configurator from its copy of the profile, and first-boot setup from `default/regions/<region>/timezone` for the region in `/etc/omarchy/region`. A successful geo guess still wins, and the person can choose any other zone.
- `skel/` (optional): new-user defaults. The ISO installer overlays these onto target `/etc/skel` after the base settings packages and before user creation, including installations that defer user creation until first boot. It never overlays existing home directories.
For China, the builder installs `archlinuxcn-keyring` using the existing Arch trust chain before downloading other regional packages. Signature or keyring failures abort the build; no unverified keyserver trust or online signature bypass is added. The keyring is also installed on the target from the offline package set, then initialized and populated before online repositories are enabled. The ISO's existing offline repository verification policy is unchanged.
## Scope of the China profile
The China profile currently provides repository defaults only. System language (Simplified Chinese), timezone (Asia/Shanghai), and input-method defaults are planned as separate changes on top of this mechanism: `packages` and `skel/` carry them into the ISO, and the installer stages `skel/` before any user exists.
The China profile provides repository defaults and preselects `Asia/Shanghai` as the timezone. System language (Simplified Chinese) and input-method defaults are planned as separate changes on top of this mechanism: `packages` and `skel/` carry them into the ISO, and the installer stages `skel/` before any user exists.
## Remaining release validation
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
zone=$(<"$ROOT/default/regions/cn/timezone")
[[ $zone == "Asia/Shanghai" ]] || fail "China profile names Asia/Shanghai"
[[ -f /usr/share/zoneinfo/$zone ]] || fail "China profile timezone exists in tzdata"
pass "China profile defaults to an existing Asia/Shanghai zone"
# Load the real region_timezone() from the first-boot command.
OMARCHY_PATH="$ROOT"
REGION_MARKER="$scratch/region"
eval "$(sed -n '/^region_timezone() {/,/^}/p' "$ROOT/bin/omarchy-provision-owner")"
[[ -z $(region_timezone) ]] || fail "missing region marker offers no timezone"
for region in global CN ../cn zz ""; do
printf '%s\n' "$region" >"$REGION_MARKER"
[[ -z $(region_timezone) ]] || fail "region '$region' offers no timezone"
done
pass "global, unknown, and malformed regions offer no timezone"
printf 'cn\n' >"$REGION_MARKER"
[[ $(region_timezone) == "Asia/Shanghai" ]] || fail "cn region offers Asia/Shanghai"
pass "cn region offers its profile timezone"
grep -qF 'omarchy_prompt_timezone "$(region_timezone)"' "$ROOT/bin/omarchy-provision-owner" ||
fail "first-boot setup passes the region timezone to the prompt"
pass "first-boot setup preselects the region timezone"