#!/bin/sh # ###################################################### # Build script for RPI # # # # See .info for details # ###################################################### tce-load -i compiletc libasound-dev squashfs-tools tar ###################################################### # Configure extension creation parameters # ###################################################### SRCPATH="../../../sources" SRCNAM=alsa-lib-1.2.12.tar.bz2 WRKDIR=alsa-lib-1.2.12 EXTNAM=alsa TMPDIR=/tmp/alsa UCMCONF=alsa-ucm-conf-1.2.12.tar.gz PATCHDIR=$(pwd) ###################################################### # Prepare extension creation # ###################################################### # Remove dirs and files left from previous creation rm -r -f $WRKDIR rm -r -f $TMPDIR # Crete temporary directory mkdir -p $TMPDIR ###################################################### # Compile extension # ###################################################### # Export variables needed for compilation case $(find /lib | grep ld-linux) in *armhf*) export CFLAGS="-flto=auto -Os -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" export CXXFLAGS="-flto=auto -Os -pipe -fno-exceptions -fno-rtti -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" BITS="linux32" ;; *aarch64*) export CFLAGS="-flto=auto -Os -pipe -march=armv8-a+crc -mtune=cortex-a72" export CXXFLAGS="-flto=auto -Os -pipe -fno-exceptions -fno-rtti -march=armv8-a+crc -mtune=cortex-a72" BITS="" ;; esac export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig # Unpack source in current directory tar xf ${SRCPATH}/${SRCNAM} # Configure it cd $WRKDIR ${BITS} ./configure --prefix=/usr/local --enable-shared --disable-python \ --disable-topology # Compile ${BITS} make -j6 # Install in base temp dir ${BITS} make install DESTDIR=$TMPDIR # Delete compilation work directory cd .. rm -r -f $WRKDIR # Adjust directory access rigths find $TMPDIR/ -type d | xargs chmod -v 755; # Strip executables find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | ${BITS} xargs strip --strip-unneeded # Delete unneded files rm -r -f $TMPDIR/usr/local/lib rm -r -f $TMPDIR/usr/local/include rm -r -f $TMPDIR/usr/local/share/aclocal # Change gid #cd $TMPDIR #patch -p0 < $PATCHDIR/alsa-ipc-gid.patch # alsa.conf is changed, just use sed to change group sed -i 's/defaults.pcm.ipc_gid audio/defaults.pcm.ipc_gid staff/' $TMPDIR/usr/local/share/alsa/alsa.conf # Change alsa.conf to show all name hints sed -i 's/defaults.namehint.showall off/defaults.namehint.showall on/' $TMPDIR/usr/local/share/alsa/alsa.conf sed -i 's/defaults.namehint.extended off/defaults.namehint.extended on/' $TMPDIR/usr/local/share/alsa/alsa.conf # install ucm config files /usr/local/bin/tar xvzf ${SRCPATH}/${UCMCONF} -C $TMPDIR/usr/local/share/alsa --strip-components=1 --wildcards "*/ucm" "*/ucm2" ################################################### # Create base extension in temp dir # ################################################### cd $TMPDIR cd .. mksquashfs $TMPDIR $EXTNAM.tcz cd $TMPDIR find usr -not -type d > $EXTNAM.tcz.list mv ../$EXTNAM.tcz . # Create md5 file md5sum $EXTNAM.tcz > $EXTNAM.tcz.md5.txt # Cleanup temp directory rm -r -f usr