-
-
Save ntavish/a305975306e98caa1f4efa12239b1832 to your computer and use it in GitHub Desktop.
Building m8c for RG35XX Plus/H/SP on KNULLI (Scroll down for zip)
This file contains hidden or 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/bash | |
# | |
# build kernel modules | |
# | |
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.170.tar.gz | |
tar xzf linux-4.9.170.tar.gz | |
cd linux-4.9.170 | |
wget -O .config https://raw.githubusercontent.com/knulli-cfw/distribution/knulli-main/board/batocera/allwinner/h700/rg35xx-plus/linux-sunxi64-legacy.config | |
sed -i 's/# CONFIG_SND_USB_AUDIO is not set/CONFIG_SND_USB_AUDIO=m/g' .config | |
sed -i 's/# CONFIG_USB_ACM is not set/CONFIG_USB_ACM=m/g' .config | |
sed -i 's/^YYLTYPE yylloc;$/extern YYLTYPE yylloc;/g' scripts/dtc/dtc-lexer.lex.c_shipped | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- olddefconfig | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_prepare | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- M=drivers/usb/class | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- M=sound/core | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- M=sound/usb | |
cd .. | |
# | |
# setup toolchain | |
# | |
wget https://github.com/knulli-cfw/toolchains/releases/download/rg35xx-plush-sdk-20240421/aarch64-buildroot-linux-gnu_sdk-buildroot.tar.gz | |
tar xzf aarch64-buildroot-linux-gnu_sdk-buildroot.tar.gz | |
aarch64-buildroot-linux-gnu_sdk-buildroot/relocate-sdk.sh | |
# | |
# build m8c | |
# | |
export XTOOL=$(realpath aarch64-buildroot-linux-gnu_sdk-buildroot) | |
export XHOST=aarch64-buildroot-linux-gnu | |
export PATH=$PATH:$XTOOL/bin | |
export SYSROOT=$XTOOL/$XHOST/sysroot | |
export PKG_CONFIG_PATH=$SYSROOT/usr/lib/pkgconfig | |
export PKG_CONFIG_SYSROOT_DIR=$SYSROOT | |
git clone https://github.com/laamaa/m8c | |
cd m8c | |
git pull | |
make CC=$XHOST-gcc | |
cd .. | |
# | |
# collect files | |
# | |
mkdir -p build/m8c | |
cp linux-4.9.170/drivers/usb/class/cdc-acm.ko build/m8c | |
cp linux-4.9.170/sound/core/snd-hwdep.ko build/m8c | |
cp linux-4.9.170/sound/usb/snd-usbmidi-lib.ko build/m8c | |
cp linux-4.9.170/sound/usb/snd-usb-audio.ko build/m8c | |
cp m8c/m8c build/m8c | |
cat << 'EOF' > build/m8c.sh | |
#!/bin/sh | |
export HOME=$(dirname $(realpath $0))/m8c | |
cd $HOME | |
cp *.ko /lib/modules/4.9.170 | |
depmod | |
modprobe -a cdc-acm snd-hwdep snd-usbmidi-lib snd-usb-audio | |
pw-loopback -C alsa_input.usb-DirtyWave_M8_14900360-02.analog-stereo -P alsa_output._sys_devices_platform_soc_soc_03000000_codec_mach_sound_card0.stereo-fallback & | |
SDL_GAMECONTROLLERCONFIG="19000000010000000100000000010000,Deeplay-keys,a:b3,b:b4,x:b6,y:b5,leftshoulder:b7,rightshoulder:b8,lefttrigger:b13,righttrigger:b14,guide:b11,start:b10,back:b9,dpup:h0.1,dpleft:h0.8,dpright:h0.2,dpdown:h0.4,volumedown:b1,volumeup:b2,leftx:a0,lefty:a1,leftstick:b12,rightx:a2,righty:a3,rightstick:b15,platform:Linux," ./m8c | |
kill $(jobs -p) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment