LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 11-19-2007, 05:06 PM   #1
bbmak
Member
 
Registered: May 2004
Posts: 178

Rep: Reputation: 31
Running post script after installation.


Hi,
I am using Microsoft RIS with kickstart(ks.cfg) to deploy ubuntu os to machine.

The problem is that I will remove and config some of the packages after the installation.

Right now I have to run the bash script manually after the installation to config the desktop.

I want to know are there anyway to integrate the bash script into the kickstart file. I hope some experts can help me on this

here is my kickstart file
Quote:
#Generated by Kickstart Configurator
#platform=x86

#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone --utc America/Los_Angeles
#Root password
rootpw --disabled
#Initial user
user bbmak --fullname "bbmak" --password xxxx
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
url --url http://san.csc.calpoly.edu/ubuntu/ubuntu/
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype ext3 --size 64 --asprimary --onpart=hda3
part swap --size 1024 --onpart=hda2
part / --fstype ext3 --size 2048 --grow --onpart=hda1
#System authorization infomation
auth --useshadow --enablemd5
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
#Package install information
%packages --resolvedeps
@ xubuntu-desktop
xmms
xmms-wma
pidgin
konqueror
wine
nfs-common
samba
portmap

here is my bash file
Quote:
####################Making Folders#############################

sudo mkdir /home/bbmak/Desktop/mp3
sudo mkdir /home/bbmak/Desktop/wallpaper
sudo mkdir /home/bbmak/Desktop/login
sudo mkdir /home/bbmak/Desktop/source
sudo mkdir /home/bbmak/Desktop/package
sudo mkdir /home/bbmak/Desktop/calculator

####################Making Folders#############################


####################Insert New Sources#########################
sudo echo -e '\n' >> /etc/apt/sources.list
sudo echo "##Skype Source" >> /etc/apt/sources.list
sudo echo "deb http://download.skype.com/linux/repos/debian/ stable non-free" >> /etc/apt/sources.list

sudo echo -e '\n' >> /etc/apt/sources.list
sudo echo "##Madwifi" >> /etc/apt/sources.list
sudo echo "deb ftp://ftp.au.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list
sudo echo "deb-src ftp://ftp.au.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list

sudo echo -e '\n' >> /etc/apt/sources.list
sudo echo "##Webmin" >> /etc/apt/sources.list
sudo echo "deb http://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list
####################Insert New Sources#########################

##################Insert DNS server##########################
sudo echo "nameserver 68.94.156.1" >> /etc/resolv.conf
sudo echo "nameserver 68.94.157.1" >> /etc/resolv.conf
##################Insert DNS server##########################


################Removing Package###############################
sudo apt-get -y update
sudo apt-get -y remove gaim
sudo apt-get -y remove xfburn
sudo apt-get -y remove gxine
sudo apt-get -y remove thunderbird
sudo apt-get -y remove totem
sudo apt-get -y remove totem-xine
sudo apt-get -y remove gnome-games
sudo apt-get -y remove brasero
sudo apt-get -y install skype
sudo apt-get -y install webmin
sudo apt-get -y install stardict
sudo apt-get -y install openoffice.org-calc
sudo apt-get -y install openoffice.org-impress
sudo apt-get -y autoremove
sudo apt-get -y autoclean
################Removing Package###############################




###################Installing madwifi#########################
# Install essential tools
sudo apt-get -y install build-essential bin86

# Install the sharutils package
sudo apt-get -y install sharutils

# Change to the /usr/src folder
cd /usr/src

# Get the necessary drivers from www.stchman.com
sudo wget http://internap.dl.sourceforge.net/s...0.9.3.3.tar.gz

# unpack the tarball
sudo tar -xzf /usr/src/madwifi-0.9.3.3.tar.gz

##Uninstall previous madwifi##
cd /usr/src/madwifi-0.9.3.3/scripts
sudo ifconfig ath0 down
sudo ifconfig wifi0 down
sudo ./madwifi-unload.bash
sudo ./find-madwifi-modules.sh $(uname -r)

# Change to the folder that the tarball created
cd /usr/src/madwifi-0.9.3.3/

# Make the drivers
sudo make clean
sudo make
sudo make install

# Make backup of /etc/modules file
sudo cp /etc/modules /etc/modules.bak

# Append to the end of the /etc/modules file by using >>
# First insert a carriage return in to the /etc/modules file
sudo echo -e '\n' >> /etc/modules
sudo echo "ath_pci" >> /etc/modules


#bring interfaces up
sudo ifconfig ath0 up
sudo ifconfig wifi0 up
#####################Finished Installing madwifi#######################


################download aircrack-ng#######################
cd /home/bbmak/Desktop/source/
sudo apt-get -y install build-essential
sudo wget http://download.aircrack-ng.org/airc...g-0.9.1.tar.gz
sudo tar -zxvf aircrack-ng-0.9.1.tar.gz
cd aircrack-ng-0.9.1
sudo make
sudo make install
################download aircrack-ng#######################



################installing the missing package################
###installing xmms-mpg123-ja###
sudo apt-get install xmms-mpg123-ja
###installing xmms-mpg123-ja###

######downloading wallpaper######
cd /home/bbmak/Desktop/wallpaper
sudo wget http://192.168.0.101/linux/ubuntu/wa.../140_large.jpg
######downloading wallpaper######

#########downloading login#########
cd /home/bbmak/Desktop/login
sudo wget http://192.168.0.101/linux/ubuntu/lo...nomeZen.tar.gz
#########downloading login#########


################downloading desktop icon###############
cd /home/bbmak/Desktop/
sudo wget http://192.168.0.101/linux/ubuntu/de...queror.desktop
sudo wget http://192.168.0.101/linux/ubuntu/de...pidgin.desktop
sudo wget http://192.168.0.101/linux/ubuntu/de...rminal.desktop
sudo wget http://192.168.0.101/linux/ubuntu/de...r/XMMS.desktop
################downloading desktop icon###############


#########downloading hp10bii calculator####################
cd /home/bbmak/Desktop/calculator
sudo wget http://192.168.0.101/linux/ubuntu/de...er/hp10bii.tar
sudo tar xf hp*
#########downloading hp10bii calculator####################



##############Network Card Fix############################
sudo touch /etc/init.d/wireless-network.sh
sudo echo "/etc/init.d/networking restart" >> /etc/init.d/wireless-network.sh
sudo chmod +x /etc/init.d/wireless-network.sh
sudo ln -s /etc/init.d/wireless-network.sh /etc/rcS.d/S40wireless-network
##############Network Card Fix############################


##########Final Apt-Get#############
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y autoremove
sudo apt-get -y autoclean
##########Final Apt-Get#############

##########################End Script############################################

###reboot###
sudo reboot
###reboot###

Last edited by bbmak; 11-19-2007 at 07:44 PM.
 
Old 11-20-2007, 10:10 AM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Setup your first machine with all the packages you want..

sudo dpkg --get-selections > /tmp/dpkglist.txt

on the new machine import the selections

sudo dpkg --set-selections < /tmp/dpkglist.txt
sudo apt-get -y update
sudo apt-get dselect-upgrade


that should shorten your script..



Since you are using a Debian based distro you could also look at using FAI - Fully Automatic Installation
http://www.informatik.uni-koeln.de/fai/
http://www.debian-administration.org/articles/240
Quote:
FAI is an automated installation tool to install or deploy Debian GNU/Linux and other distributions on a bunch of different hosts or a Cluster. It's more flexible than other tools like kickstart for Red Hat, autoyast and alice for SuSE or Jumpstart for SUN Solaris. FAI can also be used for configuration management of a running system.

You can take one or more virgin PCs, turn on the power and after a few minutes Linux is installed, configured and running on all your machines, without any interaction necessary.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Post Installation Script and others Guitarist88 SUSE / openSUSE 2 02-17-2007 01:27 AM
Here's my post-installation slackware configuration script (great for newbies) WindowBreaker Slackware 25 10-05-2006 01:43 AM
running %post script for Mailserver through kickstart abhi2778 Fedora 0 09-06-2006 03:12 AM
installation shell script not running (mandrake 10.1 / windowmaker) batfastad Linux - Newbie 6 11-15-2004 04:11 PM
Running script with -m option / Kylix installation pchaisty Linux - Software 1 05-27-2004 03:01 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration