refactor: rename Chrome references to Chromium

- Rename hook file: 0060-install-chrome -> 0060-install-chromium
- Update all logs and comments to say "Chromium" instead of "Chrome"
- Rename chromeStatus -> chromiumStatus in daemon
- Update UI to show "Chromium Browser" instead of "Chrome Browser"
- Update documentation (readme.plan.md, readme.hints.md)

Note: Binary paths (/opt/chromium/chrome) remain as the actual
Chromium executable is named "chrome"
This commit is contained in:
2026-01-08 16:17:48 +00:00
parent 6a5cb3b70c
commit 1435496a1c
9 changed files with 56 additions and 56 deletions

View File

@@ -5,7 +5,7 @@
* Runs as root via systemd and orchestrates:
* - Management UI on :3006
* - Sway compositor as ecouser
* - Chrome browser in kiosk mode
* - Chromium browser in kiosk mode
*/
import { EcoDaemon } from './ts/daemon/index.ts';

View File

@@ -29,7 +29,7 @@ export class EcoDaemon {
private uiServer: UIServer;
private logs: string[] = [];
private swayStatus: ServiceStatus = { state: 'stopped' };
private chromeStatus: ServiceStatus = { state: 'stopped' };
private chromiumStatus: ServiceStatus = { state: 'stopped' };
constructor(config?: Partial<DaemonConfig>) {
this.config = {
@@ -64,8 +64,8 @@ export class EcoDaemon {
return {
sway: this.swayStatus.state === 'running',
swayStatus: this.swayStatus,
chrome: this.chromeStatus.state === 'running',
chromeStatus: this.chromeStatus,
chromium: this.chromiumStatus.state === 'running',
chromiumStatus: this.chromiumStatus,
systemInfo: this.systemInfo.getInfo(),
logs: this.logs.slice(-50),
};
@@ -79,7 +79,7 @@ export class EcoDaemon {
await this.uiServer.start();
this.log('Management UI started successfully');
// Start the Sway/Chrome initialization in the background
// Start the Sway/Chromium initialization in the background
// This allows the UI server to remain responsive even if Sway fails
this.startServicesInBackground();
@@ -95,15 +95,15 @@ export class EcoDaemon {
this.log('Checking seatd service...');
await this.ensureSeatd();
// Try to start Sway and Chrome
await this.tryStartSwayAndChrome();
// Try to start Sway and Chromium
await this.tryStartSwayAndChromium();
} catch (error) {
this.log(`Service initialization error: ${error}`);
}
})();
}
private async tryStartSwayAndChrome(): Promise<void> {
private async tryStartSwayAndChromium(): Promise<void> {
// Try DRM mode first, fall back to headless if it fails
const modes = ['drm', 'headless'] as const;
@@ -129,8 +129,8 @@ export class EcoDaemon {
this.swayStatus = { state: 'running' };
this.log(`Sway compositor running with ${mode} backend`);
// Start Chrome in kiosk mode
await this.startChromeAfterSway();
// Start Chromium in kiosk mode
await this.startChromiumAfterSway();
return;
} else {
this.log(`Sway ${mode} backend failed - Wayland socket did not appear`);
@@ -147,21 +147,21 @@ export class EcoDaemon {
this.log('All Sway backend modes failed');
}
private async startChromeAfterSway(): Promise<void> {
this.chromeStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
this.log('Starting Chrome browser...');
private async startChromiumAfterSway(): Promise<void> {
this.chromiumStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
this.log('Starting Chromium browser...');
try {
await this.startChrome();
this.chromeStatus = { state: 'running' };
this.log('Chrome browser started');
await this.startChromium();
this.chromiumStatus = { state: 'running' };
this.log('Chromium browser started');
} catch (error) {
this.chromeStatus = {
this.chromiumStatus = {
state: 'failed',
error: String(error),
lastAttempt: new Date().toISOString()
};
this.log(`Failed to start Chrome: ${error}`);
this.log(`Failed to start Chromium: ${error}`);
}
}
@@ -230,11 +230,11 @@ export class EcoDaemon {
return false;
}
private async startChrome(): Promise<void> {
private async startChromium(): Promise<void> {
const uid = await this.getUserUid();
const runtimeDir = `/run/user/${uid}`;
await this.processManager.startChrome({
await this.processManager.startBrowser({
runtimeDir,
waylandDisplay: this.config.waylandDisplay,
url: 'http://localhost:' + this.config.uiPort,
@@ -278,26 +278,26 @@ export class EcoDaemon {
if (this.swayStatus.state === 'running' && !this.processManager.isSwayRunning()) {
this.log('Sway process died, attempting restart...');
this.swayStatus = { state: 'stopped' };
this.chromeStatus = { state: 'stopped' };
await this.tryStartSwayAndChrome();
this.chromiumStatus = { state: 'stopped' };
await this.tryStartSwayAndChromium();
}
// If Sway is running but Chrome died, restart Chrome
if (this.swayStatus.state === 'running' && this.chromeStatus.state === 'running'
&& !this.processManager.isChromeRunning()) {
this.log('Chrome process died, attempting restart...');
this.chromeStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
// If Sway is running but Chromium died, restart Chromium
if (this.swayStatus.state === 'running' && this.chromiumStatus.state === 'running'
&& !this.processManager.isBrowserRunning()) {
this.log('Chromium process died, attempting restart...');
this.chromiumStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
try {
await this.startChrome();
this.chromeStatus = { state: 'running' };
this.log('Chrome browser restarted');
await this.startChromium();
this.chromiumStatus = { state: 'running' };
this.log('Chromium browser restarted');
} catch (error) {
this.chromeStatus = {
this.chromiumStatus = {
state: 'failed',
error: String(error),
lastAttempt: new Date().toISOString()
};
this.log(`Failed to restart Chrome: ${error}`);
this.log(`Failed to restart Chromium: ${error}`);
}
}
@@ -309,7 +309,7 @@ export class EcoDaemon {
const now = Date.now();
if (now - lastAttempt > 30000) {
this.log('Retrying Sway startup...');
await this.tryStartSwayAndChrome();
await this.tryStartSwayAndChromium();
}
}
} catch (error) {

View File

@@ -1,7 +1,7 @@
/**
* Process Manager
*
* Manages spawning and monitoring of Sway and Chrome processes
* Manages spawning and monitoring of Sway and Chromium processes
*/
export interface SwayConfig {
@@ -202,7 +202,7 @@ for_window [class="chromium-browser"] fullscreen enable
}
/**
* Start Chrome browser in kiosk mode
* Start Chromium browser in kiosk mode
*/
async startBrowser(config: BrowserConfig): Promise<void> {
const env: Record<string, string> = {
@@ -213,7 +213,7 @@ for_window [class="chromium-browser"] fullscreen enable
XDG_DATA_HOME: `/home/${this.user}/.local/share`,
};
// Chrome arguments for kiosk mode on Wayland
// Chromium arguments for kiosk mode on Wayland
const browserArgs = [
'--ozone-platform=wayland',
'--enable-features=UseOzonePlatform',
@@ -269,17 +269,17 @@ for_window [class="chromium-browser"] fullscreen enable
this.browserProcess = command.spawn();
// Log output in background
this.pipeOutput(this.browserProcess, 'chrome');
this.pipeOutput(this.browserProcess, 'chromium');
// Force fullscreen via swaymsg after Chrome window appears (backup)
// Force fullscreen via swaymsg after Chromium window appears (backup)
this.forceFullscreenAfterDelay(config);
}
/**
* Force fullscreen for Chrome window after a delay (backup for kiosk mode)
* Force fullscreen for Chromium window after a delay (backup for kiosk mode)
*/
private async forceFullscreenAfterDelay(config: { runtimeDir: string; waylandDisplay: string }): Promise<void> {
// Wait for Chrome window to appear
// Wait for Chromium window to appear
await new Promise((resolve) => setTimeout(resolve, 3000));
console.log('[chromium] Forcing fullscreen via swaymsg');
@@ -379,7 +379,7 @@ for_window [class="chromium-browser"] fullscreen enable
console.log(`[${name}] Process exited with code ${status.code}`);
if (name === 'sway') {
this.swayProcess = null;
} else if (name === 'chrome') {
} else if (name === 'chromium') {
this.browserProcess = null;
}
});

View File

@@ -201,8 +201,8 @@ export class UIServer {
Sway Compositor
</div>
<div class="stat">
<span class="status-dot" id="chrome-status"></span>
Chrome Browser
<span class="status-dot" id="chromium-status"></span>
Chromium Browser
</div>
</div>
<div class="card">
@@ -252,8 +252,8 @@ export class UIServer {
// Services
document.getElementById('sway-status').className =
'status-dot ' + (data.sway ? 'running' : 'stopped');
document.getElementById('chrome-status').className =
'status-dot ' + (data.chrome ? 'running' : 'stopped');
document.getElementById('chromium-status').className =
'status-dot ' + (data.chromium ? 'running' : 'stopped');
// System info
if (data.systemInfo) {

View File

@@ -1,5 +1,5 @@
#!/bin/sh
# Create ecouser for running Sway and Chrome
# Create ecouser for running Sway and Chromium
set -e

View File

@@ -13,7 +13,7 @@ fonts-noto-color-emoji
fonts-liberation
fonts-dejavu
# Browser dependencies (Chrome installed via hook)
# Browser dependencies (Chromium installed via Dockerfile)
libnss3
libatk1.0-0
libatk-bridge2.0-0

View File

@@ -53,7 +53,7 @@ The installer (`install.sh`) creates this config explicitly during installation.
The project uses **Chromium** for the kiosk browser.
### Key Files
- `isobuild/config/hooks/normal/0060-install-chrome.hook.chroot` - Installs Chromium from Debian repos
- `isobuild/config/hooks/normal/0060-install-chromium.hook.chroot` - Installs Chromium dependencies
- `ecoos_daemon/ts/daemon/process-manager.ts` - Launches Chromium with Wayland support
### Why Chromium from Debian?
@@ -101,7 +101,7 @@ Source: ArchWiki Sway page, GitHub issue swaywm/sway#6210
## CRITICAL: Hook Permissions
**ISSUE**: Chrome not installed in ISO.
**ISSUE**: Chromium not installed in ISO.
**FIX**: All hook files must be `chmod +x`:
```bash

View File

@@ -44,7 +44,7 @@ When "Install EcoOS" is selected:
When "EcoOS Live" is selected:
1. Boots into RAM (squashfs)
2. eco-daemon starts via systemd
3. Sway + Chrome should start
3. Sway + Chromium should start
4. **No persistent storage** - changes lost on reboot
### After Installation (Normal Boot)
@@ -52,7 +52,7 @@ When "EcoOS Live" is selected:
2. eco-daemon.service starts
3. Daemon writes Sway config to `~/.config/sway/config`
4. Daemon starts Sway compositor
5. Daemon starts Chrome in kiosk mode pointing to localhost:3006
5. Daemon starts Chromium in kiosk mode pointing to localhost:3006
6. Management UI serves on port 3006
## Architecture
@@ -63,7 +63,7 @@ eco_os/
│ └── ts/
│ ├── daemon/
│ │ ├── index.ts # Main daemon orchestration
│ │ ├── process-manager.ts # Sway/Chrome process control
│ │ ├── process-manager.ts # Sway/Chromium process control
│ │ └── system-info.ts # CPU/memory stats
│ └── ui/
│ └── server.ts # HTTP server + WebSocket
@@ -73,7 +73,7 @@ eco_os/
│ │ ├── hooks/normal/ # Chroot hooks (MUST BE EXECUTABLE)
│ │ │ ├── 0050-setup-ecouser.hook.chroot
│ │ │ ├── 0055-fix-networkmanager.hook.chroot
│ │ │ ├── 0060-install-chrome.hook.chroot # Installs Chrome
│ │ │ ├── 0060-install-chromium.hook.chroot # Installs Chromium
│ │ │ └── 0100-enable-services.hook.chroot
│ │ ├── includes.chroot/ # Files copied into ISO
│ │ │ ├── etc/
@@ -104,7 +104,7 @@ Features:
- 1920x1080 resolution
- No window borders
- All windows forced fullscreen
- Chrome app_id rules for fullscreen
- Chromium app_id rules for fullscreen
### Chromium Launch
Command: `chromium-browser` (or `chromium`)
@@ -117,7 +117,7 @@ Flags:
### Port 3006 Management UI
- Serves HTML dashboard
- Shows Sway/Chrome status
- Shows Sway/Chromium status
- Shows CPU/memory stats
- Shows daemon logs
- WebSocket for live updates
@@ -146,7 +146,7 @@ All files in `isobuild/config/hooks/normal/*.hook.chroot` MUST be executable:
chmod +x isobuild/config/hooks/normal/*.hook.chroot
```
If hooks aren't executable, Chrome won't be installed!
If hooks aren't executable, Chromium won't be installed!
## Testing in QEMU