rabbit-slide-kenhys-tokyodebian-d-i-font-202307 2023.07.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rabbit +1 -0
- data/README.md +14 -0
- data/Rakefile +17 -0
- data/config.yaml +26 -0
- data/debian-installer.md +318 -0
- data/images/d-i-compared.png +0 -0
- data/images/d-i-fixed.png +0 -0
- data/images/d-i-highlight.png +0 -0
- data/images/d-i-original.png +0 -0
- data/images/d-i-packages.png +0 -0
- data/images/heistack.png +0 -0
- data/pdf/tokyodebian-d-i-font-202307-debian-installer.pdf +0 -0
- data/theme.rb +5 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 20a7055fe23629774481fc8d2dbe7dd1788b80a35837dac8ff36a879d0ae0069
|
4
|
+
data.tar.gz: 50f6af4f1b3348c40d2a96a7d0e92848d02190daf70b65034922f9a79d121feb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 84314f5c00276f9cc32b543d530680862b6c3394cb899f89145716943e02457b795965c5ee6da91d95f3187989fc5b4a8611697c736ff1da3ee90c169e1156fe
|
7
|
+
data.tar.gz: 7985f103b36513814bbc0875aa6c20d68c5fd3b6f749a221f62a24a2079337557dba60d68ae2d29a14068b008303f92bf382fd90d665f2cba722b3d9702bcf04
|
data/.rabbit
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--size=1024,768 debian-installer.md
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "rabbit/task/slide"
|
2
|
+
|
3
|
+
# Edit ./config.yaml to customize meta data
|
4
|
+
|
5
|
+
spec = nil
|
6
|
+
Rabbit::Task::Slide.new do |task|
|
7
|
+
spec = task.spec
|
8
|
+
# spec.files += Dir.glob("doc/**/*.*")
|
9
|
+
# spec.files -= Dir.glob("private/**/*.*")
|
10
|
+
# spec.add_runtime_dependency("rabbit-theme-YOUR-THEME")
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Tag #{spec.version}"
|
14
|
+
task :tag do
|
15
|
+
sh("git", "tag", "-a", spec.version.to_s, "-m", "Publish #{spec.version}")
|
16
|
+
sh("git", "push", "--tags")
|
17
|
+
end
|
data/config.yaml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
id: tokyodebian-d-i-font-202307
|
3
|
+
base_name: debian-installer
|
4
|
+
tags:
|
5
|
+
- rabbit
|
6
|
+
- debian
|
7
|
+
- debian-installer
|
8
|
+
- d-i
|
9
|
+
presentation_date: 2023-07-15
|
10
|
+
presentation_start_time:
|
11
|
+
presentation_end_time:
|
12
|
+
slideshare_id:
|
13
|
+
version: 2023.07.15.1
|
14
|
+
licenses:
|
15
|
+
- CC-BY-SA-4.0
|
16
|
+
slideshare_id: kenhys
|
17
|
+
speaker_deck_id:
|
18
|
+
vimeo_id:
|
19
|
+
youtube_id:
|
20
|
+
author:
|
21
|
+
markup_language: :md
|
22
|
+
name: Kentaro Hayashi
|
23
|
+
email: kenhys@gmail.com
|
24
|
+
rubygems_user: kenhys
|
25
|
+
slideshare_user:
|
26
|
+
speaker_deck_user: kenhys
|
data/debian-installer.md
ADDED
@@ -0,0 +1,318 @@
|
|
1
|
+
# Debian Installerの\\n日本語フォントを\\nどうにかする話
|
2
|
+
|
3
|
+
subtitle
|
4
|
+
: 日本語を選択して\\n違和感なくインストールしたい
|
5
|
+
|
6
|
+
author
|
7
|
+
: Kentaro Hayashi
|
8
|
+
|
9
|
+
institution
|
10
|
+
: ClearCode Inc.
|
11
|
+
|
12
|
+
content-source
|
13
|
+
: 2023年7月 東京エリア・関西合同Debian勉強会
|
14
|
+
|
15
|
+
allotted-time
|
16
|
+
: 20m
|
17
|
+
|
18
|
+
theme
|
19
|
+
: .
|
20
|
+
|
21
|
+
# スライドはRabbit Slide Showにて公開済みです
|
22
|
+
|
23
|
+
* Debian Installerの日本語フォントをどうにかする話
|
24
|
+
* <https://slide.rabbit-shocker.org/authors/kenhys/tokyodebian-d-i-font-202307>
|
25
|
+
|
26
|
+
# 本日の内容
|
27
|
+
|
28
|
+
* Debian Installerを改善する試み
|
29
|
+
* 日本語を選択してインストールするときの違和感
|
30
|
+
* 違和感の正体とその経緯について
|
31
|
+
* どうすればいいのか?
|
32
|
+
* Debian Installerのビルドをして検証してみた
|
33
|
+
|
34
|
+
# Debian Installerとは
|
35
|
+
|
36
|
+
* <https://www.debian.org/devel/debian-installer/index.en.html>
|
37
|
+
* Debianをインストールするためのイメージを提供
|
38
|
+
* ネットワークインストールしたり、ライブイメージも利用できる
|
39
|
+
* 詳細は <https://d-i.debian.org/> 参照
|
40
|
+
|
41
|
+
# Debian Installerのドキュメント
|
42
|
+
|
43
|
+
* Debian Installer Internationalization and Localization Guide
|
44
|
+
* <https://d-i.debian.org/doc/i18n-guide/>
|
45
|
+
* Debian Installation Guide — Development version
|
46
|
+
* <https://d-i.debian.org/doc/installation-guide/>
|
47
|
+
* Debian Installer internals
|
48
|
+
* <https://d-i.debian.org/doc/internals/>
|
49
|
+
|
50
|
+
# インストール中に\\n違和感を覚える
|
51
|
+
|
52
|
+
* インストール時に日本語🇯🇵を選択すると発生
|
53
|
+
* インストールそのものに支障をきたすほどではない🤔
|
54
|
+
|
55
|
+
# Debian bookwormのインストーラーの画面
|
56
|
+
|
57
|
+
![](images/d-i-original.png){:relative-height="100"}
|
58
|
+
|
59
|
+
# 間違い探しの答え
|
60
|
+
|
61
|
+
![](images/d-i-highlight.png){:relative-height="100"}
|
62
|
+
|
63
|
+
# どういうことか?
|
64
|
+
|
65
|
+
* 一部の文字がいわゆる中華フォントになる
|
66
|
+
* 「新」、「空」、「化」、「戻」、「続」など❌
|
67
|
+
* フォントが中華フォント臭いなと思いながらもインストールをそのまま続行してしまいがち
|
68
|
+
|
69
|
+
# 問題の発生する環境
|
70
|
+
|
71
|
+
* Debian 8 (jessie) では発生しない
|
72
|
+
* 2015/04/25-2018/06/17 EOL, 2020/06/30 EOL LTS
|
73
|
+
* Debian 9 (stretch) 以降で発生する
|
74
|
+
* 2017/06/17-2020/07/18 EOL, 2022/07/01 EOL LTS
|
75
|
+
|
76
|
+
# Debian 9で\\n何が起こったのか
|
77
|
+
|
78
|
+
* Proposal: Drop ttf-cjk-compact, get fonts-droid
|
79
|
+
* <https://lists.debian.org/debian-boot/2015/07/msg00304.html>
|
80
|
+
* ttf-cjk-compactではなく fonts-androidが採用された
|
81
|
+
* ttf-cjk-compactでは必要な文字を含むコンパクトなフォントを用意していた
|
82
|
+
* ~ 160KB程度にまとめていた
|
83
|
+
|
84
|
+
# fonts-android?
|
85
|
+
|
86
|
+
* <https://wiki.debian.org/DebianInstaller/GUIFonts>
|
87
|
+
* CJK向けフォントとしてfonts-androidではDroidSansFallbackが採用
|
88
|
+
* 結果として特定の文字が中華フォントになる Han Unification
|
89
|
+
|
90
|
+
# 変更当時から\\n問題が認識されていた
|
91
|
+
|
92
|
+
* kmutoさん曰く
|
93
|
+
|
94
|
+
- Some Japanese characters look bit funny.
|
95
|
+
(I believe it is negligible for installer.)
|
96
|
+
|
97
|
+
* <https://lists.debian.org/debian-boot/2015/07/msg00304.html>
|
98
|
+
|
99
|
+
# Han Unificationに関する問題の一般的な解説記事
|
100
|
+
|
101
|
+
* 参考: Your Code Displays Japanese Wrong
|
102
|
+
* <https://heistak.github.io/your-code-displays-japanese-wrong/>
|
103
|
+
|
104
|
+
# Your Code Displays Japanese Wrong
|
105
|
+
|
106
|
+
![](images/heistack.png){:relative-height="75"}
|
107
|
+
|
108
|
+
* <https://heistak.github.io/your-code-displays-japanese-wrong/>
|
109
|
+
|
110
|
+
# どうするとよいのか
|
111
|
+
|
112
|
+
* ざっくりいうと
|
113
|
+
* 適切なフォントを選んで
|
114
|
+
* 言語選択時に変更する
|
115
|
+
|
116
|
+
# 適切なフォントを選ぶ
|
117
|
+
|
118
|
+
* 案1: fonts-androidにフォントを追加する
|
119
|
+
* ソースアーカイブ(MTLc3m.ttf)にのみあり、インストールはされない
|
120
|
+
* MTLc3m.ttfは1.9MBほど(他の日本語フォントと比べるとコンパクト)
|
121
|
+
* fonts-android.udeb**のみ**フォントを追加インストールするよう変更
|
122
|
+
|
123
|
+
# 適切なフォントを選ぶ(2)
|
124
|
+
|
125
|
+
* 案2: fonts-motoya-l-cedarのudebを用意する
|
126
|
+
* udebを提供するのは理にかなっている
|
127
|
+
|
128
|
+
# どうするとよいのか
|
129
|
+
|
130
|
+
* 適切なフォントを選んで
|
131
|
+
* **fonts-motoya-l-cedarのudebを用意**
|
132
|
+
* 言語選択時に変更する
|
133
|
+
|
134
|
+
# udeb?
|
135
|
+
|
136
|
+
* 拡張子が.udebでmicro-debと呼称
|
137
|
+
* d-i専用の容量削減を重視するdebパッケージ
|
138
|
+
* Debian Policyのもろもろには準拠せず
|
139
|
+
* アンインストールや更新は意図されていない
|
140
|
+
* changelogやライセンス、ドキュメント等を省略
|
141
|
+
* See Chapter 3. D-I components or udebs
|
142
|
+
* <https://d-i.debian.org/doc/internals/ch03.html>
|
143
|
+
|
144
|
+
# 言語選択時に変更する(1)
|
145
|
+
|
146
|
+
* d-iは各種パッケージから構成される
|
147
|
+
|
148
|
+
![](images/d-i-packages.png){:relative-height="85" :relative-width="100"}
|
149
|
+
|
150
|
+
# 言語選択時に変更する(2)
|
151
|
+
|
152
|
+
* cdefconfでGTKのリソースを変更(抜粋)
|
153
|
+
* たぶんもっとよいやりかたはあるはず
|
154
|
+
|
155
|
+
```
|
156
|
+
static void set_language_specific_font_name(struct frontend *fe)
|
157
|
+
char * language = cdebconf_gtk_get_text(fe, "debconf/language",
|
158
|
+
"Current language for installer");
|
159
|
+
if (language && strcmp(language, "ja") == 0) {
|
160
|
+
gtk_rc_parse_string('gtk-font-name = "MotoyaLCedar"');
|
161
|
+
}
|
162
|
+
```
|
163
|
+
|
164
|
+
# どうするとよいのか
|
165
|
+
|
166
|
+
* 適切なフォントを選んで
|
167
|
+
* **fonts-motoya-l-cedarのudebを用意**
|
168
|
+
* 言語選択時に変更する
|
169
|
+
* **cdefconfでGTKのリソースを変更**
|
170
|
+
* 注: もっとよいやりかたはありそう
|
171
|
+
|
172
|
+
# インストーラーを\\nビルドして検証する
|
173
|
+
|
174
|
+
* Debian Installerのビルド方法を解説
|
175
|
+
|
176
|
+
# Debian Installerのビルド方法(1)
|
177
|
+
|
178
|
+
* リポジトリのチェックアウト
|
179
|
+
|
180
|
+
```
|
181
|
+
$ sudo apt install -y myrepos
|
182
|
+
$ mr bootstrap \
|
183
|
+
https://salsa.debian.org/installer-team/d-i/raw/master/.mrconfig \
|
184
|
+
debian-installer
|
185
|
+
```
|
186
|
+
|
187
|
+
# Debian Installerのビルド方法(2)
|
188
|
+
|
189
|
+
* 必要なパッケージのインストール
|
190
|
+
* パッケージいろいろインストールするのでコンテナ推奨
|
191
|
+
|
192
|
+
```
|
193
|
+
# apt install -y \
|
194
|
+
git curl myrepos dpkg-dev \
|
195
|
+
apt-utils wget bc xsltproc docbook-xml docbook-xsl libbogl-dev \
|
196
|
+
genext2fs genisoimage dosfstools cpio \
|
197
|
+
syslinux syslinux-utils isolinux pxelinux syslinux-common \
|
198
|
+
shim-signed grub-efi-amd64-signed grub-common xorriso tofrodos mtools kmod \
|
199
|
+
bf-utf-source win32-loader librsvg2-bin fdisk fontconfig
|
200
|
+
```
|
201
|
+
|
202
|
+
# Debian Installerのビルド方法(3)
|
203
|
+
|
204
|
+
* フォントのudebを用意する
|
205
|
+
* debian/control
|
206
|
+
|
207
|
+
```
|
208
|
+
diff -ur fonts-motoya-l-cedar-1.01.orig/debian/control fonts-motoya-l-cedar-1.01/debian/control
|
209
|
+
--- fonts-motoya-l-cedar-1.01.orig/debian/control 2019-04-14 22:16:41.000000000 +0900
|
210
|
+
+++ fonts-motoya-l-cedar-1.01/debian/control 2023-07-03 18:44:45.938298199 +0900
|
211
|
+
@@ -21,3 +21,14 @@
|
212
|
+
.
|
213
|
+
This package provides "MotoyaLCedar W3 mono" - Gothic that images Japanese
|
214
|
+
cedar, straight and thick tree.
|
215
|
+
+
|
216
|
+
+Package: fonts-motoya-l-cedar-udeb
|
217
|
+
+Package-Type: udeb
|
218
|
+
+Section: debian-installer
|
219
|
+
+Architecture: all
|
220
|
+
+Description: Japanese Truetype font, Motoya L Cedar
|
221
|
+
```
|
222
|
+
|
223
|
+
# Debian Installerのビルド方法(4)
|
224
|
+
|
225
|
+
* MTLc3m.ttfをインストールするための.installを用意
|
226
|
+
* debian/fonts-motoya-l-cedar-1.01/debian/fonts-motoya-l-cedar-udeb.install
|
227
|
+
|
228
|
+
```
|
229
|
+
MTLc3m.ttf usr/share/fonts/truetype/motoya-l-cedar/
|
230
|
+
```
|
231
|
+
|
232
|
+
# Debian Installerのビルド方法(5)
|
233
|
+
|
234
|
+
* udebを参照できるようにする
|
235
|
+
* debian-installer/installer/build/sources.list.udeb.localを配置する
|
236
|
+
* 例: /debianがコンテナにマウントしたdebian-installerディレクトリ
|
237
|
+
|
238
|
+
```
|
239
|
+
deb [trusted=yes] copy:/debian/installer/build localudebs/
|
240
|
+
deb http://deb.debian.org/debian unstable main/debian-installer
|
241
|
+
```
|
242
|
+
|
243
|
+
# Debian Installerのビルド方法(6)
|
244
|
+
|
245
|
+
* debian-installer/installer/build/localudebsにフォントのudebを配置する
|
246
|
+
|
247
|
+
```
|
248
|
+
# ls -1 /debian/installer/build/localudebs/
|
249
|
+
Packages
|
250
|
+
Packages.gz
|
251
|
+
fonts-motoya-l-cedar-udeb_1.01-5.1_all.udeb
|
252
|
+
```
|
253
|
+
|
254
|
+
# Debian Installerのビルド方法(7)
|
255
|
+
|
256
|
+
* installer/build/pkg-lists/gtk-commonのパッケージリストにフォントを追加する
|
257
|
+
|
258
|
+
```
|
259
|
+
# For Japanese
|
260
|
+
fonts-motoya-l-cedar-udeb
|
261
|
+
```
|
262
|
+
|
263
|
+
* cdebconfにパッチをあてる
|
264
|
+
|
265
|
+
# Debian Installerのビルド方法(8)
|
266
|
+
|
267
|
+
* build/config/commonでLINUX_KERNEL_ABIを環境にあわせて設定しなおす
|
268
|
+
* linux-image-x.y.z-1が揃っていないと依存するudebをダウンロードできない
|
269
|
+
|
270
|
+
```
|
271
|
+
# Default kernel ABI version to use. Append a kernel flavour to
|
272
|
+
# produce KERNELVERSION.
|
273
|
+
#LINUX_KERNEL_ABI ?= 6.3.0-2
|
274
|
+
LINUX_KERNEL_ABI ?= 6.1.0-9
|
275
|
+
```
|
276
|
+
|
277
|
+
# Debian Installerのビルド方法(9)
|
278
|
+
|
279
|
+
* buildディレクトリに移動して、build_netboot-gtkをビルド
|
280
|
+
|
281
|
+
```
|
282
|
+
# cd /debian/installer/build/
|
283
|
+
# make build_netboot-gtk
|
284
|
+
```
|
285
|
+
|
286
|
+
# Debian Installerのビルド方法(10)
|
287
|
+
|
288
|
+
* ビルドが成功するとmini.isoができる
|
289
|
+
|
290
|
+
```
|
291
|
+
/debian/installer/build/dest/netboot/gtk/mini.iso
|
292
|
+
```
|
293
|
+
|
294
|
+
# 手元で修正してみた画面
|
295
|
+
|
296
|
+
![](images/d-i-fixed.png){:relative-height="100"}
|
297
|
+
|
298
|
+
|
299
|
+
# 新旧の比較
|
300
|
+
|
301
|
+
* 中華フォントが修正されている
|
302
|
+
|
303
|
+
![](images/d-i-compared.png){:relative-height="100" :relative-width="100"}
|
304
|
+
|
305
|
+
# バグレポート
|
306
|
+
|
307
|
+
* debian-installer: GUI font for Japanese was incorrectly rendered
|
308
|
+
* <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037256>
|
309
|
+
|
310
|
+
* Proposal: change Japanese font for GUI installer
|
311
|
+
* <https://lists.debian.org/debian-boot/2023/06/msg00224.html>
|
312
|
+
|
313
|
+
# さいごに
|
314
|
+
|
315
|
+
* ❌Debian 9以降インストーラーは中華フォント問題(Han Unification)を抱えている
|
316
|
+
* ✅日本語向けには次の変更で解決できる
|
317
|
+
* フォントを追加インストールする
|
318
|
+
* 追加インストールしたフォントを動的に選択可能にする
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/images/heistack.png
ADDED
Binary file
|
Binary file
|
data/theme.rb
ADDED
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rabbit-slide-kenhys-tokyodebian-d-i-font-202307
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2023.07.15.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kentaro Hayashi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-07-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rabbit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.2
|
27
|
+
description: ''
|
28
|
+
email:
|
29
|
+
- kenhys@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".rabbit"
|
35
|
+
- README.md
|
36
|
+
- Rakefile
|
37
|
+
- config.yaml
|
38
|
+
- debian-installer.md
|
39
|
+
- images/d-i-compared.png
|
40
|
+
- images/d-i-fixed.png
|
41
|
+
- images/d-i-highlight.png
|
42
|
+
- images/d-i-original.png
|
43
|
+
- images/d-i-packages.png
|
44
|
+
- images/heistack.png
|
45
|
+
- pdf/tokyodebian-d-i-font-202307-debian-installer.pdf
|
46
|
+
- theme.rb
|
47
|
+
homepage: https://slide.rabbit-shocker.org/authors/kenhys/tokyodebian-d-i-font-202307/
|
48
|
+
licenses:
|
49
|
+
- CC-BY-SA-4.0
|
50
|
+
metadata: {}
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubygems_version: 3.3.26
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: Tokyo Debian Debian Installer Issue 202307
|
70
|
+
test_files: []
|