Show Table of Contents
4. グラフィカルユーザーインターフェースのブランド化と色調節
本セクションでは、Anaconda インストーラーのグラフィカルユーザーインターフェース (GUI) の外観を変更する方法について説明します。
Anaconda の外観をカスタマイズするために変更可能な GUI の要素は複数あります。カスタマイズには
product.img ファイルを作成し、これに installclass (インストーラーで表示される製品名を変更する) と独自のブランド化資料を格納します。この product.img ファイルはインストールイメージではありません。これは完全インストール ISO イメージを補完するもので、カスタマイズを読み込んで使用することで、デフォルトでブートイメージに含まれているファイルを上書きします。
Red Hat が提供するブートイメージの抽出、
product.img ファイルの作成、およびこのファイルを ISO イメージに追加する方法については、「ISO イメージを使った作業」 を参照してください。
4.1. グラフィカル要素のカスタマイズ
インストーラーのグラフィカル要素で変更可能なものは、インストーラーランタイムファイルシステムの
/usr/share/anaconda/pixmaps/ ディレクトリーに保存されています。このディレクトリーには以下のファイルが格納されています。
pixmaps ├─ anaconda-selected-icon.svg ├─ dialog-warning-symbolic.svg ├─ right-arrow-icon.png ├─ rnotes │ └─ en │ ├─ RHEL_7_InstallerBanner_Andreas_750x120_11649367_1213jw.png │ ├─ RHEL_7_InstallerBanner_Blog_750x120_11649367_1213jw.png │ ├─ RHEL_7_InstallerBanner_CPAccess_CommandLine_750x120_11649367_1213jw.png │ ├─ RHEL_7_InstallerBanner_CPAccess_Desktop_750x120_11649367_1213jw.png │ ├─ RHEL_7_InstallerBanner_CPAccess_Help_750x120_11649367_1213jw.png │ ├─ RHEL_7_InstallerBanner_Middleware_750x120_11649367_1213jw.png │ ├─ RHEL_7_InstallerBanner_OPSEN_750x120_11649367_1213cd.png │ ├─ RHEL_7_InstallerBanner_RHDev_Program_750x120_11649367_1213cd.png │ ├─ RHEL_7_InstallerBanner_RHELStandardize_750x120_11649367_1213jw.png │ └─ RHEL_7_InstallerBanner_Satellite_750x120_11649367_1213cd.png ├─ sidebar-bg.png ├─ sidebar-logo.png └─ topbar-bg.png
また、
/usr/share/anaconda/ ディレクトリーには anaconda-gtk.css という名前の CSS スタイルシートが格納されており、これがファイル名や、ロゴおよびサイドバー/トップバーの背景といったメインの UI 要素のパラメーターを決定します。このファイルには以下のコンテンツが含まれます。
/* vendor-specific colors/images */
@define-color redhat #021519;
/* logo and sidebar classes for RHEL */
.logo-sidebar {
background-image: url('/usr/share/anaconda/pixmaps/sidebar-bg.png');
background-color: @redhat;
background-repeat: no-repeat;
}
.logo {
background-image: url('/usr/share/anaconda/pixmaps/sidebar-logo.png');
background-position: 50% 20px;
background-repeat: no-repeat;
background-color: transparent;
}
AnacondaSpokeWindow #nav-box {
background-color: @redhat;
background-image: url('/usr/share/anaconda/pixmaps/topbar-bg.png');
background-repeat: no-repeat;
color: white;
}
AnacondaSpokeWindow #layout-indicator {
color: black;
}
この CSS ファイルで最も重要な点は、解像度に基づいて拡大縮小を処理する方法です。PNG イメージの背景は拡大縮小せず、常に正確な寸法で表示されます。代わりに、背景には透過度のある背景があり、スタイルシートは
@define-color の行で一致する背景色を定義します。このため、背景の イメージ は背景色に「紛れる」ことになり、すべての解像度において背景はイメージを拡大縮小せずに機能します。
また
background-repeat パラメーターを変更して背景をタイル表示にしたり、インストールしているすべてのシステムで同一の解像度を使用することが分かっている場合は、バー全体を占める背景イメージを使用することもできます。
rnotes/ ディレクトリーにはバナーのセットを格納します。インストール中は、ほぼ 1 分ごとにバナー画像が画面下部で循環します。
上記で記載されているファイルはすべてカスタマイズが可能です。カスタマイズが終了したら、「product.img ファイルの作成」 の指示に従ってカスタマイズ画像で
product.img を作成し、「カスタムブートイメージの作成」 にあるように変更を含めた新規の起動可能な ISO イメージを作成します。
4.2. 製品名のカスタマイズ
前のセクションで説明したグラフィカル要素とは別に、インストール中に表示される製品名をカスタマイズすることもできます。この製品名は、全画面の右上に表示されます。
製品名を変更するには、installation class を作成する必要があります。以下の例のようなコンテンツで
custom.py という名前の新規ファイルを作成します。
例1 カスタム Installclass の作成
from pyanaconda.installclass import BaseInstallClass
from pyanaconda.product import productName
from pyanaconda import network
from pyanaconda import nm
class CustomBaseInstallClass(BaseInstallClass):
name = "My Distribution"
sortPriority = 30000
if not productName.startswith("My Distribution"):
hidden = True
defaultFS = "xfs"
bootloaderTimeoutDefault = 5
bootloaderExtraArgs = []
ignoredPackages = ["ntfsprogs"]
installUpdates = False
_l10n_domain = "comps"
efi_dir = "redhat"
help_placeholder = "RHEL7Placeholder.html"
help_placeholder_with_links = "RHEL7PlaceholderWithLinks.html"
def configure(self, anaconda):
BaseInstallClass.configure(self, anaconda)
BaseInstallClass.setDefaultPartitioning(self, anaconda.storage)
def setNetworkOnbootDefault(self, ksdata):
if ksdata.method.method not in ("url", "nfs"):
return
if network.has_some_wired_autoconnect_device():
return
dev = network.default_route_device()
if not dev:
return
if nm.nm_device_type_is_wifi(dev):
return
network.update_onboot_value(dev, "yes", ksdata)
def __init__(self):
BaseInstallClass.__init__(self)
上記のファイルは (デフォルトのファイルシステムなどの) インストーラーのデフォルト値を指定しますが、この手順に関連する部分は以下のブロックになります。
class CustomBaseInstallClass(BaseInstallClass):
name = "My Distribution"
sortPriority = 30000
if not productName.startswith("My Distribution"):
hidden = True
ここでの My Distribution をインストーラーで表示したい名前に置き換えます。また、
sortPriority 属性を 20000 以上に設定し、新規の installation class が最初に読み込まれるようにします。
警告
このファイルの他の属性やクラス名を変更しないでください。変更すると、インストーラーが予期しない動作をする場合があります。
カスタム installclass を作成したら、「product.img ファイルの作成」 の指示に従ってカスタマイズを含む
product.img ファイルを作成し、「カスタムブートイメージの作成」 にあるように変更を含めた新規の起動可能な ISO ファイルを作成します。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.