Commit bf845f5c authored by Lior Spach's avatar Lior Spach

le-pregao-712010: Refs #1280, Better performance of building and installing

Signed-off-by: Lior Spach's avatarLior Spach <ls12@inf.ufpr.br>
parent e3f5b4cf
......@@ -23,11 +23,16 @@
PACKAGE_NAME="lepregao712010"
PACKAGE_VERSION="2.3.0.0-Alpha-v2"
KERNEL_VERSION="$(uname -r)"
ALL_KERNEL_VERSION="$(dpkg --get-selections | egrep '^linux-image.*generic-pae.*install$' | awk '{print $1}' | cut --bytes=13-)"
# Put conflicting modules at /etc/modprobe.d/blacklist.conf
echo "# replaced by rt3562sta" >> /etc/modprobe.d/blacklist.conf
echo "blacklist rt2800pci" >> /etc/modprobe.d/blacklist.conf
# Put conflicting modules at /etc/modprobe.d/blacklist.conf
echo "# enable wireless for pregao 71/2010" >> /etc/modules
echo "rt3562sta" >> /etc/modules
# Function to set selections
setselections() {
selfile=$1
......@@ -41,14 +46,19 @@ setselections() {
# Hold Kernel
sels=$(mktemp)
auxfile=$(mktemp)
dpkg --get-selections \* > ${sels}
dpkg --get-selections > ${sels}
awk '{if (($1 ~ /^linux-image-generic-pae/) || ($1 ~ /^linux-headers-generic-pae/)) {print $1"\thold"} else { print $0} }' ${sels} >\
${auxfile}
rm -f ${sels}
setselections ${auxfile} & disown
echo "Building module for all installed kernels using dkms..."
/usr/lib/dkms/common.postinst $PACKAGE_NAME $PACKAGE_VERSION
echo "Building and Installing module for each installed kernel using dkms..."
dkms add -m $PACKAGE_NAME -v $PACKAGE_VERSION
for EACH_KERNEL in $ALL_KERNEL_VERSION
do
dkms build -m $PACKAGE_NAME -v $PACKAGE_VERSION -k $EACH_KERNEL
dkms install -m $PACKAGE_NAME -v $PACKAGE_VERSION -k $EACH_KERNEL
done
echo "Loading module rt3562sta"
modprobe rt3562sta || true
......
......@@ -20,12 +20,21 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
if [[ "$1" = "upgrade" ]]; then
exit 0
fi
# TODO: remove lines instead of changing them to "blank"
# removing conflicting modules from blacklist
sed -i s/'# replaced by rt3562sta'/''/ /etc/modprobe.d/blacklist.conf
sed -i s/'blacklist rt2800pci'/''/ /etc/modprobe.d/blacklist.conf
echo "Running depmod..."
/sbin/depmod -a 2.6.32-29-generic-pae
# removing wireless entries from modules file
sed -i s/'# enable wireless for pregao 71/2010'/''/ /etc/modules
sed -i s/'rt3562sta'/''/ /etc/modules
echo "Removing wireless module from dkms tree..."
dkms remove -m lepregao712010 -v 2.3.0.0-Alpha-v2 --all
echo "Restarting network interfaces"
/etc/init.d/networking restart || true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment