#!/bin/sh

# cocon-spmachine-early
# Script for special machines (and need root).

# This script calls BEFORE standup udev.

#SPMACHINE486_CONF="/usr/share/spmachine-486"
#XORG_CONF_D="/etc/X11/xorg.conf.d"

# Machine name
if [ "$( which dmidecode )" ];
then
  # dmidecode is only for x86
  MACHINE_MAKER="$( dmidecode -s system-manufacturer )"
  MACHINE_NAME="$( dmidecode -s system-product-name )"
  echo "Manufacturer: $MACHINE_MAKER"
  echo "Product name: $MACHINE_NAME"
fi

# Workaroud for HP 2533t
if echo "$MACHINE_MAKER" | grep -q 'Hewlett-Packard' && echo "$MACHINE_NAME" | grep -q 'HP 2533t Mobile Thin Client'
then
  # processer ACPI driver is broken : blacklisting processer driver
  #mv /lib/modules/`uname -r`/kernel/drivers/acpi/processor.ko /lib/modules/`uname -r`/kernel/drivers/acpi/processor.disabled
  echo "install processor /bin/false" >> /etc/modprobe.d/blacklist.conf

  # b43 is not working correctly (TODO : wl driver or debug)
  echo "install b43 /bin/false" >> /etc/modprobe.d/blacklist.conf
fi


# Workaroud for KOHJINSHA PM
if echo "$MACHINE_MAKER" | grep -q 'KOHJINSHA' && echo "$MACHINE_NAME" | grep -q 'PM Series'
then
  echo "install libertas_sdio /bin/false" >> /etc/modprobe.d/blacklist.conf
fi
