Skip to content

Instantly share code, notes, and snippets.

@benbristow
Created December 6, 2013 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benbristow/7833416 to your computer and use it in GitHub Desktop.
Save benbristow/7833416 to your computer and use it in GitHub Desktop.
#!/bin/bash
_kernver=$(uname -r | cut -d- -f 1)
_basever=$(uname -r | cut -d. -f -2)
[ -e "linux-${_basever}.tar.xz" ] || wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-${_basever}.tar.xz
[ -e "patch-${_kernver}.xz" ] || wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-${_kernver}.xz
[ -e "xonar-01.patch" ] || wget https://gist.github.com/ipha/7831385/raw/69e172eb9336f9371a8fab6300ff2cbeaf622851/xonar-01.patch
[ -e "xonar-02.patch" ] || wget https://gist.github.com/ipha/7831385/raw/c23e88245d8ee3ea09fe5607496ee2d833aa3053/xonar-02.patch
[ -e "xonar-03.patch" ] || wget https://gist.github.com/ipha/7831385/raw/25d4d2a55eac9f64b84eb36bf41428f499f9a8bb/xonar-03.patch
[ -e "xonar-04.patch" ] || wget https://gist.github.com/ipha/7831385/raw/47c0206fa8a3451ed0bd99aa97b0adb288346631/xonar-04.patch
[ -d "linux-${_basever}" ] && rm -r "linux-${_basever}"
tar xf linux-${_basever}.tar.xz
cd linux-${_basever}
xzcat ../patch-${_kernver}.xz | patch -Np1
patch -Np1 -i ../xonar-01.patch
patch -Np1 -i ../xonar-02.patch
patch -Np1 -i ../xonar-03.patch
patch -Np1 -i ../xonar-04.patch
cd sound/pci/oxygen
make -C /usr/lib/modules/$(uname -r)/build M="$(pwd)" modules
find -name "*.ko" -exec gzip {} \;
[ -d /usr/lib/modules/$(uname -r)/updates ] || sudo mkdir /usr/lib/modules/$(uname -r)/updates
sudo cp *.ko.gz /lib/modules/$(uname -r)/updates/
sudo depmod -a
pulseaudio --kill
sudo rmmod snd-oxygen
sudo rmmod snd-oxygen-lib
sudo modprobe snd-oxygen
pulseaudio --start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment