Help with creating a Debian Package

Carl J. Richell carl at system76.com
Mon Apr 23 16:06:41 BST 2007


Hi Everyone,

I have a pretty simple (I think) debian package that I need created but I'm not sure how to go about it.  When the package is installed the following script should be applied.  Once the package is removed the script should be reversed.

-------- Script ----------

#!/bin/bash
#
## For Ubuntu 7.04 "Feisty Fawn"
## Installing this package changes the hard drive driver from ata-piix to piix
## Removing this packages reverts back to the new ata-piix driver
## Released under the GNU General Public License (See LICENSE)

# Check ubuntu version - must be 7.04
ubuntuversion () {
export RELEASE=`lsb_release -r -s`

if [ $RELEASE = 7.04 ];
then fix_ata;
else exit;
fi
}

fix_ata () {
# replaces ata-piix driver with piix driver
echo blacklist ata_piix | sudo tee -a /etc/modprobe.d/blacklist-ata
echo piix | sudo tee -a /etc/initramfs-tools/modules
sudo update-initramfs -u
sudo reboot

}

ubuntuversion

-------- Script ----------

This is related to a Feisty bug effecting lots of our existing users: https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/84603

Thanks for the help!

Carl J Richell
System76, Inc.



More information about the Ubuntu-motu mailing list