Skip to content

Instantly share code, notes, and snippets.

@waynevanson
Last active April 6, 2022 03:05
Show Gist options
  • Save waynevanson/6d308e70b34353686431e8a5d96a9ff4 to your computer and use it in GitHub Desktop.
Save waynevanson/6d308e70b34353686431e8a5d96a9ff4 to your computer and use it in GitHub Desktop.
Builds void-linux for use with rpi4
#!/bin/bash
# DO NOT RUN AS SUDO
# AS XBPS-SRC WILL THROW AN ERROR
DIR="$HOME/void-rpi4"
[ -d "$DIR" ] || mkdir "$DIR"
DIR_PACKAGES="$DIR/void-packages"
[ -d "$DIR_PACKAGES" ] || git clone https://github.com/void-linux/void-packages.git "$DIR_PACKAGES"
DIR_MKLIVE="$DIR/void-mklive"
[ -d "$DIR_MKLIVE" ] || git clone https://github.com/void-linux/void-mklive.git "$DIR_MKLIVE"
PULL="pull --ff -Xtheirs --no-edit"
GIT="git -C $DIR_PACKAGES"
$GIT remote add piraty https://github.com/piraty/void-packages.git
$GIT checkout -f -B rpi4
$GIT $PULL piraty rpi-kernel-flavor-subpackage
GIT="git -C $DIR_MKLIVE"
$GIT remote add piraty https://github.com/piraty/void-mklive.git
$GIT checkout -f -B rpi4
$GIT $PULL piraty rpi4
XBPS_SRC="$DIR_PACKAGES/xbps-src"
"$XBPS_SRC" -a aarch64-musl binary-bootstrap
"$XBPS_SRC" -a aarch64-musl pkg rpi4-base
DATE=$(date '+%Y%m%d')
sudo -i make -C "$DIR_MKLIVE" XBPS_REPOSITORY="-r $DIR_PACKAGES/hostdir/binpkgs/rpi4" "void-aarch64-musl-ROOTFS-$DATE.tar.xz" "void-rpi4-musl-$DATE.img.xz"
@calibius
Copy link

calibius commented Mar 13, 2021

If you're running this on the raspberry pi or an aarch64 architecture it will fail with the -a aarch64 selected with a error:

=> ERROR: cross-aarch64-linux-gnu-0.33_3: cannot be built, it's currently broken; see the build log:
=> ERROR: cross-aarch64-linux-gnu-0.33_3: Can't build crosstoolchain to itself

So just omit the -a aarch64-musl, if that's the case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment