diff --git a/README.md b/README.md index 881e766..9882cc0 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ To perform manual generation, you'll need access to the container directly. You can get a shell inside the container by running the following command: ```sh -podman compose run --build rpi_imagegen bash +podman compose run rpi_imagegen bash ``` If running on a non-ARM host, from within the container, run the following diff --git a/compose.yml b/compose.yml index d9aaa63..5a50ac9 100644 --- a/compose.yml +++ b/compose.yml @@ -9,6 +9,6 @@ services: image: rpi-imagegen:latest working_dir: /home/imagegen/rpi-image-gen volumes: - - ./build:/home/imagegen/build - - ./scripts:/home/imagegen/scripts - - ./uniclogs:/home/imagegen/uniclogs + - ./build:/home/imagegen/build:z + - ./scripts:/home/imagegen/scripts:ro + - ./uniclogs:/home/imagegen/uniclogs:ro diff --git a/container/Containerfile b/container/Containerfile index abdbe67..7647a5d 100644 --- a/container/Containerfile +++ b/container/Containerfile @@ -16,17 +16,15 @@ RUN curl -L -o rpi-image-gen.tar.gz https://github.com/raspberrypi/rpi-image-gen && mv rpi-image-gen-${RPIIG_GIT_SHA} /rpi-image-gen \ && rm rpi-image-gen.tar.gz -RUN </dev/null; + then + print_info "binfmt_misc is already available." + return 0 + fi + print_info "Mounting binfmt_misc ..." print_warning "Enter the imagegen user's password (imagegen)!" - if sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc; + mount_output=$(sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc 2>&1) + mount_status=$? + + if [ $mount_status -eq 0 ]; then print_success "binfmt_misc mounted successfully." else - print_error "Failed to mount binfmt_misc." - exit 1 + if echo "$mount_output" | grep -iq "already mounted" || [ -f /proc/sys/fs/binfmt_misc/status ]; + then + print_info "binfmt_misc is already mounted." + return 0 + else + print_error "Failed to mount binfmt_misc." + echo "$mount_output" + exit 1 + fi fi }