Add doltool and script to convert linux kernel to .dol executable
This commit is contained in:
parent
9e6b9c8726
commit
46a1ed07f6
2 changed files with 40 additions and 2 deletions
14
Dockerfile
14
Dockerfile
|
@ -36,20 +36,30 @@ RUN git clone https://github.com/fail0verflow/bootmii-utils.git /build/bootmii-u
|
|||
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
28
makedol.sh
Executable 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 ""
|
Loading…
Add table
Add a link
Reference in a new issue