Hot answers tagged

9

What are the differences between %pre and %post sections of a kickstart script in CentOS? The %pre section runs prior to when anaconda evaluates the rest of the kickstart file, after the second stage of the installer has started. This means that you can create files in %pre that can be included with a %include /tmp/somefile in the kickstart ...


7

The %pre section(s) of your kickstart run inside the installer environment. Here's a list of helpful commands that are available in the installer environment in RHEL6.5: Shell utils: arch awk basename bash cat chattr chgrp chmod chown chroot clear clock consoletype cp cut date df dmesg du echo egrep env expr false fgrep find getopt grep head hwclock id ...


5

The dhcp server doesn't actually serve the file. The dhcp server assigns an IP address to a host (pxe client) which lacks an operating system when it boots. In addition to the IP address, the dhcp server can tell the pxe client that it should contact a separate server for a boot loader and then the pxe client downloads the boot loader (usually using tftp) ...


3

As noted above, the tool you want is Kickstart. See Ubuntu notes on Kickstart for important tips. To get the IP address of the newly installed server, one simple approach might be to just put something in the Kickstart Post-Install Script that could be as simple as hitting a web server you control with a bogus request (you'd see the IP address in the Apache ...


3

You want to provide the following lines in the kickstart file: firewall --enable --ssh --port=mysql:tcp The %post section only does things during the installation process. You should let the install finish and reboot the machine and that firewall line should set the firewall rules for the box to allow only ssh and mysql (port 3306).


3

Possibly you need to load the ipmi_devintf kernel module. Also, note that you don't need the Dell software to get the model. You can get it from IPMI with ipmitool # ipmitool fru FRU Device Description : Builtin FRU Device (ID 0) Board Mfg Date : Sun Dec 31 23:00:00 1995 Board Mfg : DELL Board Product : PowerEdge R515 or ...


3

You can gently nudge the installation but telling the Kernel not to install drivers related to USB storage. This has the effect of stopping these devices from ever coming into the driveorder in the first place. From the GRUB menu: linux nousbstorage .... Kickstart Example From a Kickstart .cfg file: # Kickstart file automatically generated by anaconda. ...


3

According to the docs, it seems you can't get rid of it from Kickstart: http://fedoraproject.org/wiki/Anaconda/Kickstart#bootloader But what you can do is get the command line and the grub config replaced in the post-install (%post) section and delete it from there. I think this should do: %post sed -i -e 's/quiet//' ...


2

I had exactly the same need as you, to capture the %pre log for later analysis. You're right, by the time you're in %post Anaconda has already chrooted you to the newly-built filesystem, so it's not possible to access the %pre log. You could run %post with --nochroot, but IMO that makes paths in %post a pain. I managed to get what I wanted by using %include ...


2

Method #1 You can do this in the %post section: echo "configuring epel repository" rpm -Uvh http://download.fedora.redhat.com/pub/epel/beta/6/x86_64/epel-release-6-5.noarch.rpm Method #2 I think the more formal way of doing this is like this though in your .ks file: repo --name=epel --baseurl=http://LOCALEPELMIRROR/.../epel/6/x86_64/ %package ... ...


2

Build a kickstart server and a kickstart configuration file that specifies your disk layout, packages to be installed and a %post section. In this later section you can deploy any number of scripts (shell, Perl, etc.) from your kickstart server that will be executed to customize your basic configuration. The time you invest setting up a kickstart server ...


2

go into the BIOS of the host and rearrange the order of the hard drives and removable drives. This will adjust the order as it appears to the Linux kernel.


2

Ok, so here's the way the boot process works: firmware > bootloader maybe > kernel ${parameters} > initramfs > userspace maybe On a redhat installation disk their dracut system of scripts is what builds and constitutes initramfs and their anaconda installation system constitutes the final userspace. It is udev that handles the device setup - as in, it ...


2

Your kickstart file seems to be fine. The only package that should be logic to have during installation and removed after is authconfig. This guy seems to be required during installation to configure your authentication scheme on this kind of deploy This is not the ideal solution, but how about if you create a post install block and add your yum remove ...


2

Modify the kickstart file by adding an ignoredisk line in the first part, see the kickstart doc: By default, all disks will be available for partitioning. Only one of the following three options may be used. ignoredisk --drives=sdb ignoredisk --only-use=sda ignoredisk --interactive


2

It turns out that the device node needed to be created with mknod /dev/ram1 b 1 1 Once this is done, it can be formatted via e.g. mkfs.ext2: mkfs.ext2 /dev/ram1 8192


2

I have solved it... %post --log=/root/ks-post.log exec < /dev/tty6 > /dev/tty6 2> /dev/tty6 chvt 6 #mount the cd (ISO in my case) to copy files from it #since this is chrooted environment mount /dev/cdrom /mnt cp -rf /mnt/JOTC/src/jotc/ /opt/ cp -f /mnt/JOTC/src/service /etc/init.d/jotc #starting a service is dead simple chkconfig iptables on ...


2

The code was my spin from the following projects into an integrated "best-effort" - the scripts from Aqueduct, USGCB, etc. were tuned to RHEL 5 - I had to make a lot of modification to make it all work for RHEL 6 - so it is a fork in that sense. Anyway, I've merged and unified the code from the projects listed in the README of the stig-fix-el6 project: ...


2

Not being a CentOS user, I can't say why /tmp/cdrom would have existed in the first place, but it seems weird. Presumably it was a symlink to a real device node. You might try grep -R cdrom /etc/udev/ to see if someone set this up. There's probably a parallel symlink at /dev/cdrom, so you should be able to use that instead.


2

Commands such as these are typically not available in the %pre section of kickstart. excerpt - http://narrabilis.com/book/export/s5/6 %pre The %pre section is where you can specify commands to run before the system is installed. Commands placed here are not run in the chrooted install environment. %pre must come at the end of the kickstart file. ...


1

The packages listed are actually yum package groups. Groups are used to that they don't have to list out the individual packages (or necessarily know which packages are recommended for a particular effect) manually. For example, on RHEL 6 (and I would presume CentOS 6) if you're text-only you can do yum groupinstall Desktop which installs all the packages ...


1

Not sure if this is your issue but I would change this line: echo "vagrant" | passwd --stdin vagrant To this line: echo -n "vagrant" | passwd vagrant --stdin


1

I have some scripts that are probably still "beta" from a project on GitHub by the RedHatGov organization (Red Hat, Inc. government sector employees). https://github.com/RedHatGov While their project is not complete, nor universally applicable, it is a great start and I plan on forking, contributing, and requesting pulls for the projects. Frank Cavvigia ...


1

This looks like the default behaviour for kickstart installs, per the docs: You will only be prompted for information about your network: * before fetching the kickstart file if you are using the asknetwork boot option * when the network is first accessed once the kickstart file has been fetched, if the network was not used to fetch ...


1

The Fedora Project has some documentation on its mirrorlists on its MirrorManage wiki page. metalink=http://mirrors.fedoraproject.org/metalink?repo=fedora-10&arch=$basearch mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-10&arch=$basearch I also discovered that the CentOS 7 epel-release package installs a configuration ...


1

I'm not sure I understood all your echo's, but this may be want you want. Put exactly what you want to have in the mysqlsec_skript.sh file inside a here string, i.e. a multiline string that starts on the line after a "<<'endoffileindicator'", and ends just before a line consisting of only the chosen endoffileindicator. I used the single char "!" as ...


1

You will need to create a repo for the RPM first. $ mkdir supportScripts $ cp supportScripts-0.1-1.noarch.rpm supportScripts $ createrepo supportScripts You will then have to either add the repo to your iso or point kickstart at that repository location. If all that has already been done then all you need to do is add the name of the RPM to the list of ...


1

You have the kernel-debug package installed: Description : The kernel package contains the Linux kernel (vmlinuz), the core of any : Linux operating system. The kernel handles the basic functions : of the operating system: memory allocation, process allocation, device : input and output, etc. : : ...


1

You don't need to set the repo URLs in ks.cfg, here is an example of kickstart that I use currently with rhel6. # interactive install from CD-ROM/DVD interactive install cdrom key --skip lang en_US.UTF-8 # keyboard us # clearpart --all --initlabel part /boot --fstype ext4 --size=100 part pv.100000 --size=1 --grow volgroup vg00 --pesize=32768 pv.100000 ...


1

Short answer: the URL should be pointing to the ./os/x86_64 directory, not /isos/x86_64/. url --url=http://mirror.ukhost4u.com/centos/7.0.1406/os/x86_64/ Usual mistakes: There are three typical errors I encountered: Wrong URL ! Proxy problem (in corporate networks) DNS resolution problem



Only top voted, non community-wiki answers of a minimum length are eligible