Skip to content

feat: Implement Docker image #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM ubuntu:jammy-20231004
LABEL Maxence Laude <maxence@laude.pro>

ARG DEBIAN_FRONTEND=noninteractive
ARG UEFIExtract_VERSION=A68

RUN echo 'apt::install-recommends "false";' > /etc/apt/apt.conf.d/no-install-recommends
RUN apt update && \
apt install -y git ruby ruby-dev upx-ucl p7zip-full innoextract build-essential unzip curl file && \
gem install bundler && \
apt autoremove -y && \
apt autoclean && \
apt clean && \
rm -rf /var/lib/apt/lists/*

RUN groupadd -g 1000 app \
&& useradd -d /app -s /bin/bash -g app app \
&& chown -R app:app /app

RUN git clone https://github.com/awilliam/rom-parser && \
cd rom-parser && \
make && \
chmod +x rom-parser && \
mv rom-parser /usr/local/bin

WORKDIR /app

USER app

COPY --chown=app:app . .

# https://github.com/coderobe/VBiosFinder/issues/50
# https://github.com/coderobe/VBiosFinder/pull/51
RUN git remote add vkhodygo https://github.com/vkhodygo/VBiosFinder.git && \
git fetch vkhodygo && \
git rebase

RUN mkdir -p /app/.gem && \
bundle config set --local path '/app/.gem' && \
bundle install --path=vendor/bundle

ENV PATH=$PATH:$HOME/.gem/bin

RUN curl -LO https://github.com/LongSoft/UEFITool/releases/download/A68/UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && unzip UEFIExtract_NE_${UEFIExtract_VERSION}_x64_linux.zip && mv uefiextract ./3rdparty/UEFIExtract

RUN mkdir ./output

ENTRYPOINT ["./vbiosfinder", "extract"]
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# VBiosFinder (linux)

This tool attempts to extract a VBIOS from a bios update
This tool attempts to extract a VBIOS from a bios update
Laptops with NVIDIA Optimus graphics often have the dGPU VBIOS integrated in their system BIOS, this makes extracting the VBIOS a complicated process. Provided you have a BIOS Update for your laptop, this tool might be able to automagically extract all available VBIOS from it.

## Dependencies

- Ruby
- bundler **(a ruby gem)**
- [UEFIExtract](https://github.com/LongSoft/UEFITool) **(note: UEFIExtract can be found in the branch `new_engine`)**
Expand All @@ -13,15 +14,30 @@ Laptops with NVIDIA Optimus graphics often have the dGPU VBIOS integrated in the
- upx **(optional)**

## Note

Some dependencies might not offer a package for your linux distribution **(like UEFIDump and rom-parser)**. The binaries can be placed in `./3rdparty` to avoid having to install them.

## Usage

- Run `bundle install --path=vendor/bundle` to install the required ruby modules **(once)**
- Run `./vbiosfinder extract /path/to/bios_update.exe` to attempt an extraction
- A temporary working dir is created at `./tmp-vbiosfinder` which can be removed inbetween runs
- Extracted VBIOS roms will be placed in `./output`

### Running with Docker

- Create a temporary folder using the command `mkdir -p /tmp/extract/output`.
- Move your BIOS file into the `/tmp/extract/` directory.
- Run the Docker container using the following command:

```
docker run -v /tmp/extract/:/app/bios/ -v /tmp/extract/output/:/app/output/ binboum/vbiosfinder:latest /app/bios/bios_update.exe
```

- You can find the extract in `/tmp/extract/output/`

## Compatibility (non-exhaustive)

- [ASUS N580GD](https://github.com/coderobe/VBiosFinder/issues/15)
- Lenovo y50-70
- [Lenovo S5 2nd Gen (20JAA009HH)](https://github.com/coderobe/VBiosFinder/issues/1)
Expand All @@ -35,14 +51,17 @@ Some dependencies might not offer a package for your linux distribution **(like
- **note: if your device isn't listed here, feel free to try this tool and report your results!**

## Troubleshooting
**Q:** There are no files in `./output` after running the tool!

**Q:** There are no files in `./output` after running the tool!
**A:** It's very possible that VBiosFinder can't extract your type of BIOS update right now. Feel free to open an issue with a link to your bios update and the program output you get!

## TODO

- Add option to extract the bios of the running system **(can we?)**
- ~~Clean up temporary working dir after finishing up~~ done
- Test with more BIOS updates

## Licensing
This project, initially authored by Robin Broda, is licensed under the GNU Affero General Public License v3

This project, initially authored by Robin Broda, is licensed under the GNU Affero General Public License v3
A copy of the license is available in `LICENSE.txt`