RE: using /dev/ram devices in RHEL5 kickstarts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Exactly.  The way I would do this is to create a directory in /tmp in the %pre and simply copy the contents of that directory to /mnt/sysimage/tmp in a %post –nochroot immediately preceeding your current %post.

 

%pre

mkdir /tmp/my_stuff_to_copy

cp stuff /tmp/my_stuff_to_copy

 

%post –nochroot

cp -a /tmp/my_stuff_to_copy/* /mnt/sysimage/tmp

 

%post

Your_post_here


From: kickstart-list-bounces@xxxxxxxxxx [mailto:kickstart-list-bounces@xxxxxxxxxx] On Behalf Of Hearn, Stan J.
Sent: Monday, March 24, 2008 10:40 AM
To: Discussion list about Kickstart
Subject: RE: using /dev/ram devices in RHEL5 kickstarts

 

So in order to not use a ram disk and to still have access to the files in the chrooted %post, you'd need to copy the files to a directory beneath /mnt/sysimage during the %pre stage, right?  Something like /mnt/sysimage/var/tmp?  This way no ram disk is needed and the data is written in %pre and readable by %post.

 

 


From: kickstart-list-bounces@xxxxxxxxxx [mailto:kickstart-list-bounces@xxxxxxxxxx] On Behalf Of Shabazian, Chip
Sent: Monday, March 24, 2008 1:16 PM
To: Discussion list about Kickstart
Subject: RE: using /dev/ram devices in RHEL5 kickstarts

The important thing to know about this is that you can run TWO %post sections.  In the first, you can copy whatever you want from /tmp/your_dir to the chrooted /tmp, then you can use your current %post within a chrooted environment


From: kickstart-list-bounces@xxxxxxxxxx [mailto:kickstart-list-bounces@xxxxxxxxxx] On Behalf Of Kent Baxley
Sent: Monday, March 24, 2008 8:38 AM
To: kickstart-list@xxxxxxxxxx
Subject: using /dev/ram devices in RHEL5 kickstarts

 

I'm researching a kickstart problem that deals with some of the differences between RHEL4 and RHEL5.  In RHEL 4, I could create a RAM drive and copy files to this RAM drive in the %pre script portion of kickstart.  I would then open the RAM drive in the %post section.  This allowed me to pass information from the Pre to the Post processing scripts.  Because the %pre scripts do not have a local drive to write to at this time in the installation process the became the easiest way tell the post process scripts what went on during the pre script installation choices.

In the past, I was able to use the following code to create a ram drive during the %pre process of kickstart.

mkdir /tmp/ramdisk
mke2fs /dev/ram
mount /dev/ram /tmp/ramdisk

This code is right out of my kickstart.

Once in the %post process

mkdir /tmp/ramdisk
mount /dev/ram /tmp/ramdisk

Then I copy files from the /tmp/ramdisk mount point.


The /dev/ram devices seem to be missing during the installation process, so, the above code snippents don't seem to work anymore on RHEL5. I've found I can work around this by doing something like:

mknod /dev/ram b 1 0
 
Then continue with the steps above, however, why is /dev/ram seemingly not created by default anymore in RHEL5? Should I be using another method from here on out?

Another possibility for passing data between %pre and %post environments, I've found, could be:

%pre
Create a tmpfs ram drive
Copy files to tmpfs

%post --nochroot
copy files from tmpfs ram drive to /mnt/sysimage/path

%post
.
.

Notice that the first %post allows for a nochroot flag so I can copy data from the tmpfs. The second and last %post is where I would run my bash scripts after the data in tmpfs has been copied to the local hard drive.

So, my question is, will either option (run mknod to create /dev/ram or use tmpfs) work, and what should I be doing for RHEL5 installs and beyond?  I'm also open to any other suggestions.

Thanks!

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux