LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-22-2011, 02:59 PM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
Question Post Installation in Kickstart File


Hi All,

I have created a customized RHEL 5.4 DVD and placed a Kickstart file in it.
It is running fine except the post installation steps.

I need to copy some files from DVD to the newly built server. For this I have modified my Kickstart file as below, but no luck

Here, EXTRAS is the folder which I need to copy on the server after installing from the DVD.
Code:
%post --nochroot
mkdir /mnt/sysimage/tempdir
mkdir -p /mnt/cdrom
mount -t iso9660 /tmp/cdrom /mnt/cdrom
cp -ar /mnt/cdrom/EXTRAS /mnt/sysimage/tempdir
umount /mnt/cdrom


Any ideas.


EDIT: I just found a way to log my post section here. Let me try this and post results here.

Last edited by vikas027; 03-22-2011 at 03:02 PM.
 
Old 03-22-2011, 03:55 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
in %post the system is chrooted into the sysimage, so you need to access files as they will be after reboot, so just drop all the "/mnt/sysimage" bits.
 
Old 03-23-2011, 02:48 PM   #3
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Original Poster
Rep: Reputation: 107Reputation: 107
Hi Acid,

Thanks for your time and reply. I am marking this thread as solved.

This helped me out.

Code:
%post --nochroot
#!/bin/bash
# Copying EXTRAS folder from CDROM to /root/EXTRAS
mkdir /tmp/c
mount -t iso9660 /tmp/cdrom /tmp/c
mkdir -p /mnt/sysimage/root/EXTRAS
cp -arv /tmp/c/EXTRAS/* /mnt/sysimage/root/EXTRAS
umount /tmp/c
%end
However, I was unable to create log file for this section of kickstart. I tried these:-
Code:
%post --nochroot --log=/root/post-chroot.log
#!/bin/bash
# Copying EXTRAS folder from CDROM to /root/EXTRAS
mkdir /tmp/c
mount -t iso9660 /tmp/cdrom /tmp/c
mkdir -p /mnt/sysimage/root/EXTRAS
cp -arv /tmp/c/EXTRAS/* /mnt/sysimage/root/EXTRAS
umount /tmp/c
%end
and
Code:
%post --nochroot
{
#!/bin/bash
# Copying EXTRAS folder from CDROM to /root/EXTRAS
mkdir /tmp/c
mount -t iso9660 /tmp/cdrom /tmp/c
mkdir -p /mnt/sysimage/root/EXTRAS
cp -arv /tmp/c/EXTRAS/* /mnt/sysimage/root/EXTRAS
umount /tmp/c
} > /root/post-chroot.log
%end
 
Old 03-23-2011, 05:15 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Yeah, I've tried that stuff too, got nowhere. just got blank log files at best.
 
  


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
kickstart post-installation abhi2778 Linux - Software 8 07-10-2012 09:30 AM
[SOLVED] Kickstart post installation Vimuth Linux - General 9 09-16-2009 04:01 AM
kickstart installation issue with %post samhoover Linux - Server 4 09-13-2009 11:27 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 - Software

All times are GMT -5. The time now is 01:37 AM.

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