centos 7 kickstart - were to put ks file
-
hi all,
following this great how to guide by @george1421 about how to make a centos 7 ipxe menu
but where do i put my kickstart line in
kernel tftp://${fog-ip}/os/centos/7/vmlinuz
initrd tftp://${fog-ip}/os/centos/7/initrd.img
imgargs vmlinuz initrd=initrd.img root=live:nfs://${fog-ip}:/images/os/centos/7/LiveOS/squashfs.img ip=dhcp inst.repo=nfs:${fog-ip}:/images/os/centos/7 splash quiet
boot || goto MENUdo i append it after the “imgargs” and before the “root=”?
thanks,
rob -
you append it to the last line, found it here
default menu.c32
prompt 0
timeout 30
menu title Homelab PXE Menu
label Install CentOS 7 Server
kernel /networkboot/CentOS7/vmlinuz
append initrd=/networkboot/CentOS7/initrd.img inst.repo=ftp://10.11.1.20/pub/pxe/CentOS7 ks=ftp://10.11.1.20/pub/pxe/centos7-ks.cfg -
@robertkwild Typically the config file is dished up by http, but if you have it working with FTP then that will work too. I’m a bit surprised that the repo works via FTP, but if it works, it works.
-
oh no sorry @george1421, im not using ftp im using what you said in the how to, im just wondering where i should put the KS line in -
kernel tftp://${fog-ip}/os/centos/7/vmlinuz
initrd tftp://${fog-ip}/os/centos/7/initrd.img
imgargs vmlinuz initrd=initrd.img root=live:nfs://${fog-ip}:/images/os/centos/7/LiveOS/squashfs.img ip=dhcp inst.repo=nfs:${fog-ip}:/images/os/centos/7 splash quiet
KS=
boot || goto MENU -
@robertkwild said in centos 7 kickstart - were to put ks file:
Well the
ks
value should be a kernel parameter so I would append it onto the end of the imgargs. The kernel parameters are a way of passing variables into the linux startup code. The linux kernel or the init code might use these values to alter the startup or running process.Passing it might look something like this:
kernel tftp://${fog-ip}/os/centos/7/vmlinuz initrd tftp://${fog-ip}/os/centos/7/initrd.img imgargs vmlinuz initrd=initrd.img root=live:nfs://${fog-ip}:/images/os/centos/7/LiveOS/squashfs.img ip=dhcp inst.repo=nfs:${fog-ip}:/images/os/centos/7 splash quiet ks=http://${fog-ip}/centos7-ks.cfg boot || goto MENU
Then the actual file since we are using http would be in the root of the apache server data directory
/var/www/html
for rhel variants and/var/www
for debian variants.Just to be clear I don’t know if
ks
is the proper variable or if the centos kernel will accept that value (case is important). I only translated what you posted to the proper location on the fog server. -
ok @george1421 so i put it under the http dir
/var/www/html/fog/centos7.ks.cfg
but ${fog-ip} means the above doesnt it?
-
@robertkwild said in centos 7 kickstart - were to put ks file:
but ${fog-ip} means the above doesnt it?
that is only the IP address that represents the fog server. This is filled in automatically by the FOG boot.php code.
I would not place your file in the fog directory directly, but up one level in the docroot of the web server.
-
should i chown it apache:apache?
-
@robertkwild You can change it if you want. It should work as long as world has read access. You can test by a second computer, just open a browser and connect to the FOG ip address and then the name of the file to see if you can download it with a browser.
-
thanks @george1421 i can access the kickstart script via the web gui so all is good
i can view it but i cant download it
if i go here
i can view it on the web
but if i go here
it re directs me to the fog dashboard, ie
https://fog-ip//fog/management/index.php?node=home
i was hoping it would list the dir listing of apache and when i click the file i could download it
maybe i need to make a dir and put the file in the dir and then i can download it
many thanks,
rob -
@robertkwild If you can access the file via a web browser then you should be pretty confident that the centos linux kernel can get it when its time. As for directory browsing of the apache docroot that is turned off. The redirect asking for no specific file and then being redirected to the fog web ui is by design. You would need to do some changing in the web configuration if you wanted to do that. I would advise against changing the web configuration in apache because it may stop fog from operating.
-
@george1421 im getting closer, ive tried all different variants but this is the best one, this one actually tries to load the “kickstart” file
kernel tftp://${fog-ip}/os/centos/7/vmlinuz ks=http://${fog-ip}/listing/ks.cfg
initrd tftp://${fog-ip}/os/centos/7/initrd.img
boot || goto MENUbut this is the error i get when trying it out
-
changed it like so and so far so good, will let you know the outcome, big shout out to @george1421
kernel tftp://${fog-ip}/os/centos/7/vmlinuz ks=nfs:${fog-ip}:/images/os/centos/7/ks.cfg
initrd tftp://${fog-ip}/os/centos/7/initrd.img
boot || goto MENU -
@robertkwild Again I would confirm if you can download the config file via a browser first. If you can and you are on the same subnet as the pxe booting computer then the problem is elsewhere. I see you’ve taken the minimalist approach to the kernel args. If that’s kind of working for you, I think I might just tack a few on for good measure since some kernels get cranky without the initrd line.
Using your ipxe menu config.
kernel tftp://${fog-ip}/os/centos/7/vmlinuz initrd=initrd.img ip=dhcp ks=http://${fog-ip}/listing/ks.cfg initrd tftp://${fog-ip}/os/centos/7/initrd.img boot || goto MENU
And since we don’t know if it can’t pull the config file because of the http server or the client lets add in
ip=dhcp
for good measure.FWIW
imgargs
command should do the same thing as appending the values after the kernel call, but I’ve seen some kernels not accept the imgargs line but take the kernel parameters the way you have presented them.EDIT: I just noticed the certificate error. Your fog server is running configured under https:// but your curl call is using http:// This might also cause the error. Its not clear if all you need to do is change the kernel call to the ks file to https or have to do something different because fog is using a privately created certificate for https.
-
Hey,
Recently I have been doing exactly same think as you are doing now and in my case worked:
kernel tftp://${fog-ip}/os/centos/7/vmlinuz
initrd tftp://${fog-ip}/os/centos/7/initrd.img
imgargs vmlinuz initrd=initrd.img root=live:nfs://${fog-ip}:/images/os/centos/7/LiveOS/squashfs.img ip=dhcp inst.repo=nfs:${fog-ip}:/images/os/centos/7 inst.ks=nfs:${fog-ip}:/images/dev/ks.cfg splash quiet
boot || goto MENUNote, that in my case I had to have kickstart file located in /images/dev.
-
ive tested it and all works perfect!!!
heres my kickstart script
#platform=x86, AMD64, or Intel EM64T #version=DEVEL # Install OS instead of upgrade install # Keyboard layouts keyboard 'uk' # Root password rootpw --iscrypted # System language lang en_GB # System authorization information auth --useshadow --passalgo=sha512 # Use text mode install text # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # Use NFS installation media nfs --server=10.110.10.60 --dir=/images/os/centos/7 # Firewall configuration firewall --disabled # Network information network --bootproto=dhcp --device=eth0 # Reboot after installation reboot # System timezone timezone Europe/London # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --drives=sda --all --initlabel #Create Partitions automatically autopart --type=lvm
-
@george1421 thanks george about this, i will edit my syntax and get back to you about this
-
my dir listing works but when i click the kickstart file, it doesnt ask me to download it, where as it should instead of just viewing me the contents of it
is it ok to add this line in my httpd.conf as i know @george1421 advised against it
<Directory /var/www/html/listing>
Options +Indexes
</Directory>