add coral and grunt boards to actions

This commit is contained in:
ading2210 2024-01-30 21:13:03 +00:00
parent 598c13e2c4
commit ad4f759fab
4 changed files with 16 additions and 10 deletions

View File

@ -6,7 +6,7 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
board: [dedede, octopus] board: [dedede, octopus, coral, grunt]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -26,6 +26,7 @@ fi
. ./common.sh . ./common.sh
assert_deps "cpio binwalk pcregrep realpath cgpt mkfs.ext4 mkfs.ext2 fdisk rsync" assert_deps "cpio binwalk pcregrep realpath cgpt mkfs.ext4 mkfs.ext2 fdisk rsync"
parse_args "$@"
output_path=$(realpath -m "${1}") output_path=$(realpath -m "${1}")
shim_path=$(realpath -m "${2}") shim_path=$(realpath -m "${2}")
@ -63,7 +64,7 @@ echo "creating partitions on the disk image"
create_partitions $image_loop "${kernel_dir}/kernel.bin" create_partitions $image_loop "${kernel_dir}/kernel.bin"
echo "copying data into the image" 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" echo "cleaning up loop devices"
losetup -d $image_loop losetup -d $image_loop

View File

@ -16,9 +16,9 @@ fi
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo "Usage: ./build_complete.sh board_name" echo "Usage: ./build_complete.sh board_name"
echo "Valid named arguments (specify with 'key=value'):" 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 " 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 " 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 " quiet - Don't use progress indicators which may clog up log files."
exit 1 exit 1
fi fi
@ -72,7 +72,7 @@ download_and_unzip() {
local zip_path="$2" local zip_path="$2"
local bin_path="$3" local bin_path="$3"
if [ ! -f "$bin_path" ]; then if [ ! -f "$bin_path" ]; then
if [ ! "${args['quiet_download']}" ]; then if [ ! "${args['quiet']}" ]; then
wget -q --show-progress $url -O $zip_path -c wget -q --show-progress $url -O $zip_path -c
else else
wget -q $url -O $zip_path -c wget -q $url -O $zip_path -c
@ -83,7 +83,7 @@ download_and_unzip() {
cleanup_path="$bin_path" cleanup_path="$bin_path"
echo "extracting $zip_path" echo "extracting $zip_path"
local total_bytes="$(unzip -lq $zip_path | tail -1 | xargs | cut -d' ' -f1)" 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 unzip -p $zip_path | pv -s $total_bytes > $bin_path
else else
unzip -p $zip_path > $bin_path unzip -p $zip_path > $bin_path
@ -115,12 +115,12 @@ else
fi fi
echo "patching debian rootfs" 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" echo "building final disk image"
final_image="$base_dir/data/shimboot_$board.bin" final_image="$base_dir/data/shimboot_$board.bin"
rm -rf $final_image 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" echo "build complete! the final disk image is located at $final_image"
if [ "${args['compress_img']}" ]; then if [ "${args['compress_img']}" ]; then

View File

@ -91,6 +91,7 @@ populate_partitions() {
local image_loop=$(realpath -m "${1}") local image_loop=$(realpath -m "${1}")
local bootloader_dir=$(realpath -m "${2}") local bootloader_dir=$(realpath -m "${2}")
local rootfs_dir=$(realpath -m "${3}") local rootfs_dir=$(realpath -m "${3}")
local quiet="$4"
#mount and write empty file to stateful #mount and write empty file to stateful
local stateful_mount=/tmp/shim_stateful local stateful_mount=/tmp/shim_stateful
@ -109,7 +110,11 @@ populate_partitions() {
#write rootfs to image #write rootfs to image
local rootfs_mount=/tmp/new_rootfs local rootfs_mount=/tmp/new_rootfs
safe_mount "${image_loop}p4" $rootfs_mount 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 umount $rootfs_mount
} }