Install RHEL8/CentOS 8

Matteo Guglielmi Matteo.Guglielmi at dalco.ch
Thu Nov 28 16:34:31 CET 2019


first Create a working IMAGE file using a virtual machine.


here it's how i do it:



#=========================================#
# RHEL81G IMAGE (rhel-8.1-x86_64-dvd.iso) #
#=========================================#

*) NETWORK & HOST NAME

   # TURN THE NIC ON

   Host Name: dalcowks.localdomain <APPLY>

*) TIME & DATE

   Region: Europe

   City: Zurich

   Network Time: ON

*) KEYBOARD

   English (US)

*) LANGUAGE SUPPORT

   English (United States)

*) INSTALLATION SOURCE

   (o) Auto-detect installation media

   Device: sr0

   Label: RHEL-8-1-0-BaseOS-x86_64

*) SYSTEM PURPOSE

   (o) Red Hat Enterprise Linux Workstation

   (o) Self-Support

   (o) Production

*) SOFTWARE SELECTION

   Workstation

   GNOME Applications

   System Tools

*) INSTALLATION DESTINATION

   (o) Custom

   /dev/sda1   /   ext4
   /dev/sda2       swap

*) KDUMP

   [ ] Enable kdump

*) SECURITY POLICY

   Apply security policy: ON (No profile selected) # firewalld and sshd active

*) ROOT PASSWORD

   Root Password:   xxxxx

   Confirm:         xxxxx

*) USER CREATION

   Full name:          SOMEUSER

   User name:          someuser

   Password:           xxxxxxx

   Confirm password:   xxxxxxx

# ACCEPT THE LICENSE

# LOGIN AS root VIA SSH

cat > /etc/yum.repos.d/RHEL-AppStream.repo <<-EOF
[appstream]
name=AppStream
baseurl=http://myserver/rhel81/dvd1/AppStream
enabled=1
gpgcheck=0
EOF

cat > /etc/yum.repos.d/RHEL-BaseOS.repo <<-EOF
[baseos]
name=BaseOS
baseurl=http://myserver/rhel81/dvd1/BaseOS
enabled=1
gpgcheck=0
EOF

dnf update

dnf install \
  perl xfsprogs autofs lvm2 openssh vim-enhanced \
  acl iputils redhat-lsb-core rsync sudo attr

reboot

# remove old kernels?

dnf clean all

shutdown -h now

### TAKE A VM SNAPSHOT ###

# disable selinux
sed -i '/^SELINUX=/c SELINUX=disabled' /etc/selinux/config

reboot

dnf clean all

rm -rf /etc/yum.repos.d/RHEL-*.repo

#rm -rf /var/cache/dnf

# find folders to be "excluded" when using tar
findmnt

# need to umount devices?
#umount /dev/sr0

# find files with selinux contexts
#find / -type f \
#  -not \( -path "/sys/*" -o -path "/proc/*" -o -path "/dev/*" -o -path "/run/*" -o -path "/tmp/*" \) \
#  -exec ls -lZ {} \; | grep '.*_u:.*_r:.*_t:.*'
#
#find / -xdev -type f -exec ls -lZ {} \; | grep '.*_u:.*_r:.*_t:.*'

find / -xdev -type f -context *_u:*_r:*_t:* -printf '%-50Z%p\n'

# find files with extended-attributes
getfattr -R / 2> /dev/null

# find files with ACLs set
getfacl -R -s -p / 2> /dev/null | sed -n 's_^# file: __p'

ls -liah / # leftovers to remove?

# remove efi
#rm -rf /boot/efi

# cleanup root
ls -liah /root

rm -rf ~/.bash_history ~/*

# based on previous findings
tar --no-selinux --no-xattrs --no-acls \
  -cpf /tmp/IMAGE.tar \
  --exclude=/sys/* \
  --exclude=/proc/* \
  --exclude=/dev/* \
  --exclude=/run/* \
  --exclude=/tmp/* \
  --exclude=/var/tmp/* \
  --exclude=/var/spool/postfix/private/* \
  --exclude=/var/spool/postfix/public/* \
  --exclude=/var/lib/nfs/rpc_pipefs/* \
  --exclude=/media/* \
  --exclude=/lost+found \
  --exclude=/var/cache/dnf \
  --exclude=/boot/efi \
  /

scp /tmp/IMAGE.tar myserver:/tmp/RHEL81G.tar



________________________________
From: linux-fai <linux-fai-bounces at uni-koeln.de> on behalf of Daniel Liikamaa <daniel.liikamaa at axis.com>
Sent: Friday, November 15, 2019 4:04:02 PM
To: linux-fai at uni-koeln.de
Subject: Install RHEL8/CentOS 8

I'm trying to get FAI to install RHEL 8 with local mirrored repos.
I seem to have struck a wall, mostly because I don't understand what's
going on behind the curtains.
Currently, I get a system that will boot up until it's supposed to mount
the root file system, then it drops to emergency shell, telling me that
there's no support for ext4 in my initramfs. I just copied the CentOS 7
files in the configuration, but it seems like there's more to it.
Has anyone successfully installed CentOS 8 or RHEL 8 with fai, and care
to share any tips and tricks?

Best regards,
Daniel


More information about the linux-fai mailing list