Skip to content

Commit

Permalink
revert dynamic size [upload]
Browse files Browse the repository at this point in the history
  • Loading branch information
andiradulescu committed Sep 11, 2024
1 parent 92d5da5 commit e60ccea
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions build_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OUT_SKIP_CHUNKS_IMAGE="$OUTPUT_DIR/system-skip-chunks.img"

# the partition is 10G, but openpilot's updater didn't always handle the full size
# openpilot fix, shipped in 0.9.8 (8/18/24): https://github.com/commaai/openpilot/pull/33320
# ROOTFS_IMAGE_SIZE=4G # replaced static size with dynamic export tar size + 10%
ROOTFS_IMAGE_SIZE=4000M

# Create temp dir if non-existent
mkdir -p $BUILD_DIR $OUTPUT_DIR
Expand Down Expand Up @@ -59,19 +59,11 @@ fi
export DOCKER_BUILDKIT=1
docker build -f Dockerfile.agnos --check $DIR

# Start agnos-builder docker build, create container and export
# Start agnos-builder docker build and create container
echo "Building agnos-builder docker image"
docker build -f Dockerfile.agnos -t agnos-builder $DIR --build-arg UBUNTU_BASE_IMAGE=$UBUNTU_FILE
echo "Creating agnos-builder container"
CONTAINER_ID=$(docker container create --entrypoint /bin/bash agnos-builder:latest)
echo "Exporting agnos-builder container"
docker container export -o $BUILD_DIR/filesystem.tar $CONTAINER_ID

# Calculate dynamic ROOTFS_IMAGE_SIZE
FILESYSTEM_SIZE=$(stat -c %s $BUILD_DIR/filesystem.tar)
ROOTFS_IMAGE_SIZE=$((FILESYSTEM_SIZE * 115 / 100))

echo "Calculated ROOTFS_IMAGE_SIZE: $ROOTFS_IMAGE_SIZE bytes"

# Check agnos-meta-builder Dockerfile
docker build -f Dockerfile.builder --check $DIR \
Expand Down Expand Up @@ -118,6 +110,7 @@ docker container rm -f $CONTAINER_ID $MOUNT_CONTAINER_ID" EXIT

# Extract image
echo "Extracting docker image"
docker container export -o $BUILD_DIR/filesystem.tar $CONTAINER_ID
exec_as_root tar -xf $BUILD_DIR/filesystem.tar -C $ROOTFS_DIR > /dev/null

# Avoid detecting as container
Expand Down

0 comments on commit e60ccea

Please sign in to comment.