Skip to content

Commit

Permalink
Merge pull request #44 from PingNote/main
Browse files Browse the repository at this point in the history
add zh-TW
  • Loading branch information
yuk7 authored Oct 2, 2023
2 parents ca400a3 + 6e77c76 commit 1e4b0e3
Show file tree
Hide file tree
Showing 11 changed files with 369 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _includes/footer_custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<script type="text/javascript">
window.addEventListener("load", addTranslates);
trans_langs = [["ja-JP", "日本語"],["zh-CN", "简体中文"],["ko-KR", "한국어"],["pt-BR", "Português Brasileiro"]];
trans_langs = [["ja-JP", "日本語"],["zh-CN", "简体中文"],["zh-TW", "繁體中文"],["ko-KR", "한국어"],["pt-BR", "Português Brasileiro"]];

function addTranslates() {
target = document.getElementById("footer_translates");
Expand Down
2 changes: 2 additions & 0 deletions locale/Translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ has_children: true

[Simplified Chinese(简体中文)](zh-CN/README.md)

[Traditional Chinese(繁體中文)](zh-TW/README.md)

[Korean (한국어) ](ko-KR/README.md)

[Brazilian Portuguese (Português Brasileiro)](pt-BR/README.md)
106 changes: 106 additions & 0 deletions locale/zh-TW/How-to-Setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
title: "如何安裝"
parent: "繁體中文"
grand_parent: "Translations"
has_children: true
---
# 如何安裝

## 系統需求

* Windows 10 1709 秋季創作者更新或者更高版本
* 開啟 `適用於 Linux 的 Windows 子系統` 功能

## 安裝方法

有兩種方法安裝 ArchWSL.



### 方法 1:zip 檔案
1. 下載 [[GH](https://github.com/yuk7/ArchWSL/releases/latest) / [鏡像](https://gitee.com/yuk7/archwsl-mirror)] zip 安裝包。
2. 解壓縮 zip 檔案中的全部內容到相同的目錄。
請解壓到一個你擁有寫許可權的目錄。
例如, `C:\Program Files` 就不該被使用。
3. 執行 `Arch.exe` 來安裝 rootfs 和註冊表配置。

另外,EXE 檔案的名稱會同時用作你的 WSL 實例名稱。

也就是說,如果複製多個 EXE 檔案,並重命名成不同的名稱,你就同時擁有了多個不同的 ArchWSL 並且互不衝突。

### 方法 2:appx 包
1.[[GH](https://github.com/yuk7/ArchWSL/releases/latest) / [鏡像](https://gitee.com/yuk7/archwsl-mirror)] 下載發佈的 .appx 和 .cer 檔案。

2. 安裝 .cer 檔案到 「本機電腦」 的 「受信任的根憑證授權單位」。
更多詳情,請 [檢視對應的文件頁面](Install-Certificate.md)
3. 雙擊安裝 appx 檔案。

## 完成安裝後的操作
### 若你使用 WSL1 ,你將**必須**修改一下 glibc 包。更多詳情,請 [檢視已知問題章節](Known-issues.md#wsl1--wsl2)

### 設定Root密碼

```shell
>Arch.exe
[root@PC-NAME]# passwd
```

### 設定預設使用者

參考 ArchWiki 的
[Sudo](https://wiki.archlinux.org/index.php/Sudo#Example_entries)
[User and groups](https://wiki.archlinux.org/index.php/Users_and_groups) 頁。

```shell
>Arch.exe
[root@PC-NAME]# echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/wheel
(設定 sudoers 檔案。)

[root@PC-NAME]# useradd -m -G wheel -s /bin/bash {username}
(新增使用者)

[root@PC-NAME]# passwd {username}
(設定預設使用者密碼)

[root@PC-NAME]# exit

>Arch.exe config --default-user {username}
(設定預設使用者)
```

如果預設使用者密碼被更改
([issue #7](https://github.com/yuk7/ArchWSL/issues/7)),
請重啟電腦或者用管理員CMD重啟LxssManager。

要重啟 `LxssManager`, 請執行:

```batch
net stop lxssmanager && net start lxssmanager
```

### 初始化金鑰環(keyring)

請執行這些命令以初始化金鑰環(keyring)。
(必須執行此步驟才可以使用 Pacman)

```shell
>Arch.exe
[user@PC-NAME]$ sudo pacman-key --init

[user@PC-NAME]$ sudo pacman-key --populate

[user@PC-NAME]$ sudo pacman -Syy archlinux-keyring
```

### 安裝修改版 glibc (WSL1 環境下必需)
Arch 官方的 glibc 包是為新版內核(4.4以上版本)設計的,並且使用了未在 WSL1 被實現的系統呼叫。

因此,如果你不使用打過 patch 的 glibc 包,你的實例會完全開不起來。

WSL1 使用者 **必須** 跟著 [這些步驟](Known-issues.md#wsl1--wsl2) 修改 glibc 後才可使用。

### 安裝 systemctl 替代品(可選)

WSL 並不支援 systemd,但是也有一些解決方案。
可以 [檢視已知問題](Known-issues.md#systemdsystemctl)
105 changes: 105 additions & 0 deletions locale/zh-TW/How-to-Use.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: "如何使用"
parent: "繁體中文"
grand_parent: "Translations"
---
# 如何使用 (ArchWSL 安裝以後)

## exe 用法

```shell
用法 :
<無參數>
- 以你的預設設定打開一個新的 Shell。

run <命令列>
- 在此實例中執行你所給出的命令,繼承當前Shell的所在目錄。

runp <命令列 (包含 windows 路徑)>
- 在此實例里執行轉譯過的命令列。

config [setting [值]]
- `--default-user <使用者>`: 設定此實例的預設使用者到 <使用者>
- `--default-uid <uid>`: 設定此實例的預設使用者 UID 到 <uid>
- `--append-path <on|off>`: 加入 Windows PATH 到 $PATH 的開關。
- `--mount-drive <on|off>`: 掛載驅動器的開關。
- `--default-term <default|wt|flute>`: 設定預設的終端視窗樣式。

get [setting]
- `--default-uid`: 輸出此實例的預設使用者UID。
- `--append-path`: 輸出「加入 Windows PATH 到 $PATH」的開關狀態。
- `--mount-drive`: 輸出「掛載驅動器」的開關狀態。
- `--wsl-version`: 輸出此實例的WSL版本(1/2)。
- `--default-term`: 輸出此實例啟動器的預設終端樣式。
- `--lxguid`: 輸出此實例的 WSL GUID key。

backup [contents]
- `--tar`: 輸出 backup.tar 到目前目錄。
- `--reg`: 輸出設定註冊表檔案到目前目錄。

clean
- 解除安裝此實例。

help
- 顯示此幫助資訊。
```
## 打開預設 Shell
```shell
>Arch.exe
[root@PC-NAME user]#
```
## 立刻執行一個命令後退出
```shell
>Arch.exe run uname -r
4.4.0-43-Microsoft
```
## 執行一個命令(轉譯路徑)後退出
```shell
>Arch.exe runp echo C:\Windows\System32\cmd.exe
/mnt/c/Windows/System32/cmd.exe
```
## 更改預設使用者(需要 ID 命令)
```shell
>Arch.exe config --default-user 使用者

>Arch.exe
[user@PC-NAME dir]$
```
若是預設使用者未被更改
([issue #7](https://github.com/yuk7/ArchWSL/issues/7)),
請重啟電腦或者重啟 LxssManager 服務。
若要重啟 `LxssManager`, 在管理員命令提示符中執行:
```batch
net stop lxssmanager && net start lxssmanager
```
## 備份 Rootfs
備份:
```shell
>Arch.exe backup
```
還原備份檔案:
```shell
>Arch.exe install full/path/to/backup.tar
```
## 解除安裝實例
```shell
>Arch.exe clean
```
30 changes: 30 additions & 0 deletions locale/zh-TW/Install-Certificate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: 安裝 AppX 所用的憑證
parent: "如何安裝"
#nav_order:
---

# 安裝 AppX 的憑證

ArchWSL 並不是 Microsoft 開發的。因此,你必須手動安裝一個代碼簽章憑證才能正常使用 `.appx` 包。
這個憑證需要被安裝到本機電腦的「受信任人」儲存區。

## 第一步

1. 打開 .cer 檔案,然後點選「安裝憑證」。

![screenshot1](img/cert/1.install.png)

2. 選擇「本機電腦」,然後下一步。

![screenshot2](img/cert/2.to-localmachine.png)

3. 選擇 「將所有憑證放入以下的存放區」,然後點選「瀏覽」選擇安裝目標。

![screenshot3](img/cert/3.to-following.png)

4. 現在選擇「受信任的人」。完成後點選確定。

![screenshot4](img/cert/4.to-trustedpeople.png)

5. 安裝完成!
107 changes: 107 additions & 0 deletions locale/zh-TW/Known-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
title: "已知問題"
parent: "繁體中文"
grand_parent: "Translations"
---
# 已知問題

## 快捷方式

[檢視 wsldl 的文件](https://git.io/wsldl-doc)

## glibc
Arch 預設的 glibc 包是為新版本 Linux 內核的 syscall 設計的,而 WSL1 並不支援它們。

因此,如果你不使用打過 patch 的 glibc 包,你的實例會完全開不起來。

你可以使用 AUR 中的 `glibc-linux4`[ᴬᵁᴿ](https://aur.archlinux.org/packages/glibc-linux4) 包。

你可以從 archlinuxcn 社區倉庫安裝此包,以方便自動更新。
```
echo '[archlinuxcn]
Server = https://repo.archlinuxcn.org/$arch' >> /etc/pacman.conf
sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring && sudo pacman -S glibc-linux4
```
當然,你也可以直接使用 AUR helper 安裝。
```
yay -S glibc-linux4
```

## fakeroot

fakeroot 預設使用 SYSV IPC,
但是 WSL1 目前還不支援它。

你可以轉而使用 `fakeroot-tcp`[ᴬᵁᴿ](https://aur.archlinux.org/packages/fakeroot-tcp) 包。 (WSL2 無此問題)

下載 [fakeroot-tcp-1.23-1-x86_64.pkg.tar.xz](https://github.com/yuk7/arch-prebuilt/releases/download/18082100/fakeroot-tcp-1.23-1-x86_64.pkg.tar.xz) 然後執行 `pacman -U fakeroot-tcp-1.23-1-x86_64.pkg.tar.xz` 以安裝。

## Qt5

qt >=5.10 庫在 WSL1 不能使用,這是 WSL 的問題。(在 [Microsoft/WSL#3023](https://github.com/Microsoft/WSL/issues/3023))

請以 root 執行這個:
`strip --remove-section=.note.ABI-tag /usr/lib/libQt5Core.so.5`

## MySQL 8/MariaDB

MySQL >=8 預設會使用使用原版的 AIO interface。WSL1 並不相容它,因此你必須手動配置它。
編輯 `/etc/my.cnf.d/server.cnf` ,增加 `innodb_use_native_aio=0``[mysqld]`

```text
[mysqld]
innodb_use_native_aio=0
```

## D-Bus

systemd D-Bus 守護程序在 WSL1 不能使用。
我建議使用 `dbus-x11`[ᴬᵁᴿ](https://aur.archlinux.org/packages/dbus-x11/)
下載 [dbus-x11-1.12.16-1-x86_64.pkg.tar.xz](https://github.com/yuk7/arch-prebuilt/releases/download/20051200/dbus-x11-1.12.16-1-x86_64.pkg.tar.xz) 並執行 `pacman -U dbus-x11-1.12.16-1-x86_64.pkg.tar.xz` 以安裝。

要啟動 D-Bus 守護程序,執行:

```bash
sudo mkdir /run/dbus -p
sudo dbus-daemon --system
```

## systemd/systemctl

WSL 並沒有 systemd 的原生支援。
如果你需要使用依賴 systemd 支援的程式,我們建議使用替代指令碼或容器。

### WSL1 / WSL2

你可以用 systemctl 替代指令碼,
不過它只能部分相容 systemctl。

下載 [systemd-altctl-1.4.4181-1-any.pkg.tar.xz](https://github.com/yuk7/arch-systemctl-alt/releases/download/1.4.4181-1/systemd-altctl-1.4.4181-1-any.pkg.tar.xz) 然後執行 `pacman -U systemd-altctl-1.4.4181-1-any.pkg.tar.xz` 以安裝。

### WSL2

你可以使用 systemd 容器 [subsystemctl](https://github.com/sorah/subsystemctl) 或是 [genie](https://github.com/arkane-systems/genie)

使用它們,你就可以使用完整的 systemd 了。

#### subsystemctl

你可以下載 [PKGBUILD](https://raw.githubusercontent.com/sorah/arch.sorah.jp/master/aur-sorah/PKGBUILDs/subsystemctl/PKGBUILD) 然後構建它。

[讀這裡瞭解更多資訊](https://github.com/sorah/subsystemctl#usage)

#### genie

你可以下載 [這裡的 PKGBUILDs](https://gist.github.com/arlllk/7001c521de601f01735af5ca440f03ae).

[讀這裡瞭解更多資訊](https://github.com/arkane-systems/genie#usage)

#### Intel 顯示卡

ArchWSL 預設可能無法正常載入 Intel WSL 驅動,這會導致無法在 Intel 顯示卡上使用 D3D12 驅動程式。

導致這個問題的原因是 Intel WSL 驅動檔案連結了 ArchLinux 並不存在的庫檔案,你可以手動修復它們使其正常工作。

你需要先使用 `ldd` 檢視它們連結了哪些庫,例如: `ldd /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/*.so`,然後查詢標記為 `not found` 的庫。接著檢視 ArchLinux 軟體包倉庫是否有對應的包,如果有,安裝它們,問題或許就解決了。如果在軟體包倉庫找不到對應的庫檔案,那可能是庫檔案的版本後綴不一樣,比如 `libedit.so.0.0.68``libedit.so.2`,這時你可以試著為其建立一個指向現有版本的軟連結。

Issue: [#308](https://github.com/yuk7/ArchWSL/issues/308)
18 changes: 18 additions & 0 deletions locale/zh-TW/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
layout: default
title: "繁體中文"
parent: "Translations"
description: "繁體中文的主頁"
permalink: /locale/zh-TW/
has_children: true
---

# ArchWSL 文件

[如何安裝](How-to-Setup.md)

[如何使用](How-to-Use.md)

[已知問題](Known-issues.md)

[回到翻譯列表](../Translations.md)
Binary file added locale/zh-TW/img/cert/1.install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added locale/zh-TW/img/cert/2.to-localmachine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added locale/zh-TW/img/cert/3.to-following.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added locale/zh-TW/img/cert/4.to-trustedpeople.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1e4b0e3

Please sign in to comment.