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:
strategy:
matrix:
board: [dedede, octopus]
board: [dedede, octopus, coral, grunt]
runs-on: ubuntu-latest
steps:

View File

@ -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

View File

@ -18,7 +18,7 @@ if [ -z "$1" ]; then
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 " 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,7 +115,7 @@ 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"

View File

@ -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
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
}