Last active
June 17, 2021 16:49
-
-
Save pbsds/93a432c2a8b89df9c8a1b811726c4c39 to your computer and use it in GitHub Desktop.
Build FreeBSD Wii (does not work)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://wiki.freebsd.org/Wii | |
# https://wiki.freebsd.org/BuildingOnNonFreeBSD | |
# https://github.com/freebsd/freebsd-src/blob/main/.github/workflows/cross-bootstrap-tools.yml | |
# https://github.com/freebsd/freebsd-ci/tree/master/jobs/FreeBSD-main-powerpc-build | |
# https://github.com/freebsd/freebsd-ci/blob/master/scripts/build/build-world-kernel-head.sh | |
# Support for the wii was removed in 29d0137a8d2b31771eee2172f4f73e7d4fe48373 . | |
# Reverting it causes merge conflicts. | |
# It never had support for external peripherals. | |
type -p clang || (echo clang not found ; false) || exit 1 | |
type -p lld || (echo lld not found ; false) || exit 1 | |
export NPROC=2 | |
export BUILD_ARGS="" | |
export BUILD_ARGS="$BUILD_ARGS TARGET=powerpc" | |
export BUILD_ARGS="$BUILD_ARGS TARGET_ARCH=powerpc" | |
export BUILD_ARGS="$BUILD_ARGS --cross-bindir=/usr/bin" | |
export EXTRA_MAKE_ARGS="" | |
export MAKEOBJDIRPREFIX="$(pwd)/build" | |
mkdir build | |
test -d freebsd-src || git clone git@github.com:freebsd/freebsd-src.git | |
cd freebsd-src | |
#git pull | |
set -xe | |
./tools/build/make.py --debug $BUILD_ARGS -n | |
./tools/build/make.py --debug $BUILD_ARGS kernel-toolchain -s -j$NPROC | |
./tools/build/make.py --debug $BUILD_ARGS KERNCONF=WII NO_MODULES=yes buildkernel -s -j$NPROC $EXTRA_MAKE_ARGS | |
mkdir -p sd_card/apps/freebsd | |
cp -v sys/WII/kernel sd_card/apps/freebsd/boot.elf | |
curl 'https://wiki.freebsd.org/Wii?action=AttachFile&do=get&target=icon.png' > sd_card/apps/freebsd/icon.png | |
cat <<'EOF' > sd_card/apps/freebsd/meta.xml | |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<app version="1"> | |
<name>FreeBSD 10</name> | |
<coder>The FreeBSD Project</coder> | |
<version>10</version> | |
<release_date>today</release_date> | |
<short_description>FreeBSD</short_description> | |
<long_description>FreeBSD is an advanced operating system for modern server, desktop, and embedded computer platforms.</long_description> | |
</app> | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment