fix: move Chromium download to Docker build phase
- Download Chromium from Google snapshots during Docker build (network works there) - Chroot hook now only verifies and installs runtime dependencies - Remove generated files from repo (OVMF_VARS.fd, qemu.pid, screenshots) - Update isotest scripts to use .nogit/ directory structure - Chromium kiosk verified working with Sway compositor
This commit is contained in:
@@ -51,6 +51,20 @@ COPY ecoos_daemon/ /daemon/
|
||||
# Bundle the daemon
|
||||
RUN cd /daemon && deno compile --allow-all --output /build/daemon-bundle/eco-daemon mod.ts
|
||||
|
||||
# Download Chromium during Docker build (network works here, not in chroot hooks)
|
||||
RUN echo "Downloading Chromium from official snapshots..." && \
|
||||
cd /tmp && \
|
||||
LATEST=$(curl -fsSL "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media" 2>/dev/null || echo "1368529") && \
|
||||
echo "Using Chromium build: $LATEST" && \
|
||||
curl -fsSL "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F${LATEST}%2Fchrome-linux.zip?alt=media" -o chromium.zip || \
|
||||
curl -fsSL "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F1368529%2Fchrome-linux.zip?alt=media" -o chromium.zip && \
|
||||
mkdir -p /build/chromium && \
|
||||
unzip -q chromium.zip -d /tmp && \
|
||||
mv /tmp/chrome-linux/* /build/chromium/ && \
|
||||
rm -rf chromium.zip /tmp/chrome-linux && \
|
||||
chmod +x /build/chromium/chrome && \
|
||||
echo "Chromium downloaded to /build/chromium/"
|
||||
|
||||
# Make scripts executable
|
||||
RUN chmod +x /build/scripts/*.sh
|
||||
|
||||
@@ -102,6 +116,22 @@ mkdir -p config/includes.chroot/etc/systemd/system
|
||||
cp /build/daemon-bundle/eco-daemon config/includes.chroot/opt/eco/bin/
|
||||
chmod +x config/includes.chroot/opt/eco/bin/eco-daemon
|
||||
|
||||
# Copy pre-downloaded Chromium
|
||||
echo "Installing pre-downloaded Chromium into chroot..."
|
||||
mkdir -p config/includes.chroot/opt/chromium
|
||||
cp -r /build/chromium/* config/includes.chroot/opt/chromium/
|
||||
chmod +x config/includes.chroot/opt/chromium/chrome
|
||||
|
||||
# Create symlinks for chromium-browser command
|
||||
mkdir -p config/includes.chroot/usr/bin
|
||||
cat > config/includes.chroot/usr/bin/chromium-browser << 'CHROMEWRAPPER'
|
||||
#!/bin/sh
|
||||
exec /opt/chromium/chrome "$@"
|
||||
CHROMEWRAPPER
|
||||
chmod +x config/includes.chroot/usr/bin/chromium-browser
|
||||
ln -sf /opt/chromium/chrome config/includes.chroot/usr/bin/chromium
|
||||
echo "Chromium installed to /opt/chromium/"
|
||||
|
||||
# Create dummy isohybrid in chroot (UEFI-only, no BIOS boot record)
|
||||
mkdir -p config/includes.chroot/usr/bin
|
||||
cat > config/includes.chroot/usr/bin/isohybrid << 'ISOHYBRID'
|
||||
|
||||
@@ -66,10 +66,7 @@ autoinstall:
|
||||
# Enable eco-daemon service
|
||||
- curtin in-target -- systemctl enable eco-daemon
|
||||
|
||||
# Install Google Chrome
|
||||
- curtin in-target -- wget -q -O /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
||||
- curtin in-target -- apt-get install -y /tmp/chrome.deb
|
||||
- curtin in-target -- rm /tmp/chrome.deb
|
||||
# Chromium is already installed in the ISO via live-build hook
|
||||
|
||||
# Reboot after installation
|
||||
shutdown: reboot
|
||||
|
||||
@@ -1,19 +1,54 @@
|
||||
#!/bin/sh
|
||||
# Install Chromium browser (from Ubuntu repos - more reliable than downloading Chrome)
|
||||
# Install Chromium dependencies
|
||||
# Chromium itself is pre-installed from Docker build (network works there)
|
||||
|
||||
set -e
|
||||
|
||||
echo "Installing Chromium browser..."
|
||||
echo "Installing Chromium dependencies..."
|
||||
|
||||
# Install Chromium from Ubuntu repos
|
||||
apt-get update
|
||||
apt-get install -y chromium-browser
|
||||
# Verify Chromium was pre-installed from Docker build
|
||||
if [ ! -x /opt/chromium/chrome ]; then
|
||||
echo "ERROR: Chromium not found at /opt/chromium/chrome"
|
||||
echo "This should have been installed during Docker build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create symlink so scripts expecting google-chrome-stable work
|
||||
ln -sf /usr/bin/chromium-browser /usr/bin/google-chrome-stable
|
||||
# Install required runtime dependencies for Chromium
|
||||
# Using --no-install-recommends to minimize size
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
libasound2t64 \
|
||||
libatk-bridge2.0-0t64 \
|
||||
libatk1.0-0t64 \
|
||||
libatspi2.0-0t64 \
|
||||
libcairo2 \
|
||||
libcups2t64 \
|
||||
libdrm2 \
|
||||
libgbm1 \
|
||||
libgtk-3-0t64 \
|
||||
libnspr4 \
|
||||
libnss3 \
|
||||
libpango-1.0-0 \
|
||||
libxcomposite1 \
|
||||
libxdamage1 \
|
||||
libxfixes3 \
|
||||
libxkbcommon0 \
|
||||
libxrandr2 \
|
||||
fonts-liberation \
|
||||
xdg-utils || true
|
||||
|
||||
# Clean up
|
||||
apt-get clean
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
# Verify the symlink exists
|
||||
if [ ! -x /usr/bin/chromium-browser ]; then
|
||||
echo "Creating chromium-browser symlink..."
|
||||
cat > /usr/bin/chromium-browser << 'WRAPPER'
|
||||
#!/bin/sh
|
||||
exec /opt/chromium/chrome "$@"
|
||||
WRAPPER
|
||||
chmod +x /usr/bin/chromium-browser
|
||||
fi
|
||||
|
||||
echo "Chromium browser installed."
|
||||
echo "Chromium dependencies installed."
|
||||
echo "Chromium available at:"
|
||||
ls -la /opt/chromium/chrome
|
||||
ls -la /usr/bin/chromium-browser
|
||||
|
||||
echo "Chromium setup complete."
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user