Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


pc_engines_apu_centos_7

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
pc_engines_apu_centos_7 [2014/12/27 13:12] – [Preparation] adminpc_engines_apu_centos_7 [2014/12/27 13:17] – [Preparation] admin
Line 27: Line 27:
   kernel http://yourrepo.host/centos/7/CentOS7-base/images/pxeboot/vmlinuz   kernel http://yourrepo.host/centos/7/CentOS7-base/images/pxeboot/vmlinuz
   append initrd=http://yourrepo.host/centos/7/CentOS7-base/images/pxeboot/initrd.img ks.device=bootif ip=dhcp ks=http://yourpxe.host/apu-centos7.ks console=ttyS0,115200</code>   append initrd=http://yourrepo.host/centos/7/CentOS7-base/images/pxeboot/initrd.img ks.device=bootif ip=dhcp ks=http://yourpxe.host/apu-centos7.ks console=ttyS0,115200</code>
 +===Kickstart===
 +  * Edit kickstart file apu-centos7.ks:<code>####
 +#### PC Engines APU KickStart installation
 +####
 +install
 +skipx
 +text
 +
 +# Base repo
 +url --url=http://repo/centos/7/CentOS7-base
 +# Configure updates repo
 +repo --name="Fedora-updates"  --baseurl=http://repo/centos/7/CentOS7-updates
 +
 +network --onboot yes --bootproto dhcp
 +lang en_US.UTF-8
 +keyboard --vckeymap=us --xlayouts='us','us'
 +rootpw --iscrypted <your sha512 passphrase 
 +firewall --service=ssh
 +authconfig --enableshadow --passalgo=sha512
 +selinux --enforcing
 +timezone --utc Europe/Amsterdam
 +
 +# Set serial console and change disk elevator to noop for SSD.
 +bootloader --location=mbr --driveorder=sda --append="console=tty0 console=ttyS0,115200 elevator=noop rd_NO_PLYMOUTH"
 +
 +# Any disks whose formatting is unrecognized are initialized.
 +zerombr
 +
 +# Erases all partitions from the system.
 +clearpart --all --drives=sda --initlabel
 +
 +# Initialize boot partition.
 +part /boot --fstype=ext4 --fsoptions="defaults,noatime,discard,commit=60" --size=512 --asprimary
 +
 +# Create LVM pv and vg.
 +part pv.01 --size=1000 --grow --asprimary
 +volgroup vg pv.01
 +
 +# Create lv's, set discard, noatime and commit time. Leave some space left in the VG for later use.
 +logvol swap  --vgname=vg --size=512  --name=lv_swap    --fstype=swap
 +logvol /     --vgname=vg --size=4096 --name=lv_root --fstype=ext4 --fsoptions="defaults,noatime,discard,commit=60"
 +logvol /var  --vgname=vg --size=4096 --name=lv_var  --fstype=ext4 --fsoptions="defaults,noatime,discard,commit=60"
 +logvol /home --vgname=vg --size=512  --name=lv_home --fstype=ext4 --fsoptions="defaults,noatime,discard,commit=60"
 +
 +# Create non administrative user
 +user --name=benst --homedir=/home/benst --password=<your sha512 passphrase here> --iscrypted
 +
 +# Reboot after installation.
 +reboot
 +
 +# Install minimal, exclude @Base, exclude documentation
 +%packages --nobase --excludedocs
 +@Core #default
 +bind-utils      #dig, host, nslookup
 +openssh-clients #ssh client, key agent, sftp, scp
 +nc #nc (netcat)
 +%end
 +
 +%post
 +# Disable SSH root login
 +/bin/sed -i.bak 's/#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config
 +
 +# Mount /tmp as tmpfs.
 +echo "tmpfs /tmp tmpfs size=64m 0 0" >> /etc/fstab
 +
 +# Enable LVM to issue discards.
 +/bin/sed -i.bak 's/issue_discards = 0/issue_discards = 1/g' /etc/lvm/lvm.conf
 +
 +# Reduce swappiness.
 +echo "vm.swappiness=1" >> /etc/sysctl.d/swappiness.conf
 +echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.d/swappiness.conf
 +
 +# Set chassis name and icon
 +/bin/hostnamectl set-chassis "server"
 +
 +exit 0
 +%end</code>
 ====Installation==== ====Installation====
   * Boot the APU and press F12, select "iPXE" to boot from network.   * Boot the APU and press F12, select "iPXE" to boot from network.
pc_engines_apu_centos_7.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1