Skip to content

Get kernel format

Get kernel format #5

name: Get kernel format
on:
workflow_dispatch: # Allow manual triggering of the workflow
inputs:
boot_img_url:
description: "URL to download the boot.img file"
required: true
type: string
#default: "https://filebin.net/gp05fto9lulm3qwg/boot.img" # Default URL if not provided
jobs:
process-boot-img:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Download boot.img from the provided URL
- name: Download boot.img
run: |
curl -L -o boot.img "${{ github.event.inputs.boot_img_url }}"
if [ ! -f "boot.img" ]; then
echo "Failed to download boot.img. Exiting."
exit 1
fi
# Step 3: Ensure magiskboot is executable and process boot.img
- name: Process boot.img
continue-on-error: true
run: |
# Ensure magiskboot is executable
chmod +x magiskboot
KERNEL_FMT=$(./magiskboot unpack boot.img 2>&1 | grep 'KERNEL_FMT' | awk '{print $2}' | tr -d '[]')
if echo "$KERNEL_FMT" | grep -qi 'gzip'; then
echo "Your kernel format is GZIP (gz)"
elif echo "$KERNEL_FMT" | grep -qi 'lz4'; then
echo "Your kernel format is LZ4 (lz4)"
elif echo "$KERNEL_FMT" | grep -qi 'raw'; then
echo "Your kernel format is raw"
else
echo "error: Unknown kernel format!"
exit 1
fi