diff --git a/Documentation/admin-guide/installation.rst b/Documentation/admin-guide/installation.rst index 38da950c..d224247c 100644 --- a/Documentation/admin-guide/installation.rst +++ b/Documentation/admin-guide/installation.rst @@ -65,6 +65,10 @@ ReliefNT 当前未提供 Landlock。生成的系统配置使用 pacman 标准选 语言、许可证、在线安装说明、目标磁盘、引导方式、分区方案、系统选项、账户、 安装摘要、安装进度和结果。安装器只负责全新安装;安装后请用 pacman 更新。 +安装 ISO 的图形入口由 systemd 启动 Xorg,在专用 IceWM 会话中运行安装器, +提供窗口边框、移动、缩放和任务栏,不经过 XDM 登录界面。 +关闭安装器会结束该图形会话;选择目标系统的桌面不会改变安装环境的 IceWM 会话。 + 安装前可以用“上一步”返回,图形侧栏也可回到已经经过的配置步骤。 修改磁盘、引导方式、分区或系统选项后,摘要根据当前选择重新生成; 账户密码不会出现在摘要或日志中。图形许可证页面需明确勾选确认, @@ -93,6 +97,12 @@ F3 继续、F2 返回修改,PgUp/PgDn 滚动页面或许可证。界面适 进度页显示分区、下载、验签、包事务、配置及引导安装等阶段。 安装失败时保留错误详情,完整日志位于安装环境的 ``/var/log/installer.log``。 +图形安装器可随时通过侧栏的“查看日志 (F4)”按钮或 F4 打开独立日志窗口, +安装期间和结果页面均可使用;关闭日志窗口不会退出安装器或中断安装。 +窗口显示最近约 8 KiB 日志,默认每秒刷新并跟随新内容;取消“跟随日志”可暂停阅读, +也可点击“刷新”手动更新。日志可滚动和复制,完整内容仍保存在上述日志文件中。 +控制台安装器在进度页用 F4 显示或隐藏日志。 + 图形向导在语言选择后显示 Apache License 2.0 英文原文,可滚动阅读全文。 该文本直接取自仓库的 ``LICENSE``,中文界面也保留许可证原文。 diff --git a/Documentation/locale/en/LC_MESSAGES/admin-guide/installation.po b/Documentation/locale/en/LC_MESSAGES/admin-guide/installation.po index 61a3b355..ee3ff5f2 100644 --- a/Documentation/locale/en/LC_MESSAGES/admin-guide/installation.po +++ b/Documentation/locale/en/LC_MESSAGES/admin-guide/installation.po @@ -442,3 +442,9 @@ msgstr "" "reported error and retry as an administrator with ``reliefos-boot-update " "/ /boot``. For recovery, select a retained previous kernel from GRUB. " "Kernel rollback does not roll back other packages." + +msgid "安装 ISO 的图形入口由 systemd 启动 Xorg,在专用 IceWM 会话中运行安装器, 提供窗口边框、移动、缩放和任务栏,不经过 XDM 登录界面。 关闭安装器会结束该图形会话;选择目标系统的桌面不会改变安装环境的 IceWM 会话。" +msgstr "The graphical entry of the installation ISO starts Xorg through systemd and runs the installer in a dedicated IceWM session, providing window decorations, movement, resizing and a taskbar without an XDM login screen. Closing the installer ends this graphical session; the desktop selected for the target system does not change the installation environment’s IceWM session." + +msgid "图形安装器可随时通过侧栏的“查看日志 (F4)”按钮或 F4 打开独立日志窗口, 安装期间和结果页面均可使用;关闭日志窗口不会退出安装器或中断安装。 窗口显示最近约 8 KiB 日志,默认每秒刷新并跟随新内容;取消“跟随日志”可暂停阅读, 也可点击“刷新”手动更新。日志可滚动和复制,完整内容仍保存在上述日志文件中。 控制台安装器在进度页用 F4 显示或隐藏日志。" +msgstr "In the graphical installer, use the sidebar’s “View log (F4)” button or F4 to open a separate log window at any time, including during installation and on the result page. Closing it does not exit the installer or interrupt installation. The window displays approximately the latest 8 KiB of the log, refreshing once per second and following new output by default. Clear “Follow log” to pause reading, or click “Refresh” to update manually. You can scroll and copy the log; the complete contents remain in the log file above. In the console installer, F4 shows or hides the log on the progress page." diff --git a/Documentation/locale/ja/LC_MESSAGES/admin-guide/installation.po b/Documentation/locale/ja/LC_MESSAGES/admin-guide/installation.po index da963967..e04d67b4 100644 --- a/Documentation/locale/ja/LC_MESSAGES/admin-guide/installation.po +++ b/Documentation/locale/ja/LC_MESSAGES/admin-guide/installation.po @@ -355,3 +355,9 @@ msgstr "" "の項目を生成します。起動準備に失敗してもパッケージはすでにインストールされている場合があります。報告された原因を解消してから、管理者として " "``reliefos-boot-update / /boot`` を実行し、再試行してください。復旧時は GRUB " "で保持されている旧カーネルを選択できます。カーネルを戻しても他のパッケージは戻りません。" + +msgid "安装 ISO 的图形入口由 systemd 启动 Xorg,在专用 IceWM 会话中运行安装器, 提供窗口边框、移动、缩放和任务栏,不经过 XDM 登录界面。 关闭安装器会结束该图形会话;选择目标系统的桌面不会改变安装环境的 IceWM 会话。" +msgstr "インストール ISO のグラフィカル起動では、systemd が Xorg を起動し、専用の IceWM セッションでインストーラーを実行します。XDM のログイン画面を経由せず、ウィンドウの枠、移動、サイズ変更、タスクバーを利用できます。インストーラーを閉じると、このグラフィカルセッションは終了します。インストール先のデスクトップ選択は、インストール環境の IceWM セッションを変更しません。" + +msgid "图形安装器可随时通过侧栏的“查看日志 (F4)”按钮或 F4 打开独立日志窗口, 安装期间和结果页面均可使用;关闭日志窗口不会退出安装器或中断安装。 窗口显示最近约 8 KiB 日志,默认每秒刷新并跟随新内容;取消“跟随日志”可暂停阅读, 也可点击“刷新”手动更新。日志可滚动和复制,完整内容仍保存在上述日志文件中。 控制台安装器在进度页用 F4 显示或隐藏日志。" +msgstr "グラフィカルインストーラーでは、サイドバーの「ログを表示 (F4)」ボタンまたは F4 で、インストール中や結果画面を含め、いつでも独立したログウィンドウを開けます。ログウィンドウを閉じても、インストーラーは終了せず、インストールも中断しません。直近の約 8 KiB のログを表示し、既定では毎秒更新して新しい出力を追尾します。「ログを追尾」を解除すると表示を一時停止でき、「更新」で手動更新できます。ログはスクロールとコピーが可能で、完全な内容は上記のログファイルに保存されます。コンソールインストーラーでは、進捗ページで F4 を押すとログを表示または非表示にします。" diff --git a/configs/nls/po/installer/installer.pot b/configs/nls/po/installer/installer.pot index d820a01c..cd6590de 100644 --- a/configs/nls/po/installer/installer.pot +++ b/configs/nls/po/installer/installer.pot @@ -14,7 +14,7 @@ msgstr "" msgid "Account setup failed" msgstr "" -#: userland/apps/installer/main.cpp:198 +#: userland/apps/installer/main.cpp:201 msgid "Accounts" msgstr "" @@ -22,15 +22,15 @@ msgstr "" msgid "Add to Favorites" msgstr "" -#: userland/apps/installer/main.cpp:793 +#: userland/apps/installer/main.cpp:805 msgid "Add to plan" msgstr "" -#: userland/apps/installer/main.cpp:975 +#: userland/apps/installer/main.cpp:987 msgid "Administrator: root" msgstr "" -#: userland/apps/installer/main.cpp:546 +#: userland/apps/installer/main.cpp:558 msgid "After installation, update ReliefOS with pacman -Syu." msgstr "" @@ -42,7 +42,7 @@ msgstr "" msgid "Another installation is already running" msgstr "" -#: userland/apps/installer/installer_tui.c:575 +#: userland/apps/installer/installer_tui.c:576 msgid "Apply" msgstr "" @@ -70,31 +70,31 @@ msgstr "" msgid "Automatic mode replaces its partition table; manual mode can preserve other partitions." msgstr "" -#: userland/apps/installer/main.cpp:1042 +#: userland/apps/installer/main.cpp:1054 msgid "Automatic partitioning creates a FAT32 ESP and an ext4 root. No BIOS Boot partition is needed." msgstr "" -#: userland/apps/installer/main.cpp:1043 +#: userland/apps/installer/main.cpp:1055 msgid "Automatic partitioning creates an unformatted BIOS Boot partition, a FAT32 ESP and an ext4 root. BIOS also uses the FAT32 partition for boot files." msgstr "" -#: userland/apps/installer/main.cpp:651 +#: userland/apps/installer/main.cpp:663 msgid "Automatic plan: BIOS Boot 1 MiB; ESP 512 MiB FAT32; root %llu MiB ext4.\nThis replaces all existing partitions only after confirmation." msgstr "" -#: userland/apps/installer/main.cpp:650 +#: userland/apps/installer/main.cpp:662 msgid "Automatic plan: ESP 512 MiB FAT32; root %llu MiB ext4.\nThis replaces all existing partitions only after confirmation." msgstr "" -#: userland/apps/installer/installer_tui.c:276 +#: userland/apps/installer/installer_tui.c:277 msgid "B BIOS E ESP R / D Data . Free" msgstr "" -#: userland/apps/installer/main.cpp:893 +#: userland/apps/installer/main.cpp:905 msgid "BIOS Boot" msgstr "" -#: userland/apps/installer/installer_tui.c:496 +#: userland/apps/installer/installer_tui.c:497 msgid "Back" msgstr "" @@ -122,15 +122,15 @@ msgstr "" msgid "Cannot initialize the terminal or installer log" msgstr "" -#: userland/apps/installer/installer_tui.c:611 +#: userland/apps/installer/installer_log.c:36 msgid "Cannot read installer log" msgstr "" -#: userland/apps/installer/main.cpp:680 +#: userland/apps/installer/main.cpp:692 msgid "Cannot read the partition layout" msgstr "" -#: userland/apps/installer/main.cpp:559 +#: userland/apps/installer/main.cpp:571 msgid "Cannot read the selected disk" msgstr "" @@ -138,15 +138,15 @@ msgstr "" msgid "Cannot select the requested locale." msgstr "" -#: userland/apps/installer/main.cpp:371 +#: userland/apps/installer/main.cpp:382 msgid "Cannot start the installation worker" msgstr "" -#: userland/apps/installer/main.cpp:717 +#: userland/apps/installer/main.cpp:729 msgid "Cannot update the partition plan" msgstr "" -#: userland/apps/installer/main.cpp:822 +#: userland/apps/installer/main.cpp:834 msgid "Change added to the installation plan." msgstr "" @@ -162,7 +162,7 @@ msgstr "" msgid "Changes remain pending until you confirm the installation. Going back keeps your choices." msgstr "" -#: userland/apps/installer/main.cpp:1157 +#: userland/apps/installer/main.cpp:1169 msgid "Check the target and planned changes. Use Back or the sidebar to change your choices." msgstr "" @@ -178,7 +178,7 @@ msgstr "" msgid "Choose a language, then configure your installation. You can return to earlier steps before installing." msgstr "" -#: userland/apps/installer/main.cpp:1059 +#: userland/apps/installer/main.cpp:1071 msgid "Choose bootloaders" msgstr "" @@ -186,7 +186,7 @@ msgstr "" msgid "Choose how this disk will start. Selecting BIOS and UEFI supports both firmware types; the partition plan follows this choice." msgstr "" -#: userland/apps/installer/main.cpp:1098 +#: userland/apps/installer/main.cpp:1110 msgid "Choose the desktop and additional disk space for virtual memory." msgstr "" @@ -198,7 +198,7 @@ msgstr "" msgid "Choose the installed desktop and optional swapfile. These choices are included in the final review." msgstr "" -#: userland/apps/installer/main.cpp:504 +#: userland/apps/installer/main.cpp:516 msgid "Choose the language for Setup and the installed system." msgstr "" @@ -218,7 +218,7 @@ msgstr "" msgid "Configuring installed system" msgstr "" -#: userland/apps/installer/main.cpp:199 +#: userland/apps/installer/main.cpp:202 msgid "Confirm" msgstr "" @@ -234,7 +234,7 @@ msgstr "" msgid "Console only" msgstr "" -#: userland/apps/installer/installer_tui.c:561 +#: userland/apps/installer/installer_tui.c:562 msgid "Continue" msgstr "" @@ -330,7 +330,7 @@ msgstr "" msgid "Discard changes" msgstr "" -#: userland/apps/installer/main.cpp:909 +#: userland/apps/installer/main.cpp:921 msgid "Discard edits" msgstr "" @@ -338,7 +338,7 @@ msgstr "" msgid "Discard partition changes" msgstr "" -#: userland/apps/installer/main.cpp:836 +#: userland/apps/installer/main.cpp:848 msgid "Discard pending partition edits and reload the disk?" msgstr "" @@ -346,7 +346,7 @@ msgstr "" msgid "Discard the pending partition changes and read the current disk layout again?" msgstr "" -#: userland/apps/installer/main.cpp:194 +#: userland/apps/installer/main.cpp:197 msgid "Disk" msgstr "" @@ -354,19 +354,19 @@ msgstr "" msgid "Disk " msgstr "" -#: userland/apps/installer/main.cpp:1175 +#: userland/apps/installer/main.cpp:1187 msgid "Disk changes to apply" msgstr "" -#: userland/apps/installer/main.cpp:867 +#: userland/apps/installer/main.cpp:879 msgid "Disk layout" msgstr "" -#: userland/apps/installer/installer_tui_job.c:198 +#: userland/apps/installer/installer_tui_job.c:103 msgid "Disk operations are running. Please wait for completion." msgstr "" -#: userland/apps/installer/main.cpp:1201 +#: userland/apps/installer/main.cpp:1213 msgid "Do not turn off this machine." msgstr "" @@ -394,7 +394,7 @@ msgstr "" msgid "Erase all partitions on %s.\nCreate ESP: 512 MiB, format FAT32.\nCreate system root: %llu MiB, format ext4." msgstr "" -#: userland/apps/installer/main.cpp:868 +#: userland/apps/installer/main.cpp:880 msgid "Erase disk and install automatically" msgstr "" @@ -410,7 +410,7 @@ msgstr "" msgid "Exit" msgstr "" -#: userland/apps/installer/main.cpp:398 +#: userland/apps/installer/main.cpp:410 msgid "Exit installer" msgstr "" @@ -418,7 +418,7 @@ msgstr "" msgid "Exit the installer?" msgstr "" -#: userland/apps/installer/main.cpp:399 +#: userland/apps/installer/main.cpp:411 msgid "Exit the installer? Unapplied disk changes and setup choices will be discarded." msgstr "" @@ -442,10 +442,14 @@ msgstr "" msgid "Filesystem label" msgstr "" -#: userland/apps/installer/main.cpp:201 +#: userland/apps/installer/main.cpp:204 msgid "Finish" msgstr "" +#: userland/apps/installer/installer_log_view.h:106 +msgid "Follow log" +msgstr "" + #: configs/nls/messages/installer.c:24 msgid "Format" msgstr "" @@ -466,7 +470,7 @@ msgstr "" msgid "Go back to edit any option. Nothing is written until you choose Install." msgstr "" -#: userland/apps/installer/main.cpp:535 +#: userland/apps/installer/main.cpp:547 msgid "I accept the license terms" msgstr "" @@ -486,7 +490,7 @@ msgstr "" msgid "Install" msgstr "" -#: userland/apps/installer/main.cpp:495 +#: userland/apps/installer/main.cpp:507 msgid "Install ReliefOS" msgstr "" @@ -510,11 +514,11 @@ msgstr "" msgid "Installation" msgstr "" -#: userland/apps/installer/main.cpp:1223 +#: userland/apps/installer/main.cpp:1235 msgid "Installation Complete" msgstr "" -#: userland/apps/installer/main.cpp:1240 +#: userland/apps/installer/main.cpp:1252 msgid "Installation Failed" msgstr "" @@ -538,10 +542,14 @@ msgstr "" msgid "Installation has not been confirmed" msgstr "" -#: userland/apps/installer/installer_tui.c:278 +#: userland/apps/installer/installer_tui.c:279 msgid "Installation layout - changes remain pending" msgstr "" +#: userland/apps/installer/installer_log_view.h:105 +msgid "Installation log" +msgstr "" + #: configs/nls/messages/installer.c:14 msgid "Installation mode" msgstr "" @@ -554,7 +562,7 @@ msgstr "" msgid "Installation result" msgstr "" -#: userland/apps/installer/main.cpp:341 +#: userland/apps/installer/main.cpp:352 msgid "Installation worker failed" msgstr "" @@ -570,7 +578,7 @@ msgstr "" msgid "Installing packages" msgstr "" -#: userland/apps/installer/main.cpp:1200 +#: userland/apps/installer/main.cpp:1212 msgid "Installing system" msgstr "" @@ -590,11 +598,11 @@ msgstr "" msgid "Invalid swap size" msgstr "" -#: userland/apps/installer/main.cpp:835 +#: userland/apps/installer/main.cpp:847 msgid "Keep changes" msgstr "" -#: userland/apps/installer/main.cpp:398 +#: userland/apps/installer/main.cpp:410 msgid "Keep configuring" msgstr "" @@ -606,7 +614,7 @@ msgstr "" msgid "License" msgstr "" -#: userland/apps/installer/main.cpp:524 +#: userland/apps/installer/main.cpp:536 msgid "License agreement" msgstr "" @@ -614,11 +622,11 @@ msgstr "" msgid "Manage Favorites" msgstr "" -#: userland/apps/installer/main.cpp:659 +#: userland/apps/installer/main.cpp:671 msgid "Manual layout: assign BIOS Boot, ESP and root roles. BIOS Boot stays unformatted." msgstr "" -#: userland/apps/installer/main.cpp:658 +#: userland/apps/installer/main.cpp:670 msgid "Manual layout: assign a FAT32 ESP and an ext4 or ext3 root. BIOS Boot is not required for the selected bootloaders." msgstr "" @@ -626,7 +634,7 @@ msgstr "" msgid "Manual partitioning" msgstr "" -#: userland/apps/installer/main.cpp:869 +#: userland/apps/installer/main.cpp:881 msgid "Manual partitioning / keep other systems" msgstr "" @@ -638,7 +646,7 @@ msgstr "" msgid "Mounting target filesystems" msgstr "" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Name" msgstr "" @@ -650,7 +658,7 @@ msgstr "" msgid "New GPT" msgstr "" -#: userland/apps/installer/main.cpp:734 +#: userland/apps/installer/main.cpp:746 msgid "New partition table added to the plan." msgstr "" @@ -670,7 +678,11 @@ msgstr "" msgid "No disks were found" msgstr "" -#: userland/apps/installer/main.cpp:1241 +#: userland/apps/installer/installer_log.c:31 +msgid "No installer log yet." +msgstr "" + +#: userland/apps/installer/main.cpp:1253 msgid "No writes will continue after this error." msgstr "" @@ -682,7 +694,7 @@ msgstr "" msgid "OK" msgstr "" -#: userland/apps/installer/main.cpp:543 +#: userland/apps/installer/main.cpp:555 msgid "Online installation" msgstr "" @@ -698,7 +710,7 @@ msgstr "" msgid "Package installation failed" msgstr "" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Partition" msgstr "" @@ -706,7 +718,7 @@ msgstr "" msgid "Partition %u %s %llu MiB %s %s%s" msgstr "" -#: userland/apps/installer/main.cpp:741 +#: userland/apps/installer/main.cpp:753 msgid "Partition deletion added to the plan." msgstr "" @@ -722,7 +734,7 @@ msgstr "" msgid "Partition operation failed" msgstr "" -#: userland/apps/installer/main.cpp:719 +#: userland/apps/installer/main.cpp:731 msgid "Partition plan updated" msgstr "" @@ -730,11 +742,11 @@ msgstr "" msgid "Partition role" msgstr "" -#: userland/apps/installer/main.cpp:856 +#: userland/apps/installer/main.cpp:868 msgid "Partition role updated." msgstr "" -#: userland/apps/installer/main.cpp:196 +#: userland/apps/installer/main.cpp:199 msgid "Partitions" msgstr "" @@ -746,15 +758,15 @@ msgstr "" msgid "Password:" msgstr "" -#: userland/apps/installer/installer_tui.c:278 +#: userland/apps/installer/installer_tui.c:279 msgid "Pending layout - written only after INSTALL confirmation." msgstr "" -#: userland/apps/installer/main.cpp:739 +#: userland/apps/installer/main.cpp:751 msgid "Plan deletion" msgstr "" -#: userland/apps/installer/main.cpp:732 +#: userland/apps/installer/main.cpp:744 msgid "Plan new table" msgstr "" @@ -766,7 +778,7 @@ msgstr "" msgid "Power operation failed" msgstr "" -#: userland/apps/installer/installer_tui_job.c:196 +#: userland/apps/installer/installer_tui_job.c:101 msgid "Preparing operation" msgstr "" @@ -782,19 +794,23 @@ msgstr "" msgid "Preview" msgstr "" -#: userland/apps/installer/main.cpp:496 +#: userland/apps/installer/main.cpp:508 msgid "Previous Step" msgstr "" +#: userland/apps/installer/installer_log_view.h:93 +msgid "Reading installer log..." +msgstr "" + #: configs/nls/messages/installer.c:26 msgid "Ready" msgstr "" -#: userland/apps/installer/installer_tty.c:132 +#: userland/apps/installer/installer_log_view.h:107 msgid "Refresh" msgstr "" -#: userland/apps/installer/main.cpp:1224 +#: userland/apps/installer/main.cpp:1236 msgid "ReliefOS was installed to the selected disk." msgstr "" @@ -806,11 +822,11 @@ msgstr "" msgid "Remove the installation media before rebooting." msgstr "" -#: userland/apps/installer/main.cpp:1226 +#: userland/apps/installer/main.cpp:1238 msgid "Remove the installation media, then restart." msgstr "" -#: userland/apps/installer/main.cpp:740 +#: userland/apps/installer/main.cpp:752 msgid "Remove the selected partition when the installation is confirmed?" msgstr "" @@ -826,7 +842,7 @@ msgstr "" msgid "Replace partition table" msgstr "" -#: userland/apps/installer/main.cpp:733 +#: userland/apps/installer/main.cpp:745 msgid "Replace this disk's partition table in the installation plan? All existing partitions will be removed when you install." msgstr "" @@ -838,11 +854,11 @@ msgstr "" msgid "Resize partition" msgstr "" -#: userland/apps/installer/installer_tui.c:381 +#: userland/apps/installer/installer_tui.c:382 msgid "Resize the terminal to at least 60 columns and 20 rows." msgstr "" -#: userland/apps/installer/main.cpp:752 +#: userland/apps/installer/main.cpp:764 msgid "Resizing changes the partition boundary. Existing filesystems cannot be shrunk here." msgstr "" @@ -850,7 +866,7 @@ msgstr "" msgid "Restart" msgstr "" -#: userland/apps/installer/main.cpp:1234 +#: userland/apps/installer/main.cpp:1246 msgid "Restart failed" msgstr "" @@ -886,11 +902,11 @@ msgstr "" msgid "Save" msgstr "" -#: userland/apps/installer/main.cpp:594 +#: userland/apps/installer/main.cpp:606 msgid "Select Installation Disk" msgstr "" -#: userland/apps/installer/main.cpp:503 +#: userland/apps/installer/main.cpp:515 msgid "Select Language" msgstr "" @@ -906,7 +922,7 @@ msgstr "" msgid "Select a target disk and review its layout again." msgstr "" -#: userland/apps/installer/main.cpp:1060 +#: userland/apps/installer/main.cpp:1072 msgid "Select the firmware used to start this disk. You can select both BIOS and UEFI." msgstr "" @@ -914,7 +930,7 @@ msgstr "" msgid "Select the target disk" msgstr "" -#: userland/apps/installer/main.cpp:595 +#: userland/apps/installer/main.cpp:607 msgid "Select the target. The disk layout is configured in the following steps." msgstr "" @@ -922,11 +938,11 @@ msgstr "" msgid "Selected system does not support swap" msgstr "" -#: userland/apps/installer/main.cpp:244 +#: userland/apps/installer/main.cpp:247 msgid "Setup" msgstr "" -#: userland/apps/installer/installer_tui_job.c:200 +#: userland/apps/installer/installer_tui_job.c:105 msgid "Show / hide log (F4)" msgstr "" @@ -942,11 +958,11 @@ msgstr "" msgid "Shut down" msgstr "" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Size" msgstr "" -#: userland/apps/installer/main.cpp:761 +#: userland/apps/installer/main.cpp:773 msgid "Size (MiB)" msgstr "" @@ -954,7 +970,7 @@ msgstr "" msgid "Size in MiB" msgstr "" -#: userland/apps/installer/main.cpp:1169 +#: userland/apps/installer/main.cpp:1181 msgid "Skip" msgstr "" @@ -970,7 +986,7 @@ msgstr "" msgid "Step %d of %d" msgstr "" -#: userland/apps/installer/main.cpp:1174 +#: userland/apps/installer/main.cpp:1186 msgid "Swap" msgstr "" @@ -978,7 +994,7 @@ msgstr "" msgid "Swap requires an AHCI disk" msgstr "" -#: userland/apps/installer/main.cpp:1134 +#: userland/apps/installer/main.cpp:1146 msgid "Swap size (MiB)" msgstr "" @@ -986,7 +1002,7 @@ msgstr "" msgid "Swap size in MiB" msgstr "" -#: userland/apps/installer/main.cpp:1142 +#: userland/apps/installer/main.cpp:1154 msgid "Swap uses space on the system partition and currently requires an AHCI disk. Enter a valid whole number of MiB." msgstr "" @@ -994,11 +1010,11 @@ msgstr "" msgid "Synchronizing target filesystem" msgstr "" -#: userland/apps/installer/main.cpp:197 +#: userland/apps/installer/main.cpp:200 msgid "System" msgstr "" -#: userland/apps/installer/main.cpp:1097 +#: userland/apps/installer/main.cpp:1109 msgid "System options" msgstr "" @@ -1010,7 +1026,7 @@ msgstr "" msgid "System root: %s; format %s.\nESP: %s; %s.\nOther partitions are preserved except for the changes listed above." msgstr "" -#: userland/apps/installer/installer_tui.c:495 +#: userland/apps/installer/installer_tui.c:496 msgid "Tab / arrows: select Space: toggle PgUp/PgDn: scroll" msgstr "" @@ -1046,15 +1062,15 @@ msgstr "" msgid "The system partition will be formatted. Review every pending change below." msgstr "" -#: userland/apps/installer/installer_tui_job.c:202 +#: userland/apps/installer/installer_tui_job.c:107 msgid "The terminal requested exit. Waiting for the disk operation to finish." msgstr "" -#: userland/apps/installer/main.cpp:1188 +#: userland/apps/installer/main.cpp:1200 msgid "These disk changes cannot be undone. Type INSTALL to confirm." msgstr "" -#: userland/apps/installer/main.cpp:753 +#: userland/apps/installer/main.cpp:765 msgid "This change is added to the plan. Nothing is written until installation is confirmed." msgstr "" @@ -1066,19 +1082,19 @@ msgstr "" msgid "Type INSTALL to confirm installation" msgstr "" -#: userland/apps/installer/installer_tui.c:560 +#: userland/apps/installer/installer_tui.c:561 msgid "Type the confirmation word" msgstr "" -#: userland/apps/installer/main.cpp:1229 +#: userland/apps/installer/main.cpp:1241 msgid "UEFI boot file (add it in firmware if no automatic entry appears):" msgstr "" -#: userland/apps/installer/installer_tui.c:309 +#: userland/apps/installer/installer_tui.c:310 msgid "Unallocated" msgstr "" -#: userland/apps/installer/main.cpp:688 +#: userland/apps/installer/main.cpp:700 msgid "Unformatted" msgstr "" @@ -1086,11 +1102,11 @@ msgstr "" msgid "Unnamed" msgstr "" -#: userland/apps/installer/installer_tui.c:494 +#: userland/apps/installer/installer_tui.c:495 msgid "Up/Down: partition PgUp/PgDn: page Home/End: first/last Tab: actions" msgstr "" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Use" msgstr "" @@ -1106,7 +1122,7 @@ msgstr "" msgid "Use as root" msgstr "" -#: userland/apps/installer/main.cpp:974 +#: userland/apps/installer/main.cpp:986 msgid "User" msgstr "" @@ -1118,7 +1134,11 @@ msgstr "" msgid "View log" msgstr "" -#: userland/apps/installer/main.cpp:784 +#: userland/apps/installer/main.cpp:278 +msgid "View log (F4)" +msgstr "" + +#: userland/apps/installer/main.cpp:796 msgid "Volume label" msgstr "" diff --git a/configs/nls/po/installer/ja_JP.po b/configs/nls/po/installer/ja_JP.po index f0f630ae..81da98f1 100644 --- a/configs/nls/po/installer/ja_JP.po +++ b/configs/nls/po/installer/ja_JP.po @@ -1,4 +1,3 @@ - msgid "" msgstr "" "Project-Id-Version: ReliefOS\n" @@ -14,23 +13,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.18.0\n" -#: userland/apps/installer/install_ops.c:979 -#, python-format -msgid "" -"\n" -"%s (error %d)\n" -msgstr "" -"\n" -"%s (エラー %d)\n" - -#: userland/apps/installer/install_ops.c:981 -msgid "" -"\n" -"Installation completed successfully." -msgstr "" -"\n" -"インストールが正常に完了しました。" - #: userland/apps/installer/installer_tty.c:304 msgid "Accept and continue" msgstr "同意して続ける" @@ -43,7 +25,7 @@ msgstr "アカウントとシステム設定" msgid "Account setup failed" msgstr "アカウントの設定に失敗しました" -#: userland/apps/installer/main.cpp:198 +#: userland/apps/installer/main.cpp:201 msgid "Accounts" msgstr "アカウント" @@ -51,15 +33,15 @@ msgstr "アカウント" msgid "Add to Favorites" msgstr "お気に入りに追加" -#: userland/apps/installer/main.cpp:793 +#: userland/apps/installer/main.cpp:805 msgid "Add to plan" msgstr "計画に追加" -#: userland/apps/installer/main.cpp:975 +#: userland/apps/installer/main.cpp:987 msgid "Administrator: root" msgstr "管理者: root" -#: userland/apps/installer/main.cpp:546 +#: userland/apps/installer/main.cpp:558 msgid "After installation, update ReliefOS with pacman -Syu." msgstr "インストール後は pacman -Syu で ReliefOS を更新します。" @@ -71,7 +53,7 @@ msgstr "すべてのファイル (*)" msgid "Another installation is already running" msgstr "別のインストールが実行中です" -#: userland/apps/installer/installer_tui.c:575 +#: userland/apps/installer/installer_tui.c:576 msgid "Apply" msgstr "適用" @@ -99,13 +81,13 @@ msgstr "ミラーリストを自動選択" msgid "Automatic mode replaces its partition table; manual mode can preserve other partitions." msgstr "自動設定は分割表を置換します。他の領域を残す場合は手動設定を選択してください。" -#: userland/apps/installer/main.cpp:1042 +#: userland/apps/installer/main.cpp:1054 msgid "" "Automatic partitioning creates a FAT32 ESP and an ext4 root. No BIOS Boot partition is " "needed." msgstr "自動パーティション設定では FAT32 の ESP と ext4 のルートを作成します。BIOS Boot パーティションは不要です。" -#: userland/apps/installer/main.cpp:1043 +#: userland/apps/installer/main.cpp:1055 msgid "" "Automatic partitioning creates an unformatted BIOS Boot partition, a FAT32 ESP and an ext4 " "root. BIOS also uses the FAT32 partition for boot files." @@ -113,7 +95,7 @@ msgstr "" "自動パーティション設定では未フォーマットの BIOS Boot パーティション、FAT32 の ESP、ext4 のルートを作成します。BIOS も起動ファイルに FAT32 " "パーティションを使用します。" -#: userland/apps/installer/main.cpp:651 +#: userland/apps/installer/main.cpp:663 msgid "" "Automatic plan: BIOS Boot 1 MiB; ESP 512 MiB FAT32; root %llu MiB ext4.\n" "This replaces all existing partitions only after confirmation." @@ -121,7 +103,7 @@ msgstr "" "自動分割の計画:BIOS Boot 1 MiB、ESP 512 MiB(FAT32)、ルート %llu MiB(ext4)。\n" "インストールを確定すると、既存のすべてのパーティションを置き換えます。" -#: userland/apps/installer/main.cpp:650 +#: userland/apps/installer/main.cpp:662 msgid "" "Automatic plan: ESP 512 MiB FAT32; root %llu MiB ext4.\n" "This replaces all existing partitions only after confirmation." @@ -129,15 +111,15 @@ msgstr "" "自動分割の計画:ESP 512 MiB(FAT32)、ルート %llu MiB(ext4)。\n" "インストールを確定すると、既存のすべてのパーティションを置き換えます。" -#: userland/apps/installer/installer_tui.c:276 +#: userland/apps/installer/installer_tui.c:277 msgid "B BIOS E ESP R / D Data . Free" msgstr "B BIOS E ESP R / D データ . 空き" -#: userland/apps/installer/main.cpp:893 +#: userland/apps/installer/main.cpp:905 msgid "BIOS Boot" msgstr "BIOS Boot" -#: userland/apps/installer/installer_tui.c:496 +#: userland/apps/installer/installer_tui.c:497 msgid "Back" msgstr "戻る" @@ -165,15 +147,15 @@ msgstr "パーティション構成を表示できません。" msgid "Cannot initialize the terminal or installer log" msgstr "端末またはインストールログを初期化できません" -#: userland/apps/installer/installer_tui.c:611 +#: userland/apps/installer/installer_log.c:36 msgid "Cannot read installer log" msgstr "インストールログを読み取れません" -#: userland/apps/installer/main.cpp:680 +#: userland/apps/installer/main.cpp:692 msgid "Cannot read the partition layout" msgstr "パーティション構成を読み取れません" -#: userland/apps/installer/main.cpp:559 +#: userland/apps/installer/main.cpp:571 msgid "Cannot read the selected disk" msgstr "選択したディスクを読み取れません" @@ -181,15 +163,15 @@ msgstr "選択したディスクを読み取れません" msgid "Cannot select the requested locale." msgstr "選択したロケールに切り替えられません。" -#: userland/apps/installer/main.cpp:371 +#: userland/apps/installer/main.cpp:382 msgid "Cannot start the installation worker" msgstr "インストール用バックグラウンドプロセスを起動できません" -#: userland/apps/installer/main.cpp:717 +#: userland/apps/installer/main.cpp:729 msgid "Cannot update the partition plan" msgstr "パーティションの計画を変更できません" -#: userland/apps/installer/main.cpp:822 +#: userland/apps/installer/main.cpp:834 msgid "Change added to the installation plan." msgstr "変更をインストール計画に追加しました。" @@ -205,7 +187,7 @@ msgstr "変更はインストールを確定するまで適用されません。 msgid "Changes remain pending until you confirm the installation. Going back keeps your choices." msgstr "変更はインストールを確定するまで適用されません。前の手順に戻っても設定は保持されます。" -#: userland/apps/installer/main.cpp:1157 +#: userland/apps/installer/main.cpp:1169 msgid "Check the target and planned changes. Use Back or the sidebar to change your choices." msgstr "対象と変更内容を確認してください。「前へ」またはサイドバーから設定を変更できます。" @@ -223,7 +205,7 @@ msgid "" "installing." msgstr "言語を選び、インストールを設定してください。インストールを開始するまでは前の手順に戻れます。" -#: userland/apps/installer/main.cpp:1059 +#: userland/apps/installer/main.cpp:1071 msgid "Choose bootloaders" msgstr "ブートローダーを選択" @@ -233,7 +215,7 @@ msgid "" "partition plan follows this choice." msgstr "このディスクの起動方法を選んでください。BIOS と UEFI の両方を選ぶと、どちらのファームウェアでも起動できます。パーティションの計画もこの選択に従います。" -#: userland/apps/installer/main.cpp:1098 +#: userland/apps/installer/main.cpp:1110 msgid "Choose the desktop and additional disk space for virtual memory." msgstr "デスクトップ環境と仮想メモリ用の追加ディスク領域を設定してください。" @@ -249,7 +231,7 @@ msgid "" "review." msgstr "インストールするデスクトップ環境と必要に応じたスワップファイルを選んでください。設定は最終確認に表示されます。" -#: userland/apps/installer/main.cpp:504 +#: userland/apps/installer/main.cpp:516 msgid "Choose the language for Setup and the installed system." msgstr "セットアップとインストール後のシステムで使用する言語を選択してください。" @@ -270,7 +252,7 @@ msgstr "パーティションを設定" msgid "Configuring installed system" msgstr "インストール済みシステムを設定しています" -#: userland/apps/installer/main.cpp:199 +#: userland/apps/installer/main.cpp:202 msgid "Confirm" msgstr "確認" @@ -286,7 +268,7 @@ msgstr "root パスワードの確認" msgid "Console only" msgstr "コンソールのみ" -#: userland/apps/installer/installer_tui.c:561 +#: userland/apps/installer/installer_tui.c:562 msgid "Continue" msgstr "続行" @@ -382,7 +364,7 @@ msgstr "無効" msgid "Discard changes" msgstr "変更を破棄" -#: userland/apps/installer/main.cpp:909 +#: userland/apps/installer/main.cpp:921 msgid "Discard edits" msgstr "編集内容を破棄" @@ -390,7 +372,7 @@ msgstr "編集内容を破棄" msgid "Discard partition changes" msgstr "パーティションの変更を破棄" -#: userland/apps/installer/main.cpp:836 +#: userland/apps/installer/main.cpp:848 msgid "Discard pending partition edits and reload the disk?" msgstr "未適用のパーティション編集を破棄し、ディスクを読み直しますか?" @@ -398,7 +380,7 @@ msgstr "未適用のパーティション編集を破棄し、ディスクを読 msgid "Discard the pending partition changes and read the current disk layout again?" msgstr "未適用のパーティション変更を破棄し、現在のディスク構成を読み直しますか?" -#: userland/apps/installer/main.cpp:194 +#: userland/apps/installer/main.cpp:197 msgid "Disk" msgstr "ディスク" @@ -406,19 +388,19 @@ msgstr "ディスク" msgid "Disk " msgstr "ディスク " -#: userland/apps/installer/main.cpp:1175 +#: userland/apps/installer/main.cpp:1187 msgid "Disk changes to apply" msgstr "適用するディスクの変更" -#: userland/apps/installer/main.cpp:867 +#: userland/apps/installer/main.cpp:879 msgid "Disk layout" msgstr "ディスク構成" -#: userland/apps/installer/installer_tui_job.c:198 +#: userland/apps/installer/installer_tui_job.c:103 msgid "Disk operations are running. Please wait for completion." msgstr "ディスク操作を実行しています。完了までお待ちください。" -#: userland/apps/installer/main.cpp:1201 +#: userland/apps/installer/main.cpp:1213 msgid "Do not turn off this machine." msgstr "このコンピューターの電源を切らないでください。" @@ -463,7 +445,7 @@ msgstr "" "ESP を作成:512 MiB、FAT32 でフォーマット。\n" "システムのルートを作成:%llu MiB、ext4 でフォーマット。" -#: userland/apps/installer/main.cpp:868 +#: userland/apps/installer/main.cpp:880 msgid "Erase disk and install automatically" msgstr "ディスクを消去して自動インストール" @@ -479,7 +461,7 @@ msgstr "下にフォーマットが明記されていなければ、ESP の既 msgid "Exit" msgstr "終了" -#: userland/apps/installer/main.cpp:398 +#: userland/apps/installer/main.cpp:410 msgid "Exit installer" msgstr "インストーラーを終了" @@ -487,7 +469,7 @@ msgstr "インストーラーを終了" msgid "Exit the installer?" msgstr "インストーラーを終了しますか?" -#: userland/apps/installer/main.cpp:399 +#: userland/apps/installer/main.cpp:411 msgid "Exit the installer? Unapplied disk changes and setup choices will be discarded." msgstr "インストーラーを終了しますか?未適用のディスク変更とインストール設定は破棄されます。" @@ -511,10 +493,14 @@ msgstr "ファイルシステム" msgid "Filesystem label" msgstr "ファイルシステムラベル" -#: userland/apps/installer/main.cpp:201 +#: userland/apps/installer/main.cpp:204 msgid "Finish" msgstr "完了" +#: userland/apps/installer/installer_log_view.h:106 +msgid "Follow log" +msgstr "ログを追尾" + #: configs/nls/messages/installer.c:24 msgid "Format" msgstr "フォーマット" @@ -535,7 +521,7 @@ msgstr "ルートファイルシステムをフォーマットしています" msgid "Go back to edit any option. Nothing is written until you choose Install." msgstr "前の手順に戻って設定を変更できます。「インストール」を選ぶまでディスクには書き込みません。" -#: userland/apps/installer/main.cpp:535 +#: userland/apps/installer/main.cpp:547 msgid "I accept the license terms" msgstr "ライセンス条項に同意する" @@ -555,7 +541,7 @@ msgstr "入力が長すぎます" msgid "Install" msgstr "インストール" -#: userland/apps/installer/main.cpp:495 +#: userland/apps/installer/main.cpp:507 msgid "Install ReliefOS" msgstr "ReliefOS をインストール" @@ -579,11 +565,11 @@ msgstr "UEFI ブートローダーをインストールまたは更新" msgid "Installation" msgstr "インストール" -#: userland/apps/installer/main.cpp:1223 +#: userland/apps/installer/main.cpp:1235 msgid "Installation Complete" msgstr "インストール完了" -#: userland/apps/installer/main.cpp:1240 +#: userland/apps/installer/main.cpp:1252 msgid "Installation Failed" msgstr "インストール失敗" @@ -607,10 +593,14 @@ msgstr "インストール完了" msgid "Installation has not been confirmed" msgstr "インストールが確定されていません" -#: userland/apps/installer/installer_tui.c:278 +#: userland/apps/installer/installer_tui.c:279 msgid "Installation layout - changes remain pending" msgstr "インストール構成 — 変更は未適用" +#: userland/apps/installer/installer_log_view.h:105 +msgid "Installation log" +msgstr "インストールログ" + #: configs/nls/messages/installer.c:14 msgid "Installation mode" msgstr "インストールモード" @@ -623,7 +613,7 @@ msgstr "インストールの進行状況" msgid "Installation result" msgstr "インストール結果" -#: userland/apps/installer/main.cpp:341 +#: userland/apps/installer/main.cpp:352 msgid "Installation worker failed" msgstr "インストール用バックグラウンドプロセスでエラーが発生しました" @@ -639,7 +629,7 @@ msgstr "ブートローダーをインストールしています" msgid "Installing packages" msgstr "パッケージをインストールしています" -#: userland/apps/installer/main.cpp:1200 +#: userland/apps/installer/main.cpp:1212 msgid "Installing system" msgstr "システムをインストール中" @@ -659,11 +649,11 @@ msgstr "無効なサイズ" msgid "Invalid swap size" msgstr "スワップサイズが無効です" -#: userland/apps/installer/main.cpp:835 +#: userland/apps/installer/main.cpp:847 msgid "Keep changes" msgstr "変更を保持" -#: userland/apps/installer/main.cpp:398 +#: userland/apps/installer/main.cpp:410 msgid "Keep configuring" msgstr "設定を続ける" @@ -675,7 +665,7 @@ msgstr "言語" msgid "License" msgstr "ライセンス" -#: userland/apps/installer/main.cpp:524 +#: userland/apps/installer/main.cpp:536 msgid "License agreement" msgstr "ライセンス契約" @@ -683,11 +673,11 @@ msgstr "ライセンス契約" msgid "Manage Favorites" msgstr "お気に入りの管理" -#: userland/apps/installer/main.cpp:659 +#: userland/apps/installer/main.cpp:671 msgid "Manual layout: assign BIOS Boot, ESP and root roles. BIOS Boot stays unformatted." msgstr "手動構成: BIOS Boot、ESP、ルートの役割を割り当てます。BIOS Boot はフォーマットされません。" -#: userland/apps/installer/main.cpp:658 +#: userland/apps/installer/main.cpp:670 msgid "" "Manual layout: assign a FAT32 ESP and an ext4 or ext3 root. BIOS Boot is not required for " "the selected bootloaders." @@ -697,7 +687,7 @@ msgstr "手動構成: FAT32 の ESP と ext4 または ext3 のルートを割 msgid "Manual partitioning" msgstr "手動構成" -#: userland/apps/installer/main.cpp:869 +#: userland/apps/installer/main.cpp:881 msgid "Manual partitioning / keep other systems" msgstr "手動で分割 / 他のシステムを保持" @@ -709,7 +699,7 @@ msgstr "マウントに失敗しました" msgid "Mounting target filesystems" msgstr "対象ファイルシステムをマウントしています" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Name" msgstr "名前" @@ -721,7 +711,7 @@ msgstr "新しいフォルダーを作成しますか?" msgid "New GPT" msgstr "新しい GPT" -#: userland/apps/installer/main.cpp:734 +#: userland/apps/installer/main.cpp:746 msgid "New partition table added to the plan." msgstr "新しいパーティションテーブルを計画に追加しました。" @@ -741,7 +731,11 @@ msgstr "ブートローダーが選択されていません。新規インスト msgid "No disks were found" msgstr "ディスクが見つかりませんでした" -#: userland/apps/installer/main.cpp:1241 +#: userland/apps/installer/installer_log.c:31 +msgid "No installer log yet." +msgstr "インストールログはまだありません。" + +#: userland/apps/installer/main.cpp:1253 msgid "No writes will continue after this error." msgstr "このエラーの後、書き込みは続行されません。" @@ -753,7 +747,7 @@ msgstr "未選択" msgid "OK" msgstr "OK" -#: userland/apps/installer/main.cpp:543 +#: userland/apps/installer/main.cpp:555 msgid "Online installation" msgstr "オンラインインストール" @@ -769,7 +763,7 @@ msgstr "パッケージのダウンロードに失敗しました" msgid "Package installation failed" msgstr "パッケージのインストールに失敗しました" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Partition" msgstr "パーティション" @@ -778,7 +772,7 @@ msgstr "パーティション" msgid "Partition %u %s %llu MiB %s %s%s" msgstr "パーティション %u %s %llu MiB %s %s%s" -#: userland/apps/installer/main.cpp:741 +#: userland/apps/installer/main.cpp:753 msgid "Partition deletion added to the plan." msgstr "パーティションの削除を計画に追加しました。" @@ -794,7 +788,7 @@ msgstr "パーティション名" msgid "Partition operation failed" msgstr "パーティション操作に失敗しました" -#: userland/apps/installer/main.cpp:719 +#: userland/apps/installer/main.cpp:731 msgid "Partition plan updated" msgstr "パーティションの計画を更新しました" @@ -802,11 +796,11 @@ msgstr "パーティションの計画を更新しました" msgid "Partition role" msgstr "パーティションの用途" -#: userland/apps/installer/main.cpp:856 +#: userland/apps/installer/main.cpp:868 msgid "Partition role updated." msgstr "パーティションの役割を更新しました。" -#: userland/apps/installer/main.cpp:196 +#: userland/apps/installer/main.cpp:199 msgid "Partitions" msgstr "パーティション" @@ -818,15 +812,15 @@ msgstr "パスワード" msgid "Password:" msgstr "パスワード:" -#: userland/apps/installer/installer_tui.c:278 +#: userland/apps/installer/installer_tui.c:279 msgid "Pending layout - written only after INSTALL confirmation." msgstr "適用予定の構成です。INSTALL の最終確認後に書き込みます。" -#: userland/apps/installer/main.cpp:739 +#: userland/apps/installer/main.cpp:751 msgid "Plan deletion" msgstr "削除を計画" -#: userland/apps/installer/main.cpp:732 +#: userland/apps/installer/main.cpp:744 msgid "Plan new table" msgstr "新しいテーブルを計画" @@ -838,7 +832,7 @@ msgstr "既存のファイルを選択してください。" msgid "Power operation failed" msgstr "電源操作に失敗しました" -#: userland/apps/installer/installer_tui_job.c:196 +#: userland/apps/installer/installer_tui_job.c:101 msgid "Preparing operation" msgstr "操作を準備しています" @@ -854,19 +848,23 @@ msgstr "「再起動」を押すと、インストールしたディスクから msgid "Preview" msgstr "プレビュー" -#: userland/apps/installer/main.cpp:496 +#: userland/apps/installer/main.cpp:508 msgid "Previous Step" msgstr "前の手順" +#: userland/apps/installer/installer_log_view.h:93 +msgid "Reading installer log..." +msgstr "インストールログを読み込み中…" + #: configs/nls/messages/installer.c:26 msgid "Ready" msgstr "準備完了" -#: userland/apps/installer/installer_tty.c:132 +#: userland/apps/installer/installer_log_view.h:107 msgid "Refresh" msgstr "更新" -#: userland/apps/installer/main.cpp:1224 +#: userland/apps/installer/main.cpp:1236 msgid "ReliefOS was installed to the selected disk." msgstr "選択したディスクに ReliefOS をインストールしました。" @@ -878,11 +876,11 @@ msgstr "続行する前にインストールメディアを取り外してくだ msgid "Remove the installation media before rebooting." msgstr "再起動する前にインストールメディアを取り外してください。" -#: userland/apps/installer/main.cpp:1226 +#: userland/apps/installer/main.cpp:1238 msgid "Remove the installation media, then restart." msgstr "インストールメディアを取り外してから再起動してください。" -#: userland/apps/installer/main.cpp:740 +#: userland/apps/installer/main.cpp:752 msgid "Remove the selected partition when the installation is confirmed?" msgstr "インストールを確定したときに、選択したパーティションを削除しますか?" @@ -898,7 +896,7 @@ msgstr "パーティション名を変更" msgid "Replace partition table" msgstr "パーティションテーブルを置換" -#: userland/apps/installer/main.cpp:733 +#: userland/apps/installer/main.cpp:745 msgid "" "Replace this disk's partition table in the installation plan? All existing partitions will " "be removed when you install." @@ -912,11 +910,11 @@ msgstr "サイズ変更" msgid "Resize partition" msgstr "パーティションのサイズを変更" -#: userland/apps/installer/installer_tui.c:381 +#: userland/apps/installer/installer_tui.c:382 msgid "Resize the terminal to at least 60 columns and 20 rows." msgstr "端末のサイズを 60 列、20 行以上にしてください。" -#: userland/apps/installer/main.cpp:752 +#: userland/apps/installer/main.cpp:764 msgid "Resizing changes the partition boundary. Existing filesystems cannot be shrunk here." msgstr "サイズ変更はパーティションの境界を変更します。既存のファイルシステムはここでは縮小できません。" @@ -924,7 +922,7 @@ msgstr "サイズ変更はパーティションの境界を変更します。既 msgid "Restart" msgstr "再起動" -#: userland/apps/installer/main.cpp:1234 +#: userland/apps/installer/main.cpp:1246 msgid "Restart failed" msgstr "再起動に失敗しました" @@ -960,11 +958,11 @@ msgstr "ルートとブートのパーティション" msgid "Save" msgstr "保存" -#: userland/apps/installer/main.cpp:594 +#: userland/apps/installer/main.cpp:606 msgid "Select Installation Disk" msgstr "インストール先のディスクを選択" -#: userland/apps/installer/main.cpp:503 +#: userland/apps/installer/main.cpp:515 msgid "Select Language" msgstr "言語を選択" @@ -980,7 +978,7 @@ msgstr "先にパーティションを選択してください。" msgid "Select a target disk and review its layout again." msgstr "対象のディスクを選び、構成をもう一度確認してください。" -#: userland/apps/installer/main.cpp:1060 +#: userland/apps/installer/main.cpp:1072 msgid "Select the firmware used to start this disk. You can select both BIOS and UEFI." msgstr "このディスクの起動に使用するファームウェアを選択してください。BIOS と UEFI の両方を選択できます。" @@ -988,7 +986,7 @@ msgstr "このディスクの起動に使用するファームウェアを選択 msgid "Select the target disk" msgstr "対象ディスクを選択" -#: userland/apps/installer/main.cpp:595 +#: userland/apps/installer/main.cpp:607 msgid "Select the target. The disk layout is configured in the following steps." msgstr "対象のディスクを選んでください。ディスク構成は次の手順で設定します。" @@ -996,11 +994,11 @@ msgstr "対象のディスクを選んでください。ディスク構成は次 msgid "Selected system does not support swap" msgstr "選択したシステムはスワップに対応していません" -#: userland/apps/installer/main.cpp:244 +#: userland/apps/installer/main.cpp:247 msgid "Setup" msgstr "セットアップ" -#: userland/apps/installer/installer_tui_job.c:200 +#: userland/apps/installer/installer_tui_job.c:105 msgid "Show / hide log (F4)" msgstr "ログを表示/非表示(F4)" @@ -1016,11 +1014,11 @@ msgstr "表示:" msgid "Shut down" msgstr "シャットダウン" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Size" msgstr "容量" -#: userland/apps/installer/main.cpp:761 +#: userland/apps/installer/main.cpp:773 msgid "Size (MiB)" msgstr "サイズ(MiB)" @@ -1028,7 +1026,7 @@ msgstr "サイズ(MiB)" msgid "Size in MiB" msgstr "サイズ(MiB)" -#: userland/apps/installer/main.cpp:1169 +#: userland/apps/installer/main.cpp:1181 msgid "Skip" msgstr "スキップ" @@ -1045,7 +1043,7 @@ msgstr "一般ユーザーのパスワード" msgid "Step %d of %d" msgstr "手順 %d / %d" -#: userland/apps/installer/main.cpp:1174 +#: userland/apps/installer/main.cpp:1186 msgid "Swap" msgstr "スワップ" @@ -1053,7 +1051,7 @@ msgstr "スワップ" msgid "Swap requires an AHCI disk" msgstr "スワップには AHCI ディスクが必要です" -#: userland/apps/installer/main.cpp:1134 +#: userland/apps/installer/main.cpp:1146 msgid "Swap size (MiB)" msgstr "スワップサイズ(MiB)" @@ -1061,7 +1059,7 @@ msgstr "スワップサイズ(MiB)" msgid "Swap size in MiB" msgstr "スワップサイズ(MiB)" -#: userland/apps/installer/main.cpp:1142 +#: userland/apps/installer/main.cpp:1154 msgid "" "Swap uses space on the system partition and currently requires an AHCI disk. Enter a valid " "whole number of MiB." @@ -1071,11 +1069,11 @@ msgstr "スワップはシステムパーティションの領域を使用し、 msgid "Synchronizing target filesystem" msgstr "インストール先のファイルシステムを同期しています" -#: userland/apps/installer/main.cpp:197 +#: userland/apps/installer/main.cpp:200 msgid "System" msgstr "システム" -#: userland/apps/installer/main.cpp:1097 +#: userland/apps/installer/main.cpp:1109 msgid "System options" msgstr "システム設定" @@ -1094,7 +1092,7 @@ msgstr "" "ESP:%s、%s。\n" "上記の変更を除き、他のパーティションは保持されます。" -#: userland/apps/installer/installer_tui.c:495 +#: userland/apps/installer/installer_tui.c:496 msgid "Tab / arrows: select Space: toggle PgUp/PgDn: scroll" msgstr "Tab/矢印キーで選択 Space で切替 PgUp/PgDn でスクロール" @@ -1132,15 +1130,15 @@ msgstr "選択したディスクは利用できなくなりました" msgid "The system partition will be formatted. Review every pending change below." msgstr "システムパーティションをフォーマットします。以下の未適用の変更をすべて確認してください。" -#: userland/apps/installer/installer_tui_job.c:202 +#: userland/apps/installer/installer_tui_job.c:107 msgid "The terminal requested exit. Waiting for the disk operation to finish." msgstr "端末から終了が要求されました。ディスク操作の完了を待っています。" -#: userland/apps/installer/main.cpp:1188 +#: userland/apps/installer/main.cpp:1200 msgid "These disk changes cannot be undone. Type INSTALL to confirm." msgstr "これらのディスク変更は元に戻せません。確定するには INSTALL と入力してください。" -#: userland/apps/installer/main.cpp:753 +#: userland/apps/installer/main.cpp:765 msgid "This change is added to the plan. Nothing is written until installation is confirmed." msgstr "この変更を計画に追加します。インストールを確定するまでディスクには書き込みません。" @@ -1152,19 +1150,19 @@ msgstr "タイムゾーン" msgid "Type INSTALL to confirm installation" msgstr "INSTALL と入力してインストールを確認" -#: userland/apps/installer/installer_tui.c:560 +#: userland/apps/installer/installer_tui.c:561 msgid "Type the confirmation word" msgstr "確認の文字列を入力" -#: userland/apps/installer/main.cpp:1229 +#: userland/apps/installer/main.cpp:1241 msgid "UEFI boot file (add it in firmware if no automatic entry appears):" msgstr "UEFI 起動ファイル (自動エントリが表示されない場合はファームウェアに追加):" -#: userland/apps/installer/installer_tui.c:309 +#: userland/apps/installer/installer_tui.c:310 msgid "Unallocated" msgstr "未割り当て" -#: userland/apps/installer/main.cpp:688 +#: userland/apps/installer/main.cpp:700 msgid "Unformatted" msgstr "フォーマットしない" @@ -1172,11 +1170,11 @@ msgstr "フォーマットしない" msgid "Unnamed" msgstr "名前なし" -#: userland/apps/installer/installer_tui.c:494 +#: userland/apps/installer/installer_tui.c:495 msgid "Up/Down: partition PgUp/PgDn: page Home/End: first/last Tab: actions" msgstr "上下で選択 PgUp/PgDn でページ切替 Home/End で先頭/末尾 Tab で操作" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Use" msgstr "用途" @@ -1194,7 +1192,7 @@ msgstr "ESP として使用" msgid "Use as root" msgstr "ルートとして使用" -#: userland/apps/installer/main.cpp:974 +#: userland/apps/installer/main.cpp:986 msgid "User" msgstr "ユーザー" @@ -1206,7 +1204,11 @@ msgstr "ユーザー名" msgid "View log" msgstr "ログを表示" -#: userland/apps/installer/main.cpp:784 +#: userland/apps/installer/main.cpp:278 +msgid "View log (F4)" +msgstr "ログを表示 (F4)" + +#: userland/apps/installer/main.cpp:796 msgid "Volume label" msgstr "ボリュームラベル" @@ -1226,6 +1228,23 @@ msgstr "XFCE(実験的)" msgid "Yes" msgstr "はい" +#: userland/apps/installer/install_ops.c:979 +#, python-format +msgid "" +"\n" +"%s (error %d)\n" +msgstr "" +"\n" +"%s (エラー %d)\n" + +#: userland/apps/installer/install_ops.c:981 +msgid "" +"\n" +"Installation completed successfully." +msgstr "" +"\n" +"インストールが正常に完了しました。" + #: userland/apps/installer/install_ops.c:384 msgid "format FAT32 and erase existing files" msgstr "FAT32 でフォーマットし、既存ファイルを消去" diff --git a/configs/nls/po/installer/zh_CN.po b/configs/nls/po/installer/zh_CN.po index 1912cf8a..ab240084 100644 --- a/configs/nls/po/installer/zh_CN.po +++ b/configs/nls/po/installer/zh_CN.po @@ -1,4 +1,3 @@ - msgid "" msgstr "" "Project-Id-Version: ReliefOS 1\n" @@ -14,23 +13,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.18.0\n" -#: userland/apps/installer/install_ops.c:979 -#, python-format -msgid "" -"\n" -"%s (error %d)\n" -msgstr "" -"\n" -"%s(错误 %d)\n" - -#: userland/apps/installer/install_ops.c:981 -msgid "" -"\n" -"Installation completed successfully." -msgstr "" -"\n" -"安装已成功完成。" - #: userland/apps/installer/installer_tty.c:304 msgid "Accept and continue" msgstr "接受并继续" @@ -43,7 +25,7 @@ msgstr "账户和系统选项" msgid "Account setup failed" msgstr "账户创建失败" -#: userland/apps/installer/main.cpp:198 +#: userland/apps/installer/main.cpp:201 msgid "Accounts" msgstr "账户" @@ -51,15 +33,15 @@ msgstr "账户" msgid "Add to Favorites" msgstr "添加到收藏夹" -#: userland/apps/installer/main.cpp:793 +#: userland/apps/installer/main.cpp:805 msgid "Add to plan" msgstr "添加到安装计划" -#: userland/apps/installer/main.cpp:975 +#: userland/apps/installer/main.cpp:987 msgid "Administrator: root" msgstr "管理员:root" -#: userland/apps/installer/main.cpp:546 +#: userland/apps/installer/main.cpp:558 msgid "After installation, update ReliefOS with pacman -Syu." msgstr "安装后使用 pacman -Syu 更新 ReliefOS。" @@ -71,7 +53,7 @@ msgstr "所有文件 (*)" msgid "Another installation is already running" msgstr "已有安装正在进行" -#: userland/apps/installer/installer_tui.c:575 +#: userland/apps/installer/installer_tui.c:576 msgid "Apply" msgstr "应用" @@ -99,19 +81,19 @@ msgstr "自动使用镜像列表" msgid "Automatic mode replaces its partition table; manual mode can preserve other partitions." msgstr "自动模式会替换分区表;手动模式可以保留其他分区。" -#: userland/apps/installer/main.cpp:1042 +#: userland/apps/installer/main.cpp:1054 msgid "" "Automatic partitioning creates a FAT32 ESP and an ext4 root. No BIOS Boot partition is " "needed." msgstr "自动分区将创建 FAT32 ESP 和 ext4 根分区,无需 BIOS Boot 分区。" -#: userland/apps/installer/main.cpp:1043 +#: userland/apps/installer/main.cpp:1055 msgid "" "Automatic partitioning creates an unformatted BIOS Boot partition, a FAT32 ESP and an ext4 " "root. BIOS also uses the FAT32 partition for boot files." msgstr "自动分区将创建未格式化的 BIOS Boot 分区、FAT32 ESP 和 ext4 根分区。BIOS 也使用 FAT32 分区存放启动文件。" -#: userland/apps/installer/main.cpp:651 +#: userland/apps/installer/main.cpp:663 msgid "" "Automatic plan: BIOS Boot 1 MiB; ESP 512 MiB FAT32; root %llu MiB ext4.\n" "This replaces all existing partitions only after confirmation." @@ -119,7 +101,7 @@ msgstr "" "自动分区计划:BIOS Boot 1 MiB;ESP 512 MiB,FAT32;根分区 %llu MiB,ext4。\n" "确认安装后才会替换所有现有分区。" -#: userland/apps/installer/main.cpp:650 +#: userland/apps/installer/main.cpp:662 msgid "" "Automatic plan: ESP 512 MiB FAT32; root %llu MiB ext4.\n" "This replaces all existing partitions only after confirmation." @@ -127,15 +109,15 @@ msgstr "" "自动分区计划:ESP 512 MiB,FAT32;根分区 %llu MiB,ext4。\n" "确认安装后才会替换所有现有分区。" -#: userland/apps/installer/installer_tui.c:276 +#: userland/apps/installer/installer_tui.c:277 msgid "B BIOS E ESP R / D Data . Free" msgstr "B BIOS E ESP R / D 数据 . 空闲" -#: userland/apps/installer/main.cpp:893 +#: userland/apps/installer/main.cpp:905 msgid "BIOS Boot" msgstr "BIOS Boot" -#: userland/apps/installer/installer_tui.c:496 +#: userland/apps/installer/installer_tui.c:497 msgid "Back" msgstr "上一步" @@ -163,15 +145,15 @@ msgstr "无法显示此磁盘分区布局。" msgid "Cannot initialize the terminal or installer log" msgstr "无法初始化终端或安装日志" -#: userland/apps/installer/installer_tui.c:611 +#: userland/apps/installer/installer_log.c:36 msgid "Cannot read installer log" msgstr "无法读取安装日志" -#: userland/apps/installer/main.cpp:680 +#: userland/apps/installer/main.cpp:692 msgid "Cannot read the partition layout" msgstr "无法读取分区布局" -#: userland/apps/installer/main.cpp:559 +#: userland/apps/installer/main.cpp:571 msgid "Cannot read the selected disk" msgstr "无法读取选定的磁盘" @@ -179,15 +161,15 @@ msgstr "无法读取选定的磁盘" msgid "Cannot select the requested locale." msgstr "无法切换到所选语言。" -#: userland/apps/installer/main.cpp:371 +#: userland/apps/installer/main.cpp:382 msgid "Cannot start the installation worker" msgstr "无法启动安装后台进程" -#: userland/apps/installer/main.cpp:717 +#: userland/apps/installer/main.cpp:729 msgid "Cannot update the partition plan" msgstr "无法修改分区计划" -#: userland/apps/installer/main.cpp:822 +#: userland/apps/installer/main.cpp:834 msgid "Change added to the installation plan." msgstr "更改已添加到安装计划。" @@ -203,7 +185,7 @@ msgstr "更改将在确认安装后写入磁盘。" msgid "Changes remain pending until you confirm the installation. Going back keeps your choices." msgstr "更改将在确认安装后写入磁盘。返回上一步会保留当前选择。" -#: userland/apps/installer/main.cpp:1157 +#: userland/apps/installer/main.cpp:1169 msgid "Check the target and planned changes. Use Back or the sidebar to change your choices." msgstr "请检查目标磁盘和计划中的更改。可使用“上一步”或侧栏返回修改。" @@ -221,7 +203,7 @@ msgid "" "installing." msgstr "请选择语言,然后配置安装选项。开始安装前可随时返回前面的步骤。" -#: userland/apps/installer/main.cpp:1059 +#: userland/apps/installer/main.cpp:1071 msgid "Choose bootloaders" msgstr "选择引导方式" @@ -231,7 +213,7 @@ msgid "" "partition plan follows this choice." msgstr "请选择此磁盘的引导方式。同时选择 BIOS 和 UEFI 可兼容两种固件;分区计划会相应调整。" -#: userland/apps/installer/main.cpp:1098 +#: userland/apps/installer/main.cpp:1110 msgid "Choose the desktop and additional disk space for virtual memory." msgstr "请选择桌面环境,以及用于虚拟内存的额外磁盘空间。" @@ -247,7 +229,7 @@ msgid "" "review." msgstr "请选择要安装的桌面环境,并按需启用交换文件。这些选项会列入最终安装摘要。" -#: userland/apps/installer/main.cpp:504 +#: userland/apps/installer/main.cpp:516 msgid "Choose the language for Setup and the installed system." msgstr "选择安装程序和安装后系统使用的语言。" @@ -268,7 +250,7 @@ msgstr "配置分区" msgid "Configuring installed system" msgstr "正在配置已安装的系统" -#: userland/apps/installer/main.cpp:199 +#: userland/apps/installer/main.cpp:202 msgid "Confirm" msgstr "确认" @@ -284,7 +266,7 @@ msgstr "确认 root 密码" msgid "Console only" msgstr "仅控制台" -#: userland/apps/installer/installer_tui.c:561 +#: userland/apps/installer/installer_tui.c:562 msgid "Continue" msgstr "继续" @@ -380,7 +362,7 @@ msgstr "已禁用" msgid "Discard changes" msgstr "放弃更改" -#: userland/apps/installer/main.cpp:909 +#: userland/apps/installer/main.cpp:921 msgid "Discard edits" msgstr "放弃编辑" @@ -388,7 +370,7 @@ msgstr "放弃编辑" msgid "Discard partition changes" msgstr "放弃分区更改" -#: userland/apps/installer/main.cpp:836 +#: userland/apps/installer/main.cpp:848 msgid "Discard pending partition edits and reload the disk?" msgstr "放弃尚未应用的分区编辑,并重新读取磁盘?" @@ -396,7 +378,7 @@ msgstr "放弃尚未应用的分区编辑,并重新读取磁盘?" msgid "Discard the pending partition changes and read the current disk layout again?" msgstr "放弃尚未应用的分区更改,并重新读取磁盘当前的分区布局?" -#: userland/apps/installer/main.cpp:194 +#: userland/apps/installer/main.cpp:197 msgid "Disk" msgstr "硬盘" @@ -404,19 +386,19 @@ msgstr "硬盘" msgid "Disk " msgstr "磁盘 " -#: userland/apps/installer/main.cpp:1175 +#: userland/apps/installer/main.cpp:1187 msgid "Disk changes to apply" msgstr "将要应用的磁盘更改" -#: userland/apps/installer/main.cpp:867 +#: userland/apps/installer/main.cpp:879 msgid "Disk layout" msgstr "磁盘布局" -#: userland/apps/installer/installer_tui_job.c:198 +#: userland/apps/installer/installer_tui_job.c:103 msgid "Disk operations are running. Please wait for completion." msgstr "正在执行磁盘操作,请等待完成。" -#: userland/apps/installer/main.cpp:1201 +#: userland/apps/installer/main.cpp:1213 msgid "Do not turn off this machine." msgstr "请勿关闭此计算机。" @@ -461,7 +443,7 @@ msgstr "" "创建 ESP:512 MiB,格式化为 FAT32。\n" "创建系统根分区:%llu MiB,格式化为 ext4。" -#: userland/apps/installer/main.cpp:868 +#: userland/apps/installer/main.cpp:880 msgid "Erase disk and install automatically" msgstr "擦除整盘并自动安装" @@ -477,7 +459,7 @@ msgstr "除非下方列出了格式化操作,否则会保留 ESP 中的现有 msgid "Exit" msgstr "退出" -#: userland/apps/installer/main.cpp:398 +#: userland/apps/installer/main.cpp:410 msgid "Exit installer" msgstr "退出安装器" @@ -485,7 +467,7 @@ msgstr "退出安装器" msgid "Exit the installer?" msgstr "退出安装器?" -#: userland/apps/installer/main.cpp:399 +#: userland/apps/installer/main.cpp:411 msgid "Exit the installer? Unapplied disk changes and setup choices will be discarded." msgstr "退出安装器?尚未应用的磁盘更改和安装设置将被放弃。" @@ -509,10 +491,14 @@ msgstr "文件系统" msgid "Filesystem label" msgstr "文件系统卷标" -#: userland/apps/installer/main.cpp:201 +#: userland/apps/installer/main.cpp:204 msgid "Finish" msgstr "完成" +#: userland/apps/installer/installer_log_view.h:106 +msgid "Follow log" +msgstr "跟随日志" + #: configs/nls/messages/installer.c:24 msgid "Format" msgstr "格式" @@ -533,7 +519,7 @@ msgstr "正在格式化根文件系统" msgid "Go back to edit any option. Nothing is written until you choose Install." msgstr "可返回修改任何选项。点击“安装”前不会写入磁盘。" -#: userland/apps/installer/main.cpp:535 +#: userland/apps/installer/main.cpp:547 msgid "I accept the license terms" msgstr "我接受许可协议条款" @@ -553,7 +539,7 @@ msgstr "输入内容过长" msgid "Install" msgstr "安装" -#: userland/apps/installer/main.cpp:495 +#: userland/apps/installer/main.cpp:507 msgid "Install ReliefOS" msgstr "安装 ReliefOS" @@ -577,11 +563,11 @@ msgstr "安装或更新 UEFI 引导程序" msgid "Installation" msgstr "安装" -#: userland/apps/installer/main.cpp:1223 +#: userland/apps/installer/main.cpp:1235 msgid "Installation Complete" msgstr "安装完成" -#: userland/apps/installer/main.cpp:1240 +#: userland/apps/installer/main.cpp:1252 msgid "Installation Failed" msgstr "安装失败" @@ -605,10 +591,14 @@ msgstr "安装完成" msgid "Installation has not been confirmed" msgstr "尚未确认安装" -#: userland/apps/installer/installer_tui.c:278 +#: userland/apps/installer/installer_tui.c:279 msgid "Installation layout - changes remain pending" msgstr "安装布局 — 更改尚未应用" +#: userland/apps/installer/installer_log_view.h:105 +msgid "Installation log" +msgstr "安装日志" + #: configs/nls/messages/installer.c:14 msgid "Installation mode" msgstr "安装模式" @@ -621,7 +611,7 @@ msgstr "安装进度" msgid "Installation result" msgstr "安装结果" -#: userland/apps/installer/main.cpp:341 +#: userland/apps/installer/main.cpp:352 msgid "Installation worker failed" msgstr "安装后台进程失败" @@ -637,7 +627,7 @@ msgstr "正在安装引导程序" msgid "Installing packages" msgstr "正在安装软件包" -#: userland/apps/installer/main.cpp:1200 +#: userland/apps/installer/main.cpp:1212 msgid "Installing system" msgstr "正在安装系统" @@ -657,11 +647,11 @@ msgstr "大小无效" msgid "Invalid swap size" msgstr "交换文件大小无效" -#: userland/apps/installer/main.cpp:835 +#: userland/apps/installer/main.cpp:847 msgid "Keep changes" msgstr "保留更改" -#: userland/apps/installer/main.cpp:398 +#: userland/apps/installer/main.cpp:410 msgid "Keep configuring" msgstr "继续配置" @@ -673,7 +663,7 @@ msgstr "语言" msgid "License" msgstr "许可证" -#: userland/apps/installer/main.cpp:524 +#: userland/apps/installer/main.cpp:536 msgid "License agreement" msgstr "许可协议" @@ -681,11 +671,11 @@ msgstr "许可协议" msgid "Manage Favorites" msgstr "管理收藏夹" -#: userland/apps/installer/main.cpp:659 +#: userland/apps/installer/main.cpp:671 msgid "Manual layout: assign BIOS Boot, ESP and root roles. BIOS Boot stays unformatted." msgstr "手动布局:指定 BIOS 引导分区、ESP 和根分区。BIOS 引导分区不格式化。" -#: userland/apps/installer/main.cpp:658 +#: userland/apps/installer/main.cpp:670 msgid "" "Manual layout: assign a FAT32 ESP and an ext4 or ext3 root. BIOS Boot is not required for " "the selected bootloaders." @@ -695,7 +685,7 @@ msgstr "手动布局:指定 FAT32 ESP 和 ext4 或 ext3 根分区。当前引 msgid "Manual partitioning" msgstr "手动分区" -#: userland/apps/installer/main.cpp:869 +#: userland/apps/installer/main.cpp:881 msgid "Manual partitioning / keep other systems" msgstr "手动分区 / 保留其他系统" @@ -707,7 +697,7 @@ msgstr "挂载失败" msgid "Mounting target filesystems" msgstr "正在挂载目标文件系统" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Name" msgstr "名称" @@ -719,7 +709,7 @@ msgstr "新建目录?" msgid "New GPT" msgstr "新建 GPT" -#: userland/apps/installer/main.cpp:734 +#: userland/apps/installer/main.cpp:746 msgid "New partition table added to the plan." msgstr "新的分区表已添加到安装计划。" @@ -739,7 +729,11 @@ msgstr "未选择引导程序。新安装的系统需要另行配置引导程序 msgid "No disks were found" msgstr "未找到硬盘" -#: userland/apps/installer/main.cpp:1241 +#: userland/apps/installer/installer_log.c:31 +msgid "No installer log yet." +msgstr "尚无安装日志。" + +#: userland/apps/installer/main.cpp:1253 msgid "No writes will continue after this error." msgstr "出现此错误后不会继续写入。" @@ -751,7 +745,7 @@ msgstr "尚未选择" msgid "OK" msgstr "确定" -#: userland/apps/installer/main.cpp:543 +#: userland/apps/installer/main.cpp:555 msgid "Online installation" msgstr "在线安装" @@ -767,7 +761,7 @@ msgstr "软件包下载失败" msgid "Package installation failed" msgstr "软件包安装失败" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Partition" msgstr "分区" @@ -776,7 +770,7 @@ msgstr "分区" msgid "Partition %u %s %llu MiB %s %s%s" msgstr "分区 %u %s %llu MiB %s %s%s" -#: userland/apps/installer/main.cpp:741 +#: userland/apps/installer/main.cpp:753 msgid "Partition deletion added to the plan." msgstr "分区删除操作已添加到安装计划。" @@ -792,7 +786,7 @@ msgstr "分区名称" msgid "Partition operation failed" msgstr "分区操作失败" -#: userland/apps/installer/main.cpp:719 +#: userland/apps/installer/main.cpp:731 msgid "Partition plan updated" msgstr "分区计划已更新" @@ -800,11 +794,11 @@ msgstr "分区计划已更新" msgid "Partition role" msgstr "分区用途" -#: userland/apps/installer/main.cpp:856 +#: userland/apps/installer/main.cpp:868 msgid "Partition role updated." msgstr "已更新分区用途。" -#: userland/apps/installer/main.cpp:196 +#: userland/apps/installer/main.cpp:199 msgid "Partitions" msgstr "分区" @@ -816,15 +810,15 @@ msgstr "密码" msgid "Password:" msgstr "密码:" -#: userland/apps/installer/installer_tui.c:278 +#: userland/apps/installer/installer_tui.c:279 msgid "Pending layout - written only after INSTALL confirmation." msgstr "待应用方案,最终确认安装后才会写入磁盘。" -#: userland/apps/installer/main.cpp:739 +#: userland/apps/installer/main.cpp:751 msgid "Plan deletion" msgstr "计划删除" -#: userland/apps/installer/main.cpp:732 +#: userland/apps/installer/main.cpp:744 msgid "Plan new table" msgstr "计划新建分区表" @@ -836,7 +830,7 @@ msgstr "请选择已存在的文件!" msgid "Power operation failed" msgstr "电源操作失败" -#: userland/apps/installer/installer_tui_job.c:196 +#: userland/apps/installer/installer_tui_job.c:101 msgid "Preparing operation" msgstr "正在准备操作" @@ -852,19 +846,23 @@ msgstr "点击重启从已安装硬盘启动。" msgid "Preview" msgstr "预览" -#: userland/apps/installer/main.cpp:496 +#: userland/apps/installer/main.cpp:508 msgid "Previous Step" msgstr "上一步" +#: userland/apps/installer/installer_log_view.h:93 +msgid "Reading installer log..." +msgstr "正在读取安装日志……" + #: configs/nls/messages/installer.c:26 msgid "Ready" msgstr "就绪" -#: userland/apps/installer/installer_tty.c:132 +#: userland/apps/installer/installer_log_view.h:107 msgid "Refresh" msgstr "刷新" -#: userland/apps/installer/main.cpp:1224 +#: userland/apps/installer/main.cpp:1236 msgid "ReliefOS was installed to the selected disk." msgstr "ReliefOS 已安装到所选硬盘。" @@ -876,11 +874,11 @@ msgstr "继续前请移除安装介质。" msgid "Remove the installation media before rebooting." msgstr "重启前请移除安装介质。" -#: userland/apps/installer/main.cpp:1226 +#: userland/apps/installer/main.cpp:1238 msgid "Remove the installation media, then restart." msgstr "移除安装介质,然后重启。" -#: userland/apps/installer/main.cpp:740 +#: userland/apps/installer/main.cpp:752 msgid "Remove the selected partition when the installation is confirmed?" msgstr "确认安装时删除选定的分区?" @@ -896,7 +894,7 @@ msgstr "重命名分区" msgid "Replace partition table" msgstr "替换分区表" -#: userland/apps/installer/main.cpp:733 +#: userland/apps/installer/main.cpp:745 msgid "" "Replace this disk's partition table in the installation plan? All existing partitions will " "be removed when you install." @@ -910,11 +908,11 @@ msgstr "调整大小" msgid "Resize partition" msgstr "调整分区大小" -#: userland/apps/installer/installer_tui.c:381 +#: userland/apps/installer/installer_tui.c:382 msgid "Resize the terminal to at least 60 columns and 20 rows." msgstr "请将终端调整到至少 60 列、20 行。" -#: userland/apps/installer/main.cpp:752 +#: userland/apps/installer/main.cpp:764 msgid "Resizing changes the partition boundary. Existing filesystems cannot be shrunk here." msgstr "调整大小会更改分区边界。此处无法缩小现有文件系统。" @@ -922,7 +920,7 @@ msgstr "调整大小会更改分区边界。此处无法缩小现有文件系统 msgid "Restart" msgstr "重启" -#: userland/apps/installer/main.cpp:1234 +#: userland/apps/installer/main.cpp:1246 msgid "Restart failed" msgstr "重启失败" @@ -958,11 +956,11 @@ msgstr "根分区和引导分区" msgid "Save" msgstr "保存" -#: userland/apps/installer/main.cpp:594 +#: userland/apps/installer/main.cpp:606 msgid "Select Installation Disk" msgstr "选择安装硬盘" -#: userland/apps/installer/main.cpp:503 +#: userland/apps/installer/main.cpp:515 msgid "Select Language" msgstr "选择语言" @@ -978,7 +976,7 @@ msgstr "请先选择分区。" msgid "Select a target disk and review its layout again." msgstr "请选择目标磁盘,并重新检查分区布局。" -#: userland/apps/installer/main.cpp:1060 +#: userland/apps/installer/main.cpp:1072 msgid "Select the firmware used to start this disk. You can select both BIOS and UEFI." msgstr "选择用于启动此磁盘的固件类型。可以同时选择 BIOS 和 UEFI。" @@ -986,7 +984,7 @@ msgstr "选择用于启动此磁盘的固件类型。可以同时选择 BIOS 和 msgid "Select the target disk" msgstr "请选择目标硬盘" -#: userland/apps/installer/main.cpp:595 +#: userland/apps/installer/main.cpp:607 msgid "Select the target. The disk layout is configured in the following steps." msgstr "请选择目标磁盘。后续步骤将配置分区布局。" @@ -994,11 +992,11 @@ msgstr "请选择目标磁盘。后续步骤将配置分区布局。" msgid "Selected system does not support swap" msgstr "所选系统不支持交换空间" -#: userland/apps/installer/main.cpp:244 +#: userland/apps/installer/main.cpp:247 msgid "Setup" msgstr "安装" -#: userland/apps/installer/installer_tui_job.c:200 +#: userland/apps/installer/installer_tui_job.c:105 msgid "Show / hide log (F4)" msgstr "显示/隐藏日志(F4)" @@ -1014,11 +1012,11 @@ msgstr "显示:" msgid "Shut down" msgstr "关机" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Size" msgstr "容量" -#: userland/apps/installer/main.cpp:761 +#: userland/apps/installer/main.cpp:773 msgid "Size (MiB)" msgstr "大小(MiB)" @@ -1026,7 +1024,7 @@ msgstr "大小(MiB)" msgid "Size in MiB" msgstr "大小(MiB)" -#: userland/apps/installer/main.cpp:1169 +#: userland/apps/installer/main.cpp:1181 msgid "Skip" msgstr "跳过" @@ -1043,7 +1041,7 @@ msgstr "普通用户密码" msgid "Step %d of %d" msgstr "第 %d 步,共 %d 步" -#: userland/apps/installer/main.cpp:1174 +#: userland/apps/installer/main.cpp:1186 msgid "Swap" msgstr "交换空间" @@ -1051,7 +1049,7 @@ msgstr "交换空间" msgid "Swap requires an AHCI disk" msgstr "交换文件需要 AHCI 磁盘" -#: userland/apps/installer/main.cpp:1134 +#: userland/apps/installer/main.cpp:1146 msgid "Swap size (MiB)" msgstr "交换空间大小(MiB)" @@ -1059,7 +1057,7 @@ msgstr "交换空间大小(MiB)" msgid "Swap size in MiB" msgstr "交换文件大小(MiB)" -#: userland/apps/installer/main.cpp:1142 +#: userland/apps/installer/main.cpp:1154 msgid "" "Swap uses space on the system partition and currently requires an AHCI disk. Enter a valid " "whole number of MiB." @@ -1069,11 +1067,11 @@ msgstr "交换文件占用系统分区的空间,目前需要 AHCI 磁盘。请 msgid "Synchronizing target filesystem" msgstr "正在同步目标文件系统" -#: userland/apps/installer/main.cpp:197 +#: userland/apps/installer/main.cpp:200 msgid "System" msgstr "系统" -#: userland/apps/installer/main.cpp:1097 +#: userland/apps/installer/main.cpp:1109 msgid "System options" msgstr "系统选项" @@ -1092,7 +1090,7 @@ msgstr "" "ESP:%s;%s。\n" "除上方列出的更改外,其他分区保持不变。" -#: userland/apps/installer/installer_tui.c:495 +#: userland/apps/installer/installer_tui.c:496 msgid "Tab / arrows: select Space: toggle PgUp/PgDn: scroll" msgstr "Tab/方向键选择 空格切换 PgUp/PgDn 翻页" @@ -1130,15 +1128,15 @@ msgstr "选定的磁盘已不可用" msgid "The system partition will be formatted. Review every pending change below." msgstr "系统分区将被格式化。请核对下方所有待应用的更改。" -#: userland/apps/installer/installer_tui_job.c:202 +#: userland/apps/installer/installer_tui_job.c:107 msgid "The terminal requested exit. Waiting for the disk operation to finish." msgstr "终端已请求退出,正在等待磁盘操作完成。" -#: userland/apps/installer/main.cpp:1188 +#: userland/apps/installer/main.cpp:1200 msgid "These disk changes cannot be undone. Type INSTALL to confirm." msgstr "这些磁盘更改无法撤销。请输入 INSTALL 确认。" -#: userland/apps/installer/main.cpp:753 +#: userland/apps/installer/main.cpp:765 msgid "This change is added to the plan. Nothing is written until installation is confirmed." msgstr "此更改将添加到安装计划。确认安装前不会写入磁盘。" @@ -1150,19 +1148,19 @@ msgstr "时区" msgid "Type INSTALL to confirm installation" msgstr "输入 INSTALL 确认安装" -#: userland/apps/installer/installer_tui.c:560 +#: userland/apps/installer/installer_tui.c:561 msgid "Type the confirmation word" msgstr "输入确认文字" -#: userland/apps/installer/main.cpp:1229 +#: userland/apps/installer/main.cpp:1241 msgid "UEFI boot file (add it in firmware if no automatic entry appears):" msgstr "UEFI 引导文件(若未自动出现入口,请在固件中添加):" -#: userland/apps/installer/installer_tui.c:309 +#: userland/apps/installer/installer_tui.c:310 msgid "Unallocated" msgstr "未分配空间" -#: userland/apps/installer/main.cpp:688 +#: userland/apps/installer/main.cpp:700 msgid "Unformatted" msgstr "不格式化" @@ -1170,11 +1168,11 @@ msgstr "不格式化" msgid "Unnamed" msgstr "未命名" -#: userland/apps/installer/installer_tui.c:494 +#: userland/apps/installer/installer_tui.c:495 msgid "Up/Down: partition PgUp/PgDn: page Home/End: first/last Tab: actions" msgstr "上下键选择分区 PgUp/PgDn 翻页 Home/End 首尾 Tab 操作栏" -#: userland/apps/installer/installer_tui.c:282 +#: userland/apps/installer/installer_tui.c:283 msgid "Use" msgstr "用途" @@ -1192,7 +1190,7 @@ msgstr "用作 ESP" msgid "Use as root" msgstr "用作根分区" -#: userland/apps/installer/main.cpp:974 +#: userland/apps/installer/main.cpp:986 msgid "User" msgstr "用户" @@ -1204,7 +1202,11 @@ msgstr "用户名" msgid "View log" msgstr "查看日志" -#: userland/apps/installer/main.cpp:784 +#: userland/apps/installer/main.cpp:278 +msgid "View log (F4)" +msgstr "查看日志 (F4)" + +#: userland/apps/installer/main.cpp:796 msgid "Volume label" msgstr "卷标" @@ -1224,6 +1226,23 @@ msgstr "XFCE(实验性)" msgid "Yes" msgstr "是" +#: userland/apps/installer/install_ops.c:979 +#, python-format +msgid "" +"\n" +"%s (error %d)\n" +msgstr "" +"\n" +"%s(错误 %d)\n" + +#: userland/apps/installer/install_ops.c:981 +msgid "" +"\n" +"Installation completed successfully." +msgstr "" +"\n" +"安装已成功完成。" + #: userland/apps/installer/install_ops.c:384 msgid "format FAT32 and erase existing files" msgstr "格式化为 FAT32 并擦除现有文件" diff --git a/system/installer/icewm/preferences b/system/installer/icewm/preferences new file mode 100644 index 00000000..bea90200 --- /dev/null +++ b/system/installer/icewm/preferences @@ -0,0 +1,12 @@ +# A dedicated live session; do not start installed-desktop applications. +ShowTaskBar=1 +TaskBarShowStartMenu=0 +TaskBarShowWindowListMenu=1 +TaskBarShowMailboxStatus=0 +TaskBarShowCPUStatus=0 +TaskBarShowNetStatus=0 +TaskBarShowAPMStatus=0 +TaskBarShowWorkspaces=0 +TaskBarShowTray=0 +WorkspaceNames=" 1 " +DesktopBackgroundColor="#eceef4" diff --git a/system/installer/icewm/theme b/system/installer/icewm/theme new file mode 100644 index 00000000..252ebc97 --- /dev/null +++ b/system/installer/icewm/theme @@ -0,0 +1 @@ +Theme="default/default.theme" diff --git a/system/installer/installer-session b/system/installer/installer-session index 2b3fd372..c1c6531f 100644 --- a/system/installer/installer-session +++ b/system/installer/installer-session @@ -1,6 +1,23 @@ #!/bin/bash set -eu +if [[ ${1-} == --desktop ]]; then + # Keep the live desktop separate from installed-user autostart programs. + export ICEWM_PRIVCFG=/etc/reliefos/installer/icewm + export XDG_CURRENT_DESKTOP=ICEWM XDG_SESSION_TYPE=x11 + export XDG_SESSION_DESKTOP=icewm DESKTOP_SESSION=icewm + /usr/bin/icewm-session & + window_manager=$! + trap ' + kill "$window_manager" 2>/dev/null || : + wait "$window_manager" 2>/dev/null || : + ' EXIT + # The installer owns the session lifetime. A WM exit must not interrupt an + # installation already writing to disk; Xorg stays up until it completes. + /usr/bin/installer --graphical + exit $? +fi + if [[ ${1-} == --mount-media ]]; then media=/run/reliefosmedia mkdir -p -- "$media" @@ -27,7 +44,7 @@ fi case " $( "$root/etc/locale.conf" if [[ $desktop == installer ]]; then - for file in usr/bin/installer usr/bin/Xorg usr/bin/xinit usr/bin/xauth \ + for file in usr/bin/installer usr/bin/icewm-session usr/bin/icewm usr/bin/Xorg usr/bin/xinit usr/bin/xauth \ usr/libexec/reliefos/arch-online-install usr/bin/mkfs.ext4 usr/bin/mkfs.fat; do [[ -x $root/$file ]] || fail "missing installer executable: $file" done diff --git a/tools/test_installer_log.py b/tools/test_installer_log.py new file mode 100644 index 00000000..384d5514 --- /dev/null +++ b/tools/test_installer_log.py @@ -0,0 +1,73 @@ +"""Check the shared nonblocking log reader used by both installer frontends.""" +from pathlib import Path +import os +import shlex +import shutil +import subprocess +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[1] + + +class InstallerLogTests(unittest.TestCase): + def test_reader(self): + with tempfile.TemporaryDirectory(prefix="installer-log-") as directory: + binary = Path(directory) / "reader" + subprocess.run([ + "cc", "-std=c11", "-Wall", "-Wextra", "-Werror", "-g", "-O1", + "-fsanitize=address,undefined", "-fno-omit-frame-pointer", "-fno-pie", "-no-pie", + "-Iuserland/apps/installer", "-Wl,--wrap=pread,--wrap=__pread_chk", + "tools/tests/installer_log_test.c", "userland/apps/installer/installer_log.c", + "-o", str(binary), + ], cwd=ROOT, check=True) + subprocess.run([binary, directory], check=True, timeout=10) + + @unittest.skipUnless(shutil.which("fltk-config") and shutil.which("xvfb-run"), + "FLTK and Xvfb are needed for GUI interaction") + def test_gui_view(self): + with tempfile.TemporaryDirectory(prefix="installer-log-gui-") as directory: + work = Path(directory) + obj, binary = work / "log.o", work / "view" + subprocess.run(["cc", "-std=gnu11", "-Wall", "-Wextra", "-Werror", + "-c", str(ROOT / "userland/apps/installer/installer_log.c"), + "-o", str(obj)], check=True) + flags = shlex.split(subprocess.check_output(["fltk-config", "--cxxflags", "--ldflags"], text=True)) + subprocess.run(["c++", "-std=c++17", "-Wall", "-Wextra", "-Werror", + "-I" + str(ROOT / "userland/apps/installer"), + str(ROOT / "tools/tests/installer_log_view_test.cpp"), str(obj), + *flags, "-o", str(binary)], check=True) + for resolution in ("1024x768x24", "800x600x24"): + subprocess.run(["xvfb-run", "-a", "-s", "-screen 0 " + resolution, + str(binary), str(work / "installer.log")], check=True, timeout=15) + + def test_desktop_lifetime(self): + """Run the real shell entry with process fixtures, including WM failure.""" + for wm_fails in (False, True): + with self.subTest(wm_fails=wm_fails), tempfile.TemporaryDirectory(prefix="installer-session-") as directory: + work = Path(directory) + wm, client = work / "icewm", work / "installer" + wm.write_text("#!/bin/bash\n" + "echo $$ >\"$SESSION_TEST/wm.pid\"\n" + "if [[ $WM_FAILS == 1 ]]; then exit 1; fi\n" + "trap 'exit 0' TERM\nwhile :; do sleep 0.05; done\n") + client.write_text("#!/bin/bash\nset -eu\n" + "[[ $1 == --graphical && $XDG_CURRENT_DESKTOP == ICEWM ]]\n" + "[[ $ICEWM_PRIVCFG == /etc/reliefos/installer/icewm ]]\n" + "sleep 0.15\necho completed >\"$SESSION_TEST/result\"\nexit 7\n") + wm.chmod(0o755); client.chmod(0o755) + script = (ROOT / "system/installer/installer-session").read_text() + script = script.replace("/usr/bin/icewm-session", str(wm)).replace("/usr/bin/installer", str(client)) + entry = work / "session" + entry.write_text(script) + result = subprocess.run(["bash", entry, "--desktop"], + env={**os.environ, "SESSION_TEST": directory, "WM_FAILS": str(int(wm_fails))}, + timeout=5) + self.assertEqual(result.returncode, 7) + self.assertEqual((work / "result").read_text(), "completed\n") + with self.assertRaises(ProcessLookupError): + os.kill(int((work / "wm.pid").read_text()), 0) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/test_installer_swap_host_compile.py b/tools/test_installer_swap_host_compile.py index 80cab702..cc22f6fe 100644 --- a/tools/test_installer_swap_host_compile.py +++ b/tools/test_installer_swap_host_compile.py @@ -5,6 +5,7 @@ import shlex import shutil import subprocess +from runtime_test_dependencies import INSTALLER_HOST_INCLUDES ROOT=Path(__file__).resolve().parents[1] def run(argv): print('+ '+shlex.join(argv),flush=True) @@ -15,22 +16,21 @@ def main(): p.add_argument('--fltk-include',type=Path,required=True);a=p.parse_args();a.output.mkdir(parents=True,exist_ok=False) cc=shutil.which('clang');cxx=shutil.which('clang++');assert cc and cxx base_headers=['-idirafter','userland/runtime/include','-idirafter','include'] - headers=base_headers+['-Ikernel/reliefnt/include','-Ikernel/reliefnt/include/uapi'] + headers=INSTALLER_HOST_INCLUDES compat=(a.output/'host-mount-compat.h').resolve() - compat.write_text('#include \n#undef MNT_FORCE\n#undef MNT_DETACH\n' - '#undef MNT_EXPIRE\n#undef UMOUNT_NOFOLLOW\n') + compat.write_text('#include \n') sources=['install_ops.c','installer_capacity.c','installer_swap.c','installer_swap_bundle.c', 'installer_swap_config.c','installer_swap_prepare.c','installer_swap_storage.c','installer_tty.c', - 'installer_tui.c','installer_tui_job.c','installer_job.c'] + 'installer_tui.c','installer_tui_job.c','installer_job.c','installer_log.c'] for name in sources: selected_headers=base_headers if name=='installer_swap_storage.c' else headers # glibc must see the XSI feature level before the forced include. feature_flags=['-D_XOPEN_SOURCE=700'] if name=='installer_tui.c' else [] - cmd=[cc,'-std=gnu11','-O1','-Wall','-Wextra',*feature_flags,*selected_headers,'-include',str(compat),'-c', + cmd=[cc,'-std=gnu11','-D_GNU_SOURCE','-O1','-Wall','-Wextra',*feature_flags,*selected_headers,'-include',str(compat),'-c', 'userland/apps/installer/'+name,'-o',str((a.output/name.replace('.c','.o')).resolve())] if run(cmd):return 1 # Keep the host libc's linux/limits.h ahead of ReliefNT's UAPI headers. - cxx_headers=base_headers+['-Ikernel/reliefnt/include','-idirafter','kernel/reliefnt/include/uapi'] + cxx_headers=['-Iinclude','-idirafter','userland/runtime/include','-Ikernel/reliefnt/include','-idirafter','kernel/reliefnt/include/uapi'] cmd=[cxx,'-std=gnu++17','-O1','-Wall','-Wextra','-isystem',str(a.fltk_include.resolve()),*cxx_headers, '-c','userland/apps/installer/main.cpp','-o',str((a.output/'main.o').resolve())] if run(cmd):return 1 diff --git a/tools/test_installer_swap_tty.py b/tools/test_installer_swap_tty.py index 230ce6ba..78bc693f 100644 --- a/tools/test_installer_swap_tty.py +++ b/tools/test_installer_swap_tty.py @@ -19,7 +19,7 @@ def compile_fixture(binary): - sources = ["installer_tui.c", "installer_tui_job.c", "installer_job.c", "installer_tui_partitions.c", "installer_tty.c", "model.c", + sources = ["installer_tui.c", "installer_tui_job.c", "installer_job.c", "installer_log.c", "installer_tui_partitions.c", "installer_tty.c", "model.c", "installer_capacity.c", "installer_partitions.c", "apache_license.S"] subprocess.run([ "cc", "-std=gnu11", "-D_GNU_SOURCE", "-O1", "-g", "-Wall", "-Wextra", "-Werror", diff --git a/tools/tests/installer_log_test.c b/tools/tests/installer_log_test.c new file mode 100644 index 00000000..13c379e5 --- /dev/null +++ b/tools/tests/installer_log_test.c @@ -0,0 +1,92 @@ +#define _GNU_SOURCE +#include "installer_log.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int stall; +ssize_t __real_pread(int, void *, size_t, off_t); +ssize_t __wrap_pread(int fd, void *buffer, size_t count, off_t offset) +{ + if (stall) for (;;) pause(); + return __real_pread(fd, buffer, count, offset); +} +/* Fortified builds route a dynamic-sized read through this libc entry. */ +ssize_t __real___pread_chk(int, void *, size_t, off_t, size_t); +ssize_t __wrap___pread_chk(int fd, void *buffer, size_t count, off_t offset, size_t size) +{ + if (stall) for (;;) pause(); + return __real___pread_chk(fd, buffer, count, offset, size); +} + +static void receive(struct installer_log_reader *reader) +{ + for (int i = 0; i < 500; ++i) { + int result = installer_log_reader_step(reader); + assert(result >= 0); + if (result == 1) return; + usleep(1000); + } + assert(!"reader did not finish"); +} + +int main(int argc, char **argv) +{ + assert(argc == 2 && chdir(argv[1]) == 0); + struct installer_log_reader reader; + installer_log_reader_init(&reader); + assert(installer_log_reader_start(&reader, "missing") == 0); + receive(&reader); + assert(strstr(reader.text, "No installer log yet")); + assert(mkfifo("fifo", 0600) == 0); + installer_log_read("fifo", reader.text, sizeof(reader.text)); + assert(strstr(reader.text, "Cannot read installer log")); + FILE *stream = fopen("log", "w"); + assert(stream); + for (int i = 0; i < 1000; ++i) fprintf(stream, "安装ログ line %04d\n", i); + fclose(stream); + assert(symlink("log", "link") == 0); + installer_log_read("link", reader.text, sizeof(reader.text)); + assert(!strstr(reader.text, "line 0999")); + installer_log_reader_init(&reader); + assert(installer_log_reader_start(&reader, "log") == 0); + receive(&reader); + assert(strlen(reader.text) < INSTALLER_LOG_CAPACITY); + assert(strncmp(reader.text, "安装ログ line ", strlen("安装ログ line ")) == 0); + assert(strstr(reader.text, "line 0999\n")); + assert(!strstr(reader.text, "line 0000\n")); + stream = fopen("log", "a"); + assert(stream); fputs("latest line\n", stream); fclose(stream); + reader.refreshed = 0; + assert(installer_log_reader_start(&reader, "log") == 0); + pid_t child = reader.pid; + assert(installer_log_reader_start(&reader, "log") == 0 && reader.pid == child); + receive(&reader); + assert(strstr(reader.text, "latest line\n")); + + stall = 1; + reader.refreshed = 0; + assert(installer_log_reader_start(&reader, "log") == 0); + usleep(20000); + reader.started = 1; /* Deterministically expire the monotonic deadline. */ + int timeout = installer_log_reader_step(&reader); + assert(timeout == -ETIMEDOUT); + for (int i = 0; reader.pid && i < 100; ++i) { + installer_log_reader_step(&reader); usleep(1000); + } + assert(!reader.pid && reader.fd == -1); + stall = 0; + reader.refreshed = 0; + assert(installer_log_reader_start(&reader, "log") == 0); + receive(&reader); + assert(strstr(reader.text, "latest line\n")); + assert(waitpid(-1, NULL, WNOHANG) == -1 && errno == ECHILD); + puts("PASS installer log: bounded UTF-8 tail, refresh, unsafe files and timed-out reader cleanup"); +} diff --git a/tools/tests/installer_log_view_test.cpp b/tools/tests/installer_log_view_test.cpp new file mode 100644 index 00000000..7098dc67 --- /dev/null +++ b/tools/tests/installer_log_view_test.cpp @@ -0,0 +1,71 @@ +#include "installer_log_view.h" +#include +#include +#include +#include +#include + +static void pump(double seconds) +{ + auto end = std::chrono::steady_clock::now() + std::chrono::milliseconds((int)(seconds * 1000)); + while (std::chrono::steady_clock::now() < end) Fl::wait(0.01); +} + +static std::string text(Fl_Text_Display *display) +{ + char *value = display->buffer()->text(); + std::string result(value); + free(value); + return result; +} + +int main(int argc, char **argv) +{ + assert(argc == 2); + FILE *file = fopen(argv[1], "w"); assert(file); + fputs("first transaction\n", file); fclose(file); + Fl::scheme("gtk+"); + Fl_Window installer(768, 540, "Installer remains active"); + Fl_Box active(20, 20, 400, 40, "Configuration and progress stay available"); + installer.end(); installer.show(); + InstallerLogWindow view(argv[1]); + view.show(); + assert(view.w() + 24 <= Fl::w() && view.h() + 64 <= Fl::h()); + auto *display = dynamic_cast(view.child(0)); + auto *follow = dynamic_cast(view.child(1)); + auto *refresh = dynamic_cast(view.child(2)); + auto *close = dynamic_cast(view.child(3)); + assert(display && follow && refresh && close); + assert(!view.modal()); + pump(0.5); + assert(text(display) == "first transaction\n"); + file = fopen(argv[1], "a"); assert(file); + fputs("安装ログ: packages installed\n", file); fclose(file); + pump(1.5); + assert(text(display).find("packages installed") != std::string::npos); + follow->value(0); + pump(0.3); + std::string paused = text(display); + file = fopen(argv[1], "a"); assert(file); + fputs("installation failed: test error\n", file); fclose(file); + pump(1.2); + assert(text(display) == paused); + refresh->do_callback(); + pump(0.3); + assert(text(display).find("test error") != std::string::npos); + view.resize(view.x(), view.y(), 560, 300); + pump(0.1); + for (int i = 0; i < view.children(); ++i) { + auto *child = view.child(i); + assert(child->x() >= 0 && child->y() >= 0); + assert(child->x() + child->w() <= view.w()); + assert(child->y() + child->h() <= view.h()); + } + close->do_callback(); + pump(0.2); + assert(!view.shown() && installer.shown()); + view.show(); pump(0.3); + assert(view.shown() && text(display).find("test error") != std::string::npos); + view.hide(); pump(0.2); installer.hide(); + puts("PASS GUI log: live refresh, pause, manual refresh, resize, close and reopen"); +} diff --git a/userland/apps/installer/Kbuild b/userland/apps/installer/Kbuild index 1401810e..dcf56dd5 100644 --- a/userland/apps/installer/Kbuild +++ b/userland/apps/installer/Kbuild @@ -4,8 +4,8 @@ RELIEFOS_APP_C_OBJECTS := install_ops.o installer_capacity.o installer_partition RELIEFOS_APP_CXX_OBJECTS := main.o RELIEFOS_APP_OBJECTS += installer_tui.o installer_tui_job.o installer_tui_partitions.o installer_job.o RELIEFOS_APP_C_OBJECTS += installer_tui.o installer_tui_job.o installer_tui_partitions.o installer_job.o -RELIEFOS_APP_OBJECTS += installer_plan.o -RELIEFOS_APP_C_OBJECTS += installer_plan.o +RELIEFOS_APP_OBJECTS += installer_plan.o installer_log.o +RELIEFOS_APP_C_OBJECTS += installer_plan.o installer_log.o RELIEFOS_APP_ASM_OBJECTS := apache_license.o ifneq ($(RELIEFOS_CAPTURE_APP_KBUILD),1) include $(srctree)/scripts/reliefos/Makefile.app-kbuild diff --git a/userland/apps/installer/installer_log.c b/userland/apps/installer/installer_log.c new file mode 100644 index 00000000..fd59f757 --- /dev/null +++ b/userland/apps/installer/installer_log.c @@ -0,0 +1,167 @@ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include "installer_log.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static uint64_t now_ms(void) +{ + struct timespec now; + if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) return 0; + return (uint64_t)now.tv_sec * 1000u + (uint64_t)now.tv_nsec / 1000000u; +} + +void installer_log_read(const char *path, char *text, size_t capacity) +{ + if (!capacity) return; + text[0] = 0; + int fd = open(path, O_RDONLY | O_CLOEXEC | O_NOFOLLOW | O_NONBLOCK); + struct stat status; + if (fd < 0) { + snprintf(text, capacity, "%s", errno == ENOENT + ? gettext("No installer log yet.") : strerror(errno)); + return; + } + if (fstat(fd, &status) < 0 || !S_ISREG(status.st_mode)) { + close(fd); + snprintf(text, capacity, "%s", gettext("Cannot read installer log")); + return; + } + off_t start = status.st_size > (off_t)(capacity - 1) ? status.st_size - (off_t)(capacity - 1) : 0; + size_t used = 0; + while (used < capacity - 1) { + ssize_t count = pread(fd, text + used, capacity - 1 - used, start + used); + if (count < 0 && errno == EINTR) continue; + if (count < 0) { + snprintf(text, capacity, "%s: %s", gettext("Cannot read installer log"), strerror(errno)); + close(fd); + return; + } + if (!count) break; + used += (size_t)count; + } + text[used] = 0; + close(fd); + if (start) { + char *line = strchr(text, '\n'); + if (line) memmove(text, line + 1, strlen(line + 1) + 1); + else { + size_t partial = 0; + while (((unsigned char)text[partial] & 0xc0) == 0x80) ++partial; + if (partial) memmove(text, text + partial, strlen(text + partial) + 1); + } + } +} + +void installer_log_reader_init(struct installer_log_reader *reader) +{ + memset(reader, 0, sizeof(*reader)); + reader->fd = -1; +} + +void installer_log_reader_stop(struct installer_log_reader *reader) +{ + if (reader->fd >= 0) close(reader->fd); + reader->fd = -1; + reader->eof = reader->stopped = 1; + if (reader->pid > 0) { + (void)kill(reader->pid, SIGKILL); + pid_t result = waitpid(reader->pid, NULL, WNOHANG); + if (result == reader->pid || (result < 0 && errno == ECHILD)) reader->pid = 0; + } +} + +static void drain_snapshot(struct installer_log_reader *reader) +{ + while (reader->fd >= 0 && !reader->eof && reader->used < sizeof(reader->incoming) - 1) { + ssize_t count = read(reader->fd, reader->incoming + reader->used, + sizeof(reader->incoming) - 1 - reader->used); + if (count > 0) { reader->used += (size_t)count; continue; } + if (count < 0 && errno == EINTR) continue; + if (!count || (errno != EAGAIN && errno != EWOULDBLOCK)) reader->eof = 1; + break; + } + if (reader->used == sizeof(reader->incoming) - 1) reader->eof = 1; +} + +int installer_log_reader_step(struct installer_log_reader *reader) +{ + if (reader->pid <= 0) return 0; + drain_snapshot(reader); + int status = 0; + pid_t result = waitpid(reader->pid, &status, WNOHANG); + if (result == reader->pid || (result < 0 && errno == ECHILD)) { + /* The child may have filled the pipe between the first drain and + * waitpid. After exit there can be no later writes, so drain again + * before publishing a complete snapshot. */ + drain_snapshot(reader); + int update = !reader->stopped && result > 0 && WIFEXITED(status) && !WEXITSTATUS(status); + if (update) { + reader->incoming[reader->used] = 0; + memcpy(reader->text, reader->incoming, reader->used + 1); + } + if (reader->fd >= 0) close(reader->fd); + reader->fd = -1; + reader->pid = 0; + return update ? 1 : 0; + } + uint64_t now = now_ms(); + if (!reader->stopped && (now < reader->started || now - reader->started >= 1000)) { + installer_log_reader_stop(reader); + return -ETIMEDOUT; + } + return 0; +} + +int installer_log_reader_start(struct installer_log_reader *reader, const char *path) +{ + uint64_t now = now_ms(); + if (reader->pid > 0 || (reader->refreshed && now >= reader->refreshed && + now - reader->refreshed < 1000)) return 0; + reader->refreshed = now; + int descriptors[2]; + if (pipe(descriptors) < 0) return -errno; + if (fcntl(descriptors[0], F_SETFL, O_NONBLOCK) < 0 || + fcntl(descriptors[0], F_SETFD, FD_CLOEXEC) < 0 || + fcntl(descriptors[1], F_SETFD, FD_CLOEXEC) < 0) { + int error = errno; + close(descriptors[0]); close(descriptors[1]); return -error; + } + pid_t child = fork(); + if (child < 0) { + int error = errno; + close(descriptors[0]); close(descriptors[1]); return -error; + } + if (!child) { + close(descriptors[0]); + signal(SIGTERM, SIG_DFL); signal(SIGINT, SIG_DFL); signal(SIGHUP, SIG_DFL); + signal(SIGPIPE, SIG_IGN); + char text[INSTALLER_LOG_CAPACITY]; + installer_log_read(path, text, sizeof(text)); + size_t used = 0, length = strlen(text); + while (used < length) { + ssize_t count = write(descriptors[1], text + used, length - used); + if (count > 0) used += (size_t)count; + else if (count < 0 && errno == EINTR) continue; + else break; + } + close(descriptors[1]); + _exit(used == length ? 0 : 1); + } + close(descriptors[1]); + reader->pid = child; + reader->fd = descriptors[0]; + reader->eof = reader->stopped = 0; + reader->used = 0; + reader->started = now; + return 0; +} diff --git a/userland/apps/installer/installer_log.h b/userland/apps/installer/installer_log.h new file mode 100644 index 00000000..27867251 --- /dev/null +++ b/userland/apps/installer/installer_log.h @@ -0,0 +1,36 @@ +#ifndef RELIEFOS_INSTALLER_LOG_H +#define RELIEFOS_INSTALLER_LOG_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define INSTALLER_LOG_PATH "/var/log/installer.log" +#define INSTALLER_LOG_CAPACITY 8192 + +/* A bounded tail snapshot, read by a disposable child rather than the UI. */ +struct installer_log_reader { + pid_t pid; + int fd, eof, stopped; + size_t used; + uint64_t started, refreshed; + char incoming[INSTALLER_LOG_CAPACITY], text[INSTALLER_LOG_CAPACITY]; +}; + +void installer_log_read(const char *path, char *text, size_t capacity); +void installer_log_reader_init(struct installer_log_reader *reader); +/* Start at most one read per second. Returns zero or negative errno. */ +int installer_log_reader_start(struct installer_log_reader *reader, const char *path); +/* Nonblocking pump: 1 means new text, 0 means no update, negative errno on failure. */ +int installer_log_reader_step(struct installer_log_reader *reader); +/* Cancel without waiting on a stuck filesystem; pump again to reap if necessary. */ +void installer_log_reader_stop(struct installer_log_reader *reader); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/userland/apps/installer/installer_log_view.h b/userland/apps/installer/installer_log_view.h new file mode 100644 index 00000000..252cc549 --- /dev/null +++ b/userland/apps/installer/installer_log_view.h @@ -0,0 +1,143 @@ +#ifndef RELIEFOS_INSTALLER_LOG_VIEW_H +#define RELIEFOS_INSTALLER_LOG_VIEW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "installer_log.h" + +/* Modeless log view: the installer keeps pumping its worker while this window + * is open. Only the child reader touches the log filesystem. */ +class InstallerLogWindow : public Fl_Double_Window { + installer_log_reader reader_{}; + Fl_Text_Buffer buffer_; + Fl_Text_Display *display_; + Fl_Check_Button *follow_; + Fl_Button *refresh_, *close_; + const char *path_; + + static void tick(void *opaque) + { + auto *view = static_cast(opaque); + int result = installer_log_reader_step(&view->reader_); + if (view->shown()) { + if (result > 0) { + char *previous = view->buffer_.text(); + bool changed = strcmp(previous, view->reader_.text) != 0; + free(previous); + if (changed) { + view->buffer_.text(view->reader_.text); + if (view->follow_->value()) { + view->display_->insert_position(view->buffer_.length()); + view->display_->show_insert_position(); + } + } + } else if (result < 0) view->show_error(result); + if (view->follow_->value()) { + result = installer_log_reader_start(&view->reader_, view->path_); + if (result < 0) view->show_error(result); + } + } + if (view->shown() || view->reader_.pid > 0) Fl::repeat_timeout(0.1, tick, view); + } + + void show_error(int error) + { + char text[256]; + snprintf(text, sizeof(text), "%s: %s", gettext("Cannot read installer log"), strerror(-error)); + buffer_.text(text); + } + + static void refresh(Fl_Widget *, void *opaque) + { + auto *view = static_cast(opaque); + view->reader_.refreshed = 0; + int result = installer_log_reader_start(&view->reader_, view->path_); + if (result < 0) view->show_error(result); + } + + static void close_view(Fl_Widget *, void *opaque) + { + static_cast(opaque)->hide(); + } + +public: + explicit InstallerLogWindow(const char *path = INSTALLER_LOG_PATH) + : Fl_Double_Window(800, 460), path_(path) + { + installer_log_reader_init(&reader_); + display_ = new Fl_Text_Display(16, 30, 768, 366, path_); + display_->align(FL_ALIGN_TOP_LEFT); + display_->buffer(&buffer_); + display_->textfont(FL_COURIER); + display_->textsize(14); + follow_ = new Fl_Check_Button(16, 410, 290, 34); + follow_->value(1); + follow_->callback(refresh, this); + refresh_ = new Fl_Button(544, 410, 112, 34); + refresh_->callback(refresh, this); + close_ = new Fl_Button(672, 410, 112, 34); + close_->callback(close_view, this); + callback(close_view, this); + resizable(display_); + size_range(560, 300); + set_non_modal(); + end(); + buffer_.text(gettext("Reading installer log...")); + int width = Fl::w() - 32, height = Fl::h() - 80; + if (width < 560) width = 560; + if (height < 300) height = 300; + if (width > 800) width = 800; + if (height > 460) height = 460; + resize(x(), y(), width, height); + } + + ~InstallerLogWindow() override + { + Fl::remove_timeout(tick, this); + installer_log_reader_stop(&reader_); + display_->buffer(nullptr); + } + + void update_language() + { + copy_label(gettext("Installation log")); + follow_->copy_label(gettext("Follow log")); + refresh_->copy_label(gettext("Refresh")); + close_->copy_label(gettext("Close")); + } + + void show() override + { + update_language(); + Fl_Double_Window::show(); + Fl::remove_timeout(tick, this); + refresh(nullptr, this); + Fl::add_timeout(0.0, tick, this); + } + + void hide() override + { + Fl_Double_Window::hide(); + installer_log_reader_stop(&reader_); + Fl::remove_timeout(tick, this); + if (reader_.pid > 0) Fl::add_timeout(0.1, tick, this); + } + + int handle(int event) override + { + if (event == FL_SHORTCUT && (Fl::event_key() == FL_Escape || Fl::event_key() == FL_F + 4)) { + hide(); + return 1; + } + return Fl_Double_Window::handle(event); + } +}; +#endif diff --git a/userland/apps/installer/installer_tui.c b/userland/apps/installer/installer_tui.c index fc1bdff7..be47b2df 100644 --- a/userland/apps/installer/installer_tui.c +++ b/userland/apps/installer/installer_tui.c @@ -1,4 +1,5 @@ #define _XOPEN_SOURCE_EXTENDED 1 +#include "installer_log.h" #include #include #include @@ -602,26 +603,5 @@ void tui_message(const char *title, const char *message) void tui_read_log(const char *path, char *text, size_t capacity) { - if (!capacity) return; - text[0] = 0; - int fd = open(path, O_RDONLY | O_CLOEXEC | O_NOFOLLOW); - struct stat status; - if (fd < 0) { snprintf(text, capacity, "%s", strerror(errno)); return; } - if (fstat(fd, &status) < 0 || !S_ISREG(status.st_mode)) { - close(fd); snprintf(text, capacity, "%s", T("Cannot read installer log")); return; - } - off_t start = status.st_size > (off_t)(capacity - 1) ? status.st_size - (off_t)(capacity - 1) : 0; - size_t used = 0; - while (used < capacity - 1) { - ssize_t count = pread(fd, text + used, capacity - 1 - used, start + used); - if (count < 0 && errno == EINTR) continue; - if (count <= 0) break; - used += count; - } - text[used] = 0; - close(fd); - if (start) { - char *line = strchr(text, '\n'); - if (line) memmove(text, line + 1, strlen(line + 1) + 1); - } + installer_log_read(path, text, capacity); } diff --git a/userland/apps/installer/installer_tui_job.c b/userland/apps/installer/installer_tui_job.c index 592d4072..5e5a5920 100644 --- a/userland/apps/installer/installer_tui_job.c +++ b/userland/apps/installer/installer_tui_job.c @@ -11,107 +11,12 @@ #include #include "installer_tui.h" #include "installer_job.h" +#include "installer_log.h" #include "install_ops.h" #define T(s) gettext(s) -/* The ncurses loop never opens or reads the log filesystem. A small disposable - * reader sends one tail snapshot through a nonblocking pipe once per second. */ -static struct { - pid_t pid; - int fd, eof, stopped; - size_t used; - uint64_t started, refreshed; - char incoming[8192], text[8192]; -} log_reader = {.fd = -1}; - -static uint64_t now_ms(void) -{ - struct timespec now; - if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) return 0; - return (uint64_t)now.tv_sec * 1000u + (uint64_t)now.tv_nsec / 1000000u; -} - -static void log_reader_stop(void) -{ - if (log_reader.fd >= 0) close(log_reader.fd); - log_reader.fd = -1; - log_reader.eof = log_reader.stopped = 1; - if (log_reader.pid > 0) { - (void)kill(log_reader.pid, SIGKILL); - /* A stuck kernel read must never block the UI during cleanup. A - * surviving reader is reaped by the next pump (or PID 1 on exit). */ - pid_t result = waitpid(log_reader.pid, NULL, WNOHANG); - if (result == log_reader.pid || (result < 0 && errno == ECHILD)) log_reader.pid = 0; - } -} - -static void log_reader_step(void) -{ - if (log_reader.pid <= 0) return; - while (log_reader.fd >= 0 && !log_reader.eof && log_reader.used < sizeof(log_reader.incoming) - 1) { - ssize_t count = read(log_reader.fd, log_reader.incoming + log_reader.used, - sizeof(log_reader.incoming) - 1 - log_reader.used); - if (count > 0) { log_reader.used += (size_t)count; continue; } - if (count < 0 && errno == EINTR) continue; - if (!count || (errno != EAGAIN && errno != EWOULDBLOCK)) log_reader.eof = 1; - break; - } - if (log_reader.used == sizeof(log_reader.incoming) - 1) log_reader.eof = 1; - int status = 0; - pid_t result = waitpid(log_reader.pid, &status, WNOHANG); - if (result == log_reader.pid || (result < 0 && errno == ECHILD)) { - if (!log_reader.stopped && result > 0 && WIFEXITED(status) && !WEXITSTATUS(status)) { - log_reader.incoming[log_reader.used] = 0; - memcpy(log_reader.text, log_reader.incoming, log_reader.used + 1); - } - if (log_reader.fd >= 0) close(log_reader.fd); - log_reader.fd = -1; - log_reader.pid = 0; - } else { - uint64_t now = now_ms(); - if (now < log_reader.started || now - log_reader.started >= 1000) log_reader_stop(); - } -} - -static void log_reader_start(const char *path) -{ - uint64_t now = now_ms(); - if (log_reader.pid > 0 || (log_reader.refreshed && now >= log_reader.refreshed && - now - log_reader.refreshed < 1000)) return; - log_reader.refreshed = now; - int descriptors[2]; - if (pipe(descriptors) < 0) return; - if (fcntl(descriptors[0], F_SETFL, O_NONBLOCK) < 0 || - fcntl(descriptors[0], F_SETFD, FD_CLOEXEC) < 0 || - fcntl(descriptors[1], F_SETFD, FD_CLOEXEC) < 0) { - close(descriptors[0]); close(descriptors[1]); return; - } - pid_t child = fork(); - if (child < 0) { close(descriptors[0]); close(descriptors[1]); return; } - if (!child) { - close(descriptors[0]); - signal(SIGTERM, SIG_DFL); signal(SIGINT, SIG_DFL); signal(SIGHUP, SIG_DFL); - signal(SIGPIPE, SIG_IGN); - char text[8192]; - tui_read_log(path, text, sizeof(text)); - size_t used = 0, length = strlen(text); - while (used < length) { - ssize_t count = write(descriptors[1], text + used, length - used); - if (count > 0) used += (size_t)count; - else if (count < 0 && errno == EINTR) continue; - else break; - } - close(descriptors[1]); - _exit(used == length ? 0 : 1); - } - close(descriptors[1]); - log_reader.pid = child; - log_reader.fd = descriptors[0]; - log_reader.eof = log_reader.stopped = 0; - log_reader.used = 0; - log_reader.started = now; -} +static struct installer_log_reader log_reader = {.fd = -1}; static int job_error(int error) { @@ -179,11 +84,11 @@ int tui_run_job(const struct installer_tty_context *context, struct tui_job *job } struct tui_view view = {.previous_focus = -1}; int show_log = 0; - log_reader_step(); + installer_log_reader_step(&log_reader); log_reader.text[0] = 0; log_reader.refreshed = 0; while ((result = installer_job_step(&state)) > 0) { - log_reader_step(); + installer_log_reader_step(&log_reader); const struct installer_job_packet *packet = &state.latest; unsigned progress = packet->progress > 100 ? 100 : packet->progress; tui_begin(&view, installer_model_page_title(INSTALLER_PAGE_PROGRESS)); @@ -198,12 +103,12 @@ int tui_run_job(const struct installer_tty_context *context, struct tui_job *job tui_text(&view, T("Disk operations are running. Please wait for completion.")); tui_text(&view, log_path); tui_button(&view, T("Show / hide log (F4)"), TUI_LOG); - if (show_log) { log_reader_start(log_path); tui_document(&view, log_reader.text); } + if (show_log) { installer_log_reader_start(&log_reader, log_path); tui_document(&view, log_reader.text); } if (installer_tui_signal) snprintf(view.status, sizeof(view.status), "%s", T("The terminal requested exit. Waiting for the disk operation to finish.")); int action = tui_step(&view, NULL, 0, 0, 100); if (action == TUI_LOG) show_log = !show_log; } - log_reader_stop(); + installer_log_reader_stop(&log_reader); if (result < 0) { if (job->kind == TUI_JOB_INSTALL) tui_report_install_result(result, 0); return job_error(result); diff --git a/userland/apps/installer/main.cpp b/userland/apps/installer/main.cpp index 86b9d886..ad2369dc 100644 --- a/userland/apps/installer/main.cpp +++ b/userland/apps/installer/main.cpp @@ -44,6 +44,7 @@ extern "C" { #include "installer_tui.h" #include "installer_tui_partitions.h" #include "installer_job.h" +#include "installer_log_view.h" #include "installer_label_wrap.h" #include "model.h" @@ -77,6 +78,8 @@ static Fl_Button *sidebar_rows[INSTALLER_PAGE_COUNT]; static Fl_Button *back_button; static Fl_Return_Button *primary_button; static Fl_Button *cancel_button; +static Fl_Button *log_button; +static InstallerLogWindow *log_window; static Fl_Hold_Browser *disk_browser; static Fl_Hold_Browser *partition_browser; static tui_partition_table partition_table{}; @@ -272,10 +275,19 @@ static void update_footer(void) if (primary_disabled()) primary_button->deactivate(); else primary_button->activate(); cancel_button->copy_label(T("Cancel")); + log_button->copy_label(T("View log (F4)")); + if (log_window) log_window->update_language(); if (installer_model_can_cancel((enum installer_page)page, install_success) && !ui_busy) cancel_button->activate(); else cancel_button->deactivate(); } +static void toggle_log(Fl_Widget *, void *) +{ + if (!log_window) log_window = new InstallerLogWindow; + if (log_window->shown()) log_window->hide(); + else log_window->show(); +} + static void refresh_status_widgets(void) { if (status_box) status_box->copy_label(status_text); @@ -384,6 +396,7 @@ static void start_install_job(void) static void close_now(void) { + if (log_window) log_window->hide(); explicit_bzero(setup.password, sizeof(setup.password)); explicit_bzero(setup.password_confirm, sizeof(setup.password_confirm)); explicit_bzero(setup.root_password, sizeof(setup.root_password)); @@ -1302,6 +1315,10 @@ static void show_page(void) static int app_event_handler(int event) { if (Fl::modal()) return 0; + if (event == FL_SHORTCUT && Fl::event_key() == FL_F + 4) { + toggle_log(nullptr, nullptr); + return 1; + } if (event == FL_SHORTCUT && Fl::event_key() == FL_Escape) { if (installer_model_can_go_back((enum installer_page)page, install_success)) go_back(nullptr, nullptr); else cancel_setup(nullptr, nullptr); @@ -1343,6 +1360,7 @@ class InstallerWindow : public Fl_Window { Fl_Window::resize(x, y, w, h); if (!footer || !sidebar) return; sidebar->resize(0, 0, SIDEBAR_W, h); + log_button->resize(12, h - 56, SIDEBAR_W - 24, 38); content_group->resize(SIDEBAR_W, 0, w - SIDEBAR_W, h - 80); footer->resize(SIDEBAR_W, h - 80, w - SIDEBAR_W, 80); back_button->resize(CONTENT_X, h - 56, 136, 38); @@ -1395,6 +1413,8 @@ static int run_graphical(void) sidebar_rows[i]->callback(sidebar_pressed); reliefos_fltk::style(sidebar_rows[i]); } + log_button = make_button(T("View log (F4)"), 12, height - 56, + SIDEBAR_W - 24, 38, toggle_log, nullptr); sidebar->end(); content_group = new Fl_Group(SIDEBAR_W, 0, width - SIDEBAR_W, height - 80); content_group->box(FL_FLAT_BOX);