Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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
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.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.