Linux/Xen/DomU/CentOS/CentOS 7: Difference between revisions

From Guungle
Jump to navigation Jump to search
No edit summary
Line 18: Line 18:
Here is the kickstart config that will need to be put on a webserver.  
Here is the kickstart config that will need to be put on a webserver.  


<syntaxhighlight lang="text">
<syntaxhighlight lang="bash">
#version=1.0.0
#version=1.0.0



Revision as of 16:01, 20 January 2019

CentOS 7

The CentOS 7 installer won't install to a disk smaller then 10-20GB but its still possible to copy the finished install into a smaller image for easier distribution and cloning.

Create a empty image file and format it with xfs. We are making the file 20GB so CentOS will install.

dd if=/dev/zero of=centos_ks.img bs=1M count=1 seek=20000
mkfs.xfs centos_ks.img

The easiest way to install CentOS is using the kickstart system. You will need a webserver to host the kickstart config file. You will also need a kernel and ramdisk image from a CentOS mirror.

Download the vmlinuz and initrd.img files from your favorite CentOS mirror.

http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/

You will be booting the CentOS kickstart image with these files.

Here is the kickstart config that will need to be put on a webserver.

#version=1.0.0

install

# System authorization information
auth --enableshadow --passalgo=sha512
# Use network installation
url --url="http://mirror.centos.org/centos/7/os/x86_64/"
# Use text mode install
text
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=xvda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts=''
# System language
lang en_US.UTF-8

# Network information
network --hostname=centos7 --bootproto=dhcp --device=eth0 --onboot=on

# Root password
rootpw --iscrypted $6$QgAmrd86o3M8qQIa$0LMJo9zwIe3j1e.hnc5G.6bXyhduRF03McofIDGSb7lrso6mbl9kt.WzxYOCXysC4Fb6Rdlu8OkXNAL22BLUW0
# System services
services --enabled="network"
# Do not configure the X Window System
skipx
# System timezone
timezone Etc/UTC --isUtc
# System bootloader configuration
bootloader --timeout=5 --driveorder=xvda --append="console=hvc0"
# Partition clearing information
zerombr
clearpart --all --initlabel --drives=xvda
part / --fstype=xfs --grow --size=1 --asprimary --ondisk=xvda

# Shutdown when the kickstart is done
halt

%packages
@core --nodefaults
-grub2
-chrony
-NetworkManager
-NetworkManager-team
-NetworkManager-tui
-NetworkManager-libnm
-wireless-tools
-plymouth
-fprintd-pam
-*-firmware


%end

%addon com_redhat_kdump --disable --reserve-mb='auto'

%end

%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end