#!/bin/bash -xe # Go to http://downloads.raspberrypi.org/raspios_armhf/images/ to figure out the latest release. WHERE=/opt/cross/pi DIST=buster RASPI=http://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2020-08-24/2020-08-20-raspios-buster-armhf.zip MY_UID=`id -u` MY_GID=`id -g` sudo mkdir -p ${WHERE} sudo chown -R ${MY_UID}:${MY_GID} ${WHERE} pushd ${WHERE} IMAGE=${RASPI##*/} wget ${RASPI} mkdir -p ${DIST} 7z e ${IMAGE} rm ${IMAGE} 7z e ${IMAGE%.*}.img 1.img rm ${IMAGE%.*}.img mkdir -p /tmp/mnt-${DIST} sudo mount 1.img /tmp/mnt-${DIST} sudo cp -ax /tmp/mnt-${DIST}/. ${DIST}/ sudo chown -R ${MY_UID}:${MY_GID} ${DIST} sudo umount /tmp/mnt-${DIST} sed -i 's/#deb/deb/g' buster/etc/apt/sources.list sed -i 's/#deb/deb/g' buster/etc/apt/sources.list.d/raspi.list proot -S ${DIST} -q qemu-arm apt-get -y update proot -S ${DIST} -q qemu-arm apt-get -y upgrade proot -S ${DIST} -q qemu-arm apt-get -y build-dep libsdl2 libsdl2-image libsdl2-mixer libsdl2-ttf ffmpeg proot -S ${DIST} -q qemu-arm apt-get -y install libgbm-dev libxv-dev libx11-dev libxext-dev libxi-dev proot -S ${DIST} -q qemu-arm apt-get -y install libomxil-bellagio-bin libomxil-bellagio-dev libraspberrypi-dev proot -S ${DIST} -q qemu-arm apt-get -y install libopenal-dev libasound2-dev touch ${DIST}/usr/include/immintrin.h git clone https://github.com/raspberrypi/tools.git wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py chmod +x sysroot-relativelinks.py ./sysroot-relativelinks.py buster/ export PATH=${PATH}:${WHERE}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin popd