github actions related fixes

This commit is contained in:
ading2210 2024-01-25 21:19:25 +00:00
parent 73a2a38698
commit 922eccba42
6 changed files with 32 additions and 26 deletions

View File

@ -1,6 +1,12 @@
name: build-rootfs name: build-rootfs
run-name: Build the base Debian rootfs run-name: Build the base Debian rootfs
on: [push] on: [push]
defaults:
run:
shell: bash
working-directory: ./
jobs: jobs:
main: main:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -17,7 +23,7 @@ jobs:
run: sudo DEBUG=1 ./build_rootfs.sh data/rootfs bookworm hostname=shimboot root_passwd=root username=user user_passwd=user run: sudo DEBUG=1 ./build_rootfs.sh data/rootfs bookworm hostname=shimboot root_passwd=root username=user user_passwd=user
- name: archive rootfs - name: archive rootfs
run: tar -vcf data/rootfs.tar.gz -C data/rootfs ./ run: sudo tar -vcf data/rootfs.tar.gz -C data/rootfs ./
- name: upload rootfs - name: upload rootfs
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View File

@ -27,9 +27,9 @@ 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"
output_path=$(realpath "${1}") output_path=$(realpath -m "${1}")
shim_path=$(realpath "${2}") shim_path=$(realpath -m "${2}")
rootfs_dir=$(realpath "${3}") rootfs_dir=$(realpath -m "${3}")
echo "created loop device for shim" echo "created loop device for shim"
shim_loop=$(create_loop "${shim_path}") shim_loop=$(create_loop "${shim_path}")

View File

@ -41,7 +41,7 @@ sigint_handler() {
} }
trap sigint_handler SIGINT trap sigint_handler SIGINT
base_dir="$(realpath $(dirname "$0"))" base_dir="$(realpath -m $(dirname "$0"))"
board="$1" board="$1"
shim_url="https://dl.osu.bio/api/raw/?path=/SH1mmer/$board.zip" shim_url="https://dl.osu.bio/api/raw/?path=/SH1mmer/$board.zip"
boards_url="https://chromiumdash.appspot.com/cros/fetch_serving_builds?deviceCategory=ChromeOS" boards_url="https://chromiumdash.appspot.com/cros/fetch_serving_builds?deviceCategory=ChromeOS"
@ -90,7 +90,7 @@ echo "downloading shim image"
download_and_unzip $shim_url $shim_zip $shim_bin download_and_unzip $shim_url $shim_zip $shim_bin
if [ ! "${args['rootfs_dir']}" ]; then if [ ! "${args['rootfs_dir']}" ]; then
rootfs_dir="$(realpath data/rootfs_$board)" rootfs_dir="$(realpath -m data/rootfs_$board)"
rm -rf $rootfs_dir rm -rf $rootfs_dir
mkdir -p $rootfs_dir mkdir -p $rootfs_dir
@ -101,7 +101,7 @@ if [ ! "${args['rootfs_dir']}" ]; then
username=user \ username=user \
user_passwd=user user_passwd=user
else else
rootfs_dir="$(realpath "${args['rootfs_dir']}")" rootfs_dir="$(realpath -m "${args['rootfs_dir']}")"
fi fi
echo "patching debian rootfs" echo "patching debian rootfs"

View File

@ -47,9 +47,9 @@ compile_unionfs() {
cd $original_dir cd $original_dir
} }
rootfs_dir=$(realpath $1) rootfs_dir=$(realpath -m $1)
old_dir=$(realpath $2) old_dir=$(realpath -m $2)
shim_path=$(realpath $3) shim_path=$(realpath -m $3)
shim_rootfs="/tmp/shim_rootfs" shim_rootfs="/tmp/shim_rootfs"
root_squashfs="$rootfs_dir/root.squashfs" root_squashfs="$rootfs_dir/root.squashfs"

View File

@ -17,7 +17,7 @@ make_bootable() {
} }
partition_disk() { partition_disk() {
local image_path=$(realpath "${1}") local image_path=$(realpath -m "${1}")
local bootloader_size=${2} local bootloader_size=${2}
#create partition table with fdisk #create partition table with fdisk
@ -72,8 +72,8 @@ safe_mount() {
} }
create_partitions() { create_partitions() {
local image_loop=$(realpath "${1}") local image_loop=$(realpath -m "${1}")
local kernel_path=$(realpath "${2}") local kernel_path=$(realpath -m "${2}")
#create stateful #create stateful
mkfs.ext4 "${image_loop}p1" mkfs.ext4 "${image_loop}p1"
@ -87,9 +87,9 @@ create_partitions() {
} }
populate_partitions() { populate_partitions() {
local image_loop=$(realpath "${1}") local image_loop=$(realpath -m "${1}")
local bootloader_dir=$(realpath "${2}") local bootloader_dir=$(realpath -m "${2}")
local rootfs_dir=$(realpath "${3}") local rootfs_dir=$(realpath -m "${3}")
#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
@ -113,7 +113,7 @@ populate_partitions() {
} }
create_image() { create_image() {
local image_path=$(realpath "${1}") local image_path=$(realpath -m "${1}")
local bootloader_size=${2} local bootloader_size=${2}
local rootfs_size=${3} local rootfs_size=${3}
@ -126,7 +126,7 @@ create_image() {
} }
patch_initramfs() { patch_initramfs() {
local initramfs_path=$(realpath $1) local initramfs_path=$(realpath -m $1)
rm "${initramfs_path}/init" -f rm "${initramfs_path}/init" -f
cp -r bootloader/* "${initramfs_path}/" cp -r bootloader/* "${initramfs_path}/"

View File

@ -24,9 +24,9 @@ if [ -z "$3" ]; then
fi fi
copy_modules() { copy_modules() {
local shim_rootfs=$(realpath $1) local shim_rootfs=$(realpath -m $1)
local reco_rootfs=$(realpath $2) local reco_rootfs=$(realpath -m $2)
local target_rootfs=$(realpath $3) local target_rootfs=$(realpath -m $3)
rm -rf "${target_rootfs}/lib/modules" rm -rf "${target_rootfs}/lib/modules"
cp -r "${shim_rootfs}/lib/modules" "${target_rootfs}/lib/modules" cp -r "${shim_rootfs}/lib/modules" "${target_rootfs}/lib/modules"
@ -43,7 +43,7 @@ copy_modules() {
copy_firmware() { copy_firmware() {
local firmware_path="/tmp/chromium-firmware" local firmware_path="/tmp/chromium-firmware"
local target_rootfs=$(realpath $1) local target_rootfs=$(realpath -m $1)
if [ ! -e "$firmware_path" ]; then if [ ! -e "$firmware_path" ]; then
download_firmware $firmware_path download_firmware $firmware_path
@ -54,14 +54,14 @@ copy_firmware() {
download_firmware() { download_firmware() {
local firmware_url="https://chromium.googlesource.com/chromiumos/third_party/linux-firmware" local firmware_url="https://chromium.googlesource.com/chromiumos/third_party/linux-firmware"
local firmware_path=$(realpath $1) local firmware_path=$(realpath -m $1)
git clone --branch master --depth=1 "${firmware_url}" $firmware_path git clone --branch master --depth=1 "${firmware_url}" $firmware_path
} }
shim_path=$(realpath $1) shim_path=$(realpath -m $1)
reco_path=$(realpath $2) reco_path=$(realpath -m $2)
target_rootfs=$(realpath $3) target_rootfs=$(realpath -m $3)
shim_rootfs="/tmp/shim_rootfs" shim_rootfs="/tmp/shim_rootfs"
reco_rootfs="/tmp/reco_rootfs" reco_rootfs="/tmp/reco_rootfs"