Compare commits

...

2 commits

2 changed files with 44 additions and 4 deletions

View file

@ -12,7 +12,7 @@ RUN apt-get update && \
patch libstdc++6 rsync git meson ninja-build
WORKDIR /build
RUN wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.26.0.tar.xz && \
RUN wget https://github.com/crosstool-ng/crosstool-ng/releases/download/crosstool-ng-1.26.0/crosstool-ng-1.26.0.tar.xz && \
tar -xvf crosstool-ng-1.26.0.tar.xz && \
rm crosstool-ng-1.26.0.tar.xz && \
cd crosstool-ng-1.26.0 && \
@ -21,33 +21,45 @@ RUN wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.26.0.tar.x
make install && \
cd .. && \
rm -rf crosstool-ng-1.26.0
ADD ct-ng.config .config
RUN /usr/local/ct/bin/ct-ng build
RUN cd /build/ && \
git clone https://github.com/fail0verflow/hbc.git /build/hbc && \
cd /build/hbc/channel/wiiload && \
git checkout 13305cfbe5db47eebc5e62aeed14f7adfbb83a5a && \
make
RUN git clone https://github.com/fail0verflow/bootmii-utils.git /build/bootmii-utils && \
cd /build/bootmii-utils/client && \
git checkout a32b8f6520d136677213fcbb730035a7e89567e2 && \
make
RUN git clone https://github.com/nullgemm/doltool.git /build/doltool && \
cd /build/doltool && \
git checkout 716ca5390bb6467689165db595079e84c80b9b46 && \
make
## final build image
FROM ubuntu:${VARIANT}
FROM ubuntu:${VARIANT}
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && \
apt-get -y install \
patch ninja-build make bc ccache gcc libncurses-dev \
kmod bison flex libssl-dev openssl
kmod bison flex libssl-dev openssl binutils-powerpc-linux-gnu
RUN mkdir -p /usr/local/doltool/bin
ADD makedol.sh /usr/local/doltool/bin/makedol.sh
COPY --from=build /root/x-tools/powerpc-unknown-linux-gnu/ /usr/local/crosstool
COPY --from=build /build/hbc/channel/wiiload/wiiload /usr/local/crosstool/bin/wiiload
COPY --from=build /build/bootmii-utils/client/bootmii /usr/local/crosstool/bin/bootmii
COPY --from=build /build/doltool/doltool /usr/local/doltool/bin/doltool
ENV PATH=/usr/local/crosstool/bin:$PATH
ENV PATH=/usr/local/doltool/bin:$PATH
ENV CROSS_COMPILE=powerpc-unknown-linux-gnu-
ENV CC=powerpc-unknown-linux-gnu-gcc
ENV ARCH=powerpc

28
makedol.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
# copied from https://themkat.net/2022/12/19/gamecube_linux_sd_boot.html, which itself copied it from the now offline gc-linux wiki
# edited slightly to make it more readable and convenient to use
KSRC=${KSRC:-.}
target=${1:-zImage}
ofile=zImage
[ -r ${KSRC}/arch/powerpc/boot/${target} ] || {
echo "Can't find target image ${KSRC}/arch/powerpc/boot/${target}"
exit 1
}
cp ${KSRC}/arch/powerpc/boot/${target} ${ofile}
CROSS=powerpc-linux-gnu-
echo "+ building DOL"
load=$(${CROSS}readelf -l "$ofile" | perl -lane'printf"%08x\n",hex($F[3])+0x80000000 if /LOAD/;')
echo " LOAD: $load"
entry=$(${CROSS}readelf -l "$ofile" | perl -lane'printf"%08x\n",hex($F[2])+0x80000000 if /Entry point/;')
echo " EP : $entry"
${CROSS}objcopy -O binary -R .comment -R .shstrtab -R .symtab -R .strtab -R .gnu.attributes ${ofile} ${ofile}.bin
doltool -c ${ofile}.bin $load $entry
doltool -i ${ofile}.dol
echo ""