Skip to content

Commit

Permalink
Testing ARM Runner with base commands
Browse files Browse the repository at this point in the history
  • Loading branch information
judsonjames committed Jan 9, 2024
1 parent 3eaf336 commit e76035b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/orangepi-image-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,13 @@ jobs:
with:
name: jar-${{ matrix.artifact-name }}
# TODO- replace with the arm-runner action and run this inside of the chroot. but this works for now.
- name: Generate image
run: |
chmod +x scripts/generatePiImage.sh
./scripts/generatePiImage.sh ${{ matrix.image_url }} ${{ matrix.image_suffix }}
- uses: pguyot/arm-runner-action@v2
name: Generate image
with:
base_image: ${{ matrix.image_url }}
commands: |
chmod +x scripts/generatePiImage.sh
./scripts/generatePiImage.sh ${{ matrix.image_url }} ${{ matrix.image_suffix }}
- uses: actions/upload-artifact@v4
name: Upload image
with:
Expand Down
44 changes: 22 additions & 22 deletions scripts/generatePiImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,38 @@ TMP=$(mktemp -d)
LOOP=$(sudo losetup --show -fP "${IMAGE_FILE}")
PARTITION="${LOOP}p2"

echo "Confirming that loop partition exists"
if ! lsblk | grep -q "$(basename $PARTITION)"; then
echo "Loop device was not found in lsblk output. Creating it now."
sudo parted $LOOP mklabel msdos
# echo "Confirming that loop partition exists"
# if ! lsblk | grep -q "$(basename $PARTITION)"; then
# echo "Loop device was not found in lsblk output. Creating it now."
# sudo parted $LOOP mklabel msdos

sudo parted $LOOP mkpart primary ext4 0% 50% > /dev/null 2>&1
sudo mkfs.ext4 "${LOOP}p1" > /dev/null 2>&1
# sudo parted $LOOP mkpart primary ext4 0% 50% > /dev/null 2>&1
# sudo mkfs.ext4 "${LOOP}p1" > /dev/null 2>&1

sudo parted $LOOP mkpart primary ext4 50% 100% > /dev/null 2>&1
sudo mkfs.ext4 $PARTITION > /dev/null 2>&1
# sudo parted $LOOP mkpart primary ext4 50% 100% > /dev/null 2>&1
# sudo mkfs.ext4 $PARTITION > /dev/null 2>&1

if ! lsblk | grep -q "$(basename $PARTITION)"; then
echo "Failed to create partition. Exiting."
exit 1
fi
# if ! lsblk | grep -q "$(basename $PARTITION)"; then
# echo "Failed to create partition. Exiting."
# exit 1
# fi

echo "Created loop device partition"
fi
# echo "Created loop device partition"
# fi

echo "Image mounted! Copying jar..."
sudo mount $PARTITION $TMP


if ! command -v pushd > /dev/null 2>&1; then
echo "Overwriting pushd because it doesn't exist."
alias pushd='opi_pushd'
fi
# if ! command -v pushd > /dev/null 2>&1; then
# echo "Overwriting pushd because it doesn't exist."
# alias pushd='opi_pushd'
# fi

if ! command -v popd > /dev/null 2>&1; then
echo "Overwriting popd because it doesn't exist."
alias popd='opi_popd'
fi
# if ! command -v popd > /dev/null 2>&1; then
# echo "Overwriting popd because it doesn't exist."
# alias popd='opi_popd'
# fi

pushd .

Expand Down

0 comments on commit e76035b

Please sign in to comment.