LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-10-2009, 04:40 AM   #1
Vimuth
Member
 
Registered: Sep 2009
Posts: 59

Rep: Reputation: 15
Kickstart post installation


Dear All,
I'm in an attempt of making a kickstart file in order to carry out a customized RHEL5.3 installation. I have succeeded in creating the partitions, creating the users and so on via my ks file. However Now I'm stuck at the point where It is required to copy some files from the installation DVD to the installed system. Failed.. I know this has been a very common issue but I find it very hard to find the most accurate solution. I've tried many but none worked. Following is my post installtion section..

@core
@base

%post --nochroot
mkdir -p /mnt/cdrom
mount -t iso9660 /tmp/cdrom /mnt/cdrom
mkdir /mnt/sysimage/boot/INSTALL
cp -a /mnt/cdrom/isolinux/* /mnt/sysimage/boot/INSTALL

%post
chkconfig acpid off
chkconfig anacron off

Please help out this is extremly urgent.
 
Old 09-10-2009, 05:40 AM   #2
cardy
Member
 
Registered: Jan 2005
Location: Shropshire, England, UK
Distribution: RedHat, Fedora, CentOS..........
Posts: 121

Rep: Reputation: 19
You could try adding some logging.

Quote:
%post --log=/root/post-exec.log
and then in the post section add a few echo commands


i.e.

Quote:
%post --nochroot --log=/root/post-exec-nochroot.log
echo Making CD Mountpoint
mkdir -p /mnt/cdrom
echo Mounting CD
mount -t iso9660 /tmp/cdrom /mnt/cdrom
echo Making Dir Under sysimage
mkdir /mnt/sysimage/boot/INSTALL
echo Copying sysimage
cp -a /mnt/cdrom/isolinux/* /mnt/sysimage/boot/INSTALL

%post --log=/root/post-exec.log
echo Disabling acpid
chkconfig acpid off
echo Disabling anacron
chkconfig anacron off

I don't know if you can have multiple posts but assuming you can the above should give you a log file showing what happened in your post stages maybe helping you diagnose the issues further.
 
Old 09-10-2009, 09:21 AM   #3
Vimuth
Member
 
Registered: Sep 2009
Posts: 59

Original Poster
Rep: Reputation: 15
Kickstart post installation

Thanks alot for the reply Sir b ut still no luck. Looking forward to see more posts. Thanks. By the way destination directory to which I want to copy the files from CD immaterial at this testing stage.Destination /mnt/sysimage/boot/INSTALL could be anywhere may be /temp/files.

Quote:
Originally Posted by cardy View Post
You could try adding some logging.


and then in the post section add a few echo commands


i.e.




I don't know if you can have multiple posts but assuming you can the above should give you a log file showing what happened in your post stages maybe helping you diagnose the issues further.
 
Old 09-10-2009, 10:43 AM   #4
cardy
Member
 
Registered: Jan 2005
Location: Shropshire, England, UK
Distribution: RedHat, Fedora, CentOS..........
Posts: 121

Rep: Reputation: 19
OK I think this could be a solution.

The following site has the same issue and an apparent solution

http://forums.fedoraforum.org/showthread.php?t=147261

I am guessing that adding the #!/bin/sh caused it to run as as shell script which is somehow different to running the command directly in the chroot environment, if thats the case then I would guess adding the option

Quote:
--interpreter /usr/bin/perl
to the post entry may have the same effect.

From the entry on that site

Quote:
The problems centered around the %post --nochroot directive.
when using the --nochroot directive the system available was the installer and not the system being installed. However the cdrom was available to be mounted.
When using the %post without any options the system being installed was available for further installations and other commands e.g adduser, rpm etc. Following was the solution which worked. Note, you are allowed multiple post directives though the documentation says the order of execution IS NOT GUARANTEED!!!
The cdrom itself is available when --nochroot is given under /tmp/cdrom

%post --nochroot
#!/bin/sh
# We need to copy files from the cdrom to the new system
mkdir /mnt/sysimage/tempdir
mkdir -p /mnt/cdrom
mount -t iso9660 /tmp/cdrom /mnt/cdrom
cp -a /mnt/cdrom/directoryToBeCopied /mnt/sysimage/tempdir
umount /mnt/cdrom

# After copying the required files from the cdrom onto your new system,
# you can now do whatever you wish within your new system
%post
useradd admin
useradd clamav
rpm -ih .....
The last post on the page seems to work according to the user who was testing. I would be interested to know if this solves the issue for you.
 
Old 09-10-2009, 01:58 PM   #5
Vimuth
Member
 
Registered: Sep 2009
Posts: 59

Original Poster
Rep: Reputation: 15
Thank you very much Mr Lee. I will definitely let you know if this works. By the way I didn't quite follow the directive "--interpreter /usr/bin/perl ". Would you mind telling me where exactly should I place this directive in my ks file. Please try to mention it in the exact format that it has to be placed in the file. It would be less of hassels if you could mention it below along with the %post & %post --nochroot directive just like you did in the previous message. Again thank you very much for your support with regard to this matter.

Best Regards
Vimuth
 
Old 09-11-2009, 04:02 PM   #6
fareedreg
Member
 
Registered: Dec 2007
Posts: 51

Rep: Reputation: 15
configure yum local repository from your cd to hdd through this script
http://rapidshare.com/files/27876209...cript.txt.html

then after configure ur kick

problem will be ssolved

i had done this before in RHCE
 
Old 09-11-2009, 04:04 PM   #7
fareedreg
Member
 
Registered: Dec 2007
Posts: 51

Rep: Reputation: 15
Quote:
Originally Posted by fareedreg View Post
configure yum local repository from your cd to hdd through this script
then after configure ur kick

problem will be ssolved

i had done this before in RHCE
sorry for the dead link

new link here
http://www.megafileupload.com/en/fil...cript-txt.html
 
Old 09-12-2009, 04:21 AM   #8
Vimuth
Member
 
Registered: Sep 2009
Posts: 59

Original Poster
Rep: Reputation: 15
Dear Sir
Thanks alot for your advice Mr Ahamed. Anyway I'm a little confused determining the exact location that I should place your script in my ks file. Creating the repo is not all that important but I want to copy the folder Server and another folder containing some files(Say folder ABC) on to my hard disk from the CD so that my client can do the further modifications to the installation as he pleases. Would you mind telling me how to copy the folder Server & ABC along with their contents on to any partition in my new system being installed via ks? I'd immensely appreciate it If you could mention what is likely to be done in the ks file below so that there wont be any confusions. Many thanks in advance sir. Here goes part of my ks..Please modyfy it appropriately.


%post --nochroot
mkdir /mnt/sysimage/tempdir
mkdir -p /mnt/cdrom
mount -t iso9660 /tmp/cdrom /mnt/cdrom
cp -ar /mnt/cdrom/Server /mnt/sysimage/tempdir
umount /mnt/cdrom

%post
useradd admin
useradd clamav
rpm -ih .....

NOTE: Directories that are being created here immaterial for now. It could be any directory and any partition. Please help out mentioning your solution just modifying the sample so things would be much easier.
 
Old 09-15-2009, 12:13 AM   #9
fareedreg
Member
 
Registered: Dec 2007
Posts: 51

Rep: Reputation: 15
Quote:
Originally Posted by Vimuth View Post
Dear Sir
Thanks alot for your advice Mr Ahamed. Anyway I'm a little confused determining the exact location that I should place your script in my ks file. Creating the repo is not all that important but I want to copy the folder Server and another folder containing some files(Say folder ABC) on to my hard disk from the CD so that my client can do the further modifications to the installation as he pleases. Would you mind telling me how to copy the folder Server & ABC along with their contents on to any partition in my new system being installed via ks? I'd immensely appreciate it If you could mention what is likely to be done in the ks file below so that there wont be any confusions. Many thanks in advance sir. Here goes part of my ks..Please modyfy it appropriately.


%post --nochroot
mkdir /mnt/sysimage/tempdir
mkdir -p /mnt/cdrom
mount -t iso9660 /tmp/cdrom /mnt/cdrom
cp -ar /mnt/cdrom/Server /mnt/sysimage/tempdir
umount /mnt/cdrom

%post
useradd admin
useradd clamav
rpm -ih .....

NOTE: Directories that are being created here immaterial for now. It could be any directory and any partition. Please help out mentioning your solution just modifying the sample so things would be much easier.
Installs the package vsftpd
yum install vsftpd*

copy your cd data to /var/ftp/pub/
 
Old 09-16-2009, 04:01 AM   #10
cardy
Member
 
Registered: Jan 2005
Location: Shropshire, England, UK
Distribution: RedHat, Fedora, CentOS..........
Posts: 121

Rep: Reputation: 19
The parameter

Quote:
--interpreter /usr/bin/perl
Would go onto the %post line it defines how the post section should be run. For example

Quote:
%post --interpreter /usr/bin/perl
print "Hello World\n";
The instructions after %post using the perl interpreter.
Quote:
%post --interpreter /bin/bash
echo "Hello World"
Would run the commands in the post section as a bash shell script.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kickstart post-installation abhi2778 Linux - Software 8 07-10-2012 09:30 AM
kickstart installation issue with %post samhoover Linux - Server 4 09-13-2009 11:27 AM
Post script in kickstart qiuzhihong Linux - Software 1 04-19-2008 03:52 AM
Kickstart installation. Access to cdrom in %post mrcash Fedora - Installation 2 07-21-2005 11:29 AM
Unable to run post-Installation kickstart scripts zoulo Linux - Enterprise 0 07-05-2005 03:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:15 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