Rerun China installs in a console that draws Chinese and show the installer in Chinese
This commit is contained in:
1 parent
45b31ae98c
commit
48471b25c1
8 files changed
+373
-109
No files matched your search
@@ -28,6 +28,8 @@ Despite the local folder name, the first argument is the Omarchy source checkout
|
|||||||
|
|
||||||
A local-source install pins `omarchy-dev`, `omarchy-settings-dev` and `rime-ice-installer`, since the published builds share their version number but lack the local changes. `IgnorePkg` in `/etc/pacman.conf` makes updates skip them, and a `pre-refresh-pacman` hook (in the user's `~/.config/omarchy/hooks` and in `/etc/skel`) puts that line back after `omarchy refresh pacman`. `/etc/pacman.d/hooks/00-omarchy-pin-local-builds.hook` aborts any transaction that would still replace them. Remove all three to take the published packages.
|
A local-source install pins `omarchy-dev`, `omarchy-settings-dev` and `rime-ice-installer`, since the published builds share their version number but lack the local changes. `IgnorePkg` in `/etc/pacman.conf` makes updates skip them, and a `pre-refresh-pacman` hook (in the user's `~/.config/omarchy/hooks` and in `/etc/skel`) puts that line back after `omarchy refresh pacman`. `/etc/pacman.d/hooks/00-omarchy-pin-local-builds.hook` aborts any transaction that would still replace them. Remove all three to take the published packages.
|
||||||
|
|
||||||
|
The configurator asks for the region on its first screen. China reruns the installer in cage + foot, a console that draws Chinese, and every later screen and the install progress read in Chinese; without a working display it continues in English on the VT. The Chinese text lives in `OMARCHY_ZH` tables beside the English it replaces.
|
||||||
|
|
||||||
Use `--dev` or `--rc` to build against those package channels. Both `--dev` and `--edge` select the dev packages from the edge mirror.
|
Use `--dev` or `--rc` to build against those package channels. Both `--dev` and `--edge` select the dev packages from the edge mirror.
|
||||||
|
|
||||||
## Autoinstall
|
## Autoinstall
|
||||||
|
|||||||
@@ -135,7 +135,8 @@ bundle_release_asset amzxyz/RIME-LMDG LTS wanxiang-lts-zh-hans.gram
|
|||||||
# The selected omarchy-settings package is needed here so its post_install hook
|
# The selected omarchy-settings package is needed here so its post_install hook
|
||||||
# drops Omarchy's plymouthd.conf into /etc/plymouth before mkarchiso builds the
|
# drops Omarchy's plymouthd.conf into /etc/plymouth before mkarchiso builds the
|
||||||
# live initramfs.
|
# live initramfs.
|
||||||
arch_packages=(linux-t2 git gum jq openssl plymouth ttfx tzupdate omarchy-keyring "$OMARCHY_SETTINGS_PACKAGE" lvm2 cryptsetup parted)
|
# cage, foot and the two fonts give China installs a console that draws Chinese.
|
||||||
|
arch_packages=(linux-t2 git gum jq openssl plymouth ttfx tzupdate omarchy-keyring "$OMARCHY_SETTINGS_PACKAGE" lvm2 cryptsetup parted cage foot ttf-jetbrains-mono wqy-microhei)
|
||||||
printf '%s\n' "${arch_packages[@]}" >> "$build_cache_dir/packages.x86_64"
|
printf '%s\n' "${arch_packages[@]}" >> "$build_cache_dir/packages.x86_64"
|
||||||
|
|
||||||
# The live ISO boots linux-t2 (see airootfs/etc/mkinitcpio.d/linux-t2.preset), so
|
# The live ISO boots linux-t2 (see airootfs/etc/mkinitcpio.d/linux-t2.preset), so
|
||||||
|
|||||||
@@ -10,7 +10,10 @@
|
|||||||
# - COLUMNS/LINES so gum picks up real terminal size
|
# - COLUMNS/LINES so gum picks up real terminal size
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
[[ $(tty) == /dev/tty1 ]] || exit 0
|
[[ $(tty) == /dev/tty1 || -n ${OMARCHY_CJK_CONSOLE:-} ]] || exit 0
|
||||||
|
if [[ -n ${OMARCHY_CJK_CONSOLE:-} ]]; then
|
||||||
|
touch "$XDG_RUNTIME_DIR/cjk-console-started"
|
||||||
|
fi
|
||||||
|
|
||||||
export OMARCHY_MIRROR="$(cat /root/omarchy_mirror)"
|
export OMARCHY_MIRROR="$(cat /root/omarchy_mirror)"
|
||||||
if [[ -f /root/omarchy_iso_ref ]]; then
|
if [[ -f /root/omarchy_iso_ref ]]; then
|
||||||
@@ -39,7 +42,8 @@ set_tokyo_night_colors() {
|
|||||||
echo -en "\033[0m"
|
echo -en "\033[0m"
|
||||||
clear
|
clear
|
||||||
}
|
}
|
||||||
set_tokyo_night_colors
|
# foot sets the same palette from foot.ini; these escapes are VT-only.
|
||||||
|
[[ -n ${OMARCHY_CJK_CONSOLE:-} ]] || set_tokyo_night_colors
|
||||||
|
|
||||||
mkdir -p /var/log
|
mkdir -p /var/log
|
||||||
touch "$OMARCHY_INSTALL_LOG_FILE"
|
touch "$OMARCHY_INSTALL_LOG_FILE"
|
||||||
@@ -98,7 +102,26 @@ if /usr/local/bin/omarchy-cidata-load; then
|
|||||||
echo "Autoinstall configuration found on cidata drive; skipping the configurator."
|
echo "Autoinstall configuration found on cidata drive; skipping the configurator."
|
||||||
export OMARCHY_UI_INTERACTIVE=no
|
export OMARCHY_UI_INTERACTIVE=no
|
||||||
else
|
else
|
||||||
./configurator
|
# The configurator exits with this after China is picked on the VT, which
|
||||||
|
# cannot draw Chinese. cage + foot rerun this script in a console that can.
|
||||||
|
cjk_relaunch=10
|
||||||
|
if [[ -z ${OMARCHY_CJK_CONSOLE:-} ]] && command -v cage >/dev/null; then
|
||||||
|
export OMARCHY_CJK_RELAUNCH=$cjk_relaunch
|
||||||
|
fi
|
||||||
|
./configurator && status=0 || status=$?
|
||||||
|
unset OMARCHY_CJK_RELAUNCH
|
||||||
|
if ((status == cjk_relaunch)); then
|
||||||
|
cjk_runtime=/run/omarchy-cjk-console
|
||||||
|
mkdir -p -m 700 "$cjk_runtime"
|
||||||
|
rm -f "$cjk_runtime/cjk-console-started"
|
||||||
|
status=0
|
||||||
|
XDG_RUNTIME_DIR=$cjk_runtime OMARCHY_CJK_CONSOLE=1 OMARCHY_INSTALL_REGION=china LANG=C.UTF-8 WLR_RENDERER=pixman \
|
||||||
|
cage -- foot -c /usr/share/omarchy-iso/foot.ini "$0" || status=$?
|
||||||
|
[[ -f $cjk_runtime/cjk-console-started ]] && exit "$status"
|
||||||
|
echo "The Chinese console could not start (cage exit $status); continuing in English."
|
||||||
|
OMARCHY_INSTALL_REGION=china ./configurator && status=0 || status=$?
|
||||||
|
fi
|
||||||
|
((status == 0)) || exit "$status"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Deferred-provisioning installs skip the celebration/reboot prompt and reboot on
|
# Deferred-provisioning installs skip the celebration/reboot prompt and reboot on
|
||||||
@@ -111,6 +134,10 @@ if [[ -f /root/defer-provisioning ]] ||
|
|||||||
export OMARCHY_UI_DEFER_PROVISIONING=yes
|
export OMARCHY_UI_DEFER_PROVISIONING=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -n ${OMARCHY_CJK_CONSOLE:-} && "$(jq -r '.omarchy_install.region // "global"' /root/user_configuration.json)" == "china" ]]; then
|
||||||
|
export OMARCHY_INSTALL_LANG=zh
|
||||||
|
fi
|
||||||
|
|
||||||
# The foreground dashboard is now the sole visible install UI owner. It starts
|
# The foreground dashboard is now the sole visible install UI owner. It starts
|
||||||
# the actual installer as a non-interactive child, logs child output, waits for
|
# the actual installer as a non-interactive child, logs child output, waits for
|
||||||
# completion, then renders the final installed-time/reboot prompt itself.
|
# completion, then renders the final installed-time/reboot prompt itself.
|
||||||
|
|||||||
@@ -24,6 +24,74 @@ if [[ ! -r $SETUP_FORM ]]; then
|
|||||||
fi
|
fi
|
||||||
source "$SETUP_FORM"
|
source "$SETUP_FORM"
|
||||||
|
|
||||||
|
# Chinese text for OMARCHY_INSTALL_LANG=zh; disk-step failures stay English for support logs.
|
||||||
|
OMARCHY_ZH+=(
|
||||||
|
["Aborted installation"]="安装已中止"
|
||||||
|
["You can retry later by running: ./.automated_script.sh"]="稍后可运行 ./.automated_script.sh 重试"
|
||||||
|
["Let's setup your machine..."]="开始设置这台机器……"
|
||||||
|
["Press Ctrl+C to prepare this machine for another owner."]="按 Ctrl+C 为另一位使用者准备这台机器。"
|
||||||
|
["This prepares the machine for another owner."]="这会为另一位使用者准备这台机器。"
|
||||||
|
["The system installs now, but setup is delayed until first boot."]="系统现在安装,设置留到首次开机。"
|
||||||
|
["Yes, prepare for another owner"]="是,为他人准备"
|
||||||
|
["No, keep setting up"]="否,继续设置"
|
||||||
|
["Prepare this machine for another owner?"]="为另一位使用者准备这台机器?"
|
||||||
|
["Let's setup your user account..."]="开始设置用户账户……"
|
||||||
|
["Field"]="项目"
|
||||||
|
["Value"]="值"
|
||||||
|
["Username"]="用户名"
|
||||||
|
["Password"]="密码"
|
||||||
|
["Full name"]="姓名"
|
||||||
|
["Email address"]="邮箱"
|
||||||
|
["Hostname"]="主机名"
|
||||||
|
["Keyboard"]="键盘"
|
||||||
|
["Region"]="区域"
|
||||||
|
["Global"]="全球"
|
||||||
|
["China"]="中国"
|
||||||
|
["[Skipped]"]="[已跳过]"
|
||||||
|
["Yes"]="是"
|
||||||
|
["No, change it"]="否,去修改"
|
||||||
|
["Does this look right?"]="以上信息正确吗?"
|
||||||
|
["Not enough free space on %s"]="%s 的空闲空间不足"
|
||||||
|
["%s has %s of usable free space; Omarchy needs at least 32GB."]="%s 有 %s 可用空闲空间;Omarchy 至少需要 32GB。"
|
||||||
|
["Open the partition tool to free at least 32GB on %s, then try again."]="打开分区工具,在 %s 上腾出至少 32GB,然后重试。"
|
||||||
|
["Back"]="返回"
|
||||||
|
["Open partition tool"]="打开分区工具"
|
||||||
|
["Return to installation mode?"]="返回安装方式选择?"
|
||||||
|
["Checking for BitLocker on %s"]="检查 %s 上的 BitLocker"
|
||||||
|
["BitLocker signature detected on %s."]="在 %s 上发现 BitLocker 签名。"
|
||||||
|
["Turn BitLocker off in Windows and wait for the drive to finish decrypting, then try again."]="在 Windows 中关闭 BitLocker,等磁盘解密完成后重试。"
|
||||||
|
["Suspending BitLocker is not enough — the drive stays encrypted."]="只暂停 BitLocker 不够,磁盘仍是加密的。"
|
||||||
|
["Aborted: BitLocker is enabled on this disk."]="已中止:这块磁盘开启了 BitLocker。"
|
||||||
|
["Checking existing EFI partitions on %s"]="检查 %s 上已有的 EFI 分区"
|
||||||
|
["Found a Windows ESP at %s — leaving it untouched."]="在 %s 发现 Windows ESP,保持不动。"
|
||||||
|
["Omarchy will create its own dedicated EFI partition in free space."]="Omarchy 会在空闲空间中创建自己的 EFI 分区。"
|
||||||
|
["A new EFI partition will be created in free space."]="会在空闲空间中新建 EFI 分区。"
|
||||||
|
["Analyzing free space on %s"]="分析 %s 的空闲空间"
|
||||||
|
["Install Omarchy in the %s of free space."]="在 %s 空闲空间中安装 Omarchy。"
|
||||||
|
["Press Ctrl+C for unencrypted install."]="按 Ctrl+C 改为不加密安装。"
|
||||||
|
["Yes, install"]="是,开始安装"
|
||||||
|
["Yes, install without encryption"]="是,不加密安装"
|
||||||
|
["Confirm installing on %s"]="确认安装到 %s"
|
||||||
|
["Creating partitions on %s"]="在 %s 上创建分区"
|
||||||
|
["Setting up LUKS2 on %s"]="在 %s 上设置 LUKS2 加密"
|
||||||
|
["Creating Btrfs filesystem and subvolumes"]="创建 Btrfs 文件系统和子卷"
|
||||||
|
["Let's select where to install Omarchy..."]="选择 Omarchy 的安装位置……"
|
||||||
|
["Select install disk"]="选择安装磁盘"
|
||||||
|
["Partition tool for %s"]="%s 的分区工具"
|
||||||
|
["Create unallocated free space for Omarchy, then write changes and quit."]="为 Omarchy 腾出未分配空间,然后写入更改并退出。"
|
||||||
|
["Do not create an Omarchy partition here — leave the target area as Free space."]="不要在这里创建 Omarchy 分区,目标区域保持为 Free space。"
|
||||||
|
["Tip: free-space install needs at least 32GB unallocated, plus 2GB more if no ESP already exists."]="提示:空闲空间安装至少需要 32GB 未分配空间;没有 ESP 时再加 2GB。"
|
||||||
|
["Open cfdisk"]="打开 cfdisk"
|
||||||
|
["Open partition tool for %s?"]="打开 %s 的分区工具?"
|
||||||
|
["Full disk install"]="整盘安装"
|
||||||
|
["Free space install (alongside existing data)"]="空闲空间安装(保留现有数据)"
|
||||||
|
["Choose a different disk"]="换一块磁盘"
|
||||||
|
["Let's select how to install Omarchy..."]="选择 Omarchy 的安装方式……"
|
||||||
|
["Select installation mode on %s"]="选择 %s 上的安装方式"
|
||||||
|
["Everything will be overwritten. There is no recovery possible."]="磁盘上的一切都会被覆盖,无法恢复。"
|
||||||
|
["Confirm overwriting %s"]="确认覆盖 %s"
|
||||||
|
)
|
||||||
|
|
||||||
# Partition creation helpers, shared with test/partition-numbering-test.sh so
|
# Partition creation helpers, shared with test/partition-numbering-test.sh so
|
||||||
# the numbering logic can be exercised without a real disk.
|
# the numbering logic can be exercised without a real disk.
|
||||||
DISK_PARTITIONING="${DISK_PARTITIONING:-/usr/share/omarchy-iso/disk-partitioning.sh}"
|
DISK_PARTITIONING="${DISK_PARTITIONING:-/usr/share/omarchy-iso/disk-partitioning.sh}"
|
||||||
@@ -176,9 +244,9 @@ greeter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abort() {
|
abort() {
|
||||||
gum style "${1:-Aborted installation}"
|
gum style "${1:-$(omarchy_text "Aborted installation")}"
|
||||||
echo
|
echo
|
||||||
gum style "You can retry later by running: ./.automated_script.sh"
|
gum style "$(omarchy_text "You can retry later by running: ./.automated_script.sh")"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,6 +271,19 @@ notice() {
|
|||||||
|
|
||||||
# STEP 1: KEYBOARD LAYOUT
|
# STEP 1: KEYBOARD LAYOUT
|
||||||
|
|
||||||
|
# China reads in Chinese only where the console draws CJK. On the VT,
|
||||||
|
# .automated_script.sh sets OMARCHY_CJK_RELAUNCH and reruns us in one.
|
||||||
|
apply_region_language() {
|
||||||
|
if [[ $region == "china" && -n ${OMARCHY_CJK_RELAUNCH:-} ]]; then
|
||||||
|
exit "$OMARCHY_CJK_RELAUNCH"
|
||||||
|
fi
|
||||||
|
if [[ $region == "china" && -n ${OMARCHY_CJK_CONSOLE:-} ]]; then
|
||||||
|
export OMARCHY_INSTALL_LANG=zh
|
||||||
|
else
|
||||||
|
unset OMARCHY_INSTALL_LANG
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
keyboard_form() {
|
keyboard_form() {
|
||||||
# Ctrl+C is the hidden entry into deferred provisioning, offered on every
|
# Ctrl+C is the hidden entry into deferred provisioning, offered on every
|
||||||
# visit: the user step unwinds back here and nothing is on disk yet. Callers
|
# visit: the user step unwinds back here and nothing is on disk yet. Callers
|
||||||
@@ -212,12 +293,18 @@ keyboard_form() {
|
|||||||
while true; do
|
while true; do
|
||||||
clear_logo
|
clear_logo
|
||||||
echo
|
echo
|
||||||
say "Let's setup your machine..."
|
say "$(omarchy_text "Let's setup your machine...")"
|
||||||
say --foreground 8 "Press Ctrl+C to prepare this machine for another owner."
|
say --foreground 8 "$(omarchy_text "Press Ctrl+C to prepare this machine for another owner.")"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
omarchy_prompt_region && status=0 || status=$?
|
if $ask_region; then
|
||||||
|
omarchy_prompt_region && status=0 || status=$?
|
||||||
|
else
|
||||||
|
status=0
|
||||||
|
fi
|
||||||
|
ask_region=true
|
||||||
if ((status == 0)); then
|
if ((status == 0)); then
|
||||||
|
apply_region_language
|
||||||
omarchy_prompt_keyboard && status=0 || status=$?
|
omarchy_prompt_keyboard && status=0 || status=$?
|
||||||
fi
|
fi
|
||||||
((status == 0)) && break
|
((status == 0)) && break
|
||||||
@@ -248,11 +335,11 @@ keyboard_form() {
|
|||||||
confirm_prepare_for_another_owner() {
|
confirm_prepare_for_another_owner() {
|
||||||
clear_logo
|
clear_logo
|
||||||
echo
|
echo
|
||||||
say "This prepares the machine for another owner."
|
say "$(omarchy_text "This prepares the machine for another owner.")"
|
||||||
say --foreground 8 "The system installs now, but setup is delayed until first boot."
|
say --foreground 8 "$(omarchy_text "The system installs now, but setup is delayed until first boot.")"
|
||||||
echo
|
echo
|
||||||
gum confirm --affirmative "Yes, prepare for another owner" --negative "No, keep setting up" \
|
gum confirm --affirmative "$(omarchy_text "Yes, prepare for another owner")" --negative "$(omarchy_text "No, keep setting up")" \
|
||||||
"Prepare this machine for another owner?"
|
"$(omarchy_text "Prepare this machine for another owner?")"
|
||||||
}
|
}
|
||||||
|
|
||||||
# The user step. Deferred-provisioning installs skip it entirely — the machine's first owner
|
# The user step. Deferred-provisioning installs skip it entirely — the machine's first owner
|
||||||
@@ -260,7 +347,7 @@ confirm_prepare_for_another_owner() {
|
|||||||
# operator sets nothing user-specific.
|
# operator sets nothing user-specific.
|
||||||
|
|
||||||
user_form() {
|
user_form() {
|
||||||
step "Let's setup your user account..."
|
step "$(omarchy_text "Let's setup your user account...")"
|
||||||
|
|
||||||
# Each prompt reports 0 (set), OMARCHY_FORM_BACK (Esc), or OMARCHY_FORM_SIGNAL
|
# Each prompt reports 0 (set), OMARCHY_FORM_BACK (Esc), or OMARCHY_FORM_SIGNAL
|
||||||
# (Ctrl+C). Both non-zero cases unwind to user_step, which decides what they
|
# (Ctrl+C). Both non-zero cases unwind to user_step, which decides what they
|
||||||
@@ -294,19 +381,21 @@ user_step() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Add manual padding since gum table -p doesn't respect padding
|
# Add manual padding since gum table -p doesn't respect padding
|
||||||
echo -e "Field,Value
|
local skipped
|
||||||
Username,$username
|
skipped=$(omarchy_text "[Skipped]")
|
||||||
Password,$(printf "%${#password}s" | tr ' ' '*')
|
echo -e "$(omarchy_text Field),$(omarchy_text Value)
|
||||||
Full name,${full_name:-[Skipped]}
|
$(omarchy_text Username),$username
|
||||||
Email address,${email_address:-[Skipped]}
|
$(omarchy_text Password),$(printf "%${#password}s" | tr ' ' '*')
|
||||||
Hostname,$hostname
|
$(omarchy_text "Full name"),${full_name:-$skipped}
|
||||||
Timezone,$timezone
|
$(omarchy_text "Email address"),${email_address:-$skipped}
|
||||||
Keyboard,$keyboard
|
$(omarchy_text Hostname),$hostname
|
||||||
Region,${region^}" |
|
$(omarchy_text Timezone),$timezone
|
||||||
|
$(omarchy_text Keyboard),$keyboard
|
||||||
|
$(omarchy_text Region),$(omarchy_text "${region^}")" |
|
||||||
gum table -s "," -p | sed "s/^/${PADDING_LEFT_SPACES}/"
|
gum table -s "," -p | sed "s/^/${PADDING_LEFT_SPACES}/"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
if gum confirm --negative "No, change it" "Does this look right?"; then
|
if gum confirm --affirmative "$(omarchy_text "Yes")" --negative "$(omarchy_text "No, change it")" "$(omarchy_text "Does this look right?")"; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
keyboard_form
|
keyboard_form
|
||||||
@@ -508,11 +597,11 @@ print_dry_run_files() {
|
|||||||
# action so users have a way to actually fix the situation.
|
# action so users have a way to actually fix the situation.
|
||||||
not_enough_space() {
|
not_enough_space() {
|
||||||
local available="${1:-0}"
|
local available="${1:-0}"
|
||||||
step "Not enough free space on $disk"
|
step "$(omarchy_text "Not enough free space on %s" "$disk")"
|
||||||
say --foreground 1 "$disk has $(to_gb $available) of usable free space; Omarchy needs at least 32GB."
|
say --foreground 1 "$(omarchy_text "%s has %s of usable free space; Omarchy needs at least 32GB." "$disk" "$(to_gb $available)")"
|
||||||
say "Open the partition tool to free at least 32GB on $disk, then try again."
|
say "$(omarchy_text "Open the partition tool to free at least 32GB on %s, then try again." "$disk")"
|
||||||
echo
|
echo
|
||||||
if ! gum confirm --affirmative "Back" --negative "Open partition tool" "Return to installation mode?"; then
|
if ! gum confirm --affirmative "$(omarchy_text "Back")" --negative "$(omarchy_text "Open partition tool")" "$(omarchy_text "Return to installation mode?")"; then
|
||||||
open_partition_tool
|
open_partition_tool
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
@@ -522,14 +611,14 @@ not_enough_space() {
|
|||||||
# encryption confirm. Sets the globals run_partition_execute needs. Returns 1
|
# encryption confirm. Sets the globals run_partition_execute needs. Returns 1
|
||||||
# to fall back to the install-mode picker.
|
# to fall back to the install-mode picker.
|
||||||
run_partition_decide() {
|
run_partition_decide() {
|
||||||
step "Checking for BitLocker on $disk"
|
step "$(omarchy_text "Checking for BitLocker on %s" "$disk")"
|
||||||
local bl_part
|
local bl_part
|
||||||
bl_part=$(detect_bitlocker || true)
|
bl_part=$(detect_bitlocker || true)
|
||||||
if [[ -n "$bl_part" ]]; then
|
if [[ -n "$bl_part" ]]; then
|
||||||
say --foreground 1 "BitLocker signature detected on $bl_part."
|
say --foreground 1 "$(omarchy_text "BitLocker signature detected on %s." "$bl_part")"
|
||||||
say "Turn BitLocker off in Windows and wait for the drive to finish decrypting, then try again."
|
say "$(omarchy_text "Turn BitLocker off in Windows and wait for the drive to finish decrypting, then try again.")"
|
||||||
say "Suspending BitLocker is not enough — the drive stays encrypted."
|
say "$(omarchy_text "Suspending BitLocker is not enough — the drive stays encrypted.")"
|
||||||
abort "Aborted: BitLocker is enabled on this disk."
|
abort "$(omarchy_text "Aborted: BitLocker is enabled on this disk.")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Omarchy always creates its own dedicated ESP in free space and never
|
# Omarchy always creates its own dedicated ESP in free space and never
|
||||||
@@ -538,17 +627,17 @@ run_partition_decide() {
|
|||||||
# Windows ESP is far too small for our Unified Kernel Images, and a shared
|
# Windows ESP is far too small for our Unified Kernel Images, and a shared
|
||||||
# ESP forces the install unencrypted. A separate Linux ESP keeps Windows
|
# ESP forces the install unencrypted. A separate Linux ESP keeps Windows
|
||||||
# and Omarchy fully isolated and keeps LUKS on the table.
|
# and Omarchy fully isolated and keeps LUKS on the table.
|
||||||
step "Checking existing EFI partitions on $disk"
|
step "$(omarchy_text "Checking existing EFI partitions on %s" "$disk")"
|
||||||
local detected_win_esp
|
local detected_win_esp
|
||||||
detected_win_esp=$(detect_windows_esp || true)
|
detected_win_esp=$(detect_windows_esp || true)
|
||||||
if [[ -n "$detected_win_esp" ]]; then
|
if [[ -n "$detected_win_esp" ]]; then
|
||||||
say "Found a Windows ESP at $detected_win_esp — leaving it untouched."
|
say "$(omarchy_text "Found a Windows ESP at %s — leaving it untouched." "$detected_win_esp")"
|
||||||
say "Omarchy will create its own dedicated EFI partition in free space."
|
say "$(omarchy_text "Omarchy will create its own dedicated EFI partition in free space.")"
|
||||||
else
|
else
|
||||||
say "A new EFI partition will be created in free space."
|
say "$(omarchy_text "A new EFI partition will be created in free space.")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
step "Analyzing free space on $disk"
|
step "$(omarchy_text "Analyzing free space on %s" "$disk")"
|
||||||
partprobe "$disk" 2>/dev/null || true
|
partprobe "$disk" 2>/dev/null || true
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
@@ -623,21 +712,21 @@ run_partition_decide() {
|
|||||||
while true; do
|
while true; do
|
||||||
clear_logo
|
clear_logo
|
||||||
echo
|
echo
|
||||||
say "Install Omarchy in the $(to_gb $INSTALL_MAX_B) of free space."
|
say "$(omarchy_text "Install Omarchy in the %s of free space." "$(to_gb $INSTALL_MAX_B)")"
|
||||||
|
|
||||||
case $mode in
|
case $mode in
|
||||||
encrypted)
|
encrypted)
|
||||||
say --foreground 8 "Press Ctrl+C for unencrypted install."
|
say --foreground 8 "$(omarchy_text "Press Ctrl+C for unencrypted install.")"
|
||||||
affirmative="Yes, install"
|
affirmative="$(omarchy_text "Yes, install")"
|
||||||
;;
|
;;
|
||||||
unencrypted)
|
unencrypted)
|
||||||
affirmative="Yes, install without encryption"
|
affirmative="$(omarchy_text "Yes, install without encryption")"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo
|
echo
|
||||||
|
|
||||||
gum confirm --affirmative "$affirmative" --negative "No, change it" \
|
gum confirm --affirmative "$affirmative" --negative "$(omarchy_text "No, change it")" \
|
||||||
"Confirm installing on $disk"
|
"$(omarchy_text "Confirm installing on %s" "$disk")"
|
||||||
confirm_status=$?
|
confirm_status=$?
|
||||||
|
|
||||||
case $confirm_status in
|
case $confirm_status in
|
||||||
@@ -695,7 +784,7 @@ run_partition_execute() {
|
|||||||
say "[dry] partition numbers are assigned by parted at creation, then read back"
|
say "[dry] partition numbers are assigned by parted at creation, then read back"
|
||||||
say "[dry] encrypted=$encrypt_installation kernel=$kernel_choice"
|
say "[dry] encrypted=$encrypt_installation kernel=$kernel_choice"
|
||||||
else
|
else
|
||||||
step "Creating partitions on $disk"
|
step "$(omarchy_text "Creating partitions on %s" "$disk")"
|
||||||
if $needs_mklabel; then
|
if $needs_mklabel; then
|
||||||
disk_step "initializing GPT on $disk" parted --script "$disk" mklabel gpt
|
disk_step "initializing GPT on $disk" parted --script "$disk" mklabel gpt
|
||||||
partprobe "$disk" 2>/dev/null || true
|
partprobe "$disk" 2>/dev/null || true
|
||||||
@@ -733,7 +822,7 @@ run_partition_execute() {
|
|||||||
disk_step "clearing stale signatures on $root_partition_device" wipefs -af "$root_partition_device"
|
disk_step "clearing stale signatures on $root_partition_device" wipefs -af "$root_partition_device"
|
||||||
|
|
||||||
if [[ "$encrypt_installation" == "true" ]]; then
|
if [[ "$encrypt_installation" == "true" ]]; then
|
||||||
step "Setting up LUKS2 on $root_partition_device"
|
step "$(omarchy_text "Setting up LUKS2 on %s" "$root_partition_device")"
|
||||||
# Kept as pipes rather than routed through disk_step: the passphrase must
|
# Kept as pipes rather than routed through disk_step: the passphrase must
|
||||||
# not become an argv the process table can show. Folding stderr into
|
# not become an argv the process table can show. Folding stderr into
|
||||||
# stdout still lands any error in the install log.
|
# stdout still lands any error in the install log.
|
||||||
@@ -750,7 +839,7 @@ run_partition_execute() {
|
|||||||
root_mapper="$root_partition_device"
|
root_mapper="$root_partition_device"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
step "Creating Btrfs filesystem and subvolumes"
|
step "$(omarchy_text "Creating Btrfs filesystem and subvolumes")"
|
||||||
disk_step "creating the Btrfs filesystem on $root_mapper" \
|
disk_step "creating the Btrfs filesystem on $root_mapper" \
|
||||||
mkfs.btrfs -f -L OMARCHY "$root_mapper"
|
mkfs.btrfs -f -L OMARCHY "$root_mapper"
|
||||||
wait_for_device "$root_mapper" || disk_abort_hook "Root device $root_mapper never appeared"
|
wait_for_device "$root_mapper" || disk_abort_hook "Root device $root_mapper never appeared"
|
||||||
@@ -867,7 +956,7 @@ _EOF_
|
|||||||
}
|
}
|
||||||
|
|
||||||
disk_form() {
|
disk_form() {
|
||||||
step "Let's select where to install Omarchy..."
|
step "$(omarchy_text "Let's select where to install Omarchy...")"
|
||||||
|
|
||||||
# Don't offer the install media as an option (Arch ISO mounts it here)
|
# Don't offer the install media as an option (Arch ISO mounts it here)
|
||||||
local boot_source
|
local boot_source
|
||||||
@@ -893,19 +982,19 @@ disk_form() {
|
|||||||
fi
|
fi
|
||||||
done <<<"$available_disks"
|
done <<<"$available_disks"
|
||||||
|
|
||||||
selected_display=$(echo "$disk_options" | gum choose --header "Select install disk") || abort
|
selected_display=$(echo "$disk_options" | gum choose --header "$(omarchy_text "Select install disk")") || abort
|
||||||
disk=$(echo "$selected_display" | awk '{print $1}')
|
disk=$(echo "$selected_display" | awk '{print $1}')
|
||||||
}
|
}
|
||||||
|
|
||||||
# STEP 4: INSTALL MODE
|
# STEP 4: INSTALL MODE
|
||||||
|
|
||||||
open_partition_tool() {
|
open_partition_tool() {
|
||||||
step "Partition tool for $disk"
|
step "$(omarchy_text "Partition tool for %s" "$disk")"
|
||||||
gum style "Create unallocated free space for Omarchy, then write changes and quit."
|
gum style "$(omarchy_text "Create unallocated free space for Omarchy, then write changes and quit.")"
|
||||||
gum style --foreground 8 "Do not create an Omarchy partition here — leave the target area as Free space."
|
gum style --foreground 8 "$(omarchy_text "Do not create an Omarchy partition here — leave the target area as Free space.")"
|
||||||
gum style --foreground 8 "Tip: free-space install needs at least 32GB unallocated, plus 2GB more if no ESP already exists."
|
gum style --foreground 8 "$(omarchy_text "Tip: free-space install needs at least 32GB unallocated, plus 2GB more if no ESP already exists.")"
|
||||||
echo
|
echo
|
||||||
gum confirm --affirmative "Open cfdisk" --negative "Back" "Open partition tool for $disk?" || return 0
|
gum confirm --affirmative "$(omarchy_text "Open cfdisk")" --negative "$(omarchy_text "Back")" "$(omarchy_text "Open partition tool for %s?" "$disk")" || return 0
|
||||||
|
|
||||||
clear
|
clear
|
||||||
cfdisk "$disk" || true
|
cfdisk "$disk" || true
|
||||||
@@ -938,17 +1027,17 @@ requires_full_disk_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_mode_form() {
|
install_mode_form() {
|
||||||
local choices=("Full disk install")
|
local choices=("$(omarchy_text "Full disk install")")
|
||||||
|
|
||||||
# The free-space/protected path registers an EFI boot entry and is UEFI-only.
|
# The free-space/protected path registers an EFI boot entry and is UEFI-only.
|
||||||
# Full-disk installs still support BIOS through the orchestrator's BIOS branch.
|
# Full-disk installs still support BIOS through the orchestrator's BIOS branch.
|
||||||
if [[ -d /sys/firmware/efi ]] && ! $full_disk_only; then
|
if [[ -d /sys/firmware/efi ]] && ! $full_disk_only; then
|
||||||
choices+=("Free space install (alongside existing data)")
|
choices+=("$(omarchy_text "Free space install (alongside existing data)")")
|
||||||
fi
|
fi
|
||||||
choices+=("Choose a different disk")
|
choices+=("$(omarchy_text "Choose a different disk")")
|
||||||
|
|
||||||
step "Let's select how to install Omarchy..."
|
step "$(omarchy_text "Let's select how to install Omarchy...")"
|
||||||
install_mode=$(gum choose --header "Select installation mode on $disk" "${choices[@]}") || abort
|
install_mode=$(gum choose --header "$(omarchy_text "Select installation mode on %s" "$disk")" "${choices[@]}") || abort
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm_disk_overwrite() {
|
confirm_disk_overwrite() {
|
||||||
@@ -958,17 +1047,17 @@ confirm_disk_overwrite() {
|
|||||||
while true; do
|
while true; do
|
||||||
clear_logo
|
clear_logo
|
||||||
echo
|
echo
|
||||||
say "Everything will be overwritten. There is no recovery possible."
|
say "$(omarchy_text "Everything will be overwritten. There is no recovery possible.")"
|
||||||
|
|
||||||
if [[ $mode == "encrypted" ]]; then
|
if [[ $mode == "encrypted" ]]; then
|
||||||
say --foreground 8 "Press Ctrl+C for unencrypted install."
|
say --foreground 8 "$(omarchy_text "Press Ctrl+C for unencrypted install.")"
|
||||||
affirmative="Yes, install"
|
affirmative="$(omarchy_text "Yes, install")"
|
||||||
else
|
else
|
||||||
affirmative="Yes, install without encryption"
|
affirmative="$(omarchy_text "Yes, install without encryption")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
gum confirm --affirmative "$affirmative" --negative "No, change it" "Confirm overwriting ${disk}"
|
gum confirm --affirmative "$affirmative" --negative "$(omarchy_text "No, change it")" "$(omarchy_text "Confirm overwriting %s" "$disk")"
|
||||||
confirm_status=$?
|
confirm_status=$?
|
||||||
|
|
||||||
case $confirm_status in
|
case $confirm_status in
|
||||||
@@ -1007,13 +1096,13 @@ select_installation() {
|
|||||||
# With no free-space option to offer, a full-disk install is the only
|
# With no free-space option to offer, a full-disk install is the only
|
||||||
# mode, so skip the picker and go straight to the overwrite confirm.
|
# mode, so skip the picker and go straight to the overwrite confirm.
|
||||||
if $full_disk_only; then
|
if $full_disk_only; then
|
||||||
install_mode="Full disk install"
|
install_mode=$(omarchy_text "Full disk install")
|
||||||
else
|
else
|
||||||
install_mode_form
|
install_mode_form
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$install_mode" in
|
case "$install_mode" in
|
||||||
"Full disk install")
|
"$(omarchy_text "Full disk install")")
|
||||||
if confirm_disk_overwrite; then
|
if confirm_disk_overwrite; then
|
||||||
install_target="full_disk"
|
install_target="full_disk"
|
||||||
return 0
|
return 0
|
||||||
@@ -1022,13 +1111,13 @@ select_installation() {
|
|||||||
# wants a different disk.
|
# wants a different disk.
|
||||||
$full_disk_only && disk_form
|
$full_disk_only && disk_form
|
||||||
;;
|
;;
|
||||||
"Free space install"*)
|
"$(omarchy_text "Free space install (alongside existing data)")")
|
||||||
if run_partition_decide; then
|
if run_partition_decide; then
|
||||||
install_target="free_space"
|
install_target="free_space"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"Choose a different disk")
|
"$(omarchy_text "Choose a different disk")")
|
||||||
disk_form
|
disk_form
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1039,13 +1128,19 @@ select_installation() {
|
|||||||
|
|
||||||
defer_provisioning=false
|
defer_provisioning=false
|
||||||
install_target="full_disk"
|
install_target="full_disk"
|
||||||
region="global"
|
# A relaunch in the CJK console arrives with the region already chosen.
|
||||||
|
region="${OMARCHY_INSTALL_REGION:-global}"
|
||||||
|
ask_region=true
|
||||||
|
|
||||||
# Let the live VT reach its settled width before the first screen so the logo
|
# 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.
|
# isn't measured against the transient 80-column boot console.
|
||||||
wait_for_stable_terminal
|
wait_for_stable_terminal
|
||||||
|
|
||||||
greeter
|
if [[ -n ${OMARCHY_INSTALL_REGION:-} ]]; then
|
||||||
|
ask_region=false
|
||||||
|
else
|
||||||
|
greeter
|
||||||
|
fi
|
||||||
|
|
||||||
keyboard_form
|
keyboard_form
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,70 @@ tips=(
|
|||||||
"Keep the system fresh with Update in the Omarchy menu"
|
"Keep the system fresh with Update in the Omarchy menu"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# omarchy_text and its Chinese table come from the setup form the configurator uses.
|
||||||
|
SETUP_FORM="${SETUP_FORM:-/usr/share/omarchy-iso/setup-form.sh}"
|
||||||
|
[[ -r $SETUP_FORM ]] || SETUP_FORM="${OMARCHY_PATH:-/usr/share/omarchy}/install/provisioning/setup-form.sh"
|
||||||
|
source "$SETUP_FORM"
|
||||||
|
OMARCHY_ZH+=(
|
||||||
|
["Tip: %s"]="提示:%s"
|
||||||
|
["Installed Omarchy"]="Omarchy 安装完成"
|
||||||
|
["Installed Omarchy in %s"]="Omarchy 安装完成,用时 %s"
|
||||||
|
["Reboot Now"]="立即重启"
|
||||||
|
["Last log lines:"]="日志末尾:"
|
||||||
|
["Last target log lines:"]="目标系统日志末尾:"
|
||||||
|
["Press Enter to continue…"]="按回车继续……"
|
||||||
|
["No log uploader is available in this environment."]="这个环境没有日志上传工具。"
|
||||||
|
["Install log: %s"]="安装日志:%s"
|
||||||
|
["Target log: %s"]="目标系统日志:%s"
|
||||||
|
["Omarchy installation stopped"]="Omarchy 安装已停止"
|
||||||
|
["Installer exited with status %s"]="安装程序退出,状态码 %s"
|
||||||
|
["Get help at https://omarchy.org/discord"]="求助:https://omarchy.org/discord"
|
||||||
|
["What would you like to do?"]="接下来做什么?"
|
||||||
|
["Upload log for support"]="上传日志求助"
|
||||||
|
["View full log"]="查看完整日志"
|
||||||
|
["Drop to shell"]="进入 shell"
|
||||||
|
["Reboot"]="重启"
|
||||||
|
["Power off"]="关机"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ ${OMARCHY_INSTALL_LANG:-} == "zh" ]]; then
|
||||||
|
whimsy=(
|
||||||
|
"备好贴心的默认设置"
|
||||||
|
"省掉装机的折腾"
|
||||||
|
"挑选打磨过的软件包"
|
||||||
|
"调配协调的配色"
|
||||||
|
"准备悦目的像素"
|
||||||
|
"唤醒 Hyprland"
|
||||||
|
"接好顺手的界面"
|
||||||
|
"搭起漂亮的系统"
|
||||||
|
"写好趁手的命令"
|
||||||
|
"让机器焕然一新"
|
||||||
|
"擦亮每一个像素"
|
||||||
|
"调好终端的品味"
|
||||||
|
"织出流畅的工作流"
|
||||||
|
)
|
||||||
|
tips=(
|
||||||
|
"Super + Space 打开 Omarchy 菜单:应用、设置等"
|
||||||
|
"Super + K 查看全部快捷键"
|
||||||
|
"Super 是键盘上的 Windows 或 Command 键"
|
||||||
|
"用 Xournal++ 给 PDF 签名"
|
||||||
|
"用 LocalSend 和手机、电脑互传文件"
|
||||||
|
"菜单 安装 > 网页应用 把任意网站变成应用"
|
||||||
|
"Super + Return 打开终端,Super + Shift + Return 打开浏览器"
|
||||||
|
"图片用 Pinta,视频用 Kdenlive,文档用 LibreOffice"
|
||||||
|
"Super + Ctrl + Print 用 OCR 抓取屏幕文字"
|
||||||
|
"Print 截屏,Alt + Print 录屏"
|
||||||
|
"Super + Ctrl + R 设置提醒"
|
||||||
|
"菜单 风格 > 主题 切换主题"
|
||||||
|
"双击菜单栏让它透明"
|
||||||
|
"菜单 安装 > Windows 运行完整的 Windows 虚拟机"
|
||||||
|
"Super + Ctrl + V 打开剪贴板管理器"
|
||||||
|
"Super + 1 到 0 切换工作区,加 Shift 带上窗口"
|
||||||
|
"Super + Print 拾取屏幕上任意位置的颜色"
|
||||||
|
"用菜单里的 更新 让系统保持最新"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
printf '%s%s' "$RESET" "$SHOW_CURSOR" >"$TTY_PATH" 2>/dev/null || true
|
printf '%s%s' "$RESET" "$SHOW_CURSOR" >"$TTY_PATH" 2>/dev/null || true
|
||||||
}
|
}
|
||||||
@@ -286,8 +350,8 @@ left_padding() {
|
|||||||
|
|
||||||
visible_len() {
|
visible_len() {
|
||||||
local text="$1"
|
local text="$1"
|
||||||
text="$(printf '%b' "$text" | sed -E $'s/\x1b\\[[0-9;?]*[A-Za-z]//g')"
|
# wc -L counts display columns, so double-width CJK centers too.
|
||||||
printf '%s' "${#text}"
|
printf '%b' "$text" | sed -E $'s/\x1b\\[[0-9;?]*[A-Za-z]//g' | wc -L
|
||||||
}
|
}
|
||||||
|
|
||||||
blank_line() { printf '\r%s\n' "$CLEAR_LINE"; }
|
blank_line() { printf '\r%s\n' "$CLEAR_LINE"; }
|
||||||
@@ -678,7 +742,7 @@ render_dynamic() {
|
|||||||
render_icon "$DISPLAY_PM"
|
render_icon "$DISPLAY_PM"
|
||||||
|
|
||||||
message="$(truncate_for_width "$(current_whimsy)" "$PROGRESS_TEXT_WIDTH")"
|
message="$(truncate_for_width "$(current_whimsy)" "$PROGRESS_TEXT_WIDTH")"
|
||||||
tip="$(truncate_for_width "Tip: $(current_tip)" "$PROGRESS_TEXT_WIDTH")"
|
tip="$(truncate_for_width "$(omarchy_text "Tip: %s" "$(current_tip)")" "$PROGRESS_TEXT_WIDTH")"
|
||||||
printf '%s%d;1H' "$CSI" "$((TOP_ROW + ICON_HEIGHT + 1))"
|
printf '%s%d;1H' "$CSI" "$((TOP_ROW + ICON_HEIGHT + 1))"
|
||||||
center "${GREEN}$((DISPLAY_PM / 10))%${RESET}" "$PROGRESS_TEXT_WIDTH"
|
center "${GREEN}$((DISPLAY_PM / 10))%${RESET}" "$PROGRESS_TEXT_WIDTH"
|
||||||
center "${GREEN}${message}${RESET}" "$PROGRESS_TEXT_WIDTH"
|
center "${GREEN}${message}${RESET}" "$PROGRESS_TEXT_WIDTH"
|
||||||
@@ -718,9 +782,13 @@ install_duration() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render_finish() {
|
render_finish() {
|
||||||
local duration effect_canvas_width title="Installed Omarchy"
|
local duration effect_canvas_width title
|
||||||
duration="$(install_duration || true)"
|
duration="$(install_duration || true)"
|
||||||
[[ -n $duration ]] && title+=" in ${duration}"
|
if [[ -n $duration ]]; then
|
||||||
|
title=$(omarchy_text "Installed Omarchy in %s" "$duration")
|
||||||
|
else
|
||||||
|
title=$(omarchy_text "Installed Omarchy")
|
||||||
|
fi
|
||||||
# ttfx centers its text two columns right of plain centering. A canvas two
|
# ttfx centers its text two columns right of plain centering. A canvas two
|
||||||
# columns narrower aligns the animation with the title and fallback logo.
|
# columns narrower aligns the animation with the title and fallback logo.
|
||||||
effect_canvas_width="$(term_cols)"
|
effect_canvas_width="$(term_cols)"
|
||||||
@@ -765,7 +833,7 @@ render_finish() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reboot_prompt() {
|
reboot_prompt() {
|
||||||
local prompt_pad
|
local prompt_pad label
|
||||||
|
|
||||||
# Nobody to confirm; the OMARCHY_UI_AUTO_REBOOT check at the call site still
|
# Nobody to confirm; the OMARCHY_UI_AUTO_REBOOT check at the call site still
|
||||||
# applies, so setting both stops on the finish screen without a keyboard.
|
# applies, so setting both stops on the finish screen without a keyboard.
|
||||||
@@ -776,13 +844,15 @@ reboot_prompt() {
|
|||||||
# gum allows. FINISH_HEIGHT budgets for the same three rows.
|
# gum allows. FINISH_HEIGHT budgets for the same three rows.
|
||||||
printf '%s%d;1H%s' "$CSI" "$((FINISH_TOP_ROW + LOGO_HEIGHT + 2))" "$CLEAR_LINE" >"$TTY_PATH"
|
printf '%s%d;1H%s' "$CSI" "$((FINISH_TOP_ROW + LOGO_HEIGHT + 2))" "$CLEAR_LINE" >"$TTY_PATH"
|
||||||
|
|
||||||
prompt_pad=$(( ( $(term_cols) - 18 ) / 2 ))
|
# gum pads the button label by four columns on each side.
|
||||||
|
label=$(omarchy_text "Reboot Now")
|
||||||
|
prompt_pad=$(( ( $(term_cols) - $(visible_len "$label") - 8 ) / 2 ))
|
||||||
(( prompt_pad < 0 )) && prompt_pad=0
|
(( prompt_pad < 0 )) && prompt_pad=0
|
||||||
gum confirm \
|
gum confirm \
|
||||||
--padding "0 0 0 $prompt_pad" \
|
--padding "0 0 0 $prompt_pad" \
|
||||||
--show-help=false \
|
--show-help=false \
|
||||||
--default \
|
--default \
|
||||||
--affirmative "Reboot Now" \
|
--affirmative "$label" \
|
||||||
--negative "" \
|
--negative "" \
|
||||||
"" <"$TTY_PATH" >"$TTY_PATH" 2>&1
|
"" <"$TTY_PATH" >"$TTY_PATH" 2>&1
|
||||||
}
|
}
|
||||||
@@ -819,8 +889,8 @@ render_failure_log_tail() {
|
|||||||
fi
|
fi
|
||||||
[[ -f $tail_log ]] || return 0
|
[[ -f $tail_log ]] || return 0
|
||||||
|
|
||||||
label="Last log lines:"
|
label=$(omarchy_text "Last log lines:")
|
||||||
[[ $tail_log == /mnt/* ]] && label="Last target log lines:"
|
[[ $tail_log == /mnt/* ]] && label=$(omarchy_text "Last target log lines:")
|
||||||
line_at "$CONTENT_WIDTH" 2 "${DIM}${label}${RESET}"
|
line_at "$CONTENT_WIDTH" 2 "${DIM}${label}${RESET}"
|
||||||
printf '\n'
|
printf '\n'
|
||||||
tail -n "$lines" "$tail_log" 2>/dev/null | while IFS= read -r line; do
|
tail -n "$lines" "$tail_log" 2>/dev/null | while IFS= read -r line; do
|
||||||
@@ -843,7 +913,7 @@ find_log_uploader() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt_enter() {
|
prompt_enter() {
|
||||||
printf '\nPress Enter to continue…' >"$TTY_PATH"
|
printf '\n%s' "$(omarchy_text "Press Enter to continue…")" >"$TTY_PATH"
|
||||||
IFS= read -r _ <"$TTY_PATH" || true
|
IFS= read -r _ <"$TTY_PATH" || true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -854,9 +924,9 @@ upload_failure_log() {
|
|||||||
"$uploader" install >"$TTY_PATH" 2>&1 || true
|
"$uploader" install >"$TTY_PATH" 2>&1 || true
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "No log uploader is available in this environment."
|
printf '%s\n' "$(omarchy_text "No log uploader is available in this environment.")"
|
||||||
echo "Install log: $LOG_FILE"
|
printf '%s\n' "$(omarchy_text "Install log: %s" "$LOG_FILE")"
|
||||||
[[ -f /mnt/var/log/omarchy-install.log ]] && echo "Target log: /mnt/var/log/omarchy-install.log"
|
[[ -f /mnt/var/log/omarchy-install.log ]] && printf '%s\n' "$(omarchy_text "Target log: %s" /mnt/var/log/omarchy-install.log)"
|
||||||
} >"$TTY_PATH"
|
} >"$TTY_PATH"
|
||||||
fi
|
fi
|
||||||
prompt_enter
|
prompt_enter
|
||||||
@@ -922,8 +992,8 @@ render_failure() {
|
|||||||
blank_line
|
blank_line
|
||||||
render_logo
|
render_logo
|
||||||
blank_line
|
blank_line
|
||||||
center "${RED}Omarchy installation stopped${RESET}" "$CONTENT_WIDTH"
|
center "${RED}$(omarchy_text "Omarchy installation stopped")${RESET}" "$CONTENT_WIDTH"
|
||||||
center "Installer exited with status $status" "$CONTENT_WIDTH"
|
center "$(omarchy_text "Installer exited with status %s" "$status")" "$CONTENT_WIDTH"
|
||||||
|
|
||||||
render_media_diagnosis "$media_diagnosis"
|
render_media_diagnosis "$media_diagnosis"
|
||||||
|
|
||||||
@@ -938,12 +1008,12 @@ render_failure() {
|
|||||||
blank_line
|
blank_line
|
||||||
render_failure_log_tail "$(media_diagnosis_rows "$media_diagnosis")"
|
render_failure_log_tail "$(media_diagnosis_rows "$media_diagnosis")"
|
||||||
blank_line
|
blank_line
|
||||||
center "${DIM}Get help at https://omarchy.org/discord${RESET}" "$CONTENT_WIDTH"
|
center "${DIM}$(omarchy_text "Get help at https://omarchy.org/discord")${RESET}" "$CONTENT_WIDTH"
|
||||||
blank_line
|
blank_line
|
||||||
}
|
}
|
||||||
|
|
||||||
failure_menu() {
|
failure_menu() {
|
||||||
local choice uploader
|
local choice uploader actions shown i
|
||||||
|
|
||||||
[[ ${OMARCHY_UI_FAILURE_ACTION:-} == "exit" ]] && return 0
|
[[ ${OMARCHY_UI_FAILURE_ACTION:-} == "exit" ]] && return 0
|
||||||
# The failure screen and log tail have already rendered; exit with the
|
# The failure screen and log tail have already rendered; exit with the
|
||||||
@@ -953,26 +1023,20 @@ failure_menu() {
|
|||||||
while true; do
|
while true; do
|
||||||
uploader=""
|
uploader=""
|
||||||
uploader=$(find_log_uploader || true)
|
uploader=$(find_log_uploader || true)
|
||||||
if [[ -n $uploader ]]; then
|
actions=("View full log" "Drop to shell" "Reboot" "Power off")
|
||||||
choice=$(gum choose \
|
[[ -n $uploader ]] && actions=("Upload log for support" "${actions[@]}")
|
||||||
--height 6 \
|
shown=()
|
||||||
--header "What would you like to do?" \
|
for i in "${!actions[@]}"; do
|
||||||
"Upload log for support" \
|
shown+=("$(omarchy_text "${actions[i]}")")
|
||||||
"View full log" \
|
done
|
||||||
"Drop to shell" \
|
choice=$(gum choose \
|
||||||
"Reboot" \
|
--height "$((${#actions[@]} + 1))" \
|
||||||
"Power off" \
|
--header "$(omarchy_text "What would you like to do?")" \
|
||||||
<"$TTY_PATH" 2>"$TTY_PATH") || choice="Drop to shell"
|
"${shown[@]}" \
|
||||||
else
|
<"$TTY_PATH" 2>"$TTY_PATH") || choice=""
|
||||||
choice=$(gum choose \
|
for i in "${!shown[@]}"; do
|
||||||
--height 5 \
|
[[ ${shown[i]} == "$choice" ]] && choice=${actions[i]}
|
||||||
--header "What would you like to do?" \
|
done
|
||||||
"View full log" \
|
|
||||||
"Drop to shell" \
|
|
||||||
"Reboot" \
|
|
||||||
"Power off" \
|
|
||||||
<"$TTY_PATH" 2>"$TTY_PATH") || choice="Drop to shell"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
"Upload log for support")
|
"Upload log for support")
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# The China installer's console: the VT's Tokyo Night palette, with CJK from wqy-microhei.
|
||||||
|
[main]
|
||||||
|
font=JetBrains Mono:size=13,WenQuanYi Micro Hei Mono:size=13
|
||||||
|
|
||||||
|
[colors-dark]
|
||||||
|
background=1a1b26
|
||||||
|
foreground=a9b1d6
|
||||||
|
regular0=1a1b26
|
||||||
|
regular1=f7768e
|
||||||
|
regular2=9ece6a
|
||||||
|
regular3=e0af68
|
||||||
|
regular4=7aa2f7
|
||||||
|
regular5=bb9af7
|
||||||
|
regular6=7dcfff
|
||||||
|
regular7=a9b1d6
|
||||||
|
bright0=414868
|
||||||
|
bright1=f7768e
|
||||||
|
bright2=9ece6a
|
||||||
|
bright3=e0af68
|
||||||
|
bright4=7aa2f7
|
||||||
|
bright5=bb9af7
|
||||||
|
bright6=7dcfff
|
||||||
|
bright7=c0caf5
|
||||||
@@ -273,6 +273,12 @@ mkdir -p "$omarchy_share"
|
|||||||
printf 'logo bottom row%*s\n' 66 ''
|
printf 'logo bottom row%*s\n' 66 ''
|
||||||
} >"$omarchy_share/logo.txt"
|
} >"$omarchy_share/logo.txt"
|
||||||
|
|
||||||
|
# The ISO vendors the runtime's setup form; the dashboard only needs its text lookup.
|
||||||
|
cat >"$work/setup-form.sh" <<'FORM'
|
||||||
|
declare -gA OMARCHY_ZH=()
|
||||||
|
omarchy_text() { local text=$1; shift; printf -- "$text" "$@"; }
|
||||||
|
FORM
|
||||||
|
|
||||||
run_dashboard() {
|
run_dashboard() {
|
||||||
local install_log="$1"
|
local install_log="$1"
|
||||||
|
|
||||||
@@ -284,7 +290,7 @@ run_dashboard() {
|
|||||||
"error": "Pacstrap failed. See /var/log/archinstall.log"}]}
|
"error": "Pacstrap failed. See /var/log/archinstall.log"}]}
|
||||||
STATE
|
STATE
|
||||||
: >"$screen"
|
: >"$screen"
|
||||||
script -qefc "stty rows 40 cols 120; PATH='$stubs:$PATH' OMARCHY_PATH='$omarchy_share' OMARCHY_UI_INTERACTIVE=no OMARCHY_UI_FAILURE_ACTION=exit OMARCHY_FAILURE_TAIL_LOG='$install_log' '$DASHBOARD' '$install_log' '$state_file' -- bash -c 'exit 1'" \
|
script -qefc "stty rows 40 cols 120; PATH='$stubs:$PATH' OMARCHY_PATH='$omarchy_share' SETUP_FORM='$work/setup-form.sh' OMARCHY_UI_INTERACTIVE=no OMARCHY_UI_FAILURE_ACTION=exit OMARCHY_FAILURE_TAIL_LOG='$install_log' '$DASHBOARD' '$install_log' '$state_file' -- bash -c 'exit 1'" \
|
||||||
"$screen" >/dev/null 2>&1
|
"$screen" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# China installs read in Chinese: every text the configurator and the install
|
||||||
|
# dashboard pass to omarchy_text needs an OMARCHY_ZH entry, or it shows in English.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)
|
||||||
|
SETUP_FORM="${OMARCHY_SOURCE:-$ROOT/../omarchy}/install/provisioning/setup-form.sh"
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
printf 'not ok - %s\n' "$1"
|
||||||
|
[[ -z ${2:-} ]] || printf '%s\n' "$2" | sed 's/^/# /'
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ! -r $SETUP_FORM ]]; then
|
||||||
|
printf 'ok - # skip the setup form is not checked out next to this repo (set OMARCHY_SOURCE)\n'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
source "$SETUP_FORM"
|
||||||
|
for file in configs/airootfs/root/configurator configs/airootfs/usr/local/bin/omarchy-install-dashboard; do
|
||||||
|
eval "$(sed -n '/^OMARCHY_ZH+=(/,/^)/p' "$ROOT/$file")"
|
||||||
|
done
|
||||||
|
|
||||||
|
mapfile -t texts < <(
|
||||||
|
grep -ho 'omarchy_text "[^"$]*"' "$ROOT/configs/airootfs/root/configurator" "$ROOT/configs/airootfs/usr/local/bin/omarchy-install-dashboard" |
|
||||||
|
sed 's/^omarchy_text "//; s/"$//' | sort -u
|
||||||
|
)
|
||||||
|
((${#texts[@]} > 50)) || fail "the installer routes its text through omarchy_text" "found ${#texts[@]}"
|
||||||
|
for text in "${texts[@]}"; do
|
||||||
|
[[ -n ${OMARCHY_ZH[$text]:-} ]] || fail "every installer text has a Chinese entry" "missing: $text"
|
||||||
|
done
|
||||||
|
printf 'ok - every installer and dashboard text has a Chinese entry\n'
|
||||||
|
|
||||||
|
for action in "View full log" "Drop to shell" "Reboot" "Power off" "Upload log for support" "Global" "China"; do
|
||||||
|
[[ -n ${OMARCHY_ZH[$action]:-} ]] || fail "labels passed through variables have Chinese entries" "missing: $action"
|
||||||
|
done
|
||||||
|
printf 'ok - labels passed through variables have Chinese entries\n'
|
||||||
|
|
||||||
|
[[ $(OMARCHY_INSTALL_LANG=zh omarchy_text "Confirm overwriting %s" /dev/vda) == "确认覆盖 /dev/vda" ]] ||
|
||||||
|
fail "Chinese text keeps its printf arguments"
|
||||||
|
[[ $(omarchy_text "Confirm overwriting %s" /dev/vda) == "Confirm overwriting /dev/vda" ]] ||
|
||||||
|
fail "English stays the default"
|
||||||
|
printf 'ok - omarchy_text formats Chinese and English alike\n'
|
||||||
Reference in new issue
Block a user