PXE use part of my kickstart file [closed]

2019-08-18 02:22发布

I'm trying to deploy an easier way to configure my computers.

I'm using an Ubuntu Server as DHCP and tftp server to manage PXE installations.

I find help with ubuntu netboot and with ubuntu PXE install server

Everything is fine until my menu on my futur well installed computer.

It tries to connect to ubuntu mirrors.. It's a huge problem because it doesn't have internet connection !

I've mount an image of Ubuntu Trusty on my Ubuntu Server (thank to Apache) and my link is available.

Here is my code

DEFAULT vesamenu.c32
timeout 100
display boot.msg
menu background splash.png
menu title Welcome to my awesome installer

label Install new computer
  kernel ubuntu-installer/amd64/linux
  append ks=http://ip.local.server/ks.cfg vga=normal initird=ubuntu-installer/amd64/initrd.gz

When I make my decision to select "Install new computer" it seems working but finally the installer installs network tools (configure ip v4, searched dhcp, configured ip v6) and fail when try to connect to Ubuntu mirror. But I don't want it to connect to mirrors because files are already downloaded on my Ubuntu Server (http://ip.local.server/ubuntu-trusty).

It didn't seems to understand that my ks.cfg is here (http://ip.local.server/ks.cfg).

ks.cfg:

#Generated by Kickstart Configurator
#platform=x86

#Install OS instead of upgrade
install
#Use Web installation
url --url http://192.168.3.1/ubuntu-trusty


#### Mirror settings ###

d-i mirror/country          string fr
d-i mirror/http/hostname    string http://192.168.3.1
d-i mirror/http/directory   string /ubuntu-trusty
d-i mirror/suite            string trusty
#d-i mirror/country          string fr

#System language
lang fr_FR
#Language modules to install
langsupport fr_FR
#System keyboard
keyboard fr
#System mouse
mouse
#System timezone
timezone Europe/Paris
#Root password
rootpw --disabled
#Initial user
user myuser --fullname "MyUser" --iscrypted --password $1$tDwZTgoh$a25ayXUItWDWxdQlUg0Tk1
#Reboot after installation
reboot
#Use text mode install
text
#Use interactive kickstart installation method
interactive

#System bootloader configuration
bootloader --location=mbr 
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel 
#Disk partitioning information
part swap --size 4000 
part / --fstype ext4 --size 1 --grow 
#System authorization infomation
auth  --useshadow  --enablemd5 
#Network information
network --bootproto=static --ip=192.168.3.222 --netmask=255.255.255.0 --nameserver=192.168.3.1 --gateway=192.168.3.1
#Firewall configuration
firewall --disabled
#X Window System configuration information
#xconfig --depth=32 --resolution=2048x1536 --defaultdesktop=GNOME --startxonboot

This ks.cfg file was generated directly from system-config-kickstart.

Edit:

I've set a static ip on my ks.cfg and with a tcpdump on my server I can see requests with this ip. This means my ks.cfg file is read but I still don't know why it's searching to access mirrors on the web instead of searching on my server.

Does anyone have an idea of this mirror researches that fail my PXE installation?

Thank you in advance.

标签: linux ubuntu
2条回答
forever°为你锁心
2楼-- · 2019-08-18 02:52

Booting with kickstart have multiple layers and not all information is send from one layer to the next.

Even though your DHCP server have send an ip and information about bootfiles to the loader program ( often that is syslinux or pxelinux ) this information is not send to the OS when it boots. The kickstart file is only read after the system boots and the install program have started ( often that is anaconda ).

I think you need to pass ip=dhcp somewhere on the append line. In my setup I also have keymap=dk lang=en_US on this line to setup language and keyboard settings.

查看更多
叛逆
3楼-- · 2019-08-18 02:53

First let me ask if you have turned your HTTP server on? in your case the ks.cfg file is going to be retrieved by an http transfer from

http://ip.local.server/ks.cfg

Next for the mirror parameters in your ks file you have to add something like

(Ubuntu)
#### Mirror settings.
preseed         mirror/country string manual
preseed         mirror/http/hostname string thinkmate5.ma.utexas.edu
preseed         mirror/http/directory string /mirror/precise/ubuntu
preseed         apt-setup/security_host string thinkmate5.ma.utexas.edu
preseed         apt-setup/security_path string /mirror/precise/ubuntu

(Debian)
#### Mirror settings.

d-i mirror/country          string fr
d-i mirror/http/hostname    string http://ip.local.server
d-i mirror/http/directory   string /ubuntu
d-i mirror/suite            string trusty
#d-i    mirror/http/proxy   string 

you could also add mirror settings at the "append" line like

mirror/country=manual mirror/http/hostname=aaa.bbb.ccc.ddd mirror/http/directory=/directoryXX mirror/http/proxy=""
查看更多
登录 后发表回答