diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index efd812d..3772f34 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - board: [dedede, octopus] + board: [dedede, octopus, coral, grunt] runs-on: ubuntu-latest steps: diff --git a/build.sh b/build.sh index dc7b4cf..c4ff34f 100755 --- a/build.sh +++ b/build.sh @@ -26,6 +26,7 @@ fi . ./common.sh assert_deps "cpio binwalk pcregrep realpath cgpt mkfs.ext4 mkfs.ext2 fdisk rsync" +parse_args "$@" output_path=$(realpath -m "${1}") shim_path=$(realpath -m "${2}") @@ -63,7 +64,7 @@ echo "creating partitions on the disk image" create_partitions $image_loop "${kernel_dir}/kernel.bin" echo "copying data into the image" -populate_partitions $image_loop $initramfs_dir $rootfs_dir +populate_partitions $image_loop $initramfs_dir $rootfs_dir "${args['quiet']}" echo "cleaning up loop devices" losetup -d $image_loop diff --git a/build_complete.sh b/build_complete.sh index 56bc65d..59477d0 100755 --- a/build_complete.sh +++ b/build_complete.sh @@ -16,9 +16,9 @@ fi if [ -z "$1" ]; then echo "Usage: ./build_complete.sh board_name" echo "Valid named arguments (specify with 'key=value'):" - echo " compress_img - Compress the final disk image into a zip file. Set this to any value to enable this option." - echo " rootfs_dir - Use a different rootfs for the build. The directory you select will be copied before any patches are applied." - echo " quiet_download - Don't use progress bars on downloads." + echo " compress_img - Compress the final disk image into a zip file. Set this to any value to enable this option." + echo " rootfs_dir - Use a different rootfs for the build. The directory you select will be copied before any patches are applied." + echo " quiet - Don't use progress indicators which may clog up log files." exit 1 fi @@ -72,7 +72,7 @@ download_and_unzip() { local zip_path="$2" local bin_path="$3" if [ ! -f "$bin_path" ]; then - if [ ! "${args['quiet_download']}" ]; then + if [ ! "${args['quiet']}" ]; then wget -q --show-progress $url -O $zip_path -c else wget -q $url -O $zip_path -c @@ -83,7 +83,7 @@ download_and_unzip() { cleanup_path="$bin_path" echo "extracting $zip_path" local total_bytes="$(unzip -lq $zip_path | tail -1 | xargs | cut -d' ' -f1)" - if [ ! "${args['quiet_download']}" ]; then + if [ ! "${args['quiet']}" ]; then unzip -p $zip_path | pv -s $total_bytes > $bin_path else unzip -p $zip_path > $bin_path @@ -115,12 +115,12 @@ else fi echo "patching debian rootfs" -./patch_rootfs.sh $shim_bin $reco_bin $rootfs_dir +./patch_rootfs.sh $shim_bin $reco_bin $rootfs_dir "quiet=${args['quiet']}" echo "building final disk image" final_image="$base_dir/data/shimboot_$board.bin" rm -rf $final_image -./build.sh $final_image $shim_bin $rootfs_dir +./build.sh $final_image $shim_bin $rootfs_dir echo "build complete! the final disk image is located at $final_image" if [ "${args['compress_img']}" ]; then diff --git a/image_utils.sh b/image_utils.sh index 0ef193a..b95d807 100755 --- a/image_utils.sh +++ b/image_utils.sh @@ -91,6 +91,7 @@ populate_partitions() { local image_loop=$(realpath -m "${1}") local bootloader_dir=$(realpath -m "${2}") local rootfs_dir=$(realpath -m "${3}") + local quiet="$4" #mount and write empty file to stateful local stateful_mount=/tmp/shim_stateful @@ -109,7 +110,11 @@ populate_partitions() { #write rootfs to image local rootfs_mount=/tmp/new_rootfs safe_mount "${image_loop}p4" $rootfs_mount - rsync --archive --human-readable --hard-links --info=progress2 --sparse $rootfs_dir/ $rootfs_mount/ + if [ "$quiet" ]; then + rsync --archive --human-readable --hard-links --quiet --sparse $rootfs_dir/ $rootfs_mount/ + else + rsync --archive --human-readable --hard-links --info=progress2 --sparse $rootfs_dir/ $rootfs_mount/ + fi umount $rootfs_mount }