Re: need spec file example to replace files from various packages

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

 



Paul Johnson wrote:
After installing Fedora, I want to replace various configuration files
on lab computers. If I can learn how to do this in the post section of
an RPM spec file, I will be happy.  For example, I want/need to
replace things like

/etc/gdm/PreSession/Default
/etc/gdm/PostSession/Default
/etc/pam.d/system-auth
/etc/hosts.allow
/etc/hosts.deny

One brute force option is to install with rpm --replacefiles, but yum
does not like that.
So can  you point me at a spec file or two that will give example
syntax on how I can create a backup of those files and replace them
with the ones I want.

Please?


Do you want to do it via packages, or would you rather have a custom kickstart configuration?

Kickstart can perform various operations pre-, during and post-install. I've not used it since RH 7.2 so I've no idea how it's progressed since then. In the %post section of a kickstart configuration you could run pretty much any command you like. This is an example from a KS file which I have used to install a custom RH CD for a dedicated firewall:

%post
# copy bridge/firewall files from the floppy to disk
mkdir /tmp/floppy
mount /dev/fd0 /tmp/floppy
cd /
tar xf /tmp/floppy/firewall_files.tar
umount /dev/fd0
cd /root
make
make install


What happens is that I boot the system with the custom CD and a floppy disk. When the installation is complete this section mounts the floppy, extracts the files from it (which contain the iptables rules, the networking setup etc).

With kickstart you can specify the disk partition layout, select the packages you want installed etc. I think you could make your own kickstart setup which would replace those files for you after the installation is complete.


--
Nigel Wade, System Administrator, Space Plasma Physics Group,
            University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@xxxxxxxxxxxx
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux