11#! /usr/bin/env bash
22
33source common.sh
4+ source ../../shared/erofs-utils.sh
45
5- # Function to check if mkfs.erofs is available
6- check_mkfs_erofs () {
7- if command -v mkfs.erofs & > /dev/null; then
8- echo " mkfs.erofs is already installed."
9- return 0
10- else
11- echo " mkfs.erofs is not installed."
12- return 1
13- fi
14- }
15-
16- # Function to install erofs-utils package
17- install_erofs_utils () {
18- if command -v apt-get & > /dev/null; then
19- echo " Detected Ubuntu/Debian-based system. Installing erofs-utils..."
20- sudo apt update
21- sudo apt install -y erofs-utils
22- elif command -v dnf & > /dev/null; then
23- echo " Detected Fedora-based system. Installing erofs-utils..."
24- sudo dnf install -y erofs-utils
25- elif command -v yum & > /dev/null; then
26- echo " Detected CentOS/RHEL-based system. Installing erofs-utils..."
27- sudo yum install -y erofs-utils
28- elif [[ " $OSTYPE " == " darwin" * ]]; then
29- if command -v brew & > /dev/null; then
30- echo " Detected macOS. Installing erofs-utils..."
31- brew install erofs-utils
32- else
33- echo " Homebrew (brew) not found. Please install Homebrew first."
34- exit 1
35- fi
36- else
37- echo " Unsupported operating system or package manager. Please install erofs-utils manually."
38- exit 1
39- fi
40- }
41-
42- check_mkfs_erofs
43- if [ $? -ne 0 ]; then
6+ # Ensure the mkfs.erofs tool is present
7+ if ! check_mkfs_erofs; then
448 echo " mkfs.erofs is not installed. Installing erofs-utils..."
459 install_erofs_utils
4610fi
@@ -50,11 +14,9 @@ set -euo pipefail
5014cd image/
5115
5216# Build the root file system
17+ source ../../shared/start-buildkit.sh
5318rm -rf ./.rootfs || true
54-
55- # Load configuration
56- app_name=chromium-headless-test
57-
19+ app_name=chromium-headless-build
5820docker build --platform linux/amd64 -t " $IMAGE " .
5921docker rm cnt-" $app_name " || true
6022docker create --platform linux/amd64 --name cnt-" $app_name " " $IMAGE " /bin/sh
0 commit comments