From 14e4c07a5df3221af441772a026691f04c04e352 Mon Sep 17 00:00:00 2001 From: LovelyLang Date: Tue, 2 Sep 2025 19:06:39 +0900 Subject: [PATCH 1/2] macOS emulation script --- Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ build_and_run.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 Dockerfile create mode 100644 build_and_run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c709230 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM --platform=linux/amd64 ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y \ + git \ + curl \ + build-essential \ + xorriso \ + net-tools \ + grub-common \ + grub-pc-bin \ + qemu-system-x86 \ + mtools \ + lld \ + nasm \ + && rm -rf /var/lib/apt/lists/* + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly +ENV PATH="/root/.cargo/bin:${PATH}" + +WORKDIR /workspace +RUN git clone https://github.com/krustowski/rou2exOS.git . + +# 타겟 스펙 파일 수정 +RUN sed -i 's/"target-pointer-width": "64"/"target-pointer-width": 64/' x86_64-r2.json + +# Rust 컴포넌트 및 타겟 설치 +RUN rustup target add x86_64-unknown-none && \ + cargo install bootimage --locked && \ + rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu && \ + rustup component add llvm-tools-preview --toolchain nightly-x86_64-unknown-linux-gnu + +# build.rs의 assertion 문제를 디버깅하기 위해 환경변수 설정 +ENV RUST_BACKTRACE=1 + +# 빌드 시도 (실패할 수 있지만 더 자세한 오류 정보 확인) +RUN make build || echo "Build failed, but container will continue for debugging" + +CMD ["bash"] \ No newline at end of file diff --git a/build_and_run.sh b/build_and_run.sh new file mode 100644 index 0000000..4433bf1 --- /dev/null +++ b/build_and_run.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +echo "🚀 rou2exOS Build and Run Script" +echo "================================" + +# 1. Build Docker image +echo "📦 Building Docker image..." +docker build -t rou2exos-builder . + +if [ $? -ne 0 ]; then + echo "❌ Docker build failed" + exit 1 +fi + +# 2. Run container and copy ISO +echo "📋 Copying ISO file..." +docker run --rm -v $(pwd):/host rou2exos-builder bash -c " + if [ -f r2.iso ]; then + cp r2.iso /host/ + echo '✅ ISO file copied successfully: r2.iso' + exit + else + echo '❌ ISO file not found' + ls -la + exit 1 + fi +" + +if [ $? -ne 0 ]; then + echo "❌ ISO copy failed" + exit 1 +fi + +# 3. Verify ISO file exists +if [ ! -f "r2.iso" ]; then + echo "❌ r2.iso file not found" + exit 1 +fi + +# 4. Run QEMU +echo "🖥️ Running rou2exOS with QEMU..." +echo "To exit: Press Ctrl+Alt+G, then type 'quit' in QEMU monitor" +qemu-system-x86_64 -boot d -cdrom r2.iso + +echo "✅ Done!" \ No newline at end of file From 212335866d9b0fed0b326b6496b7368670eff736 Mon Sep 17 00:00:00 2001 From: LovelyLang Date: Tue, 2 Sep 2025 19:10:07 +0900 Subject: [PATCH 2/2] Update Dockerfile --- Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c709230..d489e5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,19 +22,15 @@ ENV PATH="/root/.cargo/bin:${PATH}" WORKDIR /workspace RUN git clone https://github.com/krustowski/rou2exOS.git . -# 타겟 스펙 파일 수정 RUN sed -i 's/"target-pointer-width": "64"/"target-pointer-width": 64/' x86_64-r2.json -# Rust 컴포넌트 및 타겟 설치 RUN rustup target add x86_64-unknown-none && \ cargo install bootimage --locked && \ rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu && \ rustup component add llvm-tools-preview --toolchain nightly-x86_64-unknown-linux-gnu -# build.rs의 assertion 문제를 디버깅하기 위해 환경변수 설정 ENV RUST_BACKTRACE=1 -# 빌드 시도 (실패할 수 있지만 더 자세한 오류 정보 확인) RUN make build || echo "Build failed, but container will continue for debugging" -CMD ["bash"] \ No newline at end of file +CMD ["bash"]