Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft adding uefi example #5

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ Unfortunately, specifying `RHEL` as the operating system in `meta/main.yml` is n

I have probably not tested every combination possible with the variables. If you find an issue, feel free to raise it or provide a pull request to fix it.

Provided with this role is an example Kickstart that can be used as a start to building your own. This Kickstart implements the recommended Red Hat Satellite file system layout
Provided with this role is an example Kickstart (for both UEFI and BIOS types of systems) that can be used as a start to building your own. This Kickstart implements the recommended Red Hat Satellite file system layout
[1](https://access.redhat.com/documentation/en-us/red_hat_satellite/6.12/html/installing_satellite_server_in_a_connected_network_environment/preparing_your_environment_for_installation_satellite)

The `example-uefi.ks` can be used for *both* UEFI and BIOS systems, but is a little more complexer due to the nature of supporting both UEFI and BIOS. Including also the `example.ks` which *only* supports BIOS.


Role Variables
--------------
| variable | default | required | description |
Expand Down
82 changes: 82 additions & 0 deletions files/example-uefi.ks
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
%pre --interpreter=/bin/bash --log=/tmp/pre.log --erroronfail
logger "Starting anaconda preinstall"

set -x
if [ -e /dev/sda ]; then
dev_device="sda"
elif [ -e /dev/vda ]; then
dev_device="vda"
else
echo "ERROR: No disk found!"
exit 1
fi

# source: https://git.resf.org/sig_core/kickstarts/src/branch/r8/Rocky-8-GenericCloud-Base.ks
# clear the Master Boot Record
dd if=/dev/zero of="/dev/${dev_device}" bs=512 count=1
# create a new GPT partition table
parted -s "/dev/${dev_device}" mklabel gpt
# create a partition for /boot/efi (256MB)
parted -s "/dev/${dev_device}" mkpart primary fat32 1MiB 256MiB
parted -s "/dev/${dev_device}" set 1 boot on
# create a partition for /boot (8192MB)
parted -s "/dev/${dev_device}" mkpart primary xfs 256MiB 8448MiB
# create a partition for prep (4MB)
parted -s "/dev/${dev_device}" mkpart primary 8449MiB 8453MiB
# create a partition for bios_grub (1MB)
parted -s "/dev/${dev_device}" mkpart primary 8454MiB 8455MiB
# create a partition for LVM
parted -s "/dev/${dev_device}" mkpart primary 8455MiB 100%

cat <<EOF >> /tmp/diskpart.cfg
part /boot/efi --fstype=efi --onpart="${dev_device}1"
part /boot --fstype=xfs --label=boot --onpart="${dev_device}2"
part prepboot --fstype="prepboot" --onpart="${dev_device}3"
part biosboot --fstype="biosboot" --onpart="${dev_device}4"

part pv.0 --onpart="${dev_device}5"

volgroup vg_system pv.0
logvol / --fstype xfs --name=lv_root --vgname=vg_system --size=10240
logvol /var --fstype xfs --name=lv_var --vgname=vg_system --size=8192 --fsoptions="nodev,nosuid"
logvol /var/lib/qpidd --fstype xfs --name=lv_var_lib_qpidd --vgname=vg_system --size=3072
logvol /var/lib/pgsql --fstype xfs --name=lv_var_lib_pgsql --vgname=vg_system --size=24576
logvol /var/lib/pulp --fstype xfs --name=lv_var_lib_pulp --vgname=vg_system --size=614400
logvol /var/log --fstype xfs --name=lv_var_log --vgname=vg_system --size=5120 --fsoptions="nodev,nosuid,noexec"
logvol /var/log/audit --fstype xfs --name=lv_var_log_audit --vgname=vg_system --size=2048 --fsoptions="nodev,nosuid,noexec"
logvol /var/tmp --fstype xfs --name=lv_var_tmp --vgname=vg_system --size=2048 --fsoptions="nodev,nosuid"
logvol /usr --fstype xfs --name=lv_usr --vgname=vg_system --size=8192 --fsoptions="nodev"
logvol /usr/local --fstype xfs --name=lv_usr_local --vgname=vg_system --size=1024 --fsoptions="nodev"
logvol /openscap --fstype xfs --name=lv_openscap --vgname=vg_system --size=512 --fsoptions="nodev,noexec"
logvol /home --fstype xfs --name=lv_home --vgname=vg_system --size=1024 --fsoptions="nodev,nosuid"
logvol /tmp --fstype xfs --name=lv_tmp --vgname=vg_system --size=5120 --fsoptions="nodev,nosuid,noexec"
logvol /opt --fstype xfs --name=lv_opt --vgname=vg_system --size=4096 --fsoptions="nodev"
logvol /opt/puppetlabs --fstype xfs --name=lv_opt_puppetlabs --vgname=vg_system --size=512
logvol swap --fstype swap --name=lv_swap --vgname=vg_system --size=4096
EOF
%end

%packages
dhclient
chrony
rsync
@Core
lsof
net-tools
sos
%end

cdrom
lang en_US.UTF-8
selinux --enforcing
keyboard de
skipx
services --disabled gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd
network --bootproto dhcp
firewall --service ssh
authselect --useshadow --passalgo=sha512 --kickstart
timezone Europe/Berlin --utc
bootloader --location=mbr
%include /tmp/diskpart.cfg
text
shutdown