Merge omacom/omarchy-iso#236 regional ISO builds, as an install-time choice
Every ISO bundles the cn profile; the first-screen pick decides. --region cn only preselects China and names the artifact. The region value is cn, the cn timezone is preselected when China is chosen, and the profile packages and ArchLinuxCN keyring reach the target only for China.
This commit is contained in:
commit
02ee068504
12 files changed
+492
-50
No files matched your search
@@ -116,7 +116,7 @@ else
|
||||
mkdir -p -m 700 "$cjk_runtime"
|
||||
rm -f "$cjk_runtime/cjk-console-started" "$cjk_runtime/return-to-vt"
|
||||
cage_status=0
|
||||
env -u OMARCHY_CJK_RELAUNCH XDG_RUNTIME_DIR=$cjk_runtime OMARCHY_CJK_CONSOLE=1 OMARCHY_INSTALL_REGION=china \
|
||||
env -u OMARCHY_CJK_RELAUNCH XDG_RUNTIME_DIR=$cjk_runtime OMARCHY_CJK_CONSOLE=1 OMARCHY_INSTALL_REGION=cn \
|
||||
LANG=C.UTF-8 WLR_RENDERER=pixman cage -- foot -c /usr/share/omarchy-iso/foot.ini "$0" || cage_status=$?
|
||||
if [[ -f $cjk_runtime/return-to-vt ]]; then
|
||||
OMARCHY_INSTALL_REGION=global ./configurator && status=0 || status=$?
|
||||
@@ -125,7 +125,7 @@ else
|
||||
else
|
||||
echo "The Chinese console could not start (cage exit $cage_status); continuing in English."
|
||||
unset OMARCHY_CJK_RELAUNCH
|
||||
OMARCHY_INSTALL_REGION=china ./configurator && status=0 || status=$?
|
||||
OMARCHY_INSTALL_REGION=cn ./configurator && status=0 || status=$?
|
||||
fi
|
||||
done
|
||||
if [[ -n ${OMARCHY_CJK_CONSOLE:-} ]] && ((status == vt_return)); then
|
||||
@@ -145,7 +145,7 @@ if [[ -f /root/defer-provisioning ]] ||
|
||||
export OMARCHY_UI_DEFER_PROVISIONING=yes
|
||||
fi
|
||||
|
||||
if [[ -n ${OMARCHY_CJK_CONSOLE:-} && "$(jq -r '.omarchy_install.region // "global"' /root/user_configuration.json)" == "china" ]]; then
|
||||
if [[ -n ${OMARCHY_CJK_CONSOLE:-} && "$(jq -r '.omarchy_install.region // "global"' /root/user_configuration.json)" == "cn" ]]; then
|
||||
export OMARCHY_INSTALL_LANG=zh
|
||||
fi
|
||||
|
||||
|
||||
@@ -91,6 +91,15 @@ OMARCHY_ZH+=(
|
||||
["Everything will be overwritten. There is no recovery possible."]="磁盘上的一切都会被覆盖,无法恢复。"
|
||||
["Confirm overwriting %s"]="确认覆盖 %s"
|
||||
)
|
||||
# Every ISO carries the cn profile here (builder/prepare-region.sh copies it);
|
||||
# China preselects its timezone when there is no geo guess, which is every
|
||||
# offline install.
|
||||
REGION_TIMEZONE="${REGION_TIMEZONE:-/usr/share/omarchy-iso/region/timezone}"
|
||||
region_timezone() {
|
||||
if [[ $region == "cn" ]]; then
|
||||
head -n 1 "$REGION_TIMEZONE"
|
||||
fi
|
||||
}
|
||||
|
||||
# Partition creation helpers, shared with test/partition-numbering-test.sh so
|
||||
# the numbering logic can be exercised without a real disk.
|
||||
@@ -273,13 +282,13 @@ notice() {
|
||||
|
||||
# .automated_script.sh moves China into the CJK console and Global back to the VT, which applies keymaps.
|
||||
apply_region_language() {
|
||||
if [[ $region == "china" && -n ${OMARCHY_CJK_RELAUNCH:-} ]]; then
|
||||
if [[ $region == "cn" && -n ${OMARCHY_CJK_RELAUNCH:-} ]]; then
|
||||
exit "$OMARCHY_CJK_RELAUNCH"
|
||||
fi
|
||||
if [[ $region == "global" && -n ${OMARCHY_VT_RETURN:-} ]]; then
|
||||
exit "$OMARCHY_VT_RETURN"
|
||||
fi
|
||||
if [[ $region == "china" && -n ${OMARCHY_CJK_CONSOLE:-} ]]; then
|
||||
if [[ $region == "cn" && -n ${OMARCHY_CJK_CONSOLE:-} ]]; then
|
||||
export OMARCHY_INSTALL_LANG=zh
|
||||
else
|
||||
unset OMARCHY_INSTALL_LANG
|
||||
@@ -363,7 +372,7 @@ user_form() {
|
||||
|
||||
omarchy_prompt_identity || return $?
|
||||
omarchy_prompt_hostname || return $?
|
||||
omarchy_prompt_timezone || return $?
|
||||
omarchy_prompt_timezone "$(region_timezone)" || return $?
|
||||
}
|
||||
|
||||
# Returns 0 on confirmed account details, or as soon as the keyboard screen
|
||||
@@ -384,8 +393,9 @@ user_step() {
|
||||
fi
|
||||
|
||||
# Add manual padding since gum table -p doesn't respect padding
|
||||
local skipped
|
||||
local skipped region_label=Global
|
||||
skipped=$(omarchy_text "[Skipped]")
|
||||
[[ $region == "cn" ]] && region_label=China
|
||||
echo -e "$(omarchy_text Field),$(omarchy_text Value)
|
||||
$(omarchy_text Username),$username
|
||||
$(omarchy_text Password),$(printf "%${#password}s" | tr ' ' '*')
|
||||
@@ -394,7 +404,7 @@ $(omarchy_text "Email address"),${email_address:-$skipped}
|
||||
$(omarchy_text Hostname),$hostname
|
||||
$(omarchy_text Timezone),$timezone
|
||||
$(omarchy_text Keyboard),$keyboard
|
||||
$(omarchy_text Region),$(omarchy_text "${region^}")" |
|
||||
$(omarchy_text Region),$(omarchy_text "$region_label")" |
|
||||
gum table -s "," -p | sed "s/^/${PADDING_LEFT_SPACES}/"
|
||||
|
||||
echo
|
||||
@@ -1131,8 +1141,9 @@ select_installation() {
|
||||
|
||||
defer_provisioning=false
|
||||
install_target="full_disk"
|
||||
# A rerun in the other console arrives with the region already chosen.
|
||||
region="${OMARCHY_INSTALL_REGION:-global}"
|
||||
# A rerun in the other console arrives with the region already chosen; a
|
||||
# regional build preselects its own.
|
||||
region="${OMARCHY_INSTALL_REGION:-$(<"${ISO_REGION_FILE:-/root/omarchy_region}")}"
|
||||
|
||||
# Let the live VT reach its settled width before the first screen so the logo
|
||||
# isn't measured against the transient 80-column boot console.
|
||||
|
||||
Reference in new issue
Block a user