diff --git a/.docs/assets/screenshot1.png b/.docs/assets/screenshot1.png new file mode 100644 index 0000000..5a8972f Binary files /dev/null and b/.docs/assets/screenshot1.png differ diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..3ad6fa9 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,24 @@ +name: Build +run-name: ${{ gitea.actor }} is building +on: + push: + tags: + - "*" + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + targets: x86_64-unknown-uefi + - name: Build + run: cargo build --release + - name: Release + uses: akkuman/gitea-release-action@v1 + with: + files: |- + target/x86_64-unknown-uefi/release/uefi-video.efi diff --git a/README.md b/README.md index 3e2ecf6..b2d44c7 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,95 @@ -# UEFI-Video -Media renderer embedded in UEFI boot environment +![header](https://capsule-render.vercel.app/api?type=waving&height=300&color=gradient&text=UEFI%20Video§ion=header) + +## Badges + +[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/) + +![Build](https://git.walruslab.org/mincomk/uefi-video/actions/workflows/build.yaml/badge.svg) ## Features -- Render GIF -- Render PNG -## Requirements -- Rust toolchain -- Appropriate rust target +- PNG/GIF Decoder +- Render still image +- Embed framed video to binary + +## Roadmap + +- Filesystem input support +- Encryption + +## Screenshots + +![App Screenshot](.docs/assets/screenshot1.png) + +## Build/Run + +### Prerequisites + +- QEMU x86_64 emulator +- `OVMF.fd` + +Clone the project -## Build ```bash -cargo build --target x86_64-unknown-uefi --release -# result: uefi-video.efi + git clone https://git.walruslab.org/mincomk/uefi-video.git ``` -## Test Info -Tested on: -- `x86_64-unknown-uefi` +Go to the project directory + +```bash + cd uefi-video +``` + +Modify config as you want: [Configuration](#Configuration) + +And build + +```bash + cargo build +``` + +Or run directly with QEMU + +```bash + cargo run +``` + +## Making IMG + +`.img` generation is intended to use from Linux. Contribution is welcome to support docs of other OS. + +```bash + dd if=/dev/zero of=boot.img bs=1M count=512 status=progress + mkfs.fat -F 32 boot.img + sudo mount boot.img mnt --mkdir + mkdir -p mnt/EFI/BOOT + + # Change uefi-video.efi to the desired file. + # It's in releases if you download, and it's in target/x86_64-unknown-uefi/release if you build your own. + cp uefi-video.efi mnt/EFI/BOOT/bootx64.efi + sudo umount mnt + rmdir mnt + + # use boot.img as you want +``` + +## Configuration + +You can configure the project with `config.rs`. + +### Default Config + +```rust +// src/config.rs +pub static DATA: &[u8] = include_bytes!("../assets/rainbow.png"); +pub static MEDIA_TYPE: MediaType = MediaType::ImagePNG; +pub static SCALE: f32 = 1.0; +``` + +### Config Entries + +| Name | Content | Notes | +| ------------ | ----------------------------------------------- | ----------------------------------- | +| `DATA` | `include_bytes!("ASSET_FILE")` | Path is relative to `src` directory | +| `MEDIA_TYPE` | `MediaType::ImagePNG` or `MedidaType::VideoGIF` | Should match content of `DATA` | +| `SCALE` | A scale factor | `1.0` is an original size |